Cái kho của thế giới mạng
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

(CEH) KỸ THUẬT SCANNING

Go down

(CEH) KỸ THUẬT SCANNING Empty (CEH) KỸ THUẬT SCANNING

Bài gửi by Admin Wed May 18, 2011 3:56 pm


I/ Giới thiệu về Scanning:
Scanning hay còn gọi là quét mạng là bước không thể thiếu được trong quá trình tấn
công vào hệ thống mạng của hacker. Nếu làm bước này tốt Hacker sẽ mau chóng phát hiện
được lỗi của hệ thống ví dụ như lỗi RPC của Window hay lỗi trên phầm mềm dịch vụ web
như Apache v.v. Và từ những lỗi này, hacker có thể sử dụng những đoạn mã độc hại(từ các
trang web) để tấn công vào hệ thống, tồi tệ nhất lấy shell.
Phần mềm scanning có rất nhiều loại, gồm các phầm mềm thương mại như Retina,
GFI, và các phần mềm miễn phí như Nmap,Nessus. Thông thường các ấn bản thương mại có
thể update các bug lỗi mới từ internet và có thể dò tìm được những lỗi mới hơn. Các phần
mềm scanning có thể giúp người quản trị tìm được lỗi của hệ thống, đồng thời đưa ra các giải
pháp để sửa lỗi như update Service patch hay sử dụng các policy hợp lý hơn.

II/ Các Bài thực hành



Bài thực hành 1: Sử dụng Phần mềm Nmap
Trước khi thực hành bài này, học viên nên tham khảo lại giáo trình lý thuyết về các
option của nmap.
Chúng ta có thể sử dụng phần mềm trong CD CEH v5, hay có thể download bản mới
nhất từ website: [You must be registered and logged in to see this link.] Phần mềm nmap có 2 phiên bản dành cho Win và dành
cho Linux, trong bài thực hành về Nmap, chúng ta sử dụng bản dành cho Window.
Để thực hành bài này, học viên nên sử dụng Vmware và boot từ nhiều hệ điều hành
khác nhau như Win XP sp2, Win 2003 sp1, Linux Fedora Core, Win 2000 sp4,v.v.
Trước tiên sử dụng Nmap để do thám thử xem trong subnet có host nào up và các port
các host này mở, ta sử dụng lệnh Nmap –h để xem lại các option của Nmap, sau đó thực hiện
lệnh “Nmap –sS 10.100.100.1-20”. Và sau đó được kết quả sau:
C:\Documents and Settings\anhhao>nmap -sS 10.100.100.1-20
Starting Nmap 4.20 (http://insecure.org ) at 2007-08-02 10:27 Pacific Standard
Time
Interesting ports on 10.100.100.1:
Not shown: 1695 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
MAC Address: 00:0C:29:09:ED:10 (VMware)

Interesting ports on 10.100.100.6:
Not shown: 1678 closed ports
PORT STATE SERVICE

7/tcp open echo
9/tcp open discard
13/tcp open daytime
17/tcp open qotd
19/tcp open chargen
23/tcp open telnet
42/tcp open nameserver
53/tcp open domain
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
1026/tcp open LSA-or-nterm
1027/tcp open IIS
1030/tcp open iad1
2105/tcp open eklogin
3389/tcp open ms-term-serv
8080/tcp open http-proxy
MAC Address: 00:0C:29:59:97:A2 (VMware)
Interesting ports on 10.100.100.7:
Not shown: 1693 closed ports
PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
MAC Address: 00:0C:29:95:A9:03 (VMware)
Interesting ports on 10.100.100.11:
Not shown: 1695 filtered ports
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
MAC Address: 00:0C:29:A6:2E:31 (VMware)
Skipping SYN Stealth Scan against 10.100.100.13 because Windows does not support
scanning your own machine (localhost) this way.
All 0 scanned ports on 10.100.100.13 are
Interesting ports on 10.100.100.16:
Not shown: 1689 closed ports
PORT STATE SERVICE
21/tcp open ftp
25/tcp open smtp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
1433/tcp open ms-sql-s
MAC Address: 00:0C:296:73:6D (VMware)
Interesting ports on 10.100.100.20:
Not shown: 1693 closed ports
PORT STATE SERVICE
135/tcp open msrpc
445/tcp open microsoft-ds
1000/tcp open cadlock
5101/tcp open admdog
MAC Address: 00:15:C5:65:E3:85 (Dell)
Nmap finished: 20 IP addresses (7 hosts up) scanned in 21.515 seconds
Trong mạng có tất cả 7 host, 6 máy Vmware và 1 PC DELL. Bây giờ bước tiếp theo ta
tìm kiếm thông tin về OS của các Host trên bằng sử dụng lệnh “ Nmap –v -O ip address” .
C:\Documents and Settings\anhhao>nmap -vv -O 10.100.100.7 (xem chi tiết Nmap quét)
Starting Nmap 4.20 (http://insecure.org ) at 2007-08-02 10:46 Pacific Standard
Time
Initiating ARP Ping Scan at 10:46
Scanning 10.100.100.7 [1 port]
Completed ARP Ping Scan at 10:46, 0.22s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 10:46
Completed Parallel DNS resolution of 1 host. at 10:46, 0.01s elapsed
Initiating SYN Stealth Scan at 10:46
Scanning 10.100.100.7 [1697 ports]
Discovered open port 1025/tcp on 10.100.100.7
Discovered open port 445/tcp on 10.100.100.7
Discovered open port 135/tcp on 10.100.100.7
Discovered open port 139/tcp on 10.100.100.7
Completed SYN Stealth Scan at 10:46, 1.56s elapsed (1697 total ports)
Initiating OS detection (try #1) against 10.100.100.7
Host 10.100.100.7 appears to be up ... good.
Interesting ports on 10.100.100.7:
Not shown: 1693 closed ports
PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
MAC Address: 00:0C:29:95:A9:03 (VMware)
Device type: general purpose
Running: Microsoft Windows 2003
OS details: Microsoft Windows 2003 Server SP1
OS Fingerprint:
OS:SCAN(V=4.20%D=8/2%OT=135%CT=1%CU=36092%PV=Y%DS= 1%G=Y%M=000C
29%TM=46B2187
OS:3%P=i686-pc-windowswindows)
SEQ(SP=FF%GCD=1%ISR=10A%TI=I%II=I%SS=S%TS=0)
OS:OPS(O1=M5B4NW0NNT00NNS%O2=M5B4NW0NNT00NNS%O3=M5 B4NW0NNT0
0%O4=M5B4NW0NNT0
OS:0NNS%O5=M5B4NW0NNT00NNS%O6=M5B4NNT00NNS)WIN(W1= FAF0%W2=F
AF0%W3=FAF0%W4=F
OS:AF0%W5=FAF0%W6=FAF0)ECN(R=Y%DF=N%T=80%W=FAF0%O= M5B4NW0NN
S%CC=N%Q=)T1(R=Y
OS:%DF=N%T=80%S=O%A=S+%F=AS%RD=0%Q=)T2(R=Y%DF=N%T= 80%W=0%S=
Z%A=S%F=AR%O=%RD
OS:=0%Q=)T3(R=Y%DF=N%T=80%W=FAF0%S=O%A=S+%F=AS%O=M 5B4NW0NNT
00NNS%RD=0%Q=)T4
OSR=Y%DF=N%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R= Y%DF=N%T
=80%W=0%S=Z%A=S+%
OS:F=AR%O=%RD=0%Q=)T6(R=Y%DF=N%T=80%W=0%S=A%A=O%F= R%O=%RD=
0%Q=)T7(R=Y%DF=N%
OS:T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T =80%TOS=0
%IPL=B0%UN=0%RIP
OS:L=G%RID=G%RIPCK=G%RUCK=G%RUL=G%RUD=G)IE(R=Y%DFI =S%T=80%T
OSI=Z%CD=Z%SI=S%
OSLI=S)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=255 (Good luck!)
IPID Sequence Generation: Incremental
OS detection performed. Please report any incorrect results at [You must be registered and logged in to see this link.]
rg/nmap/submit/ .
Nmap finished: 1 IP address (1 host up) scanned in 3.204 seconds
Raw packets sent: 1767 (78.460KB) | Rcvd: 1714 (79.328KB)
Ta có thể xem các figerprinting tại “ C:\Program Files\Nmap\nmap-os-fingerprints”(CEH) KỸ THUẬT SCANNING 1
Tiếp tục với những máy còn lại.
C:\Documents and Settings\anhhao>nmap -O 10.100.100.1
Starting Nmap 4.20 (http://insecure.org ) at 2007-08-02 10:54 Pacific Standard
Time
Interesting ports on 10.100.100.1:
Not shown: 1695 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
MAC Address: 00:0C:29:09:ED:10 (VMware)
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.9 - 2.6.12 (x86)
Uptime: 0.056 days (since Thu Aug 02 09:34:08 2007)
Network Distance: 1 hop
OS detection performed. Please report any incorrect results at [You must be registered and logged in to see this link.]
rg/nmap/submit/ .
Nmap finished: 1 IP address (1 host up) scanned in 2.781 seconds
Tuy nhiên có 1 số host Nmap không thể nhận diện ra như sau:
C:\Documents and Settings\anhhao>nmap -O 10.100.100.16
Starting Nmap 4.20 (http://insecure.org ) at 2007-08-02 10:55 Pacific Standard
Time
Interesting ports on 10.100.100.16:
Not shown: 1689 closed ports
PORT STATE SERVICE
21/tcp open ftp
25/tcp open smtp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
1433/tcp open ms-sql-s
MAC Address: 00:0C:296:73:No exact OS matches for host (If you know what OS is running on it, see [You must be registered and logged in to see this link.]
nsecure.org/nmap/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=4.20%D=8/2%OT=21%CT=1%CU=35147%PV=Y%DS=1 %G=Y%M=000C2
9%TM=46B21A94
OS:%P=i686-pc-windowswindows)
SEQ(SP=FD%GCD=2%ISR=10C%TI=I%II=I%SS=S%TS=0)S
OS:EQ(SP=FD%GCD=1%ISR=10C%TI=I%II=I%SS=S%TS=0)OPS( O1=M5B4NW0NNT0
0NNS%O2=M5B
OS:4NW0NNT00NNS%O3=M5B4NW0NNT00%O4=M5B4NW0NNT00NNS %O5=M5B4
NW0NNT00NNS%O6=M5
OS:B4NNT00NNS)WIN(W1=FAF0%W2=FAF0%W3=FAF0%W4=FAF0% W5=FAF0%W6
=FAF0)ECN(R=Y%D
OS:F=Y%T=80%W=FAF0%O=M5B4NW0NNS%CC=N%Q=)T1(R=Y%DF= Y%T=80%S=
O%A=S+%F=AS%RD=0
OS:%Q=)T2(R=Y%DF=N%T=80%W=0%S=Z%A=S%F=AR%O=%RD=0%Q =)T3(R=Y%
DF=Y%T=80%W=FAF0
OS:%S=O%A=S+%F=AS%O=M5B4NW0NNT00NNS%RD=0%Q=)T4(R=Y %DF=N%T=8
0%W=0%S=A%A=O%F=
OS:R%O=%RD=0%Q=)T5(R=Y%DF=N%T=80%W=0%S=Z%A=S+%F=AR %O=%RD=0
%Q=)T6(R=Y%DF=N%T
OS:=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=Y%DF=N%T=80 %W=0%S=Z
%A=S+%F=AR%O=%RD=
OS:0%Q=)U1(R=Y%DF=N%T=80%TOS=0%IPL=38%UN=0%RIPL=G% RID=G%RIPCK
=G%RUCK=G%RUL=
OS:G%RUD=G)IE(R=Y%DFI=S%T=80%TOSI=S%CD=Z%SI=S%DLI= S)
Network Distance: 1 hop
OS detection performed. Please report any incorrect results at [You must be registered and logged in to see this link.]
rg/nmap/submit/ .
Nmap finished: 1 IP address (1 host up) scanned in 12.485 seconds
Tuy nhiên ta có thể nhận diện rằng đây là 1 Server chạy dịch vụ SQL và Web Server,
bây giờ ta sử dụng lệnh “ Nmap –v –p 80 sV 10.100.100.16” để xác định version của IIS.
C:\Documents and Settings\anhhao>nmap -p 80 -sV 10.100.100.16
Starting Nmap 4.20 (http://insecure.org ) at 2007-08-02 11:01 Pacific Standard
Time
Interesting ports on 10.100.100.16:
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS webserver 5.0
MAC Address: 00:0C:296:73:6D (VMware)
Service Info: OS: Windows
Service detection performed. Please report any incorrect results at [You must be registered and logged in to see this link.]
ure.org/nmap/submit/ .
Nmap finished: 1 IP address (1 host up) scanned in 6.750 seconds
Vậy ta có thể đoán được phần nhiều host là Window 2000 Server. Ngoài việc thực
hành trên chúng ta có thể sử dụng Nmap trace, lưu log v.v

Bài thực hành thứ 2:

Sử dụng phần mềm Retina để phát hiện các vulnerabilities và tấn công
bằng Metaesploit framework.
Retina của Ieye là phần mềm thương mại(cũng như GFI, shadow v.v ) có thể update
các lỗ hỗng 1 cách thường xuyên và giúp cho người Admin hệ thống có thể đưa ra những giải
pháp để xử lý.
Bây giờ ta sử dụng phần mềm Retina để dò tìm lỗi của máy Win 2003
Sp0(10.100.100.6)
(CEH) KỸ THUẬT SCANNING Untitlede6
Report từ chương trình Retina:
TOP 20 VULNERABILITIES

The following is an overview of the top 20 vulnerabilities on your network.

1. echo service 1
2. ASN.1 Vulnerability Could Allow Code Execution 1
3. Windows Cumulative Patch 835732 Remote 1
4. Null Session 1
5. No Remote Registry Access Available 1
6. telnet service 1
7. DCOM Enabled 1
8. Windows RPC Cumulative Patch 828741 Remote 1
9.Windows RPC DCOM interface buffer overflow 1
10. Windows RPC DCOM multiple vulnerabilities 1
11. Apache 1.3.27 0x1A Character Logging DoS 1
12. Apache 1.3.27 HTDigest Command Execution 1
13. Apache mod_alias and mod_rewrite Buffer Overflow 1
14. ApacheBench multiple buffer overflows 1
15. HTTP TRACE method supported 1
TOP 20 OPEN PORTS

1. TCP:7 ECHO - Echo 1
2. TCP:9 DISCARD - Discard 1
3. TCP:13 DAYTIME - Daytime 1
4. TCP:17 QOTD - Quote of the Day 1
5. TCP:19 CHARGEN - Character Generator 1
6. TCP:23 TELNET - Telnet 1
7. TCP:42 NAMESERVER / WINS - Host Name Server 1
8. TCP:53 DOMAIN - Domain Name Server 1
9. TCP:80 WWW-HTTP - World Wide Web HTTP (Hyper Text
Transfer Protocol) 1
10. TCP:135 RPC-LOCATOR - RPC (Remote Procedure Call) Location
Service 1
11. TCP:139 NETBIOS-SSN - NETBIOS Session Service 1
12. TCP:445 MICROSOFT-DS - Microsoft-DS 1
13. TCP:1025 LISTEN - listen 1
14. TCP:1026 NTERM - nterm 1
15. TCP:1030 IAD1 - BBN IAD 1
16. TCP:2103 ZEPHYR-CLT - Zephyr Serv-HM Conncetion 1
17. TCP:2105 EKLOGIN - Kerberos (v4) Encrypted RLogin 1
18. TCP:3389 MS RDP (Remote Desktop Protocol) / Terminal Services 1
19. TCP:8080 Generic - Shared service port 1
20. UDP:7 ECHO - Echo 1

TOP 20 OPERATING SYSTEMS

The following is an overview of the top 20 operating systems on your network
1. Windows Server 2003 1
Như vậy ta đã xác định hệ điều hành của máy 10.100.100.6, các Port mở của hệ thống
và các lỗi của hệ thống. Đây là thông tin cần thiết để người Admin nhận diện lỗi và vá lỗi
Trong Top 20 vulnerabilities ta sẽ khai thác bug lỗi thứ 10 là RPC DCOM bằng chương trinh
Metaesploit framework(CD CEH v5). Ta có thể kiểm tra các thông tin lỗi này trên chính trang
của Ieye hay securityfocus.com, microsoft.com.
Ta sử dụng giao diện console của Metaesploit để tìm bug lỗi hợp với chương trình
Retina vừa quét được.
(CEH) KỸ THUẬT SCANNING Untitlede8
Ta thấy có thể nhận thấy bug lỗi msrpc_dcom_ms03_026.pm được liệt kê trong phần
exploit của metaesploit. Bây giờ ta bắt đầu khai thác lỗi này.
(CEH) KỸ THUẬT SCANNING Untitlede9
Như vậy sau khi khai thác ta đã có được shell của máy Win 2003, bây giờ ta có thể
upload backdoor hay lấy những thông tin cần thiết trong máy này(vấn đề này sẽ được bàn ở
những chương sau).
Kết luận: Phần mềm scanning rất quan trọng với Hacker để có thể phát hiện lỗi của hệ thống,
sau khi xác định lỗi Hacker có thể sử dụng Framework có sẵn hay code có sẵn trên Internet để
có thể chiếm quyền sử dụng của máy mục tiêu. Tuy nhiên đây cũng là công cụ hữu ích của
Admin hệ thống, phần mềm này giúp cho người Admin hệ thống đánh giá lại mức độ bảo mật
của hệ thống mình và kiểm tra liên tục các bug lỗi xảy ra.
Admin
Admin
Admin

Tổng số bài gửi : 985
Points : 2798
Danh tiếng : 0
Join date : 13/03/2011

https://chobe.forum-viet.com

Về Đầu Trang Go down

Về Đầu Trang

- Similar topics

 
Permissions in this forum:
Bạn không có quyền trả lời bài viết