Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
shellnoob — 一个 shellcode 编写工具包 | Kitploit
工具/GitHubGitHub/reyammer/shellnoob
漏洞利用逆向工程脚本与自动化Shellcode调试器二进制分析学习与教育Shellcode 生成Payload 开发
GitHubreyammer/shellnoob

shellnoob

一个 shellcode 编写工具包

查看仓库
694121551年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

ShellNoob

编写 shellcode 一直非常有趣,但有些部分极其枯燥且容易出错。只需专注于有趣的部分,使用 ShellNoob 吧!

快速了解,请查看 Black Hat Arsenal 演讲的幻灯片:link

想贡献代码?有功能请求?报告 Bug?想骂人?所有反馈都欢迎!!(当然,某些类型的反馈会比其他的更受欢迎 :-))。

如有任何问题,欢迎在 Twitter 上联系我 @reyammer 或发送邮件至 yanick[AT]cs.ucsb.edu!

Contributors & Acknowledgments

  • Levente Polyak (@anthraxx42)
    • 增加 Python 3 支持
    • 修复 Bug
  • @ToolsWatch & Black Hat 团队
    • 他们给了我展示工具的机会 :D

News

  • 01/21/2014 - ShellNoob 2.1 发布!完全支持 Python 3,并修复了大量 Bug。全部功劳归于 Levente Polyak!

  • 07/29/2013 - ShellNoob 2.0 发布!

  • 06/08/2013 - ShellNoob 被 Black Hat Arsenal 收录!公告见:link。

Features

  • 在不同格式和来源之间转换 shellcode。目前支持的格式:asm, bin, hex, obj, exe, C, python, ruby, pretty, safeasm, completec, shellstorm。(详情见 "Formats description" 部分。)
  • 交互式 asm-to-opcode 转换(反之亦然)模式。当你在 shellcode 中不能使用特定字节,并想知道某条汇编指令是否会引起问题时,这个功能很有用。
  • 同时支持 ATT 和 Intel 语法。查看 --intel 开关。
  • 支持 32 位和 64 位(在 x86_64 机器上运行)。查看 --64 开关。
  • 解析系统调用号、常量和错误编号(现在已经真正实现了!:-))。
  • 可移植且易于部署(仅依赖 gcc/as/objdump 和 python)。它只是一个独立的 Python 脚本,同时支持 Python2.7+ 和 Python3+。
  • 就地开发:直接在目标架构上运行 ShellNoob!
  • 内置支持 Linux/x86、Linux/x86_64、Linux/ARM、FreeBSD/x86、FreeBSD/x86_64。
  • "prepend breakpoint" 选项。查看 -c 开关。
  • 支持从 stdin 读取 / 向 stdout 写入(使用 "-" 作为文件名)。
  • 超廉价调试:查看 --to-strace 和 --to-gdb 选项!
  • 在脚本中将 ShellNoob 用作 Python 模块!查看 "ShellNoob as a library" 部分。
  • Verbose 模式显示转换的低层步骤:用于调试/理解/学习非常有用!
  • 额外插件:使用 --file-patch、--vm-patch、--fork-nopper 选项轻松实现二进制补丁!(详情如下)

Use Cases

Built-in help

root@kitploit:~
$ ./shellnoob.py -h
shellnoob.py [--from-INPUT] (input_file_path | - ) [--to-OUTPUT] [output_file_path | - ]
shellnoob.py -c (prepend a breakpoint (Warning: only few platforms/OS are supported!)
shellnoob.py --64 (64 bits mode, default: 32 bits)
shellnoob.py --intel (intel syntax mode, default: att)
shellnoob.py -q (quite mode)
shellnoob.py -v (or -vv, -vvv)
shellnoob.py --to-strace (compiles it & run strace)
shellnoob.py --to-gdb (compiles it & run gdb & set breakpoint on entrypoint)

Standalone "plugins"
shellnoob.py -i [--to-asm | --to-opcode ] (for interactive mode)
shellnoob.py --get-const <const>
shellnoob.py --get-sysnum <sysnum>
shellnoob.py --get-errno <errno>
shellnoob.py --file-patch <exe_fp> <file_offset> <data> (in hex). (Warning: tested only on x86/x86_64)
shellnoob.py --vm-patch <exe_fp> <vm_address> <data> (in hex). (Warning: tested only on x86/x86_64)
shellnoob.py --fork-nopper <exe_fp> (this nops out the calls to fork(). Warning: tested only on x86/x86_64)

"Installation"
shellnoob.py --install [--force] (this just copies the script in a convinient position)
shellnoob.py --uninstall [--force]

Supported INPUT format: asm, obj, bin, hex, c, shellstorm
Supported OUTPUT format: asm, obj, exe, bin, hex, c, completec, python, bash, ruby, pretty, safeasm
All combinations from INPUT to OUTPUT are supported!

Installation (only if you want)

root@kitploit:~
$ ./shellnoob.py --install

这只是把脚本复制到 /usr/local/bin/snoob。就这样。(运行 ./shellnoob.py --uninstall 即可撤销)。

Convert shellcode from/to different formats with a uber flexible CLI.

root@kitploit:~
$ snoob --from-asm shell.asm --to-bin shell.bin

一些等效的替代写法(该工具会尝试根据文件扩展名猜测你的意图……)

root@kitploit:~
$ snoob --from-asm shell.asm --to-bin
$ snoob shell.asm --to-bin
$ snoob shell.asm --to-bin - > shell.bin
$ cat shell.asm | snoob --from-asm - --to-bin - > shell.bin

Formats description

  • "asm" - 标准汇编。默认使用 ATT 语法,使用 --intel 切换为 Intel 语法。(更多细节见 "asm as output" 部分)
  • "bin" - 原始二进制('\x41\x42\x43\x44')
  • "hex" - 十六进制编码的原始二进制('41424344')
  • "obj" - 一个 ELF 文件
  • "exe" - 一个可执行的 ELF 文件
  • "c" - 可直接嵌入 C 程序的内容。
  • "python"、 "bash"、 "ruby" - 同上。
  • "completec" - 可编译的 C,能正确将内存设置为 RWX(以支持自修改 shellcode)
  • "safeasm" - 100% 可汇编的汇编代码:有时由 objdump 输出的(从中提取 "asm" 的)内容无法汇编。该选项会输出 "raw" 字节(以 .byte 表示法),从而可以被 "as" 汇编。
  • "shellstorm" - --from-shellstorm 开关接受一个 <shellcode_id> 作为参数。ShellNoob 会从 shell-storm shellcode 数据库获取所选 shellcode,并将其转换为所选格式。

Easy debugging

root@kitploit:~
$ snoob -c shell.asm --to-exe shell
$ gdb -q shell
$ run
Reading symbols from ./shell...(no debugging symbols found)...done.
(gdb) run
Starting program: ./shell

Program received signal SIGTRAP, Trace/breakpoint trap.
0x08048055 in ?? ()
(gdb) 

或者你也可以使用新的 --to-strace 和 --to-gdb 开关!

root@kitploit:~
$ snoob open-read-write.asm --to-strace
Converting open-read-write.asm (asm) into /tmp/tmpBaQbzP (exe)
execve("/tmp/tmpBaQbzP", ["/tmp/tmpBaQbzP"], [/* 97 vars */]) = 0
[ Process PID=12237 runs in 32 bit mode. ]
open("/tmp/secret", O_RDONLY)           = 3
read(3, "thesecretisthedolphin\n", 255) = 22
write(1, "thesecretisthedolphin\n", 22thesecretisthedolphin
) = 22
_exit(0)  
root@kitploit:~
$ snoob open-read-write.asm --to-gdb
Converting open-read-write.asm (asm) into /tmp/tmpZdImWw (exe)
Reading symbols from /tmp/tmpZdImWw...(no debugging symbols found)...done.
(gdb) Breakpoint 1 at 0x8048054
(gdb)

注意 ShellNoob 会自动在入口点设置断点!

Get syscall numbers, constants and errno

root@kitploit:~
$ snoob --get-sysnum read
i386 ~> 3
x86_64 ~> 0
$ snoob --get-sysnum fork
i386 ~> 2
x86_64 ~> 57
root@kitploit:~
$ snoob --get-const O_RDONLY
O_RDONLY ~> 0
$ snoob --get-const O_CREAT
O_CREAT ~> 64
$ snoob --get-const EINVAL
EINVAL ~> 22
root@kitploit:~
$ snoob --get-errno EINVAL
EINVAL ~> Invalid argument
$ snoob --get-errno 22
22 ~> Invalid argument
$ snoob --get-errno EACCES
EACCES ~> Permission denied
$ snoob --get-errno 13
13 ~> Permission denied

Interactive mode

root@kitploit:~
$ ./shellnoob.py -i --to-opcode
asm_to_opcode selected
>> mov %eax, %ebx
mov %eax, %ebx ~> 89c3
>> 
root@kitploit:~
./shellnoob.py -i --to-asm
opcode_to_asm selected
>> 89c3
89c3 ~> mov %eax,%ebx
>>

ShellNoob as a library

root@kitploit:~
$ python
>>> from shellnoob import ShellNoob
>>> sn = ShellNoob(flag_intel=True)

>>> sn.asm_to_hex('nop; mov ebx,eax; xor edx,edx')
'9089c331d2'
>>> sn.hex_to_inss('9089c331d2')
['nop', 'mov ebx,eax', 'xor edx,edx']

>>> sn.do_resolve_syscall('fork')
i386 ~> 2
x86_64 ~> 57

Asm as output format

当 "asm" 作为输出格式时,ShellNoob 会尽力而为。Objdump 被用作反汇编器,但它的输出并非万无一失。ShellNoob 会尝试通过添加字节(.byte 表示法)来增强反汇编结果,并在适当时显示对应的 ASCII(.ascii 表示法)。当你想要修改/汇编 objdump 的输出但需要快速修复时,这非常有用。

Example with the .byte notation:

root@kitploit:~
jmp 0x37              # .byte 0xeb,0x35      
pop %ebx              # .byte 0x5b          
mov %ebx,%eax         # .byte 0x89,0xd8      
add $0xb,%eax         # .byte 0x83,0xc0,0x0b 
xor %ecx,%ecx         # .byte 0x31,0xc9      

Example with the .ascii notation:

root@kitploit:~
das                   # .ascii "/"
je 0xac               # .ascii "tm"
jo 0x70               # .ascii "p/"
jae 0xa8              # .ascii "se"
arpl %si,0x65(%edx)   # .ascii "cre"
je 0xa0               # .ascii "tX

License

ShellNoob 以 MIT 许可证发布。请查看 COPYRIGHT 文件。

下载工具