Would anyone like some free backlinks?

Steady, Matt. We’re not selling them so it’s okay, right? Actually I won’t even be providing them. It’s all down to the good folks at PHP.

Some of us might remember the Month of PHP Bugs in March, which I have to say passed without great fanfare. I think it’s probably because it made us all look bad so less said about that the better. Anyway I was reviewing today’s server patches (via the magical apticron utility) which reminded me that I should probably review the results of the MOPB. Boy am I glad I did!

Take a look at this little doozy

Basically, it’s an XSS vulnerability in the phpinfo() function which gives unescaped output for all user-submitted arrays in GET, POST and Cookies.

Translation?

Well if anyone has a spare phpinfo() for PHP versions 4.4.3 -> 4.4.6 hanging about, try appending this to its URL:

?f[]=%3Ca%20href%3Dhttp%3A//www.davidnaylor.co.uk/%3EDaveN%20Ownz%20j00%3C/a%3E

Then scroll down to “PHP Variables”. If you have an exploitable version, you should get one, clean, un-condomned backlink. Ain’t that precious? So all you would need to do is to get a bunch of them indexed and you’re happy as Larry. However happy he is.

Now would anyone like 60,600 free backlinks?

PS. For those that don’t get it yet, this post was written by Rob, one of Dave’s programmers. In Vim. Proudly.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • Live
  • StumbleUpon

45 Comments | Leave a comment »

  1. 1. Jeremy Luebke | April 27th 2007 @ 4:04 pm
  2. 2. Liam Victor | April 27th 2007 @ 4:07 pm

    Genie mac, that’s beautiful. You’re a bit of an evil genius aren’t you Rob? I wonder if Bronco’s offices are in an underground bunker.

  3. 3. Rob Haswell | April 27th 2007 @ 4:22 pm

    Nah dude, then I wouldn’t be able to come in wearing shorts and sandles! And I’m pretty sure my wireless headphones would get crappy reception on cig breaks.

  4. 4. Glen | April 27th 2007 @ 5:16 pm

    Doesnt seem to work, tested on a few sites (linking too them of course ;) )

  5. 5. Rob Haswell | April 27th 2007 @ 5:24 pm

    I promise you it works, I’ve tested it on a number of the top ten serps for that query.

    Are you sure they’re running on PHP 4.4.3-6? May I have an example of one that doesn’t work?

    I would post working examples but Dave’s on a black-hat ban for a while. I can only show you the door…

  6. 6. Glen | April 27th 2007 @ 5:39 pm

    The links are actually showing as clickable text links and not just an array query showing you Blah in that actual format? (spaces added so it shows)

    And you are just adding that line of code onto the end of the phpinfo.php extension for e.g.

  7. 7. Alex | April 27th 2007 @ 8:15 pm

    Wow, this really works. But how would you go about getting these indexed ? You only get the link if you append the variables, right ?

  8. 8. Jimmy | April 27th 2007 @ 9:05 pm

    Nah! Doesn’t work. I tried but then it shows the statement as it is without link :(…

  9. 9. Rob (the author) | April 28th 2007 @ 12:47 am

    Ya that’s the point - free backlinks for all!

  10. 10. Glen | April 28th 2007 @ 1:00 am

    Doesnt matter, the example I posted is not how i posted it, it skipped the gaps and formed that anchor text link. The results Im seeing (prefer no linkage) are just showing the plain text version of the link and not the link itself with just as text, no link

  11. 11. Jeremy Luebke | April 28th 2007 @ 6:35 am

    Glen your looking in the wrong spot. Trust me.

  12. 12. WilliamC | April 28th 2007 @ 6:49 am

    Now that it has been posted here, you can bet those links wont affect SERPS in a day or three. I mean, be realistic, how hard is it for google, yahoo, msn to filter /phpinfo/

    Very nice find tho Rob.

  13. 13. Someone | April 28th 2007 @ 5:00 pm

    When you refresh the link disappears.
    Does it go anywhere else or is it just temporary?

  14. 14. Joris | April 29th 2007 @ 11:58 am

    It works…and all you guys that can’t figure out how to get it in the SEPRS….you don’t belong here ;-)

  15. 15. Adam Moro | April 29th 2007 @ 8:12 pm

    Good find! Thanks for sharing, Dave!

  16. 16. Microdesign | April 29th 2007 @ 9:28 pm

    Woow interesting, are you doing it?

  17. 17. ricardo | April 30th 2007 @ 10:20 am

    ’ve been trying to do this but I can only get a pure text… which doesnt help me out alot. Any hints?

  18. 18. Sausages | April 30th 2007 @ 2:03 pm

    Hmm… Google API to return all the phpinfo pages as XML, format them as links, scrape a load of content from other sites as page padding and a few well placed referral links to get my page hit a few times…

    What are the chances of someone being slightly upset about all this? lol

  19. 19. Sausages | April 30th 2007 @ 2:07 pm

    Add to that an array with a selection of keywords, all randomly pieced together and appended to the injected url :D

  20. 20. Sausages | April 30th 2007 @ 2:21 pm

    And don’t limit your backlinks to just an anchor tag either…

  21. 21. Rob Haswell | April 30th 2007 @ 2:26 pm

    Ricardo, follow my exact instructions with http://hosting.iptcom.net/phpinfo.php

  22. 22. Zasxer | April 30th 2007 @ 2:49 pm

    Hilarious…
    You guys kill me…
    I guess the only way to find out is to try it…

    Done…

  23. 23. Sausages | April 30th 2007 @ 3:18 pm

    Add a couple of backlinks to each outward link, just specify the array index inside f[]:

    ?f[0]=%3ca%….&f[1]=%3ca%… etc

    Limited to maximum length of querystring (2,083 chars IIRC)

  24. 24. Rob Haswell | April 30th 2007 @ 3:22 pm

    2083 characters in internet explorer, but Googlebot doesn’t run on IE :-)

  25. 25. Sausages | April 30th 2007 @ 3:34 pm

    “doesn’t run on IE”… what kind of insanity is this :P

  26. 26. Bill | April 30th 2007 @ 11:29 pm

    Good find, Dave. It’s now up to 69,100 backlinks.

  27. 27. Adam Moro | May 3rd 2007 @ 7:06 pm

    Here’s a nice little trick for compiling a list of links with this method. Download SEO for Firefox from tools.seobook.com and do Rob’s suggested search for the phpinfo pages. Download the CSV provided by the SEO for FF extension and delete everything but the urls. Now enter the formula below in cell B1:

    =A1&”?f[]=%3Ca%20href%3Dhttp%3A//www.davidnaylor.co.uk/%3EDaveN%20Ownz%20j00%3C/a%3E”

    Now copy the formula down and there you have it. A list of urls ready to post to comments, sigs, etc. Thanks again, Rob! :)

  28. 28. Rob Haswell | May 4th 2007 @ 10:37 am

    Any time mate :-)

    Just because Dave’s on a black-hat ban…

  29. 29. evilgreenmonkey | May 8th 2007 @ 9:46 am

    Nice find Rob - when’s Dave going to let you out of the cage so you can come along to a LondonSEO or conference? Included your find in a blog post as an XSS example, hope you don’t mind.

    Cheers,

    Rob

  30. 30. john | May 11th 2007 @ 8:22 pm

    search google for only version 4.4.4, less results but each will work

  31. 31. paul | May 14th 2007 @ 3:49 am

    The only problem I see is that it shows your ip address at _SERVER[”REMOTE_ADDR”]. How can we block that?

  32. 32. paul | May 14th 2007 @ 3:57 am

    One more question. Is this what the actual url would look like with all of the percent (%) symbols and things? Those type of url’s would be difficult to get indexed wouldn’t they?

  33. 33. Rob Haswell | May 14th 2007 @ 10:40 am

    What? The $_SERVER[’REMOTE_ADDR’] only shows the IP of the computer accessing the page - for indexing purposes that’s the spider’s IP only.

    As for the percentage signs: No, that’s just how you need to encode query string parameters. Look up URL encoding.

    Unfortunately mate I reckon you have too great a lack of understanding of the Internet and HTTP to really exploit this one properly.

    Not that exploiting it is going to do anyone any good though.

  34. 34. Enblogopedia | May 25th 2007 @ 2:59 pm

    as above.
    “Does it go anywhere else or is it just temporary?”

  35. 35. paul | May 25th 2007 @ 9:19 pm

    It doesn’t matter. There’s no way the url will ever get indexed.

  36. 36. Rob Haswell | May 26th 2007 @ 2:18 am

    Sure it will - just link to it :-)

  37. 37. Freelance Website Design | May 31st 2007 @ 3:57 pm

    I really don’t see where the confusion lies. I played around with this and came up with a very simple 1 page php script that pulls all of the php 4.4.4 results, paginates them into 20 or so pages (only the first 200 results) and every one has a random bit of text for the actual link to the php page (and this link has whatever link I want appended to the phpinfo.php pages) as well as some random content under the links. Every vestige of google has been stripped out returning only the links to the php pages. It was very simple and if I decided to try it, I’m guessing highly effective.

  38. 38. Rob Haswell | May 31st 2007 @ 4:35 pm

    I’m guessing highly effective

    Yeah if you want to get your site banned dude :-)

  39. 39. Freelance Website Design | May 31st 2007 @ 8:33 pm

    Yeah my first thought was it would be a good way to get someone elses site banned (someone you didn’t like). You could very easily fill the internet with illigetimate link backs for any site you want. 60k is a formidable number.

    But my stance is this, I, for painfully obvious reasons, wouldn’t use this, but its very very easy to implement. I doubt the writer of this blog would use it either. But you know what they say, knowledge is power. :) Cheers.

  40. 40. Lukasz | June 19th 2007 @ 10:54 am

    Everything is ok but how google would find these links if they are not indexed?
    Anyway you have to put it somewhere so what’s the difference between using these links instead your site url?

  41. 41. Rob Haswell | June 19th 2007 @ 5:18 pm

    Google finds the links if you link to them. Linking to anything that returns a 200 status line is like creating out of thin air. Remember this.

    The point is that you don’t need to put it anywhere, there’s thousands of them out there.

  42. 42. Emlak ilanlar | July 19th 2007 @ 9:21 pm

    google has been stripped out returning only the links to the php pages

  43. 43. acnecaregal | December 12th 2007 @ 10:57 am

    great one but i like geting backlinks the old fashioned way

  44. 44. Anonymous | December 15th 2007 @ 2:07 pm

    Great way to get backlinks,thanks.

  45. 45. Jamie | February 10th 2008 @ 12:02 am

    You could also go to http://www.lamelime.com and submit a thred with your link in it, your allowed to do that there

Leave a Reply

required

required, hidden

one.com
smx

Start with £50 credit in your new Yahoo! Search Marketing account for a limited period only.

+ Advertise Here