tech:cracking
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| tech:cracking [2020/11/19 10:08] – [Total Commander FTP Passwörter] lutz | tech:cracking [2026/03/06 08:21] (aktuell) – gelöscht lutz | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Windows Passwörter ====== | ||
| - | Es gibt zwei Hash-Algorithmen unter Windows: das veraltete LM und das neuere NTLM bzw. NTLMv2. Da LM die Sicherheit eines Systems aushebeln kann, sollte es unbedingt deaktiviert werden. Hierfür muss folgender Registry Schlüssel erzeugt werden: | ||
| - | |||
| - | HKLM\System\CurrentControlSet\Control\LSA | ||
| - | NoLMHash | ||
| - | |||
| - | Die Passwörter werden in der SAM Datenbank gespeichert: | ||
| - | |||
| - | C: | ||
| - | oder | ||
| - | HKLM\SAM | ||
| - | |||
| - | Diese Datenbank ist im laufenden System nicht lesbar, man muss also offline auf die Platte zugreifen oder die Werte aus dem RAM auslesen. Letzteres macht beispielsweise PGDump. | ||
| - | |||
| - | ====== Total Commander FTP Passwörter ====== | ||
| - | Folgendes Python Skript entschlüsselt die gespeicherten FTP Passwörter, | ||
| - | |||
| - | <sxh python> | ||
| - | import os | ||
| - | import optparse | ||
| - | |||
| - | def process_file(filename): | ||
| - | try: | ||
| - | print(" | ||
| - | f = open(filename," | ||
| - | print(" | ||
| - | print(" | ||
| - | print("" | ||
| - | for line in f: | ||
| - | if (" | ||
| - | print(" | ||
| - | else: print(line.strip()) | ||
| - | f.close() | ||
| - | print("" | ||
| - | except IOError: | ||
| - | print(" | ||
| - | print("" | ||
| - | |||
| - | def search_ini(): | ||
| - | """ | ||
| - | Search the wcx_ftp.ini file in common places | ||
| - | """ | ||
| - | folder = [] | ||
| - | folder.append(os.getenv(' | ||
| - | folder.append(os.getenv(' | ||
| - | folder.append(" | ||
| - | for ini in folder: | ||
| - | process_file(ini) | ||
| - | |||
| - | def tc_random(nMax): | ||
| - | global RANDOM_BASE | ||
| - | RANDOM_BASE = ((RANDOM_BASE * 0x8088405) & 0xffffffff) + 1 | ||
| - | return (((RANDOM_BASE * nMax) >> 32)& 0xffffffff) | ||
| - | |||
| - | def tc_shift(n1, | ||
| - | return (((n1 << n2) & 0xffffffff) | ((n1 >> (8 - n2)) & 0xffffffff)) & 0xff | ||
| - | |||
| - | def tc_decrypt(pwd): | ||
| - | global RANDOM_BASE | ||
| - | password=[] | ||
| - | for i in range(int(len(pwd)/ | ||
| - | password.append(int(pwd[2*i: | ||
| - | pwlen = len(password) | ||
| - | |||
| - | RANDOM_BASE = 849521 | ||
| - | |||
| - | for i in range(pwlen): | ||
| - | password[i] = tc_shift(password[i], | ||
| - | |||
| - | RANDOM_BASE = 12345 | ||
| - | for i in range(256): | ||
| - | a=tc_random(pwlen) | ||
| - | b=tc_random(pwlen) | ||
| - | password[a], | ||
| - | |||
| - | RANDOM_BASE = 42340 | ||
| - | for i in range(pwlen): | ||
| - | password[i] = (password[i] ^ tc_random(256)) & 0xff | ||
| - | |||
| - | RANDOM_BASE = 54321 | ||
| - | for i in range(pwlen): | ||
| - | password[i] = (password[i] - tc_random(256)) & 0xff | ||
| - | |||
| - | for i in range(pwlen): | ||
| - | password[i] = chr(password[i]) | ||
| - | |||
| - | return "" | ||
| - | |||
| - | def main(): | ||
| - | usage = " | ||
| - | parser = optparse.OptionParser(usage=usage) | ||
| - | |||
| - | parser.add_option(' | ||
| - | default=False, | ||
| - | parser.add_option(' | ||
| - | help=' | ||
| - | parser.add_option(' | ||
| - | default='', | ||
| - | options, args = parser.parse_args() | ||
| - | if options.common: | ||
| - | search_ini() | ||
| - | if (options.file != "" | ||
| - | process_file(options.file) | ||
| - | if (options.password != "" | ||
| - | pw = tc_decrypt(options.password) | ||
| - | print(" | ||
| - | if (options.file == "" | ||
| - | print(" | ||
| - | |||
| - | if __name__ == ' | ||
| - | main() | ||
| - | </ | ||
tech/cracking.1605780480.txt.gz · Zuletzt geändert: von lutz