LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-10-2016, 11:54 AM   #1
kingkashif
Member
 
Registered: May 2009
Posts: 94

Rep: Reputation: 16
What are these php-fpm outgoing connections to port 80 for?


Hi everyone,

Well I see on my server some outgoing connections to a couple of IPs. But I wonder why is php-fpm process making these http outgoing connections? What are they for?

Code:
tcp        0    215 XX.XX.XX.XX:46388    37.247.105.166:80       ESTABLISHED 17363/php-fpm: pool
tcp        0    220 XX.XX.XX.XX:46386    37.247.105.166:80       ESTABLISHED 14855/php-fpm: pool
tcp        0      0 XX.XX.XX.XX:60702    95.130.169.114:80       ESTABLISHED 14757/php-fpm: pool
Should I be worried? Most of these connections are to this 95.130.169.114 IP. I mean they are not many connections, usually one or two connections but I don't know why.

Are any of my scripts making these connections?

Any help would be highly appreciated.

Thanks in Advance!!
 
Old 02-11-2016, 10:06 AM   #2
Ellendhel
Member
 
Registered: Aug 2015
Location: Wilmington, NC
Distribution: Slackware
Posts: 64

Rep: Reputation: 51
Quote:
Originally Posted by kingkashif View Post
Should I be worried?
Probably. Do you know what are the PHP scripts or PHP applications running on your server? You should be able to locate the files by using the lsof command (list opened files).

The two IP addresses listed seems to be part of a pool in Turkey; I don't know if you are expecting something coming from there, if not, that's suspicious.
 
Old 02-11-2016, 05:11 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by kingkashif View Post
(..) I see on my server some outgoing connections to a couple of IPs. (..) I wonder why is php-fpm process making these http outgoing connections? What are they for? (..) Are any of my scripts making these connections?
Couple of things in random order:
- it's not the first time you've had trouble with servers. In the last thread we suggested you actively verify anything for changes. Unsure if you investigated anything yourself at this point. What did you inspect yourself? System and daemon logs? Docroot and user homes contents?
- A web service only requires outbound new TCP/80 or 443 connections if it needs to load external resources. If none of your scripts need to you know this is bad news.
- At least one of those remote servers was listed consistently from 2014 on as serving malware, scanning the 'net etc, etc.
- Given where (I think) your web server resides I would find it highly illogical for your web server to access resources on given servers as they're not your average jquery or other such popular resources.
- There are several ways to capture data like for example FPM debug settings (logging) or tcpdump (do use "-s 0" to capture whole payload).
- If unsure put up an outbound new TCP/80 or 443 block in your firewall and see what happens.
 
2 members found this post helpful.
Old 05-12-2016, 10:51 AM   #4
kingkashif
Member
 
Registered: May 2009
Posts: 94

Original Poster
Rep: Reputation: 16
I checked it today again and I find the following outgoing connections, again to a Turkish IP by php-fpm.

Quote:
root@localhost:~# netstat -antp | grep 46.20
tcp 0 0 XXXXXXXXXXX:56148 46.20.11.76:80 ESTABLISHED 1341/php-fpm: pool
tcp 0 0 XXXXXXXXXXX:59665 46.20.11.76:80 ESTABLISHED 7721/php-fpm: pool
tcp 0 0 XXXXXXXXXXX:60380 46.20.11.76:80 ESTABLISHED 9185/php-fpm: pool
There is nothing in the logs. And the php-fpm doesn't show what php script it's running.

I suspect that it's the php-fpm script itself.

Also there are a lot of nginx incoming established connections to port 80 which doesn't show in the access logs of my 2 websites nor does it show in the main nginx access logs.

It's completely spooky. I shouldn't have anything to do with a Turkish ip. I don't!

What should be the right way to move ahead?
 
Old 05-15-2016, 08:05 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by kingkashif View Post
I checked it today again
Note you started your thread in February. It is now May. The fact you're moving slower than glaciers either means you're busy doing Other Stuff (at wich point you should ponder handing over the reigns) or you're not giving it the priority it requires (at wich point you should ponder handing over the reigns too).


Quote:
Originally Posted by kingkashif View Post
What should be the right way to move ahead?
I've given you a lot of pointers, none of which you've used to gather and present information. Reread replies in this thread. Prepare information gathering configuration and apply. Do research. If unsure ask detailed questions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Using Multiple PHP Versions (PHP-FPM & FastCGI) With ISPConfig 3 (CentOS 6.3) LXer Syndicated Linux News 0 03-14-2013 08:10 PM
LXer: Installing Nginx With PHP 5.3 And PHP-FPM On Ubuntu Lucid Lynx (10.04) LXer Syndicated Linux News 0 06-14-2010 11:42 PM
LXer: Installing PHP 5.3, Nginx And PHP-fpm On Ubuntu/Debian LXer Syndicated Linux News 0 02-10-2010 05:40 PM
Setting the source port for outgoing SMTP connections in exim4 heby Debian 7 11-04-2008 01:08 PM
Outgoing connections on port 25 => refused, postfix? kingfisher Linux - Networking 8 01-25-2007 01:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration