解决 scapy “NameError: global name 'wrpcap' is not defined” 错误

通过 scapy 编写发包脚本时遇到如下错误:

  1. Traceback (most recent call last):
  2. File "attacker.py", line 62, in <module>
  3. main()
  4. File "attacker.py", line 59, in main
  5. sendpfast(pkt_list, pps=rate, iface=iface)
  6. File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 289, in sendpfast
  7. wrpcap(f, x)
  8. NameError: global name 'wrpcap' is not defined

解决方法是打开 sendrecv.py

  1. vim /usr/lib/python2.7/dist-packages/scapy/sendrecv.py

导入以下模块:

  1. from utils import warning, get_temp_file, PcapReader, wrpcap

2018.11

解决 scapy “NameError: global name 'wrpcap' is not defined” 错误的更多相关文章

  1. keras load model 遇到 自定义函数 Lambda(lambda x: softmax(x, axis=1), NameError: global name 'softmax' is not defined

    问题 在定义模型的时候,自定义了一个函数 模型保存之后,load 模型的时候报错: 解决 load 模型的时候需要指定custom object 参考: https://faroit.github.i ...

  2. global name 'validate_on_submit' is not defined错误

    原因就是validate_on_submit()方法是属于form的方法我使用的时候忘了form. 还有一个比较重要的是validate_on_submit()方法是wtf特有的而wtform是没有这 ...

  3. 【技术贴】解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法

    [技术贴]解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法 错误是:Aborting commit: xxxxx’ remains ...

  4. 解决反序列化(Deserialize)无法找到程序集的错误

    http://blog.csdn.net/w_s_q/article/details/5677536 在使用.NET序列化对象时,会将程序集信息也包含进去.如果将序列化之后的字节数组通过网络(或其他传 ...

  5. 解决:安装SQL Server 2008 Native Client遇到错误(在Navicat premium新建sqlserver连接时 需要):An error occurred during ...HRESULT: 0x80070422(注意尾部的错误号)

    解决:安装SQL Server 2008 Native Client遇到错误(在Navicat premium新建sqlserver连接时 需要):An error occurred during . ...

  6. python pip NameError:name 'pip' is not defined”

    https://www.jianshu.com/p/f57f98ebcb21 问题: 如果直接在命令行里面输入pip或者pip3,提示:(如图1) “NameError:name 'pip' is n ...

  7. 解决ajax请求(SpringMVC后台)响应415/400/405错误

    解决ajax请求(SpringMVC后台)响应415/400/405错误 后端代码 bean public class user { private String username; private ...

  8. CentOS6.5升级autoconf版本,解决”Autoconf version 2.64 or higher is required“错误

    CentOS6.5升级autoconf版本,解决”Autoconf version 2.64 or higher is required“错误 https://blog.csdn.net/pretty ...

  9. 解决win7打印机共享出现“无法保存打印机设置(错误0x000006d9)的问题

    最新解决win7打印机共享出现“无法保存打印机设置(错误0x000006d9)的问题,由系统下载吧率先分享: 有些用户在使用Windows7系统过程中,碰到到win7打印机共享出现“无法保存打印机设置 ...

随机推荐

  1. vue 基础的一些字眼及路由

    每个框架都有一些自己的写法和一些字眼 摘自 vue 官网 v-bind 缩写 <!-- 完整语法 --> <a v-bind:href="url">...& ...

  2. ES6语法 Promise Iterator

    类和对象 基本定义: class Parent{ constructor(name='lmx'){ //name= 默认值 this.name=name } } let v_parent = new ...

  3. spring 初始化

    一.Spring 容器高层视图 Spring 启动时读取应用程序提供的Bean配置信息,并在Spring容器中生成一份相应的Bean配置注册表,然后根据这张注册表实例化Bean,装配号Bean之间的依 ...

  4. Java 基础 多线程进阶(锁,线程安全)

    一,前言 前面我们已经对线程和线程池有一定的了解,但是只要说到多线程,肯定需要考虑线程安全等问题.接下来我们就来好好聊聊这些问题. 二,线程安全 如果有多个线程在同时运行,而这些线程可能会同时运行这段 ...

  5. 【LeetCode每天一题】Minimum Path Sum(最短路径和)

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which ...

  6. supervise守护进程

    通过二进制supervise文件可以直接对进程进行守护 ./supervise -f  要守护的程序 -p  守护信息存储位置 例如: ./supervise -f  http_server -p s ...

  7. 使用 acme.sh 签发续签 Let‘s Encrypt 证书 泛域名证书

    1. 安装 acme.sh 安装很简单, 一个命令: curl https://get.acme.sh | sh 并创建 一个 bash 的 alias, 方便你的使用 alias acme.sh=~ ...

  8. git宝典—应付日常工作使用足够的指北手册

    最近公司gitlab又迁移,一堆git的命令骚操作,然鹅git命令,感觉还是得复习下——其实,git现在界面操作工具蛮多,比如intellij 自带的git操作插件就不错,gitlab github ...

  9. sitecore8.2 基于相对路径查询item

    当前项目: bar (path: /sitecore/content/home/foo/bar) 查询: query:./child/grandchild 结果: grandchild (path: ...

  10. 2018.5.15Html标签初学

    body标签 -图标:&nbsp:(一个空格)&gt:(表示>)&lt:(表示<) -p标签:段落的划分 -br标签:换行 标签分为块级标签和行内标签. 块级标签: ...