Tool-Tool Hacking di Linux (part 1)

Posted by Unknown | 01:41 Categories:
Ada pepatah mengatakan bahwa jika tak kenal maka tak sayang, maka kali ini kita akan coba mengenal tentang beberapa tool hacking yang umum dipakai di linux. Jika Anda tidak kenal siapa saya maka Anda tidak akan bisa sayang saya. hehehe .

Ok, langsung saja kita mulai.
Yang diperlukan dalam artikel kali ini:
1. OS Linux (sebaiknya backtrack 2 atau 3 atau 4) atau trustix secure linux.
2. Sebungkus rokok
3. Camilan (kacang, kue, coklat, pop mie, dll)
4. Segelas kopi atau susu.
Kalau semua udah siap, mari kita langsung mulai !!!

Nmap
Nmap merupakan salah satu port scanner yang terkenal di linux, berguna melihat port-port target kita yang terbuka.
Berikut ini adalah beberapa teknik-teknik scan dengan nmap :

- Syn scan (untuk penjelasan syn silahkan cari artikel tentang three way handsake: syn, ack dan fin)
Metode scan ini mengirimkan paket syn dengan harapan target mengirimkan ack, mari kita lihat sample penggunaan:
Code:
nmap -sS 127.0.0.1
- Mengecek OS dengan nmap
Contoh penggunaan:
Code:
nmap -O 127.0.0.1
- Ping scan
Scanning ini akan mengirimkan icmp echo request ke target
Contoh penggunaan:
Code:
nmap -sP 127.0.0.1
- UDP Scan
Untuk scanning port udp di target:
Code:
nmap -sU 127.0.0.1
Contoh demo scanning dengan info traceroute,daemon fingerprinting,os guessing dan cek jumlah lompatan hop (-A):

<img src=http://www.fams-online.com/images/net1.jpg>

Tcpdump


<img src=http://www.fams-online.com/images/net2.jpg>

Nah ini dia salah satu sniffer terkenal di linux Untuk memantau aktivitas paket di jaringan.
Untuk menginstall tcpdump:
Code:
sudo apt-get install tcpdump
Untuk mulai menjalankan tcpdump ketikkan:
Code:
tcpdump
Sebelum mulai melakukan sniffing, kita lihat dulu network interface yang bisa kita capture dengan: tcpdump -D
contoh:
Code:
bt ~ # tcpdump -D
1.eth0
2.any (Pseudo-device that captures on all interfaces)
3.lo
bt ~ #
Ok mari kita langsung aja praktek dengan mengcapture paket 2 via interface lo.
Sebelum mulai tcpdump kita coba dulu bind port dan listen dengan netcat untuk contoh, misal kita buka port 3333:
Code:
bt lampp # nc -l -p 3335 -vv
listening on [any] 3335 ...
Selanjutnya kita coba jalankan tcpdump untuk capture lalu lintas di port 3335 secara lokal (loopback address dengan interface lo):
Code:
tcpdump -vv -x -X -s 1500 -i lo 'port 3335'
Ok, selanjutnya untuk eksperimen kita coba koneksi ke localhost di port 3335:
Code:
bt network # telnet localhost 3335
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ketikkan string misalnya: hacked by mywisdom


Ok mari kita lihat plain text : "hacked by mywisdom" tadi tercapture via tcpdump :


<img src=http://www.fams-online.com/images/net3.jpg>

Code:
bt ~ # tcpdump -vv -x -X -s 1500 -i lo 'port 3335'
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 1500 bytes
23:32:27.414840 IP (tos 0x0, ttl 64, id 62383, offset 0, flags [DF], proto TCP (6), length 71) localhost.3335 > localhost.55714: P, cksum 0xfe3b (incorrect (-> 0xa241), 628168326:628168345(19) ack 622312675 win 1024 <nop,nop,timestamp 2367948 2363206>
        0x0000:  4500 0047 f3af 4000 4006 48ff 7f00 0001  E..G..@.@.H.....
        0x0010:  7f00 0001 0d07 d9a2 2571 1686 2517 bce3  ........%q..%...
        0x0020:  8018 0400 fe3b 0000 0101 080a 0024 21cc  .....;.......$!.
        0x0030:  0024 0f46 6861 636b 6564 2062 7920 6d79  .$.Fhacked.by.my
        0x0040:  7769 7364 6f6d 0a                        wisdom.
23:32:27.414860 IP (tos 0x10, ttl 64, id 22880, offset 0, flags [DF], proto TCP (6), length 52) localhost.55714 > localhost.3335: ., cksum 0x2c2b (correct), 1:1(0) ack 19 win 1025 <nop,nop,timestamp 2367948 2367948>
        0x0000:  4510 0034 5960 4000 4006 e351 7f00 0001  E..4Y`@.@..Q....
        0x0010:  7f00 0001 d9a2 0d07 2517 bce3 2571 1699  ........%...%q..
        0x0020:  8010 0401 2c2b 0000 0101 080a 0024 21cc  ....,+.......$!.
        0x0030:  0024 21cc                                .$!.
Snort
Snort merupakan salah satu tool white hat hacker yang cukup terkenal. Snort(mengendus) ini apa ya? hmmm ok singkatnya gini: snort adalah suatu open source IDS (Intrusion Detection System) dengan beberapa fungsi: paket sniffer dan log, dan juga sbg mode IPS (intrusion prevention system)
Bisa digunakan memantau lalu lintas jaringan, mendeteksi penyusupan ke sistem dan mendeteksi adanya serangan DOS maupun DDOS.
Menginstal snort dan menghubungkan ke mysqld:
Code:
sudo apt-get install snort-mysql
Selanjutnya kita anggap anda sudah membuat rule untuk snort di mana elf binary snort ada di /usr/local/bin, Selanjutnya ke /etc/ lalu modifikasi file: rc.local
Dan jalankan snort pada program start up misal perintah snort:
Code:
/usr/local/bin/snort -c /etc/snort/snort.conf -i eth0 -g snort -Dde
Untuk memantau lalu lintas jaringan di interface eth0 dimana rulenya kita gunakan file: /etc/snort/snort.conf

Ettercap


<img src=http://www.fams-online.com/images/net4.jpg>
Suatu tool untuk sniffing alias intip mengintip bagi para penggemar teknik "Man in the middle attack".
Ok kita akan pakai yang cli aja yah.
Code:
 ettercap -h

ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA


Usage: ettercap [OPTIONS] [TARGET1] [TARGET2]

TARGET is in the format MAC/IPs/PORTs (see the man for further detail)

Sniffing and Attack options:
  -M, --mitm <METHOD:ARGS>    perform a mitm attack
  -o, --only-mitm             don't sniff, only perform the mitm attack
  -B, --bridge <IFACE>        use bridged sniff (needs 2 ifaces)
  -p, --nopromisc             do not put the iface in promisc mode
  -u, --unoffensive           do not forward packets
  -r, --read <file>           read data from pcapfile <file>
  -f, --pcapfilter <string>   set the pcap filter <string>
  -R, --reversed              use reversed TARGET matching
  -t, --proto <proto>         sniff only this proto (default is all)

User Interface Type:
  -T, --text                  use text only GUI
       -q, --quiet                 do not display packet contents
       -s, --script <CMD>          issue these commands to the GUI
  -C, --curses                use curses GUI
  -G, --gtk                   use GTK+ GUI
  -D, --daemon                daemonize ettercap (no GUI)

Logging options:
  -w, --write <file>          write sniffed data to pcapfile <file>
  -L, --log <logfile>         log all the traffic to this <logfile>
  -l, --log-info <logfile>    log only passive infos to this <logfile>
  -m, --log-msg <logfile>     log all the messages to this <logfile>
  -c, --compress              use gzip compression on log files

Visualization options:
  -d, --dns                   resolves ip addresses into hostnames
  -V, --visual <format>       set the visualization format
  -e, --regex <regex>         visualize only packets matching this regex
  -E, --ext-headers           print extended header for every pck
  -Q, --superquiet            do not display user and password

General options:
  -i, --iface <iface>         use this network interface
  -I, --iflist                show all the network interfaces
  -n, --netmask <netmask>     force this <netmask> on iface
  -P, --plugin <plugin>       launch this <plugin>
  -F, --filter <file>         load the filter <file> (content filter)
  -z, --silent                do not perform the initial ARP scan
  -j, --load-hosts <file>     load the hosts list from <file>
  -k, --save-hosts <file>     save the hosts list to <file>
  -W, --wep-key <wkey>        use this wep key to decrypt wifi packets
  -a, --config <config>       use the alterative config file <config>

Standard options:
  -U, --update                updates the databases from ettercap website
  -v, --version               prints the version and exit
  -h, --help                  this help screen
Ok misal kita tes untuk memantau jaringan kita:
Code:
ettercap -T
-DNS Poisoning dengan ettercap:

Contoh penggunaan:
Code:
ettercap -TQM arp:remote -P dns_spoof
- Plugin Remote Browser
digunakan untuk melihat aktivitas pengaksesan web target yang 1 subnet:
Code:
ettercap -T -Q -M arp:remote -i eth0 /target_ip/ /gateway_ip/ -P remote_browser
contoh untuk melihat ip-ip subnet dengan nmap:
Code:
nmap -sS 111.94.8.*
Contoh tampilan penggunaan ettercap via command line interface:

<img src=http://www.fams-online.com/images/net5.jpg>


John the ripper
Untuk mendownload john the ripper silahkan kunjungi web ini:
Code:
http://www.openwall.com/john
Ini dia tool lama favorit kita semua untuk cracking password.
Cara gampang makenya:
Code:
john file_password
misal kita tes dulu yah :

<img src=http://www.fams-online.com/images/net6.jpg>


Nikto
Merupakan open source web vulnerability scanner yang bisa didownload secara gratis yang dibuat dengan bahasa pemrograman perl.

Untuk menggunakan nikto (ke direktori di mana Anda menaruh skrip nikto.pl, misal di: /pentest/web/nikto):
Code:
bt nikto # pwd
/pentest/web/nikto
bt nikto # ./nikto.pl
---------------------------------------------------------------------------
- Nikto 2.02/2.03     -     cirt.net
+ ERROR: No host specified

       -Cgidirs+                scan these CGI dirs: 'none', 'all', or values like "/cgi/ /cgi-a/"
       -dbcheck                 check database and other key files for syntax errors (cannot be abbreviated)
       -evasion+                ids evasion technique
       -Format+                 save file (-o) format
       -host+                   target host
       -Help                    Extended help information
       -id+                     host authentication to use, format is userid:password
       -mutate+                 Guess additional file names
       -output+                 write output to this file
       -port+                   port to use (default 80)
       -Display+                turn on/off display outputs
       -ssl                     force ssl mode on port
       -Single                  Single request mode
       -timeout+                timeout (default 2 seconds)
       -Tuning+                 scan tuning
       -update                  update databases and plugins from cirt.net (cannot be abbreviated)
       -Version                 print plugin and database versions
       -vhost+                  virtual host (for Host header)
   + requires a value
Perintah yang biasa saya pakai untuk scan target:

Code:
./nikto.pl -host target_web_anda.com
Misal kita scan v4-team.com:
Code:
bt nikto # ./nikto.pl -host v4-team.com
---------------------------------------------------------------------------
- Nikto 2.02/2.03     -     cirt.net
+ Target IP:       67.222.154.99
+ Target Hostname: v4-team.com
+ Target Port:     80
+ Start Time:      2010-02-09 1:31:01
---------------------------------------------------------------------------
+ Server: gws

<img src=http://www.fams-online.com/images/net7.jpg>

Hydra

Hydra ini fungsinya mirip dengan program dengan nama brutus di microsoft windows

Ok, kali ini kita tes GUI nya untuk dictionary attack ftp secara lokal,
silahkan diset seperti gambar di bawah ini (jangan lupa aktifkan daemon ftp Anda untuk mendukung uji coba kali ini)


<img src=http://www.fams-online.com/images/net8.jpg>

Lalu kita klik tab "Passwords":

Misal target username adalah: "mywisdom"
Lalu kita centang Password list karena kita akan menggunakan word list yang sudah kita siapkan, misal dalam
eksperimen kali ini kita pakai file password yang sudah kita siapkan di direktori /root


<img src=http://www.fams-online.com/images/net9.jpg>


Ok selanjutnya kita klik tab Start dan kita klik tombol Start di kiri bawah dan hasilnya bisa kita lihat:

<img src=http://www.fams-online.com/images/net10.jpg>

W3AF

http://sourceforge.net/projects/w3af/

W3af ini merupakan framework untuk audit web aplikasi (pentest) dengan aneka plugin. Berikut ini adalah plugin yang bisa kita pakai untuk penetrasi suatu web

Code:
  LDAPi             Find LDAP injection bugs.
+ blindSqli         Find blind SQL injection vulnerabilities.
  buffOverflow      Find buffer overflow vulnerabilities.
  dav               Tries to upload a file using HTTP PUT method.
+ fileUpload        Uploads a file and then searches for the file inside all known directories
.
  formatString      Find format string vulnerabilities.
+ frontpage         Tries to upload a file using frontpage extensions (author.dll).
+ generic           Find all kind of bugs without using a fixed database of errors.
  globalRedirect    Find scripts that redirect the browser to any site.
  htaccessMethods   Find misconfigurations in the "<LIMIT>" configuration of Apache.
  localFileInclude  Find local file inclusion vulnerabilities.
  mxInjection       Find MX injection vulnerabilities.
  osCommanding      Find OS Commanding vulnerabilities.
  phishingVector    Find phishing vectors.
  preg_replace      Find unsafe usage of PHPs preg_replace.
+ remoteFileInclude Find remote file inclusion vulnerabilities.
  responseSplitting Find response splitting vulnerabilities.
  sqli              Find SQL injection bugs.
  ssi               Find server side inclusion vulnerabilities.
  sslCertificate    Check the SSL certificate validity( if https is being used ).
  unSSL             Find out if secure content can also be fetched using http.
  xpath             Find XPATH injection vulnerabilities.
  xsrf              Find the easiest to exploit xsrf vulnerabilities.
+ xss               Find cross site scripting vulnerabilities.
  xst               Verify Cross Site Tracing vulnerabilities.
Untuk masuk ke konsole w3af silahkan ke direktori tempat anda taruh elf binary w3af Anda. misal di
/pentest/web/w3af

ketikkan :
Code:
./w3af
Contoh:
Code:
bt w3af # pwd
/pentest/web/w3af
bt w3af # w3af
w3af>>> help
The following commands are available:
help                You are here. help [command] prints more specific help.
http-settings       Configure the URL opener.
misc-settings       Configure w3af misc settings.
plugins             Enable, disable and configure plugins.
profiles            List and start scan profiles.
start               Start site analysis.
exploit             Exploit a vulnerability.
tools               Enter the tools section.
target              Set the target URL.
version             Show the w3af version.
exit                Exit w3af.
w3af>>>
Misal kita mao audit saja dengan menggunakan semua plugin di atas:
Code:
w3af>>> plugins
w3af/plugins>>>audit all
next ketikkan back:
Code:
w3af/plugins>>> back
w3af>>>
Lalu kita set target kita, ketikkan target:
Code:
w3af>>> target
w3af/target>>>
Misal kita set target url http://jasakom.com

Code:
w3af/target>>> set target http://jasakom.com
w3af/target>>> back
Untuk mulai kita ketik start:
Code:
w3af/target>>> set target http://jasakom.com
w3af/target>>> back
w3af>>> start
Auto-enabling plugin: grep.collectCookies
Auto-enabling plugin: grep.httpAuthDetect
Auto-enabling plugin: discovery.allowedMethods
Auto-enabling plugin: discovery.serverHeader
The Server header for this HTTP server is: Apache/2.2.4 (Ubuntu) mod_fastcgi/2.4.2
x-powered-by header for this HTTP server is: PHP/5.2.3-1ubuntu6.4
The methods: COPY, GET, HEAD, LOCK, MOVE, OPTIONS, POST, PROPFIND, PROPPATCH, TRACE, UNLOCK
 are enabled on the following URLs:
- http://jasakom.com
- http://jasakom.com/
Found 4 URLs and 4 different points of injection.
The list of URLs is:
- http://jasakom.com
- http://jasakom.com/login.php?do=login
- http://jasakom.com/search.php?do=process
- http://jasakom.com/profile.php?do=dismissnotice
The list of fuzzable requests is:
So here we go:

<img src=http://www.fams-online.com/images/net11.jpg>

Vanish, wzap,zap, zap2, logzap2,uzapper

Merupakan tool-tool yang berguna untuk covering track. Ok kita tes dulu vanish (http://217.125.24.22/vanish.c)
Misal kita lihat dulu user2 apa saja yang ada di dalam sistem kita dengan mengetik: who
Code:
bt network # who
root     tty1         Feb  8 01:15
root     pts/0        Feb  8 01:16 (:0.0)
root     pts/1        Feb  8 01:19 (:0.0)
root     pts/2        Feb  8 01:22 (:0.0)
root     pts/3        Feb  8 01:27 (:0.0)
root     pts/4        Feb  8 01:28 (:0.0)
root     pts/5        Feb  8 02:02 (:0.0)
bt network #
Ok coba kita pakai vanish:
Code:
bt bd # ./vanish root localhost localhost

utmp target processed.
wtmp target processed.
lastlog target processed.
Processing /var/log/messages                       DONE.
Processing /var/log/secure                         DONE.
Processing /var/log/xferlog                        DONE.
Processing /var/log/maillog                        DONE.
Processing /var/log/warn        Couldn't open /var/log/warn

Processing /var/log/mail        Couldn't open /var/log/mail

Processing /var/log/httpd.access_log    Couldn't open /var/log/httpd.access_log

Processing /var/log/httpd.error_log     Couldn't open /var/log/httpd.error_log



mv: cannot stat `warn.hm': No such file or directory
mv: cannot stat `mail.hm': No such file or directory
mv: cannot stat `httpda.hm': No such file or directory
mv: cannot stat `httpde.hm': No such file or directory


V_A_N_I_S_H_E_D_!
Your tracks have been removed
Exiting programm !!
Lalu kita tes lagi apakah masih keliatan user root yang ada di sistem:
Code:
bt bd # who
bt bd #
ok bukan sulap bukan sihir, sim salabim abra kadabra, user root hilang dari penampakan di sistem

<img src=http://www.fams-online.com/images/net12.jpg>

Dsniff
Dsniff merupakan paket sniffer yang cukup terkenal di linux.Klo gak salah ada juga yang buat di windows.
Ok untuk mulai dsniff coba kita lihat dulu opsinya, ketik ini: dsniff -h
Code:
bt nikto # dsniff -h
Version: 2.4
Usage: dsniff [-cdmn] [-i interface] [-s snaplen] [-f services]
              [-t trigger[,...]] [-r|-w savefile] [expression]
bt nikto #
Fast Track

Merupakan suatu framework untuk penetrasi website yang dibuat dengan bahasa pemrograman python.
Beberapa fitur di dalam fast track:
- SQL injector
- SQL Bruter (biasa digunakan untuk brute force akun SA di mssql server)
- MS DOS Remote shell payload
- Exploit2:
1.HP Openview Network Node Manager CGI Buffer Overflow
2.IBM Tivoli Storage Manager Express CAD Service Buffer Overflow
3.HP Openview NNM 7.5.1 OVAS.EXE Pre Authentication SEH Overflow
- Metasploit auto pawn

Ok kali ini kita akan gunakan fitur web based dari fast track, ke direktori fast-track.py anda lalu ketikkan:
Code:
./fast-track.py -g

<img src=http://www.fams-online.com/images/net13.jpg>

Selanjutnya buka browser Anda dan ketikkan:
Code:
http://127.0.0.1:44444
Tampilan web based fast track

<img src=http://www.fams-online.com/images/net14.jpg>

Metasploit Framework

Metasploit merupakan framework yang berisi aneka exploit dan payload.

Code:
bt framework3 # ls
README          external/    lib/      msfcli*      msfelfscan*  msfmachscan*  msfpescan*  msfweb*   tools/
data/           framework3@  load.gif  msfconsole*  msfencode*   msfopcode*    msfrpc*     plugins/
documentation/  karma.rc     modules/  msfd*        msfgui*      msfpayload*   msfrpcd*    scripts/
bt framework3 #
di mana kita bisa menggunakan dalam aneka modus, yaitu mode konsole, web based, cli dan gui.

Untuk kali ini kita tes mode konsole, ketikkan:
Code:
./msfconsole
Code:
bt framework3 # ./msfconsole

                ##                          ###           ##    ##
 ##  ##  #### ###### ####  #####   #####    ##    ####        ######
####### ##  ##  ##  ##         ## ##  ##    ##   ##  ##   ###   ##
####### ######  ##  #####   ####  ##  ##    ##   ##  ##   ##    ##
## # ##     ##  ##  ##  ## ##      #####    ##   ##  ##   ##    ##
##   ##  #### ###   #####   #####     ##   ####   ####   #### ###
                                      ##


       =[ msf v3.3-dev
+ -- --=[ 294 exploits - 124 payloads
+ -- --=[ 17 encoders - 6 nops
       =[ 58 aux

msf >
Untuk melihat apa saja perintah di konsole ini ketik help:
Code:
msf > help

Core Commands
=============

    Command       Description
    -------       -----------
    ?             Help menu
    back          Move back from the current context
    banner        Display an awesome metasploit banner
    cd            Change the current working directory
    connect       Communicate with a host
    exit          Exit the console
    help          Help menu
    info          Displays information about one or more module
    irb           Drop into irb scripting mode
    jobs          Displays and manages jobs
    load          Load a framework plugin
    loadpath      Searches for and loads modules from a path
    quit          Exit the console
    resource      Run the commands stored in a file
    route         Route traffic through a session
    save          Saves the active datastores
    search        Searches module names and descriptions
    sessions      Dump session listings and display information about sessions
    set           Sets a variable to a value
    setg          Sets a global variable to a value
    show          Displays modules of a given type, or all modules
    sleep         Do nothing for the specified number of seconds
    unload        Unload a framework plugin
    unset         Unsets one or more variables
    unsetg        Unsets one or more global variables
    use           Selects a module by name
    version       Show the console library version number

msf >
contoh penggunaan auxiliary:

Code:
msf > use auxiliary/spoof/dns/bailiwicked_host
msf auxiliary(bailiwicked_host) >

<img src=http://www.fams-online.com/images/net15.jpg>

Sulley Fuzzing Framework

Merupakan suatu framework untuk fuzzing aplikasi (bisa daemon). Sulley bisa anda download dari http://www.fuzzing.org
Tool ini akan membantu anda melakukan fuzzing selain fuzzing manual.

Ok sekian artikel saya semoga bermanfaat, karena udah cape jadi saya lanjutkan lain kali. Good Luck

0 komentar:

Selamat Datang Di Blog Saya ( Rhagil Chunxkrinx )
  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube