0

As stated in the Title.

How can I detect an incoming connection from PHP's fsockopen method in my web server logs?

Which log file records this activity if it gets recorded at all.

Server: Ubuntu 16.04 upto 20.04

I've tried Nginx access.logs, but I think this is a different kind of connection and is not being recorded there.

An example PHP script:

<?php

@fsockopen("anydomain.tld", 80, $errorNo, $errorStr, 3);
droplet
  • 113
  • 5

1 Answers1

0

It could be possible to tune nginx error_log level so that it contains the details you are looking for.

However, there will be a lot of other logging included too.

These kinds of requests end up in the main nginx error.log, since there is no HTTP request and therefore no virtual host information.

I recommend you to actually describe what exactly you are looking for, so that we can recommend better approaches for it.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63