LINUX下防惡意掃描軟體PortSentry

來源:互聯網
上載者:User

標籤:portsentry

最近我們公司總是被惡意攻擊。後面查看了LINUX下有免費的防惡意掃描軟體PortSentry去解決了

 

1.安裝portSentry

下裁portsentry-1.2.tar.gz

[[email protected] ~]# tar zxvf portsentry-1.2.tar.gz

[[email protected] ~]# cd portsentry_beta/

開啟portsentry.c在1590行左右Copyright 1997-2003那行內容調整為一行,不然安裝警示

  1584   printf ("Copyright 1997-2003 Craig H. Rowland <craigrowland at users dot

   1585 sourceforget dot net>\n");

 

修改成

1584 printf ("Copyright 1997-2003 Craig H. Rowland <craigrowland at users dot sourceforget dot net>\n");

 

[[email protected] portsentry_beta]# make && make install

 

發現cp: 無法 stat “./portsentry”: 沒有那個檔案或目錄

make: *** [install] 錯誤 1這問題,我們在一次make&& make install&& make linux

[[email protected] portsentry_beta]# make linux

 

port Sentry的配置

[[email protected] portsentry_beta]# vi /usr/local/psionic/portsentry/portsentry.conf

找到

# Use these if you just want to be aware:

TCP_PORTS="1,11,15,79,111,119,143,540,635,1080,1524,2000,5742,6667,12345,12346,20034,27665,31337,32771,32772,32773,32774,40421,49724,54320"

UDP_PORTS="1,7,9,69,161,162,513,635,640,641,700,37444,34555,31335,32770,32771,32772,32773,32774,31337,54321"

 

可以把你所要監視的連接埠增加進去

 

啟動portsentry的命令如下

[[email protected] portsentry_beta]# /usr/local/psionic/portsentry/portsentry -atcp

 

查看日誌

[[email protected] portsentry_beta]# tail /var/log/messages

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced mode will manually exclude port: 139

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 22

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 25

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 80

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 111

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 631

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 637

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 113

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: Advanced Stealth scan detection mode activated. Ignored TCP port: 139

Jul 23 19:58:59 tomcat135 portsentry[11037]: adminalert: PortSentry is now active and listening.

 

如果被攻擊的我們可以查看

[[email protected] portsentry_beta]# cat /etc/hosts.deny

#

# hosts.deny    This file contains access rules which are used to

#                deny connections to network services that either use

#                the tcp_wrappers library or that have been

#                started through a tcp_wrappers-enabled xinetd.

#

#                The rules in this file can also be set up in

#                /etc/hosts.allow with a ‘deny‘ option instead.

#

#                See ‘man 5 hosts_options‘ and ‘man 5 hosts_access‘

#                for information on rule syntax.

#                See ‘man tcpd‘ for information on tcp_wrappers

#

ALL: 216.99.158.196

ALL: 116.10.191.184

ALL: 65.111.161.35

ALL: 58.52.149.161

ALL: 137.175.69.43

ALL: 14.108.157.240

ALL: 198.13.104.182

ALL: 137.175.70.226

ALL: 119.36.79.10

ALL: 27.16.231.69

ALL: 137.175.9.239

ALL: 142.4.126.35

ALL: 112.125.18.175

ALL: 119.122.9.152

ALL: 218.77.79.43

ALL: 204.93.154.216

ALL: 42.120.145.6

ALL: 23.105.86.26

 

 

說明這些IP是惡意掃描的,被這軟體自動增加到這裡面去。

本文出自 “飛鴻遝膤” 部落格,請務必保留此出處http://jxzhfei.blog.51cto.com/1382161/1444740

LINUX下防惡意掃描軟體PortSentry

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.