Skip to content

Instantly share code, notes, and snippets.

@aptavout
Created May 23, 2013 03:14
Show Gist options
  • Save aptavout/5632553 to your computer and use it in GitHub Desktop.
Save aptavout/5632553 to your computer and use it in GitHub Desktop.
cURL GET session ID followed by a login POST
@echo off
set url=http://www.target-url.org
set agent=Mozilla/2.02Gold (Win95; I)
curl -c cookies.txt -A "%agent%" %url% > get.txt
set login=jsmith
set pass=intheclear
set query=%login%^&%pass%
echo %query% > query-string.txt
curl -b cookies.txt -A "%agent%" -d @query-string.txt %url% > post.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment