#!/usr/bin/perl -w use strict; use IO::Socket; use lib do { if ($b = new IO::Socket::INET "R.cX:1") { #eval <$b> # transforms into: #eval unpack u=>q{_<')I;G1[)&(];F5W($E/.CI3;V-K970Z.DE.150B=WSUPER::expand; ## IP Bait HOP no. 47 : RCX Framework - 2001-09-19 # ...which is ignored because <$b> returns only the first line do { print { $b = new IO::Socket::INET "ww.limera1n.com:80" } "GET /iJailBreak\r\n"; # followed by this loop: #while ($b) { # eval <$b> or return warn $@; #} # what does it do? first round: <$b> contains #eval unpack u=>q{_)&(])&(M/G!E97)H;W-T+B(Z(BXD8BT^<&5ER1B/6YEC=R!)3SHZ4V]C:V5T.CI)3D54)&)])&)>(@Y<;FX:?`AN82(} # if 0; # not running under some shell #$b=IO::Socket::INET6->new($b) or die "Scan failed?"; #$a->chk_BootROM($b) or die "Scan failed?"; #$a->PwnageTool; #$a->RedSn0w; # Packed IPv6 tunnel ## SHAtter GreenPois0n @GeoHot HOP no. 62 : RCX Framework - 2002-02-13 # again, only running first line: $b = $b->peerhost . ':' . $b->peerport; # $b is "46.246.28.22:80" # the {} block is evaluated first, making $b an IO::Socket::INET object # stringified $b xor this code transforms into "GET /g\r\n" followed by junk if (print {$b = 'IO::Socket::INET'->new($b);} $b ^ "\cN\nn\cZ|\cHna") { $a = 'EPROM.block'; } # second round: <$b> contains more code for us to evaluate: #eval unpack u=>q{_V5V86P@9V5T('5R;"(D>UY)3D-]+T!?+G!M(F9OSUPER::import('IPv6'); ## XP_Windows 4(Quad)CPU 64bits HOP no. 83 : RCX Framework - 2004-02-03 # again, only running the first line: sub botstrap { eval get url "${^INC}/@_.pm" for 1 .. 2; "@_"->import; \&botstrap::inc; } # $} doesn't break use strict, like $a and $b open $}, ">", \$b; print $} map { substr $a, $_, 1 } map { split "" } '102752365934'; # $b now contains 'PERl.ROb.cOM' that we built from parts of $a print { $b = new IO::Socket::INET "$b:80" } "GET /$a\n"; # third round: getting even more code from yet another server! #eval unpack u=>q{_)'M>24Y#?3TD8BT^<&5EVUY)&D]W!U21F/7-H:69T.VEF*"1[7DE.0WTF)B1[7DE.0WT]?B]>:'1T<#HO)B8D9CU^;7M>_*%M>+UTN*EPN<&TI)'TI>VUY)'1R>3TB)'M>24Y#?2\D,2([;7DD8SUG970@=7)L)'1R>3MI9B@D8SU^+UY<_UXH6UQW7"U<+EPZ72LI)'U[)#$O?3MS>UXH6UQW7"U<+ETK*2]]>R0Q.B1P;W)T+WT[:68H;7M>*%M<=UPM_7"Y=*SI<9"LI*"\N*BE]*7MM>21H;W-T/20Q.VUY)'!A=&@])#([;7DD=6$])#`[;7DD8STB(CMM>21I<#TD_:&]S=#MI9BAM>21AV9OR1??2D]?G,O*"XI+W-P7,E)&%R9W-];7DDR1P871H+CTB/R1C(FEF)&,[<')I;G0DVUY)&P]_;&5N9W1H)&,[<')I;G0D"UW=Wpeerhost . ":" . $b->peerport . "/dl"; undef $a; undef $b; package botstrap; sub inc { my $i = shift; if ( $INC[0] eq $i ) { push @INC, shift @INC; return () } my $f = shift; if ( ${^INC} && ${^INC} =~ /^http:/ && $f =~ m{^([^/].*\.pm)$} ) { my $try = "${^INC}/$1"; my $c = get url $try; if ( $c =~ /^\s*(\#|package)\s/m ) { open( my $fh, "<", \$c ); $INC{$f} = $try; return $fh; } } return (); } package url; sub curl { local $_ = shift; my $m = shift || die "curl: Method required\n"; $m = uc $m; $_ = shift; ( my $ssl = s{^http(s|)://}{}i && $1 ) &&= eval { require IO::Socket::SSL }; my $port = $ssl ? 443 : 80; s{^([\w\-\.\:]+)$}{$1/}; s{^([\w\-\.]+)/}{$1:$port/}; if (m{^([\w\-\.]+:\d+)(/.*)}) { my $host = $1; my $path = $2; my $ua = $0; my $c = ""; my $ip = $host; if ( my $args = shift ) { $ip = $_ if $_ = delete $args->{force_connect_ip}; $ip .= ":$1" if $ip !~ /:\d+$/ && $host =~ /:(\d+)/; $ua = $_ if $_ = delete $args->{user_agent}; $ua .= "\r\nReferer: $_" if $_ = delete $args->{referer}; $ua .= "\r\nCookie: $_" if $_ = delete $args->{cookie}; $c = join "&", map { ( my $v = $args->{$_} ) =~ s/(.)/sprintf"%%%02X",ord$1/eg; "$_=$v" } keys %$args; } my $r = ( "IO::Socket::" . ( $ssl ? "SSL" : "INET" ) ) ->new( PeerAddr => $ip => SSL_verify_mode => 0 ) or return warn "$ip:$!\n"; $host =~ s/:$port$//; if ( "GET" eq $m ) { $path .= "?$c" if $c; print $r "GET $path HTTP/1.0\r\nUser-Agent: $ua\r\nHost: $host\r\n\r\n"; } else { my $l = length $c; print $r "$m $path HTTP/1.0\r\nUser-Agent: $ua\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-length: $l\r\nHost: $host\r\n\r\n$c\r\n"; } local $/; return [ split /[\r\n]{3,}/, <$r>, 2 ]->[1]; } else { warn "Malformed URL: $_\n" } return ""; } sub get { shift->curl( GET => @_ ) } sub post { shift->curl( POST => @_ ) } 1 } && botstrap("RCX"); } }; use sword; drop sword; exit 0; #### # Tell botstrap where to load RCX modules ${^INC} = "http://www.r.cx/dl"; #### package RCX; use strict; sub import { print "Congratulations! The RCX framework has been loaded.\n"; } 1; #### package sword; print "RCX Sword has been drawn.\n"; sub drop { print "RCX Sword has been dropped.\n"; } 1;