Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- string viewstateid = "/wEPDwUKLTY3NjEyMzE4NWRkK4DxZpjTmZg/RGCS2s13vkEWmwWiEE6v+XrYoWVuxeg=";
- string eventid ="/wEdAAoSjOGPZYAAeKGjkZOhQ+aKHfOfr91+YI2XVhP1c/pGR96FYSfo5JULYVvfQ61/Uw4pNGL67qcLo0vAZTfi8zd7jfuWZzOhk6V/gFA/hhJU2fx7PQKw+iST15SoB1LqJ4UpaL7786dp6laCBt9ubQNrfzeO+rrTK8MaO2KNxeFaDhrQ0hxxv9lBZnM1SHtoODXsNUYlOeO/kawcn9fX0BpWN7Brh7U3BIQTZwMNkOzIy+rv+Sj8XkEEA9HaBwlaEjg=";
- string username = "user1";
- string password = "ttee";
- string loginbutton = "Log In";
- string URLAuth = "http://localhost/login.aspx";
- string postString = string.Format("VIEWSTATE={0}&EVENTVALIDATION={1}&LoginUser_UserName={2}&LoginUser_Password={3}&LoginUser_LoginButton={4}",viewstateid,eventid, username, password,realm,otp,loginbutton);
- const string contentType = "application/x-www-form-urlencoded";
- System.Net.ServicePointManager.Expect100Continue = false;
- CookieContainer cookies = new CookieContainer();
- HttpWebRequest webRequest = WebRequest.Create(URLAuth) as HttpWebRequest;
- webRequest.Method = "POST";
- webRequest.ContentType = contentType;
- webRequest.CookieContainer = cookies;
- webRequest.ContentLength = postString.Length;
- webRequest.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1";
- webRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
- webRequest.Referer = "http://localhost/login.aspx";
- StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());
- requestWriter.Write(postString);
- requestWriter.Close();
- StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
- string responseData = responseReader.ReadToEnd();
- Console.WriteLine(responseData);
- responseReader.Close();
- webRequest.GetResponse().Close();
- }
- }
- curl --data "post1=value1&post2=value2&etc=valetc" http://host/resource
- curl -X POST -d @file http://host/resource
- http://localhost/library/book/34
- POST library/book/34 HTTP/1.0rn
- X-Requested-With: XMLHttpRequestrn
- Content-Type: text/htmlrn
- Referer: localhostrn
- Content-length: 36rnrn
- title=Learning+REST&author=Some+Name
- DATA="foo=bar&baz=qux"
- curl --data "$DATA" --request POST --header "Content-Type:application/x-www-form-urlencoded" http://example.com/api/callback | python -m json.tool
- exec 3<> /dev/tcp/example.com/80
- DATA='{"email": "foo@example.com"}'
- LEN=$(printf "$DATA" | wc -c)
- cat >&3 << EOF
- POST /api/retrieveInfo HTTP/1.1
- Host: example.com
- User-Agent: Bash
- Accept: */*
- Content-Type:application/json
- Content-Length: $LEN
- Connection: close
- $DATA
- EOF
- # Read response.
- while read line <&3; do
- echo $line
- done
- curl -X POST -A 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0' -d "field=acaca&name=afadxx" https://example.com
Add Comment
Please, Sign In to add comment