Advertisement
Guest User

Untitled

a guest
Jun 11th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. <?php
  2. $mac = '00:43:32:43:54:67';
  3. set_time_limit(10);
  4. $accounts = array(
  5. array('login' => 'login1', 'password' => 'pass'),
  6. array('login' => 'login2', 'password' => 'pass'),
  7. //....
  8. );
  9.  
  10. foreach($accounts as $data)
  11. {
  12. // Sprawdzamy downolny url - czy czyta
  13. $curl = curl_init();
  14. curl_setopt($curl, CURLOPT_URL, 'nowiny.pl');
  15. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  16. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  17. curl_setopt($curl, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt');
  18. curl_setopt($curl, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
  19. $out = curl_exec($curl);
  20. preg_match_all("/WISPAccessGatewayParam.xsd/", $out, $xy);
  21. if(!empty($xy[0][0]))
  22. {
  23. echo "Proba logowania się jako: ". $data['login'] ."\n";
  24. $curl = curl_init();
  25. curl_setopt($curl, CURLOPT_URL,'http://192.168.1.1/login');
  26. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  27. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  28. curl_setopt($curl, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt');
  29. curl_setopt($curl, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
  30. curl_setopt($curl, CURLOPT_POST, 1);
  31. curl_setopt($curl, CURLOPT_POSTFIELDS, 'hs=mt&mac='.$mac.'&user=&uamport=mikrotik&loginlink=http%3A%2F%2F192.168.1.1%2Flogin&userurl=h$
  32. curl_exec($curl);
  33. }
  34. else
  35. exit;
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement