使用 postfix 查看哪個文件

使用 postfix 查看哪個文件

我的網站上有一個 - 我認為是惡意軟體 - 問題。使用我的伺服器發送垃圾郵件。跑步時頂部SHIFT+M我得到以下資訊:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                          
 4282 postfix   20   0 63368  37m 1496 S    2  3.6   0:07.44 qmgr                                                                                                                              
 3558 mysql     20   0 1024m  26m 7736 S    0  2.6   0:04.28 mysqld                                                                                                                            
 4156 www-data  20   0  323m  20m 3900 S    0  2.0   0:00.41 apache2                                                                                                                           
 2846 www-data  20   0  323m  20m 3964 S    0  2.0   0:01.14 apache2                                                                                                                           
 1578 www-data  20   0  322m  19m 4000 S    0  1.9   0:01.39 apache2                                                                                                                           
 1896 www-data  20   0  320m  17m 3956 S    0  1.7   0:01.25 apache2                                                                                                                           
 4160 www-data  20   0  319m  16m 3948 S    0  1.6   0:00.29 apache2                                                                                                                           
 4599 www-data  20   0  319m  16m 3752 S    0  1.6   0:00.12 apache2                                                                                                                           
  666 www-data  20   0  319m  16m 3948 S    0  1.6   0:01.26 apache2                                                                                                                           
 2366 www-data  20   0  317m  13m 3976 S    0  1.4   0:01.19 apache2                                                                                                                           
 3545 www-data  20   0  316m  13m 3912 S    0  1.4   0:00.34 apache2                                                                                                                           
  654 root      20   0  309m 8436 6428 S    0  0.8   0:00.06 apache2                                                                                                                           
 1918 www-data  20   0  320m 7092 3972 S    0  0.7   0:00.74 apache2                                                                                                                           
 4335 postfix   20   0  115m 2904 2012 S    0  0.3   0:01.15 proxymap                                                                                                                          
 4386 postfix   20   0 44308 2888 2212 S    0  0.3   0:00.07 smtp                                                                                                                              
 2751 root      20   0 73316 2876 2752 S    0  0.3   0:00.07 sshd                                                                                                                              
 4349 postfix   20   0 44296 2872 2200 S    0  0.3   0:00.04 smtp                                                                                                                              
 4285 postfix   20   0  115m 2852 2008 S    0  0.3   0:00.74 proxymap                                                                                                                          
 4317 postfix   20   0 44320 2848 2212 S    0  0.3   0:00.05 smtp                                                                                                                              
 4292 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.07 smtp                                                                                                                              
 4298 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.07 smtp                                                                                                                              
 4327 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                                                              
 4332 postfix   20   0 44296 2836 2212 S    0  0.3   0:00.05 smtp                                                                                                                              
 4355 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.04 smtp                                                                                                                              
 4356 postfix   20   0 44300 2836 2212 S    0  0.3   0:00.09 smtp                                                                                                                              
 4375 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.09 smtp                                                                                                                              
 4387 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.06 smtp                                                                                                                              
 4388 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.05 smtp                                                                                                                              
 4394 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                                                              
 4405 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                                                              
 4300 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.05 smtp                                                                                                                              
 4303 postfix   20   0 44304 2832 2212 S    0  0.3   0:00.08 smtp                                                                                                                              
 4304 postfix   20   0 44188 2832 2208 S    0  0.3   0:00.05 smtp                                                                                                                              
 4314 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.06 smtp                                                                                                                              
 4340 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.02 smtp                                                                                                                              
 4357 postfix   20   0 44188 2832 2208 S    0  0.3   0:00.04 smtp                                                                                                                              
 4373 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.08 smtp                                                                                                                              
 4379 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.04 smtp                                                                                                                              
 4389 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.02 smtp                                                                                                                              
 4293 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.07 smtp                                                                                                                              
 4295 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.09 smtp                                                                                                                              
 4306 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.04 smtp                                                                                                                              
 4318 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.02 smtp                                                                                                                              
 4320 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.06 smtp                                                                                                                              
 4331 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.07 smtp                                                                                                                              
 4364 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.05 smtp                                                                                                                              
 4369 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.05 smtp                                                                                                                              
 4374 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.04 smtp                                                                                                                              
 4395 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.06 smtp                                                                                                                              
 4399 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.06 smtp                                                                                                                              
 4299 postfix   20   0 44188 2824 2208 S    0  0.3   0:00.07 smtp  

如何找到哪個檔案正在執行 postfix?
我的系統是Debian、Apache2、MySQL

答案1

為了追蹤這些東西,您需要在它發生時啟用某種審核。您可以進行進程記帳(根據我的經驗幾乎沒有用)或配置auditd來審計像execve這樣的系統呼叫。

一旦auditd記錄了該事件,您就可以找到相關二進位檔案的execve或fork,並將其追溯到特定的shell或腳本。但它可能會追溯到服務文件。如果攻擊者從命令列手動啟動 postfix 服務,它會告訴您他們第一次登入系統的使用者名稱以及從何處(控制台、遠端系統的主機名稱等)。

這個答案SF 上的內容很好地向您介紹了auditd。大多數auditd 用戶似乎都是RHEL,所以如果你用google 搜索,你會遇到很多以RHEL 為中心的信息,但顯然很多技能集可以在發行版之間轉移。

相關內容