Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- I removed the other cookies from this portion of the script, https://website/CookieAuth.dll?GetLogon?curl=Z2FPagesZ2Fschedule.aspx&reason=2&formdir=9 does not set any upon the first visit. I would assume they were left over from a previous session.
- */
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
- curl_setopt($ch, CURLOPT_URL, "https://website/CookieAuth.dll?Logon");
- curl_setopt($ch, CURLOPT_POST, true);
- $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- $data = array(
- 'username' => 'test',
- 'password' => 'test',
- 'curl' => 'Z2FPagesZ2Fschedule.aspx',
- 'flags' => '0',
- 'forcedownlevel' => '0',
- 'formdir' => '9',
- 'trusted' => '0',
- 'SubmitCreds' => 'Log On'
- );
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
- $output = curl_exec($ch);
- print_r($output);
- /*
- Response:
- HTTP/1.1 302 Moved Temporarily
- Location: https://website/Pages/schedule.aspx
- Set-Cookie: cadataF91BF9412BC9459AA2FC649721433C28="0cda9a35c-7777-46e1-be68-55475880a284KglOJh0EX2CMqruImGA1XMiSkXQLrOVBMGSHSszFMugcbfuNN3vOz7AjUw1ul7iI9KSZbTDGFU7iUHzwq4zqG9VAQmLCIEejQR60MInt6/M="; HttpOnly; Domain=website; secure; path=/
- Content-Length: 0
- Connection: close
- HTTP/1.1 302 Moved Temporarily
- Location: https://website/CookieAuth.dll?GetLogon?curl=Z2FPagesZ2Fschedule.aspx&reason=2&formdir=9
- Set-Cookie: cadataF91BF9412BC9459AA2FC649721433C28=; Domain=website; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
- Connection: close
- Content-Length: 0
- HTTP/1.1 200 OK
- Connection: close
- Content-Length: 8341
- Content-Type: text/html
- Pragma: no-cache
- Cache-control: no-cache,max-age=0,must-revalidate
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement