On Mon, Dec 21, 2009 at 03:02:37AM +0000, Arief Yudhawarman wrote:
> Script yang saya buat untuk resolve domain conficker satu demi satu dan
> membuat nilai frekuensi ipnya pakai script bash sederhana, namun rule2
> di router seperti menandai akses ke ip conficker dari client dan membuat
> scr-address-list secara dinamik pakai bahasa mikrotik :).
> Saya belum tahu teknisnya kalau pakai iptables, seperti membuat
> src-address-list dan dst-address-list kayak di mikrotik.
>
> Mungkin RR bisa sumbang saran ?
Akhirnya jawab sendiri, setelah buka2 kitab iptables, akhirnya nemu cara
yg saat ini pas untuk catat akses ke ip conficker pakai target LOG.
Ini lah yg saya buat di sebuah router warnet:
1. Sebelumnya buat dahulu list ip conficker:
$ cat /etc/conficker/ip.conficker
64.70.19.33
66.90.81.140
72.167.51.186
74.208.46.216
74.208.64.145
83.68.16.6
97.74.200.45
143.215.143.11
149.20.56.32
199.2.137.252
205.188.161.4
221.7.91.31
2. Script kecil di bawah akan menambah rule ke iptables untuk mencatat
akses ke ip conficker:
#!/bin/sh
LAN_IFACE="eth0"
IPTABLES="/usr/sbin/iptables"
FIPCONFICKER="/etc/conficker/ip.conficker"
while read IPCONFICKER
do
# only for kernel 2.6 for use with option -m comment
# CHAIN FORWARD
# uncomment this to drop access to ip conficker
#$IPTABLES -I FORWARD -i $LAN_IFACE -d $IPCONFICKER -j DROP -m comment \
# --comment "IP Conficker"
$IPTABLES -I FORWARD -i $LAN_IFACE -d $IPCONFICKER -j LOG --log-prefix \
"CONFICKER" --log-ip-options
# CHAIN PREROUTING
# uncomment this to drop access to ip conficker
#$IPTABLES -t nat -I PREROUTING -i $LAN_IFACE -d $IPCONFICKER -j DROP \
#-m comment --comment "IP Conficker"
$IPTABLES -t nat -I PREROUTING -i $LAN_IFACE -d $IPCONFICKER -j LOG \
--log-prefix "CONFICKER" --log-ip-options
done <$FIPCONFICKER
Ini hasil uji coba di syslog:
...
Dec 21 13:49:55 proxy kernel: CONFICKERIN=eth0 OUT=
MAC=00:50:04:d1:02:e0:00:19:21:13:57:5
d:08:00 SRC=192.168.0.252 DST=221.7.91.31 LEN=60 TOS=0x10 PREC=0x00 TTL=64
ID=41788 DF PRO
TO=TCP SPT=46801 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Dec 21 13:50:43 proxy kernel: CONFICKERIN=eth0 OUT=
MAC=00:50:04:d1:02:e0:00:19:21:13:57:5
d:08:00 SRC=192.168.0.252 DST=221.7.91.31 LEN=60 TOS=0x10 PREC=0x00 TTL=64
ID=41789 DF PRO
TO=TCP SPT=46801 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Ada tool yg bisa memperindah tampilan syslog ? Kalau baca begitu
terlampau pusing rasanya.
--
Terimakasih sebelumnya.
Salam,
~~ Arief Yudhawarman ~~
--
FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
Unsubscribe: kirim email ke [email protected]
Arsip dan info milis selengkapnya di http://linux.or.id/milis