• XSS.stack #1 – первый литературный журнал от юзеров форума

Hashing type?

Решение
This script is capable of identifying various hash algorithms based on the length and format of the hash. This includes algorithms like MD5, SHA-1, SHA-256, SHA-512, and even Base64. This script can be very helpful to you.

1722935681295.png



requirements :
pip install numpy scikit-learn


Identify hash Script :
Python:
import base64
import re
import json
import numpy as np
from sklearn.ensemble import RandomForestClassifier
import argparse

hash_length_map = {
    32: ["MD5 (128-bit)", "RIPEMD-128 (128-bit)"],
    40: ["SHA-1 (160-bit)", "RIPEMD-160 (160-bit)"],
    56: ["SHA-224 (224-bit)", "SHA3-224 (224-bit)"],
    64: ["SHA-256 (256-bit)", "BLAKE2b (256-bit)", "BLAKE2s (256-bit)", "RIPEMD-256 (256-bit)", "SHA3-256 (256-bit)"]...
Can anyone tell what kind of hash and salt it is?

0a964705107e1bfe3e5435b7ef0d1e11

0a860d6bf3baba290e31c50930d71fb2

0ab09bc7d30b1e0cb6f13b12b043995b

Looks like md5, try to crack it with hashcat or johntheripper see if you get lucky.
 
d053c425a316c463d031g252c302c515a236
c553a225b324c303b731g234d052c515h226c321d0
c653a224c311c543a433g151c262c615a7
c273d115c244c512d326b235
d163a224g305b512c322h147
d063c522h321b512c322h147


736db6737d78876dba6f9e36775db56b
775d77739db86f7d7a6f9e376badf76b6e76737d35
774e77738db96b7d7a738eb7774df5836e76737d36739d796b6dfa
73ae776b6db8737d75739e376b8df7835e75736eb673ad796b
736ef7775d79736e38739d76777dba6f6df9
775eb76b6db8837d396f9d76737db6875e3b
 
This script is capable of identifying various hash algorithms based on the length and format of the hash. This includes algorithms like MD5, SHA-1, SHA-256, SHA-512, and even Base64. This script can be very helpful to you.

1722935681295.png



requirements :
pip install numpy scikit-learn


Identify hash Script :
Python:
import base64
import re
import json
import numpy as np
from sklearn.ensemble import RandomForestClassifier
import argparse

hash_length_map = {
    32: ["MD5 (128-bit)", "RIPEMD-128 (128-bit)"],
    40: ["SHA-1 (160-bit)", "RIPEMD-160 (160-bit)"],
    56: ["SHA-224 (224-bit)", "SHA3-224 (224-bit)"],
    64: ["SHA-256 (256-bit)", "BLAKE2b (256-bit)", "BLAKE2s (256-bit)", "RIPEMD-256 (256-bit)", "SHA3-256 (256-bit)"],
    96: ["SHA-384 (384-bit)", "SHA3-384 (384-bit)"],
    128: ["SHA-512 (512-bit)", "SHA3-512 (512-bit)", "RIPEMD-320 (320-bit)"],
    43: ["Base64 (32-byte input)", "MD5 Base64 (128-bit)"],
    56: ["Base64 (40-byte input)", "SHA-1 Base64 (160-bit)"],
    88: ["Base64 (64-byte input)", "SHA-256 Base64 (256-bit)"],
    120: ["Base64 (96-byte input)", "SHA-384 Base64 (384-bit)"],
    172: ["Base64 (128-byte input)", "SHA-512 Base64 (512-bit)"]
}

X_train = np.array([
    [32], [40], [56], [64], [96], [128], [43], [56], [88], [120], [172]
])
y_train = [
    "MD5 (128-bit), RIPEMD-128 (128-bit)",
    "SHA-1 (160-bit), RIPEMD-160 (160-bit)",
    "SHA-224 (224-bit), SHA3-224 (224-bit)",
    "SHA-256 (256-bit), BLAKE2b (256-bit), BLAKE2s (256-bit), RIPEMD-256 (256-bit), SHA3-256 (256-bit)",
    "SHA-384 (384-bit), SHA3-384 (384-bit)",
    "SHA-512 (512-bit), SHA3-512 (512-bit), RIPEMD-320 (320-bit)",
    "Base64 (32-byte input), MD5 Base64 (128-bit)",
    "Base64 (40-byte input), SHA-1 Base64 (160-bit)",
    "Base64 (64-byte input), SHA-256 Base64 (256-bit)",
    "Base64 (96-byte input), SHA-384 Base64 (384-bit)",
    "Base64 (128-byte input), SHA-512 Base64 (512-bit)"
]

model = RandomForestClassifier(n_estimators=100)
model.fit(X_train, y_train)

def is_base64(s):
    try:
        if isinstance(s, str):
            s_bytes = s.encode('ascii')
        elif isinstance(s, bytes):
            s_bytes = s
        else:
            return False
        return base64.b64encode(base64.b64decode(s_bytes)).decode('ascii') == s
    except Exception:
        return False

def identify_hash_algorithm(hash_value):
    length = len(hash_value)

    if re.fullmatch(r'[0-9a-fA-F]+', hash_value):
        format_type = "Hex"
    elif is_base64(hash_value):
        format_type = "Base64"
    else:
        format_type = "Unknown"

    if format_type == "Hex":
        if length in hash_length_map:
            return ", ".join(hash_length_map[length]), None
        else:
            prediction = model.predict([[length]])[0]
            return prediction, None
    elif format_type == "Base64":
        decoded_hash = base64.b64decode(hash_value)
        decoded_content = decoded_hash.decode('utf-8', 'ignore')
        length = len(decoded_hash) * 2
        if length in hash_length_map:
            return f"Base64 encoded hash detected. Possible algorithms: {', '.join(hash_length_map[length])}", decoded_content
        else:
            prediction = model.predict([[length]])[0]
            return f"Base64 encoded hash detected. Possible algorithms: {prediction}", decoded_content
    else:
        return "Unknown or Unsupported Hash Algorithm", None

def compare_with_known_hashes(hash_value):
    known_hashes = {
        "5d41402abc4b2a76b9719d911017c592": "hello (MD5)",
        "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c": "hello (SHA-1)",
        "b94d27b9934d3e08a52e52d7da7dabfa2cfdd92d": "hello (SHA-224)",
        "aGVsbG8=": "hello (Base64)"
    }
    return known_hashes.get(hash_value, "No match found")

def process_hashes(hashes):
    results = {}
    for hash_value in hashes:
        identified_algorithm, decoded_content = identify_hash_algorithm(hash_value)
        known_hash_match = compare_with_known_hashes(hash_value)
        results[hash_value] = {
            "identified_algorithm": identified_algorithm,
            "decoded_content": decoded_content,
            "known_hash_match": known_hash_match
        }
    return results

def save_report(results, filename='report.json'):
    with open(filename, 'w') as file:
        json.dump(results, file, indent=4)
    print(f"Report saved to {filename}")

def main():
    parser = argparse.ArgumentParser(description="Hash Algorithm Identifier CLI")
    parser.add_argument('hashes', nargs='*', help="Hashes to identify")
    parser.add_argument('-f', '--file', help="File containing hashes to identify")
    parser.add_argument('-o', '--output', help="Output file for the report", default='report.json')
    
    args = parser.parse_args()
    
    hashes = args.hashes

    if args.file:
        try:
            with open(args.file, 'r') as file:
                hashes.extend([line.strip() for line in file])
        except FileNotFoundError:
            print("File not found.")
            return
    
    if not hashes:
        print("No hashes provided.")
        return
    
    results = process_hashes(hashes)
    
    for hash_value, result in results.items():
        print(f"Hash: {hash_value} -> Identified: {result['identified_algorithm']}, Known Match: {result['known_hash_match']}")
        if result['decoded_content']:
            print(f"Decoded Content: {result['decoded_content']}")
    
    save_report(results, args.output)

if __name__ == "__main__":
    main()
 
Решение
я всегда смотрю тут
 
d053c425a316c463d031g252c302c515a236
c553a225b324c303b731g234d052c515h226c321d0
c653a224c311c543a433g151c262c615a7
c273d115c244c512d326b235
d163a224g305b512c322h147
d063c522h321b512c322h147


736db6737d78876dba6f9e36775db56b
775d77739db86f7d7a6f9e376badf76b6e76737d35
774e77738db96b7d7a738eb7774df5836e76737d36739d796b6dfa
73ae776b6db8737d75739e376b8df7835e75736eb673ad796b
736ef7775d79736e38739d76777dba6f6df9
775eb76b6db8837d396f9d76737db6875e3b
"736db6737d78876dba6f9e36775db56b" :
MD5 [HC: 0] [JtR: raw-md5]
LM [HC: 3000] [JtR: lm]
NTLM [HC: 1000] [JtR: nt]
Domain Cached Credentials (DCC), MS Cache [HC: 1100] [JtR: mscash]
Domain Cached Credentials 2 (DCC2), MS Cache 2 [HC: 2100] [JtR: mscash2]
MD2 [JtR: md2]
MD4 [HC: 900] [JtR: raw-md4]
Haval-128 (4 rounds) [JtR: haval-128-4]
Lotus Notes/Domino 5 [HC: 8600] [JtR: lotus5]
Skype [HC: 23]
IPB 2.x (Invision Power Board) [HC: 2810]
Keyed MD5: RIPv2, OSPF, BGP, SNMPv2 [JtR: net-md5]
RIPEMD-128 [JtR: ripemd-128]
Snefru-128 [JtR: snefru-128]
IPMI 2.0 RAKP HMAC-MD5 [HC: 7350]
DNSSEC (NSEC3) [HC: 8300]
RAdmin v2.x [HC: 9900] [JtR: radmin]
Umbraco HMAC-SHA1 [HC: 24800]
Bitcoin WIF private key (P2PKH), compressed [HC: 28501]
Bitcoin WIF private key (P2PKH), uncompressed [HC: 28502]
____________
"736ef7775d79736e38739d76777dba6f6df9" , "775eb76b6db8837d396f9d76737db6875e3b" :
Umbraco HMAC-SHA1 [HC: 24800]
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх