Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- LIVE HTTP HEADER of LOGIN DirectAdmin
- http://213.000.000.000:2222/CMD_LOGIN
- POST /CMD_LOGIN HTTP/1.1
- Host: 213.000.000.000:2222
- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- Accept-Language: nl,en-us;q=0.7,en;q=0.3
- Accept-Encoding: gzip,deflate
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
- Keep-Alive: 115
- Connection: keep-alive
- Referer: http://213.000.000.000:2222/CMD_LOGIN
- Cookie: session=
- Content-Type: application/x-www-form-urlencoded
- Content-Length: 56
- referer=%2FCMD_LOGIN&username=XXXXXX&password=XXXXXX
- HTTP/1.1 302 Found
- Server: DirectAdmin Daemon v1.37.0 Registered to XXXXXXXX.nl
- Set-Cookie: session=XXXXXXXXXXXXXXXXXXXXXX; path=/; HttpOnly
- Location: http://213.000.000.000:2222/
- Content-Type: text/html
- ----------------------------------------------------------
- http://213.000.000.000:2222/
- GET / HTTP/1.1
- Host: 213.000.000.000:2222
- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- Accept-Language: nl,en-us;q=0.7,en;q=0.3
- Accept-Encoding: gzip,deflate
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
- Keep-Alive: 115
- Connection: keep-alive
- Referer: http://213.000.000.000:2222/CMD_LOGIN
- Cookie: session=XXXXXXXXXXX
- HTTP/1.1 200 OK
- Server: DirectAdmin Daemon v1.37.0 Registered to XXXXXXXX.nl
- Connection: close
- Cache-Control: no-cache
- Pragma: no-cache
- Content-Type: text/html
- */
- $ch = curl_init();
- $ckfile = tempnam ("/tmp", "CURLCOOKIE");
- curl_setopt($ch,CURLOPT_COOKIEJAR, $ckfile);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_POST,count($fields));
- curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
- $void = curl_exec($ch);
- // get file
- if($void!==false) {
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_COOKIEFILE, $ckfile);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec($ch);
- if($result===false) {
- echo 'CURL ERROR: '.curl_error($ch);
- }
- } else {
- echo 'CURL ERROR: '.curl_error($ch);
- }
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement