如何在php中阻止黑客IP地址(拒绝服务线程)
我想阻止客户端的 IP 地址,他们从 samp ip 地址(黑客)发送更多请求服务器。
我如何将 mac 代码发送到特定的 ip 地址并从用户接收 mac 代码并与原始 mac 代码进行比较..
i want to block the ipadress of clients they send more request server from samp ip adress (hackers).
how i send mac code to particular ip adress and receiving the mac code from user and compare with original mac code..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不过,您通常不能在 php 中执行此操作。 PHP 脚本只有在帖子完成后才会执行。为了甚至可能防止 DOS,您需要在帖子完成之前拒绝访问,如果您可以在客户端发送任何内容之前拒绝访问,那就更好了。
You generally can't do this in php though. A PHP script isn't executed until AFTER the post has completed. To even potentially protect against DOS you would need to deny access before the post has completed, even better if you can do it before anything is sent from the client.
您最好像这样使用 .htaccess:
您可能希望使用 PHP 脚本来记录恶意请求以进行进一步处理(例如报告它们),但除此之外,使用 PHP 是不合适的。
You are better off using .htaccess like this:
You might want to use PHP script to log the malicious request for further processing (e.g. to report them), but other then thatusing PHP is not appropriate.