khalilasharen

DEFENSE FLOOD

Nov 13th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #Coder By : jimmyromanticdevil
  3. #Tools : For defense from syn & Ping Flood attack
  4. #You Must Being a Root before You Execute The code
  5.  
  6. import threading,sys,time,base64
  7. from time import sleep
  8. import subprocess
  9.  
  10. __author__='amltbXlyb21hbnRpY2Rldmls'
  11. __email__ ='PHJvbWFudGljZGV2aWwuamltbXlAZ21haWwuY29tPg=='
  12. __blog__ ='aHR0cDovL2ppbW15cm9tYW50aWNkZXZpbC53b3JkcHJlc3MuY29t'
  13.  
  14.  
  15. def tayping(title):
  16. try:
  17. for i in title:
  18. print "\b%s"%i,
  19. sys.stdout.flush()
  20. time.sleep(0.005)
  21. except ImportError:
  22. print "Some Error",
  23.  
  24.  
  25. def title():
  26. __Auth__= base64.b64decode(__author__)
  27. __Eml__ = base64.b64decode(__email__)
  28. _blog_ = base64.b64decode(__blog__)
  29. Title ="""
  30. _______________________________________________________
  31. ////////////////////////////////////////////////////////|
  32. |----------------------------------------------------||/|
  33. ||Coder by %s ||/|
  34. ||Tools : Defense From syn & ping Flood attack ||/|
  35. || ||/|
  36. ||Contach : %s ||/|
  37. ||Home page :%s ||/|
  38. || ||/|
  39. ||<!>you must be a root<!> ||/|
  40. ||___________________________________________________||/|
  41. ||----------------------------------------------------|/
  42. '''''''''''''''''''''''''''''''''''''''''''''''''''''''
  43. """%(__Auth__,__Eml__,_blog_)
  44. tayping(Title)
  45.  
  46.  
  47. class output_command(threading.Thread):
  48. def __init__(self, command):
  49. threading.Thread.__init__(self)
  50. self.command = command
  51. def run(self):
  52. subprocess.call((self.command), shell=True)
  53. print"[!]Youre system was Defense,\nfrom syn & flood attack\n"
  54.  
  55. class input_command:
  56. def __init__(self):
  57. print "[<>]Enter the fucking shit attacker host[<>]"
  58. attacker_host = raw_input('[Host-attakcer] : ')
  59. Block_syn = "iptables -N %s"%attacker_host
  60. Block_syn2 = "iptables -A INPUT -p tcp --syn -j %s"%attacker_host
  61. Block_syn3 = "iptables -A %s -m limit --limit 1/s --limit-burst 3 -j ACCEPT"%attacker_host
  62. block_syn4 = "iptables -A %s -j DROP"%attacker_host
  63. bloc_icmp = "iptables -A INPUT -p icmp -j %s"%attacker_host
  64. block_icmp = "iptables -A %s -m limit --limit 1/s --limit-burst 2 -j ACCEPT"%attacker_host
  65. Procces = ["iptables -F","iptables -X","iptables -P INPUT ACCEPT","iptables -P OUTPUT ACCEPT","iptables -P FORWARD ACCEPT",Block_syn,Block_syn2,Block_syn3,block_syn4,bloc_icmp,]
  66. for x in Procces:
  67. try:
  68. i=output_command(x)
  69. i.start()
  70. except:
  71. pass
  72.  
  73. if __name__ == "__main__":
  74. title()
  75. objCaller = input_command()
Advertisement
Add Comment
Please, Sign In to add comment