记录一次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=100
     gaps --image=flag.jpg --size=58 --save
特别注意是sized的计算,需要先使图片的拼块恰好为像素最大的一条边的正方形,size=该边长像素。

相关推荐

  1. 工作记录

    2024-06-16 05:14:01       45 阅读
  2. WebSocket首使用记录

    2024-06-16 05:14:01       9 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-16 05:14:01       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-16 05:14:01       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-16 05:14:01       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-16 05:14:01       20 阅读

热门阅读

  1. 向mysql发送一个请求的时候,mysql到底做了什么

    2024-06-16 05:14:01       8 阅读
  2. 什么是 Linux ?(Linux)

    2024-06-16 05:14:01       7 阅读
  3. 前端面试题日常练-day70 【面试题】

    2024-06-16 05:14:01       8 阅读
  4. 服务器硬件基础知识

    2024-06-16 05:14:01       6 阅读
  5. 13.零拷贝

    2024-06-16 05:14:01       8 阅读
  6. 【定义通讯数据类型】LCM搭建系统通讯

    2024-06-16 05:14:01       7 阅读
  7. Cesium4Unreal - # 011 加载显示geojson

    2024-06-16 05:14:01       8 阅读
  8. Spring Boot 项目中的 GC Root

    2024-06-16 05:14:01       8 阅读
  9. Docker常用命令

    2024-06-16 05:14:01       7 阅读
  10. mysql 分组后每个取最新的一条记录

    2024-06-16 05:14:01       11 阅读
  11. 常用的工具:pdf转换器、流程图

    2024-06-16 05:14:01       7 阅读
  12. Linux系统学习——指令二

    2024-06-16 05:14:01       6 阅读