https://github.com/sqlmapproject/sqlmap
#测试版本 sqlmap 1.5.6
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
PyInstaller安装:
pip install pyinstaller
#使用pip3安装
#安装成功之后,会在Scripts目录下会增加pyinstaller.exe程序
#PyInstaller是跨平台的,在不同的平台上使用方法是一样的
pyinstaller --version
#测试版本 pyinstaller 4.2
http://c.biancheng.net/view/2690.html
hello.py
print('HELLO WORLD!')
-F,-onefile 产生单个的可执行文件
-D,--onedir 产生一个包含多个文件的目录作为可执行程序
-w,--windowed,--noconsolc 指定程序运行时不显示命令行窗口(仅对 Windows 有效)
-p DIR,--path=DIR 设置 Python 导入模块的路径(和设置 PYTHONPATH 环境变量的作用相似)
--hidden-import 导入没有被加载的模块
pyinstaller -F sqlmap.py
no such fileTemp_MEI106802thirdpartyidentywafdata.json
解决参考:
新建hook-thirdparty.py文件,写入内容如下:
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("thirdparty")
保存后将此py文件放入Pyinstaller下的hook的文件夹中
pyinstaller问题解决:no such fileTemp_MEI106802xxxxxyyyy
https://blog.csdn.net/u012254599/article/details/108981706
[!] wrong installation detected (missing modules). Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details
pyinstaller -F -p data/;lib/;extra/;plugins/;tamper/;thirdparty/; sqlmap.py --hidden-import lib.utils.versioncheck
#成功,但会会提示[WinError 3] 系统找不到指定的路径。
找不到路径:
'sqlmap\dist\lib\core\settings.py'
'sqlmap\dist\data\txt\common-columns.txt'
将sqlmap下的lib目录与data目录移动至distsqlmap.exe下同级目录下。
由于不知道到底有多少依赖,
建议将sqlmap下所有目录都移动到sqlmap.exe下。
(不包括 pycache、build、dist目录)
其他打包方式:
解决好以上bug之后,还可以使用-D参数进行打包,大小基本没有区别。
pyinstaller -D sqlmap.py #21M
pyinstaller -F sqlmap.py #21M
END
本文始发于微信公众号(NOVASEC):使用 Pyinstaller 打包 sqlmap
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论