<?
####### Account Info. ###########
$shafiles_login = ""; //Set your user
$shafiles_pass = ""; //Set your password
##############################
$not_done=true;
$continue_up=false;
if ($shafiles_login & $shafiles_pass){
$_REQUEST['sha_user'] = $shafiles_login;
$_REQUEST['sha_pass'] = $shafiles_pass;
$_REQUEST['action'] = "FORM";
echo "<b><center>Using your given Login Details</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
$continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap> Login*<td> <input type='text' name='sha_user' value='' style="width:160px;" /> </tr>
<tr><td nowrap> Password*<td> <input type='password' name='sha_pass' value='' style="width:160px;" /> </tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
</table>
</form>
<?php
}
if ($continue_up)
{
$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to shafiles.me</div>
<?php
if (!empty($_REQUEST['sha_user']) && !empty($_REQUEST['sha_pass'])){
$post["op"] = "login";
$post["redirect"] = "http://shafiles.me/";
$post["login"] = trim($_REQUEST['sha_user']);
$post["password"] = trim($_REQUEST['sha_pass']);
$page = geturl("www.shafiles.me", 80, "/", "http://shafiles.me/login.html", 0, $post, $_GET["proxy"]);
is_page($page);
is_present($page, "Incorrect Login or Password", "Incorrect Login or Password");
$cookie = GetCookies($page);
}else{
html_error ('Error, user and/or password is empty, please go back and try again!');
}
?>
<script>document.getElementById('info').style.display='none';</script>
<div id='info' width='100%' align='center'>Retrive upload ID</div>
<?php
$url = parse_url('http://shafiles.me/');
$page = geturl($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://shafiles.me/login.html", $cookie, 0, 0, $_GET["proxy"], $pauth);
if(!preg_match('#action="([^"]+)"#', $page, $up)){
html_error('Cannot get url action upload.', 0);
}
if(!preg_match("#var[\r|\n|\s]+utype='([^']+)'#", $page, $utype)){
html_error('Cannot get user information.', 0);
}
if(!preg_match('#name="sess_id"[\r|\n|\s]+value="([^"]+)"#', $page, $sid)){
html_error('Cannot get session id.', 0);
}
$uid = uid();
$url = parse_url($up[1].$uid.'&js_on=1&utype='.$utype[1].'&upload_type=file');
$post["upload_type"] = "file";
$post["sess_id"] = $sid[1];
$post["srv_tmp_url"] = "http://95.211.186.167/~shafiles/tmp";
$post["link_rcpt"] = '';
$post["link_pass"] = '';
$post["file_0_descr"] = '';
$post['tos'] = '1';
$post["submit_btn.x"] = '107';
$post["submit_btn.y"] = '47';
$post["submit_btn.y"] = 'Upload!';
$upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://shafiles.me/", $cookie, $post, $lfile, $lname, "file_0");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
is_page($upfiles);
preg_match_all("#>([^><]+)<#", $upfiles, $dl);
if($dl[1][1] != 'OK')
html_error('Error in upload');
$post['fn'] = $dl[1][0];
$post['st'] = 'OK';
$post['op'] = 'upload_result';
$page = geturl("www.shafiles.me", 80, "/", 0, $cookie, $post, 0, $_GET["proxy"]);
if(!empty($dl[1][0]))
$download_link = 'http://shafiles.me/'.$dl[1][0].'/'.$lname.'';
else
html_error ("Didn't find download link!");
if(preg_match("#killcode=([^=<]+)<#", $page, $del))
$delete_link = $download_link.'?killcode='.$del[1];
else
html_error ("Didn't find delete link!");
}
function uid(){
$nu = "0123456789";
for($i=0; $i < 12; $i++){
$rand .= $nu{mt_rand() % strlen($nu)};
}
return $rand;
}
// [13-May-2012] Written by bistarito
?>