Skip to content

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

Description

@CatAndCoffee

在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:
......

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions