免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234下一页
最近访问板块 发新帖
查看: 5396 | 回复: 36
打印 上一主题 下一主题

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙 [复制链接]

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
跳转到指定楼层
[收藏(0)] [报告]
发表于 2005-08-15 14:52 |只看该作者 |正序浏览
上午服务器受到了大量的imcp攻击 !我用iptraf监视到了大量的imcp攻击!内网的特别严重!现在已经查出内网的病毒,也把那些关杀毒了!服务器已恢复正常!
上午在遭攻击时,我用iptables看到了一些很奇怪的参数,很明显,我的防火墙被 更改,是谁有这样的手段?
[root@localhost root]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere           multiport dports 135,136,netbios-ns,netbios-dgm,netbios-ssn,microsoft-ds,http,ftp,domain,pop3,smtp
ACCEPT     udp  --  anywhere             anywhere           multiport dports 135,136,netbios-ns,netbios-dgm,netbios-ssn,microsoft-ds,ftp,domain
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:1723
ACCEPT     gre  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere           multiport dports pop3,http,smtp

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Lokkit-0-50-INPUT (0 references)
target     prot opt source               destination
[root@localhost root]#  

现在这样是正常的!但是在攻击期间,在
Chain RH-Lokkit-0-50-INPUT (0 references)
target     prot opt source               destination
上面被 加了一个ip而且 是特别放行的!不明白这是怎么加上去的!是谁有这样的能耐????先前我的iptables规则 里内网是无条件放行的!难道就是因为这个,内网就有权限改iptables???????????????现在我把内网也禁了!只开了一些对应的端口

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
36 [报告]
发表于 2005-08-16 19:31 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

[quote]原帖由 "ayazero"]抱歉![/quote 发表:


那倒没有必要!   

论坛徽章:
0
35 [报告]
发表于 2005-08-16 19:01 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

抱歉!

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
34 [报告]
发表于 2005-08-16 18:46 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

[quote]原帖由 "ayazero"]用我写的那个脚本跑了自己看看有没有什么异常吧[/quote 发表:



呵呵!大哥,好在我没有用!!
不过人非圣贤,谁能无过!
相信你是真心帮助我们的!

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
33 [报告]
发表于 2005-08-16 18:16 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

[quote="platinum"]首先,你的两条 iptables -P INPUT XXX 并不冲突,但就好比一个程序里面两次给同一个变量赋值一样,第一次没必要

其次,你的默认规则是 DROP,每分钟 3 次的只是 LOG 而不是 ACCEPT,因此谈
嗯!好!我刚刚从一公司回来!一公司的服务器刚刚恢复正常!发现linux服务器有时很脆弱!
唉,可能是我没有做好吧!单单一个iptables的可能还远远不够 !不过在病毒方面好像比win要强!
我现在正在看别人的iptables配制!呵呵!
谢谢你的指教!   

论坛徽章:
0
32 [报告]
发表于 2005-08-16 11:28 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m multiport --dports 443,139,80,21,53,110,25 -j ACCEPT
iptables -A INPUT -i eth1 -p udp -m multiport --dports 138,137,67,53 -j ACCEPT
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp -m multiport --dports 110,80,25 -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.0/24 -j MASQUERADE
iptables -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level INFO --log-prefix "IPT INPUT packet died: "
iptables -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level DEBUG --log-prefix "IPT FORWARD packet died: "
iptables -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level DEBUG --log-prefix "IPT OUTPUT packet died: "

红色的是逻辑上的问题
黑色的是功能上的问题

逻辑上有问题,前后设置了 2 次
功能上有问题,你只是做了每分钟 3 次的采样记录,并没有做阀值控制(这个其实也属于逻辑问题)

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
31 [报告]
发表于 2005-08-16 10:19 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

原帖由 "platinum" 发表:
http://www.chkrootkit.org/
去下一个,检查检查你的系统


好的!谢谢你!这是我现在用的防火墙脚本!
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m multiport --dports 443,139,80,21,53,110,25 -j ACCEPT
iptables -A INPUT -i eth1 -p udp -m multiport --dports 138,137,67,53 -j ACCEPT
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp -m multiport --dports 110,80,25 -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.0/24 -j MASQUERADE
iptables -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level INFO --log-prefix "IPT INPUT packet died: "
iptables -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level DEBUG --log-prefix "IPT FORWARD packet died: "
iptables -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG --log-level DEBUG --log-prefix "IPT OUTPUT packet died: "
这样我的内网可以上网了!但是如果我加上
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
这两句后就不能上网了,因为现在我的机是在这两个连是无条件放行!会不会出现很大的危机!
另外,我重起后,进入单用户模式,改了root的密码和和改了root的用户名,那两个进程已经消失!同时我没有启动iptables服务!服务器暂时已经正常!

论坛徽章:
0
30 [报告]
发表于 2005-08-16 10:06 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

http://www.chkrootkit.org/
去下一个,检查检查你的系统

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
29 [报告]
发表于 2005-08-16 08:25 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

原帖由 "platinum" 发表:
有入侵的,这个是后门之类的东西
你看看 /usr/bin/gunz 是什么


没有这个文件!

论坛徽章:
0
28 [报告]
发表于 2005-08-15 20:40 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

有入侵的,这个是后门之类的东西
你看看 /usr/bin/gunz 是什么

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
27 [报告]
发表于 2005-08-15 19:44 |只看该作者

今天服务器挂了n次。。,看iptables被更改.请版主等高手们帮忙

原帖由 "platinum" 发表:
用 iptraf 看没用,libpcap 是在 netfilter 之前运作的,因此看这个没有什么意义,tcpdump 也是一样

至于 icmp 的阀值限制问题,你可以参考网上相关文章,看看其他防火墙的例子,研究一下 -m limit 如何用



刚刚服务器又挂了!!!!
我重起用ps aux看到了一个怪进程!
[root@localhost root]# ps aux
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.0  1364  464 ?        S    18:52   0:04 init
root         2  0.0  0.0     0    0 ?        SW   18:52   0:00 [migration/0]
root         3  0.0  0.0     0    0 ?        SW   18:52   0:00 [migration/1]
root         4  0.0  0.0     0    0 ?        SW   18:52   0:00 [keventd]
root         5  0.0  0.0     0    0 ?        SWN  18:52   0:00 [ksoftirqd_CPU0]
root         6  0.0  0.0     0    0 ?        SWN  18:52   0:00 [ksoftirqd_CPU1]
root        11  0.0  0.0     0    0 ?        SW   18:52   0:00 [bdflush]
root         7  0.0  0.0     0    0 ?        SW   18:52   0:00 [kswapd]
root         8  0.0  0.0     0    0 ?        SW   18:52   0:00 [kscand/DMA]
root         9  0.0  0.0     0    0 ?        SW   18:52   0:01 [kscand/Normal]
root        10  0.0  0.0     0    0 ?        SW   18:52   0:00 [kscand/HighMem]
root        12  0.0  0.0     0    0 ?        SW   18:52   0:00 [kupdated]
root        13  0.0  0.0     0    0 ?        SW   18:52   0:00 [mdrecoveryd]
root        17  0.0  0.0     0    0 ?        SW   18:52   0:00 [kjournald]
root        75  0.0  0.0     0    0 ?        SW   18:52   0:00 [khubd]
root      3737  0.0  0.1  1440  544 ?        S    18:52   0:00 syslogd -m 0
root      3741  0.0  0.0  1368  428 ?        S    18:52   0:00 klogd -x
named     3830  0.0  0.5 38932 2972 ?        S    18:52   0:00 [named]
root      3844  0.0  0.1  2028  812 ?        S    18:52   0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
root      3855  0.0  0.2  2404 1432 ?        S    18:52   0:00 /usr/sbin/dhcpd
root      3867  0.0  0.2  4156 1076 ?        S    18:52   0:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
root      3880  0.0  0.0  1408  440 ?        S    18:52   0:00 gpm -t imps2 -m /dev/mouse
mysql     3908  0.0  0.4 14008 2524 ?        S    18:52   0:00 [mysqld]
root      3911  0.0  1.6 19748 8696 ?        S    18:52   0:00 /usr/sbin/httpd
root      3922  0.0  0.1  1524  588 ?        S    18:52   0:00 /usr/sbin/pptpd
wnn       3933  0.0  0.7  5160 3924 ?        S    18:52   0:00 [jserver]
qmails    3942  0.0  0.0  1392  328 ?        S    18:52   0:00 [qmail-send]
root      3943  0.0  0.0  1416  436 ?        S    18:52   0:00 /usr/local/bin/tcpserver -H -R -l 0 -t 1 -v -p -x /home/vpopmail/etc/tcp.smtp.
root      3944  0.0  0.0  1360  400 ?        S    18:52   0:00 /var/qmail/bin/splogger smtpd 3
root      3946  0.0  0.0  1416  444 ?        S    18:52   0:00 /usr/local/bin/tcpserver -H -R 0 pop3 /var/qmail/bin/qmail-popup hostname /hom
qmaill    3947  0.0  0.0  1360  400 ?        S    18:52   0:00 [splogger]
root      3948  0.0  0.0  1356  272 ?        S    18:52   0:00 qmail-lspawn ./Maildir/
qmailr    3949  0.0  0.0  1352  300 ?        S    18:52   0:00 [qmail-rspawn]
qmailq    3950  0.0  0.0  1348  284 ?        S    18:52   0:00 [qmail-clean]
vpopmail  4009  0.0  1.7 19788 8752 ?        S    18:53   0:00 [httpd]
vpopmail  4010  0.0  1.7 19856 8860 ?        S    18:53   0:00 [httpd]
vpopmail  4011  0.0  1.7 19788 8752 ?        S    18:53   0:00 [httpd]
vpopmail  4012  0.0  1.7 19856 8860 ?        S    18:53   0:00 [httpd]
vpopmail  4013  0.0  1.7 19788 8752 ?        S    18:53   0:00 [httpd]
vpopmail  4014  0.0  1.7 19856 8856 ?        S    18:53   0:00 [httpd]
vpopmail  4015  0.0  1.7 19788 8752 ?        S    18:53   0:00 [httpd]
vpopmail  4016  0.0  1.7 19856 8856 ?        S    18:53   0:00 [httpd]
xfs       4039  0.0  0.9  6456 4996 ?        S    18:53   0:00 [xfs]
root      4048  0.0  0.3  5784 2036 ?        S    18:53   0:00 smbd -D
root      4052  0.0  0.3  4616 1812 ?        S    18:53   0:00 nmbd -D
root      4061  0.0  0.2  2452 1064 ?        S    18:53   0:00 /usr/bin/lisa --config=/etc/lisarc
root      4091  0.0  0.0     0    0 ?        SW   18:53   0:00 [eth0]
root      4110  0.0  0.1  2252  972 ?        S    18:53   0:00 login -- root
root      4111  0.0  0.0  1348  396 tty2     S    18:53   0:00 /sbin/mingetty tty2
root      4112  0.0  0.0  1348  396 tty3     S    18:53   0:00 /sbin/mingetty tty3
root      4113  0.0  0.0  1348  396 tty4     S    18:53   0:00 /sbin/mingetty tty4
root      4114  0.0  0.0  1348  396 tty5     S    18:53   0:00 /sbin/mingetty tty5
root      4115  0.0  0.0  1348  396 tty6     S    18:53   0:00 /sbin/mingetty tty6
root      4128  0.0  0.2  5628 1468 tty1     S    18:53   0:00 -bash
root      4294  0.0  0.5  9520 2952 tty1     T    18:53   0:00 vim /etc/rc.local
root      4355  0.0  0.1  2072 1012 tty1     S    18:54   0:00 /bin/bash /sbin/adsl-connect
root      4382  0.0  0.1  2088  924 ?        S    18:54   0:00 /usr/sbin/pppd pty /usr/sbin/pppoe -p /var/run/pppoe-adsl.pid.pppoe -I eth0 -T
root      4384  0.3  0.0  1384  456 ?        S    18:54   0:11 /usr/sbin/pppoe -p /var/run/pppoe-adsl.pid.pppoe -I eth0 -T 80 -U -m 1412
root      4451  0.0  0.2  5360 1072 tty1     S    18:55   0:00 /bin/sh /usr/X11R6/bin/startx
root      4462  0.0  0.1  2332  612 tty1     S    18:55   0:00 xinit /root/.xinitrc --
root      4463  4.5  2.1 61896 10972 ?       S<   18:55   2:09 X :0
root      4467  0.0  0.2  5376 1120 tty1     S    18:55   0:00 /bin/sh /usr/bin/startkde
root      4492  0.3  3.0 27420 15640 tty1    S    18:55   0:10 fcitx
root      4510  0.0  1.6 20088 8204 ?        S    18:55   0:00 kdeinit: Running...
root      4513  0.0  1.6 22856 8316 ?        S    18:55   0:00 kdeinit: dcopserver --nosid
root      4516  0.0  1.8 24416 9460 ?        S    18:55   0:00 kdeinit: klauncher
root      4518  0.2  2.4 34944 12508 ?       S    18:55   0:07 kdeinit: kded
root      4523  0.4  1.1  8968 5776 ?        S    18:55   0:11 /usr/bin/artsd -F 10 -S 4096 -s 60 -m artsmessage -l 3 -f
root      4535  0.0  2.8 39220 14628 ?       S    18:55   0:00 kdeinit: knotify
root      4544  0.0  0.0  1356  308 tty1     S    18:55   0:00 kwrapper ksmserver
root      4546  0.0  2.3 34184 11832 ?       S    18:55   0:00 kdeinit: ksmserver
root      4547  0.1  2.8 35920 14560 ?       S    18:55   0:03 kdeinit: kwin -session 117f000001000112315207900000045990000_1124090873_198307
root      4549  0.0  3.0 36732 15724 ?       S    18:55   0:02 kdeinit: kdesktop
root      4551  0.2  3.5 38732 18148 ?       S    18:55   0:06 kdeinit: kicker
root      4552  0.0  1.6 20440 8684 ?        S    18:55   0:00 kdeinit: kio_file file /tmp/ksocket-root/klauncherCpEYGa.slave-socket /tmp/kso
root      4556  0.0  2.4 34972 12724 ?       S    18:55   0:00 kdeinit: kwrited
root      4557  0.0  0.8 13164 4532 ?        S    18:55   0:00 /usr/bin/pam-panel-icon --sm-client-id 117f000001000112315208200000045990003
root      4559  0.0  0.0  1412  480 ?        S    18:55   0:00 /sbin/pam_timestamp_check -d root
root      4561  0.0  2.3 34084 11788 ?       S    18:55   0:00 kalarmd --login
root      4562  0.7  3.1 37284 16396 ?       S    18:55   0:20 kdeinit: konsole
root      4563  0.0  0.2  5624 1476 pts/2    S    18:55   0:00 /bin/bash
root      4642  0.0  0.1  4728  720 pts/2    T    19:05   0:00 man iptables
root      4645  0.0  0.1  5356  984 pts/2    T    19:05   0:00 sh -c (cd /usr/share/man && (echo ".ll 12.6i"; echo ".pl 1100i"; /usr/bin/gunz
root      4646  0.0  0.1  5360 1024 pts/2    T    19:05   0:00 sh -c (cd /usr/share/man && (echo ".ll 12.6i"; echo ".pl 1100i"; /usr/bin/gunz
root      4649  0.0  0.2  5364 1096 pts/2    T    19:05   0:00 /bin/sh /usr/bin/nroff -c -mandoc
root      4650  0.0  0.1  5064  796 pts/2    T    19:05   0:00 /usr/bin/less -isr
root      4657  0.0  0.2  5680 1064 pts/2    T    19:05   0:00 groff -mtty-char -Tascii8 -P-c -mandoc
root      4659  0.0  0.3  6176 1556 pts/2    T    19:05   0:00 grotty -c
root      4661  0.0  0.3  4132 1672 pts/2    S    19:06   0:02 ./pipclient
root      4755  0.0  0.5  9528 2964 pts/2    T    19:25   0:00 vim /etc/rc.local
qmailr    4761  0.1  0.0  1448  444 ?        S    19:33   0:00 [qmail-remote]
qmailr    4763  0.0  0.0  1444  440 ?        S    19:33   0:00 [qmail-remote]
qmailr    4766  0.0  0.0  1448  444 ?        S    19:33   0:00 [qmail-remote]
qmailr    4767  0.1  0.0  1452  448 ?        S    19:34   0:00 [qmail-remote]
root      4771  0.0  0.5  9532 2964 pts/2    T    19:35   0:00 vim /etc/rc.local
root      4793  2.7  3.4 37608 17652 ?       S    19:40   0:04 gaim
root      4803  0.0  0.2  5388 1116 ?        S    19:40   0:00 /bin/sh /root/Desktop/firefox
root      4829  0.0  0.2  5420 1132 ?        S    19:40   0:00 /bin/sh /opt/firefox-installer/run-mozilla.sh /opt/firefox-installer/firefox-b
root      4834  5.3  7.0 133576 36320 ?      S    19:40   0:05 /opt/firefox-installer/firefox-bin
root      4838  0.0  0.5  8112 2956 ?        S    19:40   0:00 /usr/libexec/gconfd-2 11
root      4852  0.0  0.1  2788  840 pts/2    R    19:42   0:00 ps aux

我说的是
root      4645  0.0  0.1  5356  984 pts/2    T    19:05   0:00 sh -c (cd /usr/share/man && (echo ".ll 12.6i"; echo ".pl 1100i"; /usr/bin/gunz
root      4646  0.0  0.1  5360 1024 pts/2    T    19:05   0:00 sh -c (cd /usr/share/man && (echo ".ll 12.6i"; echo ".pl 1100i"; /usr/bin/gunz
这两个进程是什么东西!
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP