Try   HackMD
tags: Tryhackme

Web

BurpSuite

  • proxy
  • Repeater
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
  • Intruder
    • Sniper
      • 攻擊方式:
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →

        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →
    • Battering ram
      • 攻擊方式:
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →
    • Pitchfork
      • 攻擊方式:
        想像成同時運行多個Sniper
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →
    • Cluster bomb
      • 攻擊方式:
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →
    • Encoding/Decoding
      • 作為解/編碼使用

sqlmap

  • 測試種類

    • in of bound
    • out of bound
    • blind
  • Sqlmap Commands

    • basic commend
      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
    • Enumeration commands
      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
    • Operating System access
      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
  • POST & GET 用法

    • post用法

      • 先使用burpsuite攔截封包,並存儲成txt,再將txt檔帶入sqlmap參數中

      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →

      • 語法
        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
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
      • -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

shadow File

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • 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: 幾天建議更換

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]
      • 關於單破解模式下文件格式的說明
        • Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →
    • 自定義規則
      • 通用自定義規則

        • 大寫字母
        • 數字
        • 符號
      • 創立自訂規則

        • 修改文件,位址通常在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 (枚舉使用者)

image

  • net user jeffadmin /domain (根據帳戶的功能來識別帳戶)

image

  • net group /domain (枚舉網域中的群組)

image

  • net group "Sales Department" /domain

image

PowerShell 和 .NET 類別列舉 Active Directory

image