PDA

View Full Version : [PHP SOURCE] MEDIAFIRE.COM Uploader V1.0 - Bet@



manhluat93
05-01-2009, 10:57
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MEDIAFIRE Uploader v1.0 Bet@ -- Code: ManhLuat93</title>
</head>

<body>

<?php
ini_set('max_execution_time',9999);
if (isset($_POST['link'])) {

//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////
function download($url)
{
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
return $result;
curl_close($ch);
}
function curl($url,$httpheader) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HTTPHEADER,$httpheader);
$result = curl_exec($ch);
return $result;
curl_close($ch);

}

function post ($url,$httpheader,$post) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HTTPHEADER,$httpheader);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////
$link = trim($_POST['link']);
preg_match('/\/([^\/]+)$/',$link,$filename);
$filename = $filename[1];
$filename = '_MF-Uploader_-_'.$filename;
$filecontent = download($link);
//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////
$homemf = curl('http://www.mediafire.com',array(''));
preg_match('/flashvars.ukey="(.+?)"/',$homemf,$ukey);
preg_match('/kd=\'(.+?)\'/',$homemf,$uploadkey);
$uploadkey = $uploadkey[1];
$ukey = $ukey[1];
echo "Upload key: ".$uploadkey."<br>Ukey: ".$ukey."<br>";
flush();
ob_flush();
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////
$httpheader = array(
'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 FirePHP/0.2.1',
'Referer: http://www.mediafire.com/',"Cookie: ukey=$ukey; user=x");
$ulstatus = curl("http://www.mediafire.com/dynamic/ulstatus.php?identifier=$uploadkey&rand=qgvrm",$httpheader);
echo $ulstatus."<br>";
flush();
ob_flush();
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////
$httpheaderupload = array("Content-Type: multipart/form-data; boundary=---------------------------MFUploader_FormBoundary");

$content = "-----------------------------MFUploader_FormBoundary
Content-Disposition: form-data; name=\"file_name0\"; filename=\"$filename\"
Content-Type: text/plain

$filecontent

-----------------------------MFUploader_FormBoundary--";
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////


$linkupload = "http://upload.mediafire.com/".$uploadkey."p0";
$upload = post($linkupload,$httpheaderupload,$content);
preg_match('/http:\/\/www\.mediafire\.com\/process\.php\?id=(.+?)&did=[a-zA-Z0-9]+/',$upload,$processlink);
$processlink = $processlink[0];
echo "Process Link: ".$processlink."<br>";
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$processlink);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"http://www.mediafire.com/dynamic/verifystatus.php?identifier=$uploadkey");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
flush();
ob_flush();
sleep(10);
///////////////////////////
///////////////////////////////////
/////////////////////////////////////////////
///////////////////////////////////////////////////////
$uploadcomp = curl("http://www.mediafire.com/upload_complete.php?id=$uploadkey",$httpheader);
preg_match('/<input type="hidden" id="sharedtabsfileinfo1-qk" value="(.+?)">/',$uploadcomp,$codefiles);
$codefiles = $codefiles[1];
echo "<br>Download link: http://www.mediafire.com/?$codefiles";
} else {
?>
<form id="form1" name="form1" method="post" action="">
<label>
<input name="link" type="text" id="link" size="80" />
<br />
<br />
</label>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</form>
<? } ?>
</body>
</html>

Ghi chú: Là Source giúp từ 1 URL --> MEDIAFIRE.COM :"> (Xài thử thì biết :D)

Nhận xét: còn bị lỗi .... dùng đc trên localhost ko dùng đc trên host :|