图片隐写的小试牛刀

时间:2022-07-22
本文章向大家介绍图片隐写的小试牛刀,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

无意拿到一个图片隐写的题目,纯分享让你更直观了解图片隐写的解题套路

1.开局一张图,保存图片为 ds.jpg

2.根据提示对网站进行信息搜集,先用 dirb 直接对网站进行简单扫描

3.扫出两个 sitemap.xml 和 pass.txt 两个文件,保存字典文件为 pass.txt

4.结合字典的隐写题的思路有 steghide、F5、outguess 等加密,逐一尝试 5.利用 steghide 解密 (1)安装 steghide

apt-get install steghide (2)python 编写结合获取的密码字典遍历验证(Python2 语法编写的)

# -*- coding: utf8 -*-
from subprocess import *
 
def foo():
    stegoFile='ds.jpg'
    extractFile='hide.txt'
    passFile='pass.txt'
 
    errors=['could not extract','steghide --help','Syntax error']
    cmdFormat='steghide extract -sf "%s" -xf "%s" -p "%s"'
    f=open(passFile,'r')
 
    for line in f.readlines():
        cmd=cmdFormat %(stegoFile,extractFile,line.strip())
        p=Popen(cmd,shell=True,stdout=PIPE,stderr=STDOUT)
        content=unicode(p.stdout.read(),'gbk')
        for err in errors:
            if err in content:
                break
        else:
            print content,
            print 'the passphrase is %s' %(line.strip())
            f.close()
            return
 
if __name__ == '__main__':
    foo()
    print 'ok'
    pass

6.解密成功,获取第二关入口

bb@SC-201912210537:~$ sudo python2 2.py
the file "hide.txt" does already exist. overwrite ? (y/n)
steghide: did not write to file "hide.txt".
the passphrase is $SRV
Ok

bb@SC-201912210537:~$ cat hide.txt
HI~
恭喜你成功拿下第一关,这道题考的是图片隐藏。
NOW
我们开始进入第二关吧。
第二关要求:
《破解下面加密页面的密码》
https://blog.bbskali.cn/index.php/archives/1884/
提示:
1:利用Burp暴力破解
2:密码字典通过对本站信息收集找找看。
good luck

7.访问第二关发现为简单的暴力破解

8.利用 burp 进行暴力破解 Burp 的 https 抓包配置:https://blog.csdn.net/qq_36502272/article/details/93495744 (1)抓包发送至爆破模块

右键发送至 intruder 模块

(2)加载密码字典得出结果,通过 length 进行排序找出结果

参考资料

[1]下载地址: https://imgkr.cn-bj.ufileos.com/1d8772a4-fcdf-4a66-a218-cf2c6c1a34b1.jpg