Disini saya akan menjelaskan trik untuk mengamankan Linux kita dari serangan flooding dan IP spoffing serta bagaimana mengaudit Linux kita dari hal-hal yang membahayakan seperti rootkit yang ada.
Pada dasarnya Linux didalam kernelnya sudah memiliki fasilitas untuk memblokir Flood karena TCP/IP SYN cookies dan IP spoofing.
– Langkah Pertama
Untuk menjegahnya kita hanya perlu mengkatifkan option TCP/IP SYN cookies dan Spoof protection (rp_filter).
File tersebut berada di “/etc/sysctl.conf”
# cat /etc/sysctl.conf
#
# /etc/sysctl.conf Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
# the following stops lowlevel messages on console
kernel.printk = 4 4 1 7
# enable /proc/$pid/maps privacy so that memory relocations are not
# visible to other users.
kernel.maps_protect = 1
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next line to enable Spoof protection (reversepath filter)
#net.ipv4.conf.default.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.conf.default.forwarding=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
Secara default pertama kali instalasi pada baris net.ipv4.tcp_syncookies=1 dan net.ipv4.conf.default.rp_filter=1 masih dalam keadaan tidak aktif. Untuk mengaktifkannya tinggal membuang tanda # di depannya dan kemudian simpan.
Untuk mengeditnya di Ubuntu Server dengan :
$ sudo gedit /etc/sysctl.conf
lalu edit dan simpan kembali Untuk melalui konsole yang lain dapat menggunakan text editor lewat konsole seperti mc, vi, maupun joe, dll.
Sekarang isi dari sysctl.conf anda jadi seperti ini :
# /etc/sysctl.conf Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
# the following stops lowlevel messages on console
kernel.printk = 4 4 1 7
# enable /proc/$pid/maps privacy so that memory relocations are not
# visible to other users.
kernel.maps_protect = 1
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next line to enable Spoof protection (reversepath filter)
net.ipv4.conf.default.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.conf.default.forwarding=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
Tinggal anda restart PC anda dan kemudian modul tersebut akan otomatis jalan pada kernel
anda.
#Audit Server Linux
Rootkit pada Linux cukup banyak jenisnya dan beragam, biasanya digunakan oleh pada cracker
untuk mengambil alih login root anda.
Didalam OS Windows untuk mengaudit security yang ada di PC kita dapat menggunakan
software GFI LanGuard, tapi sayang software ini berbayar dan harganya pun cukup mahal.
(www.gfi.com/languard/).
Di Linux anda dapat menggunakan rkhunter, Ada beberapa program yang bisa dipakai untuk
mendeteksi adanya rootkit pada system. Rootkit detector kit, chkrootkit dan Rkhunter adalah
contoh yang bisa digunakan.
“rkhunter” ini gratis anda dapatkan di : http://www.rootkit.nl/projects/rootkit_hunter.html.
Untuk keluarga debian dan ubuntu, dll dapat langsung mengunduh langsung dari repositori yang
ada :
ubuntu :
$ sudo aptget install rkhunter
atau melalui synaptic :
Menu System – Administration – Synaptics Package Manager
Jika menginstall manual dapat mengikuti langkah berikut :
# tar xvzf rkhunter.tgz
# cd rkhunter
# # ls
files installer.sh
#
jalankan installer nya :
#./installer.sh
Tunggu sampai proses instalasi selesai.
Setalah selesai dengan install maka pertama kali kita harus mengupdate rkhunter tersebut
terlebih dahulu agar dapat mengenali rootkit terbaru yang ada.
# rkhunter update
(Untuk mengupdate database rootkit terbaru)
Untuk menjalankannya dapat melihat file help yang ada :
# rkhunter help
Usage: rkhunter {check | update | propupd | versioncheck |
list [tests | languages | rootkits] |
version | help} [options]
Current options are:
appendlog
bindir …
c, check
cs2, colorset2
configfile
cronjob
dbdir
debug
disable [,…]
displaylogfile
enable [,…]
Append to the logfile, do not overwrite
Use the specified command directories
Check the local system
Use the second color set for output
Use the specified configuration file
Run as a cron job
(implies c, sk and nocolors options)
Use the specified database directory
Debug mode
(Do not use unless asked to do so)
Disable specific tests
(Default is to disable no tests)
Display the logfile at the end
Enable specific tests
Dari option diatas untuk menjalankannya ketik perintah :
# rkhunter c
tunggu sampai dia selesai mengecek system kita, jika ada konfirmasi untuk melanjutkan tekan
tombol “ENTER”
# rkhunter c
[ Rootkit Hunter version 1.3.0 ]
Checking system commands…
Performing ‘strings’ command checks
Checking ‘strings’ command [ OK ]
Performing ‘shared libraries’ checks
Checking for preloading variables
[ None found ]
Checking for preload file [ Not found ]
Checking LD_LIBRARY_PATH variable [ Not found ]
Performing file properties checks
Checking for prerequisites
/bin/bash
/bin/cat
/bin/chmod
/bin/chown
/bin/cp
/bin/date
/bin/df
/bin/dmesg
/usr/bin/ldd
/usr/bin/less
/usr/bin/locate
/usr/bin/logger
/usr/bin/lsattr
/usr/bin/lsof
/usr/bin/md5sum
/usr/bin/newgrp
/usr/bin/passwd
/usr/bin/perl
/usr/bin/pstree
/usr/bin/rkhunter
/usr/bin/rpm
/usr/bin/runcon
/usr/bin/sha1sum
…… (cut)
……
/usr/sbin/usermod
/usr/sbin/vipw
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ Warning ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[ Warning ]
[ OK ]
[ OK ]
[ OK ]
[ OK ]
[Press to continue]
Checking for rootkits…
Performing check of known rootkit files and directories
55808 Trojan Variant A [ Not found ]
ADM Worm [ Not found ]
AjaKit Rootkit [ Not found ]
aPa Kit [ Not found ]
Apache Worm [ Not found ]
Ambient (ark) Rootkit [ Not found ]
…… (cut)
System checks summary
=====================
File properties checks…
Files checked: 123
Suspect files: 2
Rootkit checks…
Rootkits checked : 109
Possible rootkits: 0
Applications checks…
Applications checked: 3
Suspect applications: 0
The system checks took: 1 minute and 18 seconds
All results have been written to the logfile (/var/log/rkhunter.log)
One or more warnings have been found while checking the system.
Please check the log file (/var/log/rkhunter.log)
eof
Dari hasil resume yang diberikan kita dapat melihat apakah System Linux kita sudah aman,
hasil resume ini juga memberitahukan rootkit yang terdeteksi dan suspect file yang ada
#Jadi bagi kawan-kawan jangan lupa selalu Audit Server Anda# 🙂
Tulisan diatas didedikasikan buat seseorang yang mengajari saya,,,
NB : Maaf kalau kurang dimengerti, karena sebagian eksekusi terminal saya copy-paste dari terminal langsung 🙂
#Semoga Bermanfaat#
Brader…. ada cara gak pada bagian …
#IP spoofing
me-reload file “/etc/sysctl.conf” tanpa harus restart; /sbin/reboot
karna ane sering pake Live Linux dari HDD external / flasdisk
^_^ nice inpoh….
artikel nya bagus2 ya
wah… mantap bang amir… di test dlu… :ngacir: