Mais conteúdo relacionado
Semelhante a Ilugc curl (20)
Ilugc curl
- 3. Sat, 13 Nov, 2010 3
cURL?
curl - transfer a URL
– http://curl.haxx.se/
- 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
- 7. Sat, 13 Nov, 2010 7
●
HTTP
●
HTTPS
●
FTP
●
FTPS
●
SCP
●
SFTP
●
TFTP
●
TELNET
●
LDAP
●
DICT
●
POP
●
SMTP
●
RTMP
●
RTSP
The real cURL
- 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. 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. Sat, 13 Nov, 2010 13
Upload
$ curl -T filename http://www.upload.com/myfile
$ curl -T – ftp://ftp.upload.com//myfile
- 14. Sat, 13 Nov, 2010 14
Trace
$ curl --trace tracefile http://www.example.com/
$ curl --trace-ascii tracefile http://www.example.com/
- 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. 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. 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. Sat, 13 Nov, 2010 18
SMTP
$ curl --mail-rcpt <address>
--mail-from <akilan27@gmail.com> -u akilan27:pass
--ssl smtp://smtp.gmail.com
- 19. Sat, 13 Nov, 2010 19
HTTP
$ curl “ google.com/search?q=ilugc”
Get requests are simple:
- 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. 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. 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. 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. 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. 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. 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