Thứ Năm, 18 tháng 4, 2013

[Metasploit] Scan victim ( Một trong những bước quan trọng khi check site)

Mình đã viết một bài về Metasploit framwork rồi.
Phần này mình viết tiếp về nó.Dù nó ko liên quan gì lắm với nhau )
Phần này mình đề cập tiếp đến vấn đề scan mục tiêu cần attack đã nói trong phần trước.



Scan mục tiêu là vấn đề rất quan trọng.thu thập đc càng nhiều thông tin càng tốt.Chả thừa gì đối với chúng ta cả.
Trong metasploit framework có một module sử dụng bộ công cụ scan nmap .Trong quá trình họat động nó sử dụng giữ liệu thu đc bằng quá trình scan bởi nmap một cách tự động.
Như mình từng đề cập ở nhiều bài trước.Làm gì thì làm.Trước khi dùng mấy bộ công cụ này thì tốt nhất là nên update trước.Dữ liệu của nó cập nhật theo ngày.Nên update là ko thừa.

Step1: Vào msfconsole ,rồi type db_nmap

root@bt:~# msfconsole
msf > db_nmap

[*] Usage: db_nmap [nmap options]


Nhận đc thông báo nmap_option --> ta có thể sử dụng các option của nmap thông thường.
Thử scan victim nào đó nhé.Hộm nó mới có con shell trên honda67.com mấy mem up lên huynhdegroup.net.Hôm nay vào tên nào đã deface rồi.Nên lấy nó test luôn.
Ip của honda67.com là 112.78.2.15
msf > db_nmap 112.78.2.15



Ta nhận đc các thông tin về port.Có khá nhiều port mở.Từ những port mở này ta định hình đc khá nhiều điều.Đề cập ở đây không hết đc.Mình chỉ đưa ra một vài ví dụ thôi.Như thấy có mở port 143 chẳng hạn.Lên exploit-db.com xem sao.

Thấy có khá nhiều exploit liên quan.Đây là 1 số ví dụ:
http://www.exploit-db.com/exploits/4574/
http://www.exploit-db.com/exploits/5259/
http://www.exploit-db.com/exploits/3133/
http://www.exploit-db.com/exploits/1123/
http://www.exploit-db.com/exploits/658/
....................
Điểm yếu là thế.Nhưng có khai thác được hay không thì còn phụ thuộc vào rất nhiều yếu tố nữa.Scan giúp ta mở rộng hơn phương hướng cần tấn công.Nghĩa là càng nhiều thông tin thu được thì khả năng có thể tấn công được càng cao.

Nếu là tấn công trong mạng Lan thì ta có thể kiểm tra đầy đủ hơn toàn bộ miền Lan bằng lệnh "services".
Đây là một ví dụ.Nó scan tất cả các dịch vụ được mở.



Ngoài ra còn có lệnh "hosts" chức năng cũng tương tự.Mọi người cứ thử sẽ hiểu thôi.
Trở lại với vấn đề scan.Thu thập thông tin chung về site.Trong Metasploit có khá nhiều auxiliary dùng cho việc này.
Chúng ta sẽ xem một module để minh họa.
Module auxiliary/scanner/http/crawler

type: msf > use auxiliary/scanner/http/crawler
Xem các option của nó nào.Để có thể cấu hình cho đúng.



Như vậy ở đây ta thấy có 6 trường bắt buộc phải config.Trong đó có vài trường đã là mặc định rồi.Mình config lại cho nó luôn

set RHOST honda67.vn
set RPORT 80 //mặc định nó cũng thế rồi
set URI /forum/
run
kết quả thu đc như sau:



ừ đây ta thu đc một số thông tin về site.

Tiếp tục về việc scan.Ta sẽ thử với với plugin WMAP

đây là một bộ công cụ scanning web cho Metasploit 3.Đây là một bộ công cụ mã nguồn mở ,miễn phí nhưng rất mạnh.Mình sẽ demo về nó.
Đầu tiên phải load plugin này về.

msf auxiliary(crawler) > load wmap

nếu nhận đc như thế này thì đã load thành công

msf auxiliary(crawler) > load wmap
.-.-.-..-.-.-..---..---.
| | | || | | || | || |-'
`-----'`-'-'-'`-^-'`-'
[WMAP 1.5.1] === et [ ] metasploit.com 2012[*] Successfully loaded plugin: wmap
msf auxiliary(crawler) > help

wmap Commands
=============
Command Description
------- -----------
wmap_modules Manage wmap modules
wmap_nodes Manage nodes
wmap_run Test targets
wmap_sites Manage sites
wmap_targets Manage targets
wmap_vulns Display web vulns
Để xem thông tin chi tiết ,các bạn có thể type lệnh "wmap_sites"



Ta thử xem list cách website có thể scan nào.



Đây là mấy site mình scan khi nãy.Muốn scan thêm thằng nào thì cứ cấu hình xong là nó tự add vào thôi.

Như đã thấy ở phần option. Ta scan target với cấu trúc như sau
wmap_sites -s id

id của honda67.vn ở đây là 0 vậy ta type lệnh

wmap_sites -s 0

Nhận đc thông tin như sau
[honda67.vn] (112.78.2.15)


|-----/awstats (1)
|-----/awstats
|-----/basilic
|-----/cacti
|-----/docs (3)
|-----/CHANGELOG
|-----/html (1)
|-----/php_script_server.html
|-----/text (1)
|-----/manual.txt
|-----/forum (30)
|-----/activity.php
|-----/album.php
|-----/awstats (1)
|-----/awstats
|-----/basilic
|-----/cacti
|-----/calendar.php
|-----/clientscript (1)
|-----/vbulletin_css (1)
|-----/style00047l (3)
|-----/additional.css
|-----/forumhome-rollup.css
|-----/main-rollup.css
|-----/docs (3)
|-----/CHANGELOG
|-----/html (1)
|-----/php_script_server.html
|-----/text (1)
|-----/manual.txt
|-----/external.php
|-----/faq.php
|-----/favicon.ico
|-----/forum.php
|-----/forumdisplay.php
|-----/group.php
|-----/index.php
|-----/infernoshout.php
|-----/link
|-----/login.php
|-----/member.php
|-----/memberlist.php
|-----/private.php
|-----/profile.php
|-----/register.php
|-----/search.php
|-----/showgroups.php
|-----/stuff
|-----/test
|-----/tmp
|-----/member_inlinemod.php
|-----/inlinemod.php
|-----/stuff
|-----/style.css
|-----/test
|-----/tmp

Để scan bằng cách load tất cả các module có thể.Thì đầu tiên ta cấu hình cho target trước.

wmap_sites -l // liệt kê target
wmap_target -d 0 // chọn target có id =0
wmap_run -e

Xem ta nhận đc những thông tin gì nào

msf auxiliary(crawler) > wmap_run -e[*] Using ALL wmap enabled modules.
[-] NO WMAP NODES DEFINED. Executing local modules[*] Testing target:[*] Site: honda67.vn (112.78.2.15)[*] Port: 80 SSL: false
====================================[*] Testing started. 2013-04-14 23:13:32 +0700[*] Loading wmap modules...[*] 38 wmap enabled modules loaded.[*]
=[ SSL testing ]=
=====================================[*] Target is not SSL. SSL modules disabled.[*]
=[ Web Server testing ]=
==============================[*] Module auxiliary/scanner/http/http_version[*] Module auxiliary/scanner/http/open_proxy[*] Module auxiliary/scanner/http/robots_txt[*] Module auxiliary/scanner/http/frontpage_login[*] Module auxiliary/admin/http/tomcat_administration[*] Module auxiliary/admin/http/tomcat_utf8_traversal
[*] Attempting to connect to 112.78.2.15:80[*] Module auxiliary/scanner/http/options[*] Module auxiliary/scanner/http/drupal_views_user_enum[*] Module auxiliary/scanner/http/scraper[*] Module auxiliary/scanner/http/svn_scanner[*] Module auxiliary/scanner/http/trace
[-] Received 405 TRACE is not enabled for 112.78.2.15:80[*] Module auxiliary/scanner/http/vhost_scanner[*] >> Exception during launch from auxiliary/scanner/http/vhost_scanner: The following options failed to validate: DOMAIN.[*] Module auxiliary/scanner/http/webdav_internal_ip[*] Module auxiliary/scanner/http/webdav_scanner[*] 112.78.2.15 (Apache) WebDAV disabled.[*] Module auxiliary/scanner/http/webdav_website_content[*]
=[ File/Dir testing ]=
===============================[*] Module auxiliary/scanner/http/backup_file[*] Path: /awstats/awstats[*] Path: /basilic[*] Path: /cacti[*] Path: /docs/CHANGELOG[*] Path: /docs/html/php_script_server.html[*] Path: /docs/text/manual.txt[*] Path: /forum/activity.php[*] Path: /forum/album.php[*] Path: /forum/awstats/awstats[*] Path: /forum/basilic[*] Path: /forum/cacti[*] Path: /forum/calendar.php[*] Path: /forum/clientscript/vbulletin_css/style00047l/additional.css
[*] Path: /forum/clientscript/vbulletin_css/style00047l/forumhome-rollup.css[*] Path: /forum/clientscript/vbulletin_css/style00047l/main-rollup.css[*] Path: /forum/docs/CHANGELOG[*] Path: /forum/docs/html/php_script_server.html[*] Path: /forum/docs/text/manual.txt[*] Path: /forum/external.php[*] Path: /forum/faq.php[*] Path: /forum/favicon.ico[*] Path: /forum/forum.php[*] Path: /forum/forumdisplay.php[*] Path: /forum/group.php[*] Path: /forum/index.php[*] Path: /forum/infernoshout.php[*] Path: /forum/link[*] Path: /forum/login.php[*] Path: /forum/member.php[*] Path: /forum/memberlist.php[*] Path: /forum/private.php[*] Path: /forum/profile.php[*] Path: /forum/register.php[*] Path: /forum/search.php[*] Path: /forum/showgroups.php[*] Path: /forum/stuff[*] Path: /forum/test[*] Path: /forum/tmp[*] Path: /forum/member_inlinemod.php[*] Path: /forum/inlinemod.php[*] Path: /stuff[*] Path: /style.css[*] Path: /test[*] Path: /tmp[*] Module auxiliary/scanner/http/brute_dirs[*] Path: /[*] Using code '404' as not found.[*] Found http://honda67.vn:80/n/ 403[*] Error: 112.78.2.15: ActiveRecord::RecordInvalid Validation failed: Pname can't be blank[*] Path: /awstats/[*] Using code '404' as not found.

Có khá nhiều thông tin có thể khai thác đc bằng cách này.Nhưng mình chọn victim này khá ít thông tin ).

[To be continue]


Nguồn : iCarus - VHB

Không có nhận xét nào: