在我的Paypal帐户被盗用后,我有点偏执狂,想要保护我的网站中的所有内容。其中之一包括重命名管理员/页别的东西,然后我会把像一个蜜罐,看看哪个IP的,他们都来自:设置一个虚假的管理员登录
<?
// honeypot
if($_POST['username']) {
sleep(10);
$filename = "intruders.txt";
$date = date('l jS \of F Y h:i:s A');
$handle = fopen($filename,"a+");
$content = "Username: $_POST[username] , Password: $_POST[password] $date ... from $_SERVER[REMOTE_ADDR] \n";
fwrite($handle,$content);
fclose($handle);
echo "<br/><b>Wrong username or password. Please try again</b><br/><br/>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WHMCS - Admin alt</title>
</head>
<body>
<form id='login' action='index.php' method='post' accept-charset='UTF-8'>
<fieldset>
<legend>WHMCS Secure alt Login</legend>
<label for='username' >Username*:</label>
<input type='text' name='username' id='username' maxlength="50" />
<label for='password' >Password*:</label>
<input type='password' name='password' id='password' maxlength="50" />
<input type='submit' name='Submit' value='Submit' />
</fieldset>
</form>
<div id="footer">Copyright © <a href="http://www.whmcs.com/" target="_blank">WHMCompleteSolution</a>. All Rights Reserved.</div>
</body>
</html>
我唯一担心现在的问题是,可以这种形式被攻击访问该网站?我不认为SQL注入可以在这里工作,因为我们从来没有使用SQL,也没有注入JS输出,因为它只输出一些假文本。之后,我无法想象攻击者可能会明智地采取其他措施......
您认为什么?有没有更好的方法来追踪它们?
提交给自己并且不影响网站上其他任何内容的页面不能真正用于颠覆系统。但是,恶意用户可能只是将垃圾邮件从网页中删除,并提交数兆字节的用户名/密码,导致您填满磁盘。 –
即使你追踪他们,你打算怎么做?向保加利亚或任何地方N and并逮捕他们?从他们的运营来看,这可能不是非法的。那么下一个和下一个又是怎么样?这是令人讨厌的,但不值得大惊小怪,除了确保你的网站以及你可以。 – PurplePilot
这是一个棘手的问题,无法通过仅查看该页面来回答。蛮力几乎总是可能的,所以你必须定义正确的密码重试次数等。如果有必要,你应该执行详细的威胁分析,然后继续。看www.owasp.org。 – home