New FAMILUG

The PyMiers

Wednesday 3 October 2012

[Network] nmap - khảo sát 1 victim :D

tiếp  tục series bài nghịch ngợm modem/router, bài viết này sẽ giúp bạn không phải lần mò trong bóng tối mà là "tấn công" một cách bài bản hơn :D

http://www.familug.org/2012/10/hack-hacking-router-planet-cua-vnpt-d.html
http://www.familug.org/2012/10/pha-phach-pha-mang-internet-nha-khac.html

nmap là một công cụ phổ biến dùng trong hoạt động foot printing - khảo sát mục tiêu (bịa thế, chắc đúng 90% :)) ).

Đầu tiên hãy khám phá nmap:
(máy chưa có thì cài: sudo apt-get install nmap)

hvn@lappy:~$ whatis nmap
nmap (1)             - Network exploration tool and security / port scanner
hvn@lappy:~$ dpkg -s nmap
Package: nmap
Status: install ok installed
....


Depends: libc6 (>= 2.7), libgcc1 (>= 1:4.1.1), liblua5.1-0, libpcap0.8 (>= 0.9.8), libpcre3 (>= 8.10), libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6)
Conflicts: ndiff
Description: The Network Mapper
 Nmap is a utility for network exploration or security auditing. It
 supports ping scanning (determine which hosts are up), many port
 scanning techniques, version detection (determine service protocols
 and application versions listening behind ports), and TCP/IP
 fingerprinting (remote host OS or device identification). Nmap also
 offers flexible target and port specification, decoy/stealth scanning,
 sunRPC scanning, and more. Most Unix and Windows platforms are
 supported in both GUI and commandline modes. Several popular handheld
 devices are also supported, including the Sharp Zaurus and the iPAQ.


công dụng đã rõ, bây giờ thay vì telnet bừa vào cái router, hãy xem có cổng nào mở :
(-sT là scan TCP connect)

hvn@lappy:~$ nmap -sT 192.168.0.1

Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-03 22:45 ICT
Nmap scan report for 192.168.0.1
Host is up (0.013s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 0.29 seconds
hvn@lappy:~$ nmap -sT 192.168.2.1

Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-03 22:45 ICT
Nmap scan report for 192.168.2.1
Host is up (0.0038s latency).
Not shown: 997 filtered ports
PORT   STATE SERVICE
21/tcp open  ftp
23/tcp open  telnet
80/tcp open  http


Nmap done: 1 IP address (1 host up) scanned in 6.00 seconds


Như bạn thấy, con router ở địa chỉ 192.168.0.1 , chỉ có cổng 80 là mở nên bạn chỉ có thể truy cập cái router đó bằng trình duyệt web. Còn router ở địa chỉ 192.168.2.1, cổng 23 (telnet) mở nên bạn mới có thể telnet vào.

Ngoài lệnh nmap -sT xxx.yyy.zzz.kkk để quét các cổng mở, nmap còn 1 lệnh rất phổ biến khác để quét dải ip xem host nào đang up (máy nào đang bật):

hvn@lappy:~$ nmap -sP 192.168.0.1/24

Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-03 22:51 ICT
Nmap scan report for 192.168.0.1
Host is up (0.0025s latency).
Nmap scan report for 192.168.0.102
Host is up (0.00021s latency).
Nmap scan report for 192.168.0.104
Host is up (0.057s latency).
Nmap done: 256 IP addresses (3 hosts up) scanned in 3.15 seconds


với lệnh này, bạn không phải mò mẫm như Lâm thồn @lamdt đã hướng dẫn bằng cách dò từng ip nữa
http://www.familug.org/2012/10/pha-phach-pha-mang-internet-nha-khac.html

No comments:

Post a Comment