Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- POST http://www.site.com/login HTTP/1.1
- Connection: close
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- Accept-Language: en-us
- Host: www.site.com
- Referer: http://www.site.com/
- User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
- Content-Length: 46
- Content-Type: application/x-www-form-urlencoded
- username=aaaaa&password=bbbbbb&submit_login=Login
- HTTP/1.1 301 Moved Permanently
- Server: nginx/1.1.16
- Date: Thu, 27 Sep 2018 12:37:38 GMT
- Content-Type: text/html; charset=UTF-8
- X-Powered-By: PHP/5.2.17
- Expires: Thu, 19 Nov 1981 08:52:00 GMT
- Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
- Pragma: no-cache
- Set-Cookie: seo-board=xxxxxxxxxxxxxxxxxxxxxx; expires=Fri, 27-Sep-2019 12:37:38 GMT
- Location: http://www.site.com
- Connection: Close
- Proxy-Connection: Close
- POST http://www.site.com HTTP/1.1
- Connection: close
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- Accept-Language: en-us
- Host: www.site.com
- Referer: http://www.site.com/
- User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
- Content-Length: 46
- Content-Type: application/x-www-form-urlencoded
- Cookie: seo-board=xxxxxxxxxxxxxxxxxxxxxx
- username=aaaaa&password=bbbbbb&submit_login=Login
- use strict; use warnings;
- use HTTP::Cookies;
- use LWP::UserAgent; use LWP::Protocol::http;
- push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0);
- my $ua = LWP::UserAgent->new(timeout => 15, max_redirect => 9, ssl_opts => {verify_hostname => 0, SSL_verify_mode => 0});
- push @{ $ua->requests_redirectable }, 'POST';
- $ua->default_header('Accept-Language' => 'en-us',
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0',
- 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
- my $cookie = HTTP::Cookies->new(hide_cookie2 => 1); $ua->cookie_jar($cookie);
- 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