I suppose this has already been posted somewhere, but I figured I'd post it once and for all. Good for people who're looking for it, and because ciaociao4 and Blaze wanted an example.
LulzImg's app.php is a very simple API-ish type script (lol) which I coded a few months back for private use. Eventually, I gave it out on a selective basis to people who needed it.
It accepts an image, a zip, or a rar file. If it encounters a zip/rar file, it'll extract it, and copy any images found in it. It'll dump everything else inside; dumping happens during run-time so don't bother trying to inject malicious files/code.
You basically need to make your script simulate this form:
A php example:
Return/output is the resulting links, each on a new line. I don't remember if it's separated by a "\n" or a "<br />" but you can look up the source code and do a regex match accordingly.
LulzImg's app.php is a very simple API-ish type script (lol) which I coded a few months back for private use. Eventually, I gave it out on a selective basis to people who needed it.
It accepts an image, a zip, or a rar file. If it encounters a zip/rar file, it'll extract it, and copy any images found in it. It'll dump everything else inside; dumping happens during run-time so don't bother trying to inject malicious files/code.
You basically need to make your script simulate this form:
Code:
<form enctype="multipart/form-data" action="http://lulzimg.com/app.php" method="POST">
<input type="file" name="image" id="image" />
<br />
<input type="submit" name="submit" value="submit"></button>
</form>
A php example:
PHP:
<?php
function curl($link, $postfields = '')
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
if($postfields)
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
}
$page = curl_exec($ch);
curl_close($ch);
return($page);
}
$img = "C:\Program Files\VertrigoServ\www\img.jpg"; //Or linux path
$post = array();
$post['image'] = "@$img";
$post['submit'] = "submit";
$page = curl("http://lulzimg.com/app.php", $post);
echo $page;
?>
Return/output is the resulting links, each on a new line. I don't remember if it's separated by a "\n" or a "<br />" but you can look up the source code and do a regex match accordingly.