Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5 arp欺骗 UnboundLocalError 和 手动停止的解决办法 #19

Open
CatAndCoffee opened this issue Oct 2, 2019 · 0 comments
Open

Comments

@CatAndCoffee
Copy link

在Python3.6.8中,需要将main函数中定义的子函数build_reqbuild_rep,调整到调用的语句之前。
手动停止的办法参考

  1. 引入signal模块,构造退出函数
import signal
def quit(signum,frame):
    print('终止攻击')
    sys.exit(0)
  1. 在while循环前加入信号识别
signal.signal(signal.SIGINT,quit)
signal.signal(signal.SIGTERM,quit)
while True:
......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant