python 安装 scapy windows 10 64bit
简介:
前段时间装的pypcap做嗅探。打包受阻。因为我都是在windows做的。也要打包到exe给别人用。
所以尝试了一下scapy,也可以嗅探,貌似功能更强大。先用sniff吧。
这个也不是在venv中点鼠标就能装上的。
看下官方提示:
You need the following software packages in order to install Scapy on Windows:
- Python: Python 2.7.X or 3.3+. After installation, add the Python installation directory and its Scripts subdirectory to your PATH. Depending on your Python version, the defaults would be
C:\Python27
andC:\Python27\Scripts
respectively.- Npcap: the latest version. Default values are recommanded. Scapy will also work with Winpcap.
- Scapy: latest development version from the Git repository. Unzip the archive, open a command prompt in that directory and run “python setup.py install”.
把python加入系统PATH
安装Npcap,没说Npcap SDN。不过我电脑上装的有。也不知道不装可以不可以。
git 源码, 运行python setup.py install
再讲一下怎么图形安装它。
pycharm打开源码包。
打开setup.py,随便运行一下。不管报什么错。
点setup旁边的小箭头,打开 Edit Configurations
Script path : 这是setup.py的路径,刚才忽视错误运行一下,就是为了让它自动生成。
Parameters: 扩展命令 参数 填 install
Python interpreter :所用的环境,也就是要选venv。选你准备运行scapy的环境。安装到这个环境里面。
scapy示例代码:没有解包。乱码一样。
from scapy.all import sniff pkts = sniff(prn=lambda x:x.sprintf("{IP:%IP.src% -> %IP.dst%\n}{Raw:%Raw.load%\n}")) print(pkts)
作者:上官飞鸿
出处:https://www.cnblogs.com/jackadam/p/8438018.html
版权:本作品采用「知识共享-署名-非商业性-禁止演绎(CC-BY-NC-ND)」许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现