Advertisement
kassner

Untitled

Nov 10th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. include 'library/HttpClient.class.php';
  4.  
  5. $http = new HttpClient('192.168.41.49', 80);
  6. $http->cookie_host = 'banserver.local';
  7. $http->get('/');
  8. $http->get('/login.jsp');
  9. $matches = array();
  10. preg_match('/name=\'csrfmiddlewaretoken\' value=\'([a-z0-9]*)\'/', $http->getContent(), $matches);
  11. $token = $matches[1];
  12. if (strlen($token) != 32)
  13. {
  14.     die('Token não encontrado');
  15. }
  16.  
  17. $http->post('/login.jsp', array(
  18.     'csrfmiddlewaretoken' => $token,
  19.     'bid' => '******',
  20.     'password' => '******'
  21. ));
  22.  
  23. var_dump($http->getContent());
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement