Get the payload length in PHP

Hello,

Is it possible to get the payload length in PHP? I am trying to catch port scanners, a large red flag of port scanners is connecting to port 80 with a payload length of 0.

AFAIK port scanners generally use ICMP, not TCP, so they won’t end up at Apache/NGiNX and/or PHP. If you want to block them you’d need to do that in the firewall of your OS.

I was really trying to prevent people from scanning port 80 with TCP, as I am pretty sure software like nmap uses.

Can you recommend anything for this?

Depends on your OS. *nix already has a firewall built in to the kernel, you’d just need configure it. Lots of tutorials around for that. Windows also has a firewall, but I’m unfamiliar with it.

1 Like

Thanks! I am taking a look at this if anyone else if curious:

(also shoutout to @TechnoBear for fixing spelling)

1 Like