如何在php中阻止黑客IP地址(拒绝服务线程)

发布于 2024-10-06 02:19:15 字数 112 浏览 0 评论 0原文

我想阻止客户端的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

≈。彩虹 2024-10-13 02:19:15

不过,您通常不能在 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.

往昔成烟 2024-10-13 02:19:15

您最好像这样使用 .htaccess:

order allow,deny
deny from 127.0.0.1
allow from all

您可能希望使用 PHP 脚本来记录恶意请求以进行进一步处理(例如报告它们),但除此之外,使用 PHP 是不合适的。

You are better off using .htaccess like this:

order allow,deny
deny from 127.0.0.1
allow from all

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文