Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ilugc curl

6,100 views

Published on

The

Published in: Technology, Business

Ilugc curl

  1. 1. cURL Akilan RAkilan R akilan@tcoe.iitm.ac.in
  2. 2. Sat, 13 Nov, 2010 2 cURL? – http://curl.haxx.se/
  3. 3. Sat, 13 Nov, 2010 3 cURL? curl - transfer a URL – http://curl.haxx.se/
  4. 4. Sat, 13 Nov, 2010 4 cURL : – http://curl.haxx.se/
  5. 5. 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
  6. 6. Sat, 13 Nov, 2010 6 The real cURL
  7. 7. Sat, 13 Nov, 2010 7 ● HTTP ● HTTPS ● FTP ● FTPS ● SCP ● SFTP ● TFTP ● TELNET ● LDAP ● DICT ● POP ● SMTP ● RTMP ● RTSP The real cURL
  8. 8. Sat, 13 Nov, 2010 8 What it isn't
  9. 9. Sat, 13 Nov, 2010 9 What it isn't
  10. 10. Sat, 13 Nov, 2010 10 But you can build one...
  11. 11. Sat, 13 Nov, 2010 11 Get a file $ curl protocol://example.com/path/to/file $ curl ftps://example.com/path/to/file $ curl blah://user:pass@example.com:port/file $ curl -u user:pass scp://example.com/~/personal.txt
  12. 12. 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
  13. 13. Sat, 13 Nov, 2010 13 Upload $ curl -T filename http://www.upload.com/myfile $ curl -T – ftp://ftp.upload.com//myfile
  14. 14. Sat, 13 Nov, 2010 14 Trace $ curl --trace tracefile http://www.example.com/ $ curl --trace-ascii tracefile http://www.example.com/
  15. 15. 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
  16. 16. 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
  17. 17. 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'
  18. 18. Sat, 13 Nov, 2010 18 SMTP $ curl --mail-rcpt <address> --mail-from <akilan27@gmail.com> -u akilan27:pass --ssl smtp://smtp.gmail.com
  19. 19. Sat, 13 Nov, 2010 19 HTTP $ curl “ google.com/search?q=ilugc” Get requests are simple:
  20. 20. 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:
  21. 21. 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
  22. 22. 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
  23. 23. Sat, 13 Nov, 2010 23 Scripting cURL curl http://username:password@members.dyndns.org/nic/update? hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=N OCHG&backmx=NOCHG Update your dyndns:
  24. 24. Sat, 13 Nov, 2010 24 Scripting cURL curl -c mycookie --data-urlencode email=foo@bar.com --data-urlencode pwd=password http://example.com/ValidateEntry.php Login to a website and perform requests
  25. 25. Sat, 13 Nov, 2010 25 Scripting cURL curl -c cookie --data-urlencode email=foo@bar.com --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
  26. 26. Sat, 13 Nov, 2010 26 Scripting cURL curl -c cookie --data-urlencode email=foo@bar.com --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

×