跳到主要內容

Practical Ethical Hacking: 被動偵查Passive Reconnaissance(一)

被動偵查(Passive Reconnaissance): 駭客發動攻擊前的資料蒐集

在對web/主機攻擊之前, 駭客會使用一些既有工具與技術來蒐集相關資料, 包含以下:

1. Target Validation

WHOIS, nslookup, dnsrecon

2. Finding subdomains

Google Fu, dig, nmap, Sublist3r, Bluto, crt.sh, etc.

3. Fingerprinting

Nmap, wappalyzer, whatweb, builtwith, netcat

4. Data Breaches

HaveBeenPwned, Breach-parse, WeLeakInfo


識別目標

1. hunter.io: 找尋目標domain相關的email address

網址https://hunter.io/search

填入欲搜尋的domain, 就能找出可用的電郵位址作為攻擊之用


2. theharvester-kali內建指令, 可將欲搜尋的domain相關資訊在google等搜尋中找出來

但更好用的工具sublist3r, 安裝與使用方法如下

# apt install sublist3r

# sublist3r -d example.com

# sublist3r -d example.com -b ->針對此domain作暴力列舉

# sublist3r -d example.com -t 100 -> 用100個thread去跑, 速度更快




4. Certificate search 列出domain與相關email, 憑證等資訊

最近調查的一個domain, 憑證資訊如下

針對找出的subdomain中有關鍵字vpn, dev, sso, sso-dev, test, stage, mail, qa等, 皆可能是攻擊的入口點






5. OWASP AMASS

安裝方法

# apt-get update

# apt-get install amass

# amass enum -d example.com

# amass enum -v -src -ip -brute -min-for-recursive 2 -d example.com

若出現"The system was unable to build the pool of resolvers", 很可能是amass無法touch到目前預設的DNS服務, 可以用-r參數指定DNS server





留言

這個網誌中的熱門文章

資料序列stationary檢定方法

在這裡指的stationary是指stationary process或stationary time series. 什麼是stationary process? 簡單來說就是在一個process中的data distribution不會經過時間推移或者改變位置就改變, 平均數與變異數也會維持固定, 白雜訊(AWGN)即是一個好例子. 但有些資料序列可能呈現趨勢性(trend), 可能要經過去趨勢性(de-trend)才能顯示stationary的特性, 有些則需要將序列作差分才能顯示 為什麼要確定資料為stationary? 在經濟計量學中, 通常先利用檢定方式確定資料是否呈現stationary, 如否的話檢定資料呈現何種特性, 並做些前處理(如去趨勢性或差分)將資料處理成stationary以方便建立model, 可作為預測未來經濟數據用途 那如何確定資料序列是否為stationary呢? 在這邊Survey了一下幾種常用資料序列檢定方法, 大致可分為兩種: 一、Autoregressive Unit Root Tests 包括以下兩種檢定方式, 其特性是Null hypothesis是假定資料序列擁有unit root(non-stationary), 所以結果出來如果為0表示為擁有unit root,須作差分處理, 1則表示為可能有趨勢性的資料序列, 須作去趨勢性才能呈現stationary 1.Augmented Dickey–Fuller test (ADF): Matlab指令為"adftest" 2.Phillips-Perron test: Matlab指令為"pptest" 二、Stationarity Tests Null hyphthesis與Autoregressive Unit Root Tests相反, 所以結果為0表示為有趨勢性資料, 結果為1表示為需作差分資料, 主要包括下面這個檢定方式 1.KPSS test: Matlab指令為"kpsstest" 另, 所參考文獻中常出現I(0)或I(1), I(0)表示資料序列不需作差分即可顯示stationary, 而I(1)則代表須作一次差分, 資料序列才能呈現stati

Malware常見利用的Windows OS指令與相關參數整理

 1. wbadmin delete catalog -quiet wbadmin 是用來取代以前舊版 Windows 備份用的 ntbackup 工具程式,但是他具備更強大的功能,可以進行排程備份與還原。 上面指令功能: 在安靜模式下刪除catalog 2. vssadmin delete shadows /all /quiet vssadmin是磁碟區陰影複製服務(Volume Shadow Copy Service), 為Windows的一項元件服務, 磁碟區陰影複製服務是一項定時為磁碟區作複製的服務。服務會在磁碟區新增一個名為「陰影複製」(Shadow Copy)的選項。這服務可為離線使用者提供離線檔案服務。 上面指令功能: 將磁碟區上的所有陰影複製在安靜模式刪除掉 3.  wmic shadowcopy delete 上面指令功能: 使用wmic服務將磁碟上的陰影複製刪除, 指令會逐一去詢問 4. icacls "C:\*" /grant Everyone:F /T /C icacls工具可以檢查/變更目錄或檔案權限 上面指令功能: 賦予C槽底下所有檔案有完整存取權限給使用者Everyone, 且不論發生任何檔案錯誤, 都繼續執行操作, 但仍會顯示錯誤訊息 5. takeown /f C:\Windows\System32 將C:\Windows\system32資料夾訪問權賦予給administrator權限 6. bcdedit /set {default} recoveryenabled no bdcedit為開機管理程式, 在Windows 10上,若不正常斷電過多次會有自動保護機制, 詢問是否要Recovery的頁面跳出來, 以上指令就是將這樣的訊息disable掉 7. cmd.exe /c rd /s /q %SYSTEMDRIVE%\\$Recycle.bin  使用rd指令來刪除%SYSTEMDRIVE%\$Recycle.bin目錄和子目錄  /s: 刪除指定目錄和其子目錄  /q: 安靜模式 8. sc.exe config Dnscache start=auto  Restore Default Startup Configuration for DNS Client  http://revertservice.

Windows好用的command line指令

這邊可以下載toolkit,雖然是2003的, 可以在XP上執行: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en 提供功能如下: Acctinfo.dll (documented in Readme.htm) Adlb.exe: Active Directory Load Balancing Tool Admx.msi: ADM File Parser Atmarp.exe: Windows ATM ARP Server Information Tool Atmlane.exe: Windows ATM LAN Emulation Client Information Autoexnt.exe: AutoExNT Service Cdburn.exe: ISO CD-ROM Burner Tool Checkrepl.vbs: Check Replication Chklnks.exe: Link Check Wizard Chknic.exe: Network Interface Card Compliance Tool for Network Load Balancing Cleanspl.exe: Spooler Cleaner Clearmem.exe: Clear Memory Clusdiag.msi: Cluster Diagnostics and Verification Tool Clusfileport.dll: Cluster Print File Port Clusterrecovery.exe: Server Cluster Recovery Utility Cmdhere.inf: Command Here Cmgetcer.dll: Connection Manager Certificate Deployment Tool Compress.exe: Compress Files Confdisk.exe: Disk Configuration Tool Consume.exe: Memory Consum