Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //这是一个PHP的小程序,用于记录客户端访问页面,并将客户端的访问时间,客户端的IP地址和浏览器,操作系统类型写入数据库。
- //实际上这是我写的一个小型蜜罐,用于钓熊猫。
- //honeypot start
- <?php
- $showtime=date("Y-m-d H:i:s");
- $ip=$_SERVER["REMOTE_ADDR"];
- $agent=$_SERVER["HTTP_USER_AGENT"];
- $dbhost='Your_DataBase_Server_Name_or_IP';
- $dbuser='Your_Database_Username';
- $dbpass='Your_Database_Password';
- $dbname='Your_Database_Name';
- $conn=mysql_connect($dbhost, $dbuser, $dbpass);
- mysql_query("SET NAMES utf8");
- mysql_select_db($dbname,$conn);
- $sql="insert into Your_Database_Table_Name (`TIME`,`IP`,`AGENT`) values('$showtime','$ip','$agent')";
- mysql_query($sql);
- $showtime="";
- $ip="";
- $agent="";
- ?>
- //honeypot end
Add Comment
Please, Sign In to add comment