1 Star 0 Fork 0

妖道/SniperPhish

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
track.php 3.06 KB
一键复制 编辑 原始数据 按行查看 历史
Gem George 提交于 2021-04-13 11:10 . v1.0 upgrade
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
require_once(dirname(__FILE__) . '/spear/db.php');
require_once(dirname(__FILE__) . '/spear/common_functions.php');
require_once(dirname(__FILE__) . '/spear/libs/browser_detect/BrowserDetection.php');
date_default_timezone_set('UTC');
//-------------------------------------
if (isset($_POST))
$POSTJ = json_decode(file_get_contents('php://input'),true);
else
die();
if(isset($POSTJ['cid']) && !empty($POSTJ['cid']))
$cid = $POSTJ['cid'];
else
die("No cid");
if(isset($POSTJ['sess_id']))
$session_id = $POSTJ['sess_id'];
else
$session_id = 'Failed';
if(isset($POSTJ['trackerId']))
$trackerId = $POSTJ['trackerId'];
else
$trackerId = 'Failed';
$ua_info = new Wolfcast\BrowserDetection();
$public_ip = getenv('HTTP_CLIENT_IP')?:
getenv('HTTP_X_FORWARDED_FOR')?:
getenv('HTTP_X_FORWARDED')?:
getenv('HTTP_FORWARDED_FOR')?:
getenv('HTTP_FORWARDED')?:
getenv('REMOTE_ADDR');
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$date_time = round(microtime(true) * 1000); //(new DateTime())->format('d-m-Y H:i:s.u');
$user_browser = $ua_info->getName().' '.($ua_info->getVersion() == "unknown"?"":$ua_info->getVersion());
$user_os = $ua_info->getPlatformVersion();
$ip_info = getIPInfo($conn, $public_ip);
$device_type = $ua_info->isMobile()?"Mobile":"Desktop";
//-----------------------------------
if(isset($POSTJ['login_username']))
$login_username = $POSTJ['login_username'];
else
$login_username = 'Failed';
if(isset($POSTJ['login_pwd']))
$login_pwd = $POSTJ['login_pwd'];
else
$login_pwd = 'Failed';
if(isset($POSTJ['screen_res']))
$screen_res = $POSTJ['screen_res'];
else
$screen_res = 'Failed';
//Check tracker stopped/paused
$stmt = $conn->prepare("SELECT active FROM tb_core_web_tracker_list WHERE tracker_id = ?");
$stmt->bind_param("s", $trackerId);
$stmt->execute();
$result = $stmt->get_result()->fetch_assoc() ;
if($result["active"] == 0)
return;
$page = $POSTJ['page'];
if($page == 0){ //page visit
$stmt = $conn->prepare("INSERT INTO tb_data_webpage_visit(tracker_id,session_id,cid,public_ip,ip_info,user_agent,screen_res,time,browser,platform,device_type) VALUES(?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param('sssssssssss', $trackerId,$session_id,$cid,$public_ip,$ip_info,$user_agent,$screen_res,$date_time,$user_browser,$user_os,$device_type);
if ($stmt->execute() === TRUE)
die('success');
else
die("failed");
}
elseif(is_numeric($page)){
$form_field_data = json_encode($POSTJ['form_field_data']);
$stmt = $conn->prepare("INSERT INTO tb_data_webform_submit(tracker_id,session_id,cid,public_ip,ip_info,user_agent,screen_res,time,browser,platform,device_type,page,form_field_data) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param('sssssssssssss', $trackerId,$session_id,$cid,$public_ip,$ip_info,$user_agent,$screen_res,$date_time,$user_browser,$user_os,$device_type,$page,$form_field_data);
if ($stmt->execute() === TRUE)
die('success');
else
die("failed");
}
//-----------------------------------------
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiaocainiao149/SniperPhish.git
git@gitee.com:xiaocainiao149/SniperPhish.git
xiaocainiao149
SniperPhish
SniperPhish
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385