Ilugc curl
-
Upload
akilan-ram -
Category
Technology
-
view
4.795 -
download
2
description
Transcript of Ilugc curl
cURL
Akilan RAkilan [email protected]
Sat, 13 Nov, 2010 2
cURL?
– http://curl.haxx.se/
Sat, 13 Nov, 2010 3
cURL?
curl - transfer a URL
– http://curl.haxx.se/
Sat, 13 Nov, 2010 4
cURL :
– http://curl.haxx.se/
Sat, 13 Nov, 2010 5
● User + password Authentication
– Basic
– Digest
– NTLM
– Negotiate
– Kerberos● Proxy
● Resume● Cookies● Proxy tunneling● SSL certs● HTTP range requests● UA spoofing● Wireshark● gzip/deflate
cURL
Sat, 13 Nov, 2010 6
The real cURL
Sat, 13 Nov, 2010 7
● HTTP● HTTPS● FTP● FTPS● SCP● SFTP● TFTP
● TELNET● LDAP● DICT● POP● SMTP● RTMP● RTSP
The real cURL
Sat, 13 Nov, 2010 8
What it isn't
Sat, 13 Nov, 2010 9
What it isn't
Sat, 13 Nov, 2010 10
But you can build one.. .
Sat, 13 Nov, 2010 11
Get a fi le
$ curl protocol://example.com/path/to/file
$ curl ftps://example.com/path/to/file
$ curl blah://user:[email protected]:port/file
$ curl -u user:pass scp://example.com/~/personal.txt
Sat, 13 Nov, 2010 12
more.. .
$ curl -u user:pass -x proxy:3128 \ http://example.com/file
$ curl -u user:pass -x proxy:3128 -u user:pass \ http://example.com/file
Sat, 13 Nov, 2010 13
Upload
$ curl -T filename http://www.upload.com/myfile
$ curl -T – ftp://ftp.upload.com//myfile
Sat, 13 Nov, 2010 14
Trace$ curl --trace tracefile http://www.example.com/
$ curl --trace-ascii tracefile http://www.example.com/
Sat, 13 Nov, 2010 15
Few cool features. . .
$ curl -e www.coolsite.com http://www.showme.com/
$ curl -A 'Konqueror/1.0' http://www.example.com/
$ curl --limit-rate 10K www.far-away-site.com
Sat, 13 Nov, 2010 16
Few cool features. . .
$ curl -H "X-some-header: yes" www.example.com
$ curl --interface eth0:1 http://www.netscape.com
$ curl -E /path/to/cert.pem:password \https://secure.site.com
$curl telnet://remote.server.com
Sat, 13 Nov, 2010 17
FTP
$ curl -T – ftp://ftp.upload.com//myfile
$ curl --ftp-port <address> ftp://ftp.upload.com/myfile
$ curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
Sat, 13 Nov, 2010 18
SMTP
$ curl --mail-rcpt <address> \--mail-from <[email protected]> -u akilan27:pass \--ssl smtp://smtp.gmail.com
Sat, 13 Nov, 2010 19
HTTP
$ curl “ google.com/search?q=ilugc”
Get requests are simple:
Sat, 13 Nov, 2010 20
HTTP
$ curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" “ google.com/search?q=ilugc”
Get requests are simple:
Sat, 13 Nov, 2010 21
HTTP
$ curl --user-agent "Mozilla/5.0 [en] (X11; U; Linux 2.6.28 i386)" “ http://google.com/search?q=ilugc”
Get requests are simple:
Post requests are also simple with curl. ;-)
$ curl --data-urlencode input=value http://example.com/cgi
Sat, 13 Nov, 2010 22
HTTP
$ curl --proxy-user proxyuser:proxypassword curl.haxx.se
Proxy
Post requests are also simple with curl. ;-)
$ curl --data-urlencode input=value http://example.com/cgi
Sat, 13 Nov, 2010 23
Scripting cURL
curl http://username:[email protected]/nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG
Update your dyndns:
Sat, 13 Nov, 2010 24
Scripting cURL
curl -c mycookie --data-urlencode [email protected] --data-urlencode pwd=password http://example.com/ValidateEntry.php
Login to a website and perform requests
Sat, 13 Nov, 2010 25
Scripting cURL
curl -c cookie --data-urlencode [email protected] \ --data-urlencode pwd=password \ http://example.com/ValidateEntry.php
curl -b cookie --data-urlencode uid=bar – data-urlencode \ action=del http://example.com/usermanip.php
Login to a website and perform requests
Sat, 13 Nov, 2010 26
Scripting cURL
curl -c cookie --data-urlencode [email protected] \ --data-urlencode pwd=password \ http://example.com/ValidateEntry.php
curl -b cookie --data-urlencode uid=bar – data-urlencode \ action=del http://example.com/usermanip.php
rm cookie
Login to a website and perform requests