首页 > 解决方案 > 当我尝试在 python 中运行我的代码时出现意外的缩进错误

问题描述

我正在尝试对我在我的 PC 上托管的服务器进行简单的 dDos 攻击。但是当我启动这个程序时,它告诉我:

unexpected indent (<unknown>, line 14)

代码:

from scapy.all import *
source_IP = input("Enter IP address of Source: ")
target_IP = input("Enter IP address of Target: ")
source_port = int(input("Enter Source Port Number:"))
i = 1

while True:
   IP1 = IP(source_IP = source_IP, destination = target_IP)
   TCP1 = TCP(srcport = source_port, dstport = 80)
   pkt = IP1 / TCP1
   send(pkt, inter = .001)
   
   print ("packet sent " + i)
      i = i + 1

我该如何解决?

编辑:

现在代码显示:

Undefined variable 'send'
Undefined variable 'TCP'
Undefined variable 'IP'
Unable to import 'scapy.all'

...

标签: pythonserverddos

解决方案


推荐阅读