python - 当我尝试在 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'
...
解决方案
推荐阅读
- datatables - 如何在 Datatables 分页中自动显示下一页编号而不是省略号
- ruby-on-rails - Rails如何将哈希作为参数放入url?
- docker - 如果 docker-compose.yml 和 Dockerfile 都指定了具有优先级的环境变量?
- ruby-on-rails - Rails API 返回密码不能为 has_secure_password 的空白
- ios - 如何在横向模式下拍摄 MKMapView 快照
- linux - /usr/bin/ld: ../freeglut/libfreeglut_static.a(freeglut_state.o): 未定义对 Box2d 中符号“XGetWindowAttributes”的引用
- java - 可空 Gson 改造字段
- android - 有时在关闭和打开 GPS 后无法获取当前位置
- php - Instamojo 支付集成 - Webhook 问题
- r - 在 R 中向量化两个相似的函数适用于一个