Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A client website was recently compromised, and we're analyzing the damage and exposure from the attack. We've found a script that is "calling home" to a URL we can easily find in a log, but is this logged, and where?


Are outbound connections (ones from file_get_contents with a URL wrapper, like HTTP) logged in this file, or anywhere?

share|improve this question
up vote 1 down vote accepted

You can modify suhosin to do simulation mode that actually simulates, then, blacklist the commands used to open external connections. I posted the code fix the other day, but, the thread was deleted.

Line 1588 of suhosin-0.9.27/execute.c, comment out goto execute_internal_bailout;

if(SUHOSIN_G(func_blacklist) != NULL) {
    if(zend_hash_exists(SUHOSIN_G(func_blacklist), lcname, function _name_strlen+1)) {
        suhosin_log(S_EXECUTOR, "function within blacklist called: %s()", lcname);
        // goto execute_internal_bailout;

(the wiki mangled that code, not going to take the time to try and figure that out)

Simulation mode is the default:

suhosin.simulation = on
suhosin.executor.func.blacklist = include,include_once,require_once,open,file_get_contents

add any additional commands that you want to have logged. You'll get a log entry like:

Jun 24 06:32:07 machinexx suhosin[1086]: ALERT-SIMULATION - function within blacklist called: exec() (attacker '', file '/var/www/', line 283)

From there, at least you have a set of target files to take a look at. I do not recommend using suhosin in this manner, but, when you're looking for a needle in a haystack, sometimes you need to make the tools work the way they should.

share|improve this answer

Unless your applications/websites in PHP had a logging system, you cannot see who did what.

Apache or PHP do not keep an outbound connection log.

share|improve this answer

yeap php and apache do not log any outbound connections.. Anyway to run php script you need to have a request from user. You can always see who launched the script. To monitor outbound connections you can setup firewall and log everything what is being outbounded and then configure log system to catch outogoing connection from every package you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.