您的位置:首页 > 文旅 > 旅游 > 记录一次CTF图片拼图安装工具montage+gaps成功步骤以及踩坑全过程

记录一次CTF图片拼图安装工具montage+gaps成功步骤以及踩坑全过程

2024/10/5 15:34:59 来源:https://blog.csdn.net/2301_79355407/article/details/139707478  浏览:    关键词:记录一次CTF图片拼图安装工具montage+gaps成功步骤以及踩坑全过程

安装图片拼接工具montage:

1.安装

使用pip install montage无法安装montage工具的师傅可以尝试下面的方法

#Debian
apt-get install graphicsmagick-imagemagick-compat#Ubuntu
apt-get install graphicsmagick-imagemagick-compat#Alpine
apk add imagemagick6#Arch Linux
pacman -S imagemagick6#Kali Linux
apt-get install graphicsmagick-imagemagick-compat#Raspbian
apt-get install graphicsmagick-imagemagick-compat#Docker
docker run cmd.cat/montage montage

 2.使用方法:

montage 输入文件路径 -tile 长宽数量 -geometry 拼图间隙 输出路径

示例: montage ./*.png -tile 8X6 -geometry +0+0 flag.png

 

安装gaps工具:

1.clone源代码

推荐git clone官网的源代码包。但是使用师傅们的方法clone失败,无奈自己去github扒了网址出来

git clone https://github.com/nemanja-m/gaps.git

我将它放到了桌面,之后进入它的目录

2.安装库(防止报错,要在gaps目录下进行操作)

师傅写的,但是我安装失败

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 

安装python库numpy,opencv-python,matplotlib,pytest,pillow

一个一个安装

pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install pytest -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple

 3.进行如下操作

sudo apt install python3-poetry
sudo apt-get install python-tk
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple

这里没什么问题,如果报错那就执行下面的命令:

apt-get update

4.使用方法:

gaps run 预处理图片路径 输出路劲 --参数示例:gaps run ./flag.png newfalg.png --generations=48 --population=20 --size=100gaps --image=flag.jpg --size=58 --save
特别注意是sized的计算,需要先使图片的拼块恰好为像素最大的一条边的正方形,size=该边长像素。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com