Guest User

Untitled

a guest
Sep 27th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. POST http://www.site.com/login HTTP/1.1
  2. Connection: close
  3. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  4. Accept-Language: en-us
  5. Host: www.site.com
  6. Referer: http://www.site.com/
  7. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
  8. Content-Length: 46
  9. Content-Type: application/x-www-form-urlencoded
  10.  
  11. username=aaaaa&password=bbbbbb&submit_login=Login
  12.  
  13.  
  14. HTTP/1.1 301 Moved Permanently
  15. Server: nginx/1.1.16
  16. Date: Thu, 27 Sep 2018 12:37:38 GMT
  17. Content-Type: text/html; charset=UTF-8
  18. X-Powered-By: PHP/5.2.17
  19. Expires: Thu, 19 Nov 1981 08:52:00 GMT
  20. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  21. Pragma: no-cache
  22. Set-Cookie: seo-board=xxxxxxxxxxxxxxxxxxxxxx; expires=Fri, 27-Sep-2019 12:37:38 GMT
  23. Location: http://www.site.com
  24. Connection: Close
  25. Proxy-Connection: Close
  26.  
  27.  
  28. POST http://www.site.com HTTP/1.1
  29. Connection: close
  30. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  31. Accept-Language: en-us
  32. Host: www.site.com
  33. Referer: http://www.site.com/
  34. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
  35. Content-Length: 46
  36. Content-Type: application/x-www-form-urlencoded
  37. Cookie: seo-board=xxxxxxxxxxxxxxxxxxxxxx
  38.  
  39. username=aaaaa&password=bbbbbb&submit_login=Login
  40.  
  41. use strict; use warnings;
  42. use HTTP::Cookies;
  43. use LWP::UserAgent; use LWP::Protocol::http;
  44. push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0);
  45. my $ua = LWP::UserAgent->new(timeout => 15, max_redirect => 9, ssl_opts => {verify_hostname => 0, SSL_verify_mode => 0});
  46. push @{ $ua->requests_redirectable }, 'POST';
  47. $ua->default_header('Accept-Language' => 'en-us',
  48. 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0',
  49. 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
  50.  
  51. my $cookie = HTTP::Cookies->new(hide_cookie2 => 1); $ua->cookie_jar($cookie);
  52.  
  53. my $req = $ua->post('http://www.site.com/login', Content => 'username=aaaaa&password=bbbbbb&submit_login=Login')->as_string;
Add Comment
Please, Sign In to add comment