###### tags: `Tryhackme` # Web ## BurpSuite - proxy - FoxyProxy Basic: - https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-basic/ - Repeater -  -  -  - Intruder - Sniper - 攻擊方式:   - Battering ram - 攻擊方式:  - Pitchfork - 攻擊方式: 想像成同時運行多個Sniper  - Cluster bomb - 攻擊方式:  - Encoding/Decoding - 作為解/編碼使用 ## sqlmap - 測試種類 - in of bound - out of bound - blind - Sqlmap Commands - basic commend  - Enumeration commands  - Operating System access  - POST & GET 用法 - post用法 - 先使用burpsuite攔截封包,並存儲成txt,再將txt檔帶入sqlmap參數中  - 語法 `sqlmap -r <request_file> -p <vulnerable_parameter> --dbs` - GET用法 `sqlmap -u https://testsite.com/page.php?id=7 -D <database_name> -T <table_name> --columns` # crypto ## hashcat - crackstation 線上破解hash (https://crackstation.net/) - hash analyzer (https://www.tunnelsup.com/hash-analyzer/) - hashcat - `hashcat --help | grep {你要的hash}` : 查hash的代碼 - `hashcat -m {hash的代號} <shadow_file> <passwordlist> --force` -  - -a:attack-mode - 3 代表Brute-force模式 - 0: single 模式 - 1: 單字組合模式 - 暴力格式 - ?l:表示小寫字母,a~z - ?u:表示大寫字母,A~Z - ?h:代表16進位大寫,即0123456789ABCDEF - ?H:代表16進位小寫,即0123456789abcdef - ?s:特殊的ASCII符號,即!”#$%&’()*+,-./:;<=>?@[]^_`{|}~ - ?a:表示所有字元 - ?b:0x00 - 0xff ## hash-identifier - https://gitlab.com/kalilinux/packages/hash-identifier/-/tree/kali/master ## shadow File  - linux 機器上儲存密碼真實的地方 - 放在/etc/shadow裡,root權限才能查看 - 拿個shadow file來舉例,裡面的架構如下 - jack: 使用者名稱 - $6: 加密演算法 - $1 = MD5 hashing algorithm. - $2 =Blowfish Algorithm. - $2a =eksblowfish Algorithm - $5 =SHA-256 Algorithm - $6 =SHA-512 Algorithm - `$G2zG9OBU`: salt - `$9PtyoiQbma1ZNX5kQhVH9gyLeKSq6ge5tGnYYswKhWpnl2MHgjOIQ9Z/IDr5ohganBnpQH25UevJP5CKhPvQW0` : hashed password - `18386`: 上一次密碼的更新時間 - `0`: 兩次要更新密碼之間的天數要少於0天 - `99999`: password有效天數 - `7`: 幾天建議更換 ### 取得shadow後進行爆破(hashcat) - 提取 hash ``` # 直接提取特定用戶(例如 jack) grep '^jack:' /etc/shadow > hash.txt # 或只取 hash 部分 awk -F: '/^jack:/{print $2}' /etc/shadow > hash.txt ``` - 根據 hash 類型選擇模式 - `$6` 是 `SHA-512` - 破解指令 ``` # 字典攻擊(最常用) hashcat -m 1800 hash.txt /usr/share/wordlists/rockyou.txt # 掩碼攻擊 - 4位小寫 hashcat -m 1800 hash.txt -a 3 ?l?l?l?l # 掩碼攻擊 - 6位小寫+數字 hashcat -m 1800 hash.txt -a 3 ?a?a?a?a?a?a # 規則攻擊(字典+變形) hashcat -m 1800 hash.txt rockyou.txt -r /usr/share/hashcat/rules/best64.rule ``` ### 取得shadow後進行爆破(john) - 合併 passwd 和 shadow ``` unshadow /etc/passwd /etc/shadow > unshadowed.txt ``` ## John The Ripper - Basic Syntax - john [options] [path to file] - 自動破解 - john --wordlist=[path to wordlist] [path to file] - 特定格式的破解 - john --format=[format] --wordlist=[path to wordlist] [path to file] - ex:john --format=raw-md5 -wordlist=rockyou.txt hash_to_crack.txt - 關於格式的註釋 Tpis:MD5的format前面需要有前綴,但不是每個格式都需要,可以用下列方式查找 - `john --list=formats | grep -iF "md5"` - NTLM的格式為"NT" - 取消linux shadow file - `unshadow [path to passwd] [path to shadow]` - unshadow- 調用取消陰影工具 - [path to passwd] 包含您從目標機器獲取的 /etc/passwd 文件副本的文件 - [path to shadow] 包含您從目標機器獲取的 /etc/shadow 文件副本的文件 - single crack - `john --single --format=[format] [path to file]` - 關於單破解模式下文件格式的說明 -  - 自定義規則 - 通用自定義規則 - 大寫字母 - 數字 - 符號 - 創立自訂規則 - 修改文件,位址通常在`john.conf` `etc/john/john.conf` - 使用正則表達示來完成自訂規則 - [List.Rules:THMRules] - [0-9]- 將包括數字 0-9 - [0]- 將只包括數字 0 - [A-z]- 將包括大寫和小寫 - [A-Z]- 將只包含大寫字母 - [a-z]- 將只包含小寫字母 - [a]- 將只包括一個 - [!£$%@] - 將包括符號 !£$%@ - 使用自訂義規則 - john — wordlist=[path to wordlist] — rule=PoloPassword [path to file] - Zip2John - 將 zip 文件轉換為 John 能夠理解並有望破解的哈希格式 - zip2john [options] [zip file] > [output file] - `zip2john zipfile.zip > zip_hash.txt` - Rar2John - rar2john [rar file] > [output file] - SSH2John - ssh2john、python3 /opt/ssh2john.py - python/usr/share/john/ssh2john.py - cracking - john --wordlist=rockyou.txt *.txt # Active Directory ## Manual Enumeration ### net.exe - net user /domain (枚舉使用者)  - net user jeffadmin /domain (根據帳戶的功能來識別帳戶)  - net group /domain (枚舉網域中的群組)  - net group "Sales Department" /domain  ### PowerShell 和 .NET 類別列舉 Active Directory - [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()  -
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up