1. Import
This commit is contained in:
159
html/sysadmin/stand_alone_script/mcMobileFileTransfer.php
Normal file
159
html/sysadmin/stand_alone_script/mcMobileFileTransfer.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* mcMobileFileTransfer.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
$HTTP_POST_VARS = !empty($HTTP_POST_VARS) ? $HTTP_POST_VARS : $_POST;
|
||||
$HTTP_GET_VARS = !empty($HTTP_GET_VARS) ? $HTTP_GET_VARS : $_GET;
|
||||
$HTTP_COOKIE_VARS = !empty($HTTP_COOKIE_VARS) ? $HTTP_COOKIE_VARS : $_COOKIE;
|
||||
$HTTP_SERVER_VARS = !empty($HTTP_SERVER_VARS) ? $HTTP_SERVER_VARS : $_SERVER;
|
||||
$HTTP_ENV_VARS = !empty($HTTP_ENV_VARS) ? $HTTP_ENV_VARS : $_ENV;
|
||||
$HTTP_POST_FILES = !empty($HTTP_POST_FILES) ? $HTTP_POST_FILES : $_FILES;
|
||||
|
||||
if (!isset($PHP_SELF))
|
||||
$PHP_SELF = $_SERVER["PHP_SELF"];
|
||||
|
||||
if (substr(phpversion(), 0, 3) >= "5.1") :
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
endif;
|
||||
|
||||
|
||||
// *****************************************************************************
|
||||
|
||||
include_once ("htmlMimeMail.php");
|
||||
|
||||
|
||||
function getHttpVars($httpVars)
|
||||
{
|
||||
global $HTTP_GET_VARS, $HTTP_POST_VARS;
|
||||
|
||||
$retArr = array();
|
||||
foreach($httpVars as $hVar)
|
||||
$retArr[] = (isset($HTTP_GET_VARS[$hVar])) ? $HTTP_GET_VARS[$hVar] :
|
||||
((isset($HTTP_POST_VARS[$hVar])) ? $HTTP_POST_VARS[$hVar] : "");
|
||||
return $retArr;
|
||||
}
|
||||
|
||||
// Gets all script-parameters (HTTP_GET_VARS and HTTP_POST_VARS).
|
||||
// If "$mode == 1" then all id-parameters (only these!) will be decoded
|
||||
function getSecHttpVars($getSecHttpVarsMode = "0", $httpVars)
|
||||
{
|
||||
global $HTTP_GET_VARS, $HTTP_POST_VARS;
|
||||
|
||||
$retArr = getHttpVars($httpVars);
|
||||
$i = 0;
|
||||
foreach ($httpVars as $par) {
|
||||
global $$par;
|
||||
$$par = $retArr[$i];
|
||||
$i++;
|
||||
}
|
||||
// Decryption of the fields if encrypted
|
||||
if ($getSecHttpVarsMode == "1") :
|
||||
foreach ($httpVars as $par) {
|
||||
$$par = dc($$par);
|
||||
}
|
||||
endif;
|
||||
return $retArr;
|
||||
}
|
||||
|
||||
// Writes a string to a file optional with or without linefeed
|
||||
function writeToFile($fileName, $stringToOperate, $mode = 'a', $noLf = "") {
|
||||
$fileHandle = fopen($fileName, $mode);
|
||||
if ($noLf == "") : $stringToOperate .= "\n"; endif;
|
||||
$opCode = fwrite($fileHandle, $stringToOperate);
|
||||
fclose($fileHandle);
|
||||
return $opCode;
|
||||
}
|
||||
|
||||
// *****************************************************************************
|
||||
|
||||
getSecHttpVars("0", array("auth", "imei", "filedata"));
|
||||
|
||||
|
||||
if ($auth == "comegetsomexxxx9753" && $filedata != "") :
|
||||
|
||||
// Decode BASE64
|
||||
$filedata = base64_decode($filedata);
|
||||
|
||||
// Uncompress
|
||||
$filedata = gzinflate(substr($filedata,10,-8));
|
||||
|
||||
// Current timestamp
|
||||
$currentTime = date("Y-m-d H:i:s");
|
||||
|
||||
// calling client IP
|
||||
$currentClientIP = trim($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
// Append to log file
|
||||
$fileName = $currentClientIP . "_" . $currentTime;
|
||||
if ($imei != "") : $fileName .= "_" . $imei; endif;
|
||||
writeToFile($fileName, $filedata, "b");
|
||||
|
||||
// Send mail to admin@assecutor.de
|
||||
$mailObj = new htmlMimeMail();
|
||||
$mailObj->setFrom("admin@assecutor.de");
|
||||
$mailObj->setCc("sven.carstensen@appcreation.de");
|
||||
// $mailObj->setBcc($mailBccAddress);
|
||||
$mailObj->setSubject("NEW ANDROID FILE! (" . $currentTime . " | " . $currentClientIP . ")");
|
||||
|
||||
// HTML
|
||||
if (false) :
|
||||
$mailtextHtml = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\"></head>";
|
||||
$mailtextHtml .= "<body>";
|
||||
$mailtextHtml .= "<h4><b>NEW ANDROID FILE!</b></h4><br><br>";
|
||||
$mailtextHtml .= "<b>Timestamp: " . $currentTime . "</b><br>";
|
||||
$mailtextHtml .= "<b>Client-IP: " . $currentClientIP . "</b><br><br><br>";
|
||||
$mailtextHtml .= "<b>Dump:</b><br>";
|
||||
$mailtextHtml .= nl2br($filedata);
|
||||
$mailtextHtml .= "</body>";
|
||||
$mailtextHtml .= "</html>";
|
||||
$mailObj->setHtml($mailtextHtml, null, "./");
|
||||
endif;
|
||||
|
||||
// PLAIN-TEXT
|
||||
if (true) :
|
||||
$mailObj->setSubject("NEW ANDROID CRASHDUMP! (" . $currentTime . " | " . $currentClientIP . ")");
|
||||
$mailtext .= $crashdumpdata;
|
||||
$mailObj->setText($mailtext);
|
||||
endif;
|
||||
|
||||
$mailResult = $mailObj->send(array("dev@assecutor.de"), 'smtp');
|
||||
if ($mailResult) :
|
||||
echo "DATA LOGGED! MAIL SENT!";
|
||||
else :
|
||||
echo "DATA LOGGED! MAIL NOT SENT!";
|
||||
endif;
|
||||
$mailObj = NULL;
|
||||
|
||||
else :
|
||||
$randNum = rand(1, 10);
|
||||
if ($randNum == 1) :
|
||||
echo "SO NICHT!";
|
||||
elseif ($randNum == 2) :
|
||||
echo "ONCE MORE AGAIN!";
|
||||
elseif ($randNum == 3) :
|
||||
echo "LMAA! ;-)";
|
||||
elseif ($randNum == 4) :
|
||||
echo "OCH KOMM...!";
|
||||
elseif ($randNum == 5) :
|
||||
echo "HASTES BALD...?!";
|
||||
elseif ($randNum == 6) :
|
||||
echo "TRY IT AGAIN, BABY!";
|
||||
elseif ($randNum == 7) :
|
||||
echo "COME GET SOME!";
|
||||
elseif ($randNum == 8) :
|
||||
echo "SHAKE IT, BABY!";
|
||||
elseif ($randNum == 9) :
|
||||
echo "LOOOOOOS.......ER! ;-) ;-)";
|
||||
elseif ($randNum == 10) :
|
||||
echo "I WILL RIP OFF YOUR HEAD AND SHIT DOWN YOUR NECK! ;-)";
|
||||
else :
|
||||
echo "NU ABER...!";
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
Reference in New Issue
Block a user