[CEH V12] Module 4 Enumeration 列舉

本章大概就是說明一些Enumeration(列舉)的技巧

筆記一下,有錯誤的地方再麻煩提點一下

1. Extract usernames using email IDs

  •  email 提取出帳號名
  • 每個電子郵件地址都包含用戶名和域名兩部分,格式為username@domainname

2. Extract information using default passwords

很多線上資源可以找得到廠商預設密碼列表,用戶端常常揮忽略改預設帳密,所以簡化攻擊者列舉和利用目標系統的任務

3. Brute force Active Directory

  • 暴力破解AD

4. Extract information using DNS Zone Transfer

  • DNS 管理員如果設定不當

5.Extract user groups from Windows

6.Extract usernames using SNMP

service and port Enumeration

DNS Zone Transfer

TCP/UDP 53

SMTP

TCP 25

Microsoft RPC

TCP/UDP 135

SNMP Trap

TCPO/UDP 162

NetBIOS Name Service (NBNS)

UDP 137

ISAKMP/Internet Key Exchange (IKE)

UDP 500

NetBIOS Session Service(SMB over NetBIOS)

TCP 139

SSH

TCP 22

SMB over TCP (Direct Host)

TCP/UDP 445

LDAP

TCP/UDP 389

SNMP

UDP 161

Network File System(NFS)

TCP 2049

DNS用戶查詢 => UDP 53

DNS Zone Transfer => TCP 53

Global Catalog Service => TCP/UDP 3268

FTP : TCP 20/21

Tlent : TCP 23

TFTP : UDP 69

Border Gateway Protocol (BGP): TCP 179

NetBIOS Enumeration :

攻擊者可以使用NetBIOS列舉取得資訊有

1.List of computers that belong to a domain

2.List of shares on the individual hosts on the network è

3.Policies and passwords

Windows 名稱解析順序

1. Netbios name cache

2. Wins

3. Broadcast

4. lmhosts

NebBIOS name List

clip_image002

Nbtstat Utility :

NBTSTAT [ [-a RemoteName] [-A IP address] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [interval] ]

-a (介面卡狀態) 列出指定其名稱的遠端電腦名稱表格

-A (介面卡狀態) 列出指定其 IP 位址的遠端電腦名稱表格。

-c (快取) 列出 NBT 快取的遠端電腦名稱和它們的 IP 位址。

-n (名稱) 列出本機 NetBIOS 名稱。

-r (已解析) 列出由廣播和透過 WINS 解析的名稱

-R (重新載入) 清除和重新載入遠端快取名稱表格

-S (工作階段) 列出有目的地 IP 位址的工作階段表格

-s (階段作業) 列出將目的地 IP 位址轉換成

電腦 NETBIOS 名稱的工作階段表格。

-RR (ReleaseRefresh) 傳送名稱釋放封包到 WINS,然後開始重新整理

RemoteName 遠端的主機電腦名稱。

IP address 以點分隔表示 IP 位址的十進位數。

interval 重新顯示選取的統計資料時,每次顯示之間的暫停

間隔秒數。按 Ctrl+C 鍵可以停止重新顯示

Nmap scan netbios

Nmap -sV -v –script nbstat.nse 10.10.1.22

  • -sV  (serviceVersion)探測端口服務版本
  • -v  (view) 顯示掃描過程,會有很詳細的說明執行到哪個步驟
  • — script nbstat.nse 腳本

列舉user account

可以使用pstools

列舉shared Resources

-使用 net view

net view \\10.10.1.22 /ALL

clip_image003

SNMP Enumeration

UDP 161

Snmp 包含兩個密碼

1.Read Community String-These strings are public. 只允許viewr 設備系統設定

2.Read/Write Community String-These strings are private. 允許遠端編輯設定

攻擊者會使用 public 字串來擷取設備相關資訊

  • Network resource
  • Hosts,routers,share,arp table,routing tables,traffic

Working of  SNMP

1. GetRequest

2. GetNextRequest

3. GetResponse

4. SetRequest

5. Trap

MIB (Management Information Base)

DHCP.MIB :包含用來監視遠端主機與 DHCP 伺服器之間的網路流量的物件類型

HOSTMIB.MIB:監控和管理主機資源

LNMIB2.MIB:包含工作站和服務器服務的對像類型

MIB_II.MIB:使用簡單的架構和系統管理基於 TCP/IP Internet

WINS.MIB:用於 Windows Internet 名稱服務 (WINS)

Snmp enumeration tools

1. Snmpwalk

  • snmpwalk -v1 -c public <target ip address>

2. Snmp-chek ( snmp_enum Module)

開源的tools ,攻擊者可以使用它來收集許多資訊,如 iis , ip , user account ..等資訊

èsnmp-check <target ip address>

clip_image005

3. SpftPerfect Network Scnner (付費軟體)

https://www.softperfect.com/

可以scan port , ping computer,share folder, 經由windows WMI , SNMP,Http,SSH ,PowerShellScan.

4. 其他工具

lNetwork Performance Monitor (https://www.solarwinds.com)

 OpUtils (https://www.managgengine.com)

PRTG Network Monitor (https://www.paessler.com)

Enginner’s Toolset (https://solarwinds.com)

LDAP Enumeration

LDAP is an Internet protocol for accessing distributed directory services.

Directory services may provide any organized set of records, often in a hierarchical and logical structure, such as a corporate email directory.

l A client starts an LDAP session by connecting to a Directory System Agent (DSA), typically on TCP port 389, and sends an operation request to the DSA.

information is transmitted between the client and server using The Basic Encoding Rules (BER)

l attacker query the LDAP service to gather information such as usernames, addresses, departmental details, and server names.

LDAP TCP Port : 389

LDAPS TCP Port: 636 (建議使用)

攻擊者使用LDAP 服務來取得 username,address ,departmental details,取得這些資訊在進行下一步的攻擊。

1. Manual LDAP Enumeration

l Python tools => ldap3

2. Automated LDAP Enumeration

l Nmap

ldap-brute NSE script

nmap -p 389 –script ldap-brute –script-args ldap.base=’ “cn=users,dc=ceh,dc=com”’ <Tarage ip address>

Ldap Enumeration Tools

Softerra Ldap Administrator (https://www.ldapadministrator.com/)

LDAP Administrator 支持 LDAPv2 LDAPv3 協議,並允許使用 OpenLDAPNetscape/iPlanetNovell eDirectoryOracle Internet DirectoryLotus DominoMicrosoft Active DirectoryCA DirectorySiemens DirX 和任何其他 LDAP 服務器。

clip_image007

Ldapseach (https://linux.die.net/)

ldapsearch 打開與 LDAP 服務器的連接,綁定它,並使用指定的參數執行搜索。 過濾器應符合搜索過濾器的字符串表示形式,如 RFC 4515 中所定義。如果未提供,則使用默認過濾器 (objectClass=*)

ldapsearch -h 10.10.1.22 -x

-h LDAP主機IP或可以解析的hostname

-x 使用簡單認證方式

ldapsearch -h 10.10.1.22 -x -s base namingcontexts

-s 指定搜尋範圍, 可選值:base|one|sub|children

clip_image008

ldapsearch -h 10.10.1.22 -x -b “dc=ceh,dc=com”

-b base dn 指定用作搜索起始點的專有名稱。使用引號來指定該值,例如:“ou=West,o=Acme,c=US”

其他 LDAP Enumeration tools

  • AD Explorer (https://docs.microsoft.com)
  • LDAP Admin Tool (https://www.ldapsoft.com)
  • LDAP Account Manager (https://www.ldap-account-manager.org)
  • LDAP Search (http://securityxploded.com)
  • JXplorer

NTP Enumeration

NTP :UDP 123

攻擊者從NTP 可以或的資訊

l 列出連線的hosts

l Client IP system name , OS

l 如果NTP server 位於DMZ,還可以拿到內部IP

指令: netdae,ntptrace,ntpdc,ntpq

Ntptrac : 用來追蹤某部時間伺服器的時間對應關係

Ntptrac [-n ] [-m maxhosts] [servername/ip address]

NFS Enumeration

攻擊者可以列舉NFS 取得NFS 分享目錄,再利用其他方式取得該目錄上傳權限後散步惡意程式來做進一步攻擊。

TCP Port 2049

Rpcinfo -p <target ip address> 掃描NFS 服務

Showmont -e <target ip address> 列出NFS 分享的目錄

Tools

l RPCScan (https://github.com)

Python3 rpc-scan.py <Target ip address> –rpc

l SuperEnum (https://github.com)

  • SupmerEnum

clip_image009

SMTP Enumeartion

SMTP TCP 252525587

提供三個指令

VRFY : Validates users驗證使用者

EXPN : 別名對應的email

RCPT TO:-定義消息的接收者

攻擊者可以透過 telnet 來列舉SMTP 有效的users

Tools

  • Nmap :

Nmap -p 25 -script=smtp-commands <target ip address>

Nmap -p 25 -script=smtp-open-relay <target ip address>

Nmap -p 25 -script=smtp-enum-users <target ip address>

  • Metasploit

=>msf > use auxiliary/scanner/smtp/smtp_enum

l NetScanTools Pro

l Smtp-user-enum

FTP Enumeration

TCP Port : 21 傳遞控制訊息

TCP Port : 20 傳遞資料

Tools

1. nmap -p 21 <target domain>

2. metaspolit

FTP Bounce Attack 參考連結

利用 FTP 在傳輸檔案過程的漏洞來進行攻擊

FTP 中主動模式的 port command 可以對伺服器去設定要連線機器的 IP port

https://ithelp.ithome.com.tw/articles/10188705

TFTP Enumeration

UDP Port :69

Tools :

->PortQry

Portqry.exe -n <target domain/ip> -e 69 -p udp

->nmap

Nmap -p 69 <target domain/ip>

DNS Enumeration

Tools:

  • Disg 指令

Dig ns <taget domain>

Dig @<domain of name server> <target domain> axfr

  • DNSRecon

Dnsrecon -t axfr -d <target domain>

ipsec Enumeration

UDP Port 500

tools:

nmap  -sU -p 500 <target ip address>

ike-scan  -M <target gateway ip address>

Voip Enumeration

UDP/TCP Port 2000,2001,5060,5061

tools

Svmap (https://github.com)

svmap <tarage network rang/ip address>

RPC Enumeration

TCP and UDP port 111 (Linux)

tools:

nmap  -sR <target ip/network>

nmap  -T4  <target ip/network>



本篇瀏覽人數: 1682
分類: CEH, 資訊安全相關。這篇內容的永久連結

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *