Skip to content

Instantly share code, notes, and snippets.

@p4p4
Last active July 1, 2016 07:27
Show Gist options
  • Save p4p4/db96dd9e79fb94a75558f577794d2bf0 to your computer and use it in GitHub Desktop.
Save p4p4/db96dd9e79fb94a75558f577794d2bf0 to your computer and use it in GitHub Desktop.

Curl Notes

Login & Download with curl, delete cookies afterwards:

 curl -c cookies.txt "http://foo.bar/login.php" -d "USER=34568" -d "PASS=1234"
 curl --cookie cookies.txt "http://foo.bar/file.csv" -o file.csv
 rm cookies.txt

-d for HTTP POST parameters

-c stores a cookie (if file does not exist), or transmits a cookie (if file exists)

-o stores the response in a file (instead of a terminal output)

Adding additional Header Files to the Request:

via -H examples:

 -H "Accept-Languate: en-US,en;q=0.5" 
 -H "Accept-Encoding: gzip, deflate"

##Send refferer:

 -e "http://foo.bar/site.php"

##Fake User-Agent:

 -A "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment