Skip to content

Commit 1b3951c

Browse files
committed
v0.1.4
-now using secretsdump ntdsclass instead subprocess -now always outputs to txt. when -csv switch is used it generates individual csv for it. # special thanks to alexander neff
1 parent f247a65 commit 1b3951c

File tree

6 files changed

+28
-21
lines changed

6 files changed

+28
-21
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## about revealhashed-python v0.1.3
2+
## about revealhashed-python v0.1.4
33
revealhashed is a streamlined utility to correlate ntds usernames, nt hashes, and cracked passwords in one view while cutting out time-consuming manual tasks.
44

55
## how to install
@@ -10,14 +10,14 @@ from github:
1010
`pipx install git+https://github.com/crosscutsaw/revealhashed-python`
1111

1212
from deb package:
13-
`wget https://github.com/crosscutsaw/revealhashed-python/releases/latest/download/revealhashed_0.1.3_all.deb; apt install ./revealhashed_0.1.3_all.deb'`
13+
`wget https://github.com/crosscutsaw/revealhashed-python/releases/latest/download/revealhashed_0.1.4_all.deb; apt install ./revealhashed_0.1.4_all.deb'`
1414

1515
## don't want to install?
1616
grab revealhashed binary from [here](https://github.com/crosscutsaw/revealhashed-python/releases/latest/download/revealhashed).
1717

1818
## how to use
1919
```
20-
revealhashed v0.1.3
20+
revealhashed v0.1.4
2121
2222
usage: revealhashed [-h] [-r] {dump,reveal} ...
2323
@@ -35,7 +35,7 @@ just execute `revealhashed -r` to remove contents of ~/.revealhashed
3535

3636
### revealhashed dump
3737
```
38-
revealhashed v0.1.3
38+
revealhashed v0.1.4
3939
4040
usage: revealhashed dump [-h] [-debug] [-hashes HASHES] [-no-pass] [-k] [-aesKey AESKEY] [-dc-ip DC_IP] [-codec CODEC] -w WORDLIST WORDLIST2 [WORDLIST WORDLIST2 ...] [-e] [-nd] [-csv] target
4141
```
@@ -45,14 +45,14 @@ this command executes [zblurx's ntdsutil.py](https://github.com/zblurx/ntdsutil.
4545
-w (wordlist) switch is needed. one or more wordlists can be supplied.
4646
-e (enabled-only) switch is not needed but suggested. it's self explanatory; only shows enabled users.
4747
-nd (no-domain) switch hides domain names in usernames.
48-
-csv (csv) switch is self explanatory; saves output to csv instead txt.
48+
-csv (csv) switch is self explanatory; saves output to csv, together with txt.
4949

5050
for example:
5151
`revealhashed dump '<domain>/<username>:<password>'@<dc_ip> -w wordlist1.txt wordlist2.txt -e -nd -csv`
5252

5353
### revealhashed reveal
5454
```
55-
revealhashed v0.1.3
55+
revealhashed v0.1.4
5656
5757
usage: revealhashed reveal [-h] [-ntds NTDS] [-nxc] [-w WORDLIST WORDLIST2 [WORDLIST WORDLIST2 ...]] [-e] [-nd] [-csv]
5858
@@ -75,7 +75,7 @@ _ntds file should contain usernames and hashes. it should be not ntds.dit. examp
7575
-w (wordlist) switch is needed. one or more wordlists can be supplied.
7676
-e (enabled-only) switch is not needed but suggested. it's self explanatory; only shows enabled users.
7777
-nd (no-domain) switch hides domain names in usernames.
78-
-csv (csv) switch is self explanatory; saves output to csv instead txt.
78+
-csv (csv) switch is self explanatory; saves output to csv, together with txt.
7979

8080
for example:
8181
`revealhashed reveal -ntds <ntds_file>.ntds -w wordlist1.txt -e -nd -csv`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "revealhashed"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "Dump or analyze existing NTDS data, crack NT hashes with hashcat and match them to their corresponding user accounts."
55
authors = [{ name = "aslan emre aslan", email = "emre@zurrak.com" }]
66
license = { text = "MIT" }

revealhashed/core.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
import shutil
88
import sys
99
import csv
10+
import logging
1011
from collections import defaultdict
1112
from datetime import datetime
1213
from pathlib import Path
14+
15+
# hide secretsdump hash output
1316
from contextlib import redirect_stdout
1417

1518
# zblurx's ntdsutil.py
@@ -32,6 +35,9 @@
3235
BOLD_WHITE = "\033[1;37m"
3336
RESET = "\033[0m"
3437

38+
# hide secretsdump info outputs
39+
logging.getLogger("impacket").disabled = True
40+
3541
def parse_args():
3642
parser = argparse.ArgumentParser(
3743
description=""
@@ -174,25 +180,26 @@ def reveal_credentials(individual_ntds_path, cracked_hashes, session_dir, enable
174180
for _, _, line_out, _ in output_lines:
175181
print(line_out)
176182

183+
output_file_txt = session_dir / "revealhashed.txt"
184+
with open(output_file_txt, "w") as outf:
185+
for password_key, user, _, status in output_lines:
186+
status_str = " <disabled>" if status == "disabled" else ""
187+
outf.write(f"{user:<40} {password_key}{status_str}\n")
188+
189+
print(f"\n{BOLD_GREEN}[+]{RESET} Output saved to {output_file_txt}")
190+
177191
if to_csv:
178-
output_file = session_dir / "revealhashed.csv"
179-
with open(output_file, "w", newline="") as outf:
192+
output_file_csv = session_dir / "revealhashed.csv"
193+
with open(output_file_csv, "w", newline="") as outf:
180194
writer = csv.writer(outf)
181195
writer.writerow(["Username", "Password", "Status"])
182196
for password_key, user, _, status in output_lines:
183197
stat = "disabled" if status == "disabled" else ""
184198
writer.writerow([user, password_key, stat])
185-
else:
186-
output_file = session_dir / "revealhashed.txt"
187-
with open(output_file, "w") as outf:
188-
for password_key, user, _, status in output_lines:
189-
status_str = " <disabled>" if status == "disabled" else ""
190-
outf.write(f"{user:<40} {password_key}{status_str}\n")
191-
192-
print(f"\n{BOLD_GREEN}[+]{RESET} Output saved to {output_file}")
199+
print(f"{BOLD_GREEN}[+]{RESET} Output saved to {output_file_csv}")
193200

194201
def main():
195-
print(f"\n{BOLD_BLUE}revealhashed v0.1.3{RESET}\n")
202+
print(f"\n{BOLD_BLUE}revealhashed v0.1.4{RESET}\n")
196203

197204
parser = parse_args()
198205
args = parser.parse_args()
@@ -239,7 +246,7 @@ def main():
239246
local_ops = LocalOperations(str(system_path))
240247
boot_key = local_ops.getBootKey()
241248

242-
with open(os.devnull, 'w') as fnull, redirect_stdout(fnull):
249+
with open(os.devnull, 'w') as fnull, redirect_stdout(fnull): # hide secretsdump hash output
243250
ntds = NTDSHashes(
244251
str(ntds_path),
245252
boot_key,
@@ -337,7 +344,7 @@ def main():
337344
if __name__ == "__main__":
338345
main()
339346

340-
# revealhashed v0.1.3
347+
# revealhashed v0.1.4
341348
#
342349
# contact options
343350
# mail: https://blog.zurrak.com/contact.html

rp1.PNG

5.08 KB
Loading

rp2.PNG

-7.25 KB
Loading

rp3.PNG

-158 Bytes
Loading

0 commit comments

Comments
 (0)