hashsmith-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/MANIFEST.in +2 -0
- package/README.md +256 -0
- package/bin/index.js +10 -0
- package/dist/hashsmith_cli-0.1.0-py3-none-any.whl +0 -0
- package/dist/hashsmith_cli-0.1.0.tar.gz +0 -0
- package/hashsmith/__init__.py +3 -0
- package/hashsmith/__main__.py +4 -0
- package/hashsmith/algorithms/__init__.py +1 -0
- package/hashsmith/algorithms/cracking.py +276 -0
- package/hashsmith/algorithms/decoding.py +317 -0
- package/hashsmith/algorithms/encoding.py +203 -0
- package/hashsmith/algorithms/hashing.py +223 -0
- package/hashsmith/algorithms/morse.py +64 -0
- package/hashsmith/cli.py +1014 -0
- package/hashsmith/utils/__init__.py +1 -0
- package/hashsmith/utils/banner.py +20 -0
- package/hashsmith/utils/clipboard.py +37 -0
- package/hashsmith/utils/hashdetect.py +33 -0
- package/hashsmith/utils/identify.py +629 -0
- package/hashsmith/utils/io.py +30 -0
- package/hashsmith/utils/metrics.py +20 -0
- package/hashsmith/utils/wordlist.py +11 -0
- package/hashsmith_cli.egg-info/PKG-INFO +272 -0
- package/hashsmith_cli.egg-info/SOURCES.txt +29 -0
- package/hashsmith_cli.egg-info/dependency_links.txt +1 -0
- package/hashsmith_cli.egg-info/entry_points.txt +2 -0
- package/hashsmith_cli.egg-info/requires.txt +4 -0
- package/hashsmith_cli.egg-info/top_level.txt +1 -0
- package/package.json +15 -0
- package/pyproject.toml +3 -0
- package/requirements.txt +4 -0
- package/setup.cfg +23 -0
- package/setup.py +5 -0
- package/wordlists/common.txt +230931 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Utilities for Hashsmith."""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from rich.panel import Panel
|
|
3
|
+
from rich.text import Text
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
ASCII_ART = r"""
|
|
7
|
+
_ _ _ ____ _ _ _
|
|
8
|
+
| | | | __ _ ___| |__ / ___| _ __ ___ (_) |_| |__
|
|
9
|
+
| |_| |/ _` / __| '_ \\___ \| '_ ` _ \| | __| '_ \
|
|
10
|
+
| _ | (_| \__ \ | | |___) | | | | | | | |_| | | |
|
|
11
|
+
|_| |_|\__,_|___/_| |_|____/|_| |_| |_|_|\__|_| |_|
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def render_banner(console: Console, accent: str = "cyan") -> None:
|
|
16
|
+
title = Text("Hashsmith", style=f"bold {accent}")
|
|
17
|
+
subtitle = Text("Modular CLI for encoding, decoding, hashing, cracking", style="dim")
|
|
18
|
+
art = Text(ASCII_ART, style=f"{accent}")
|
|
19
|
+
content = Text.assemble(art, "\n", title, "\n", subtitle)
|
|
20
|
+
console.print(Panel(content, border_style=accent))
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from typing import Sequence, Union
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _run_copy(command: Union[str, Sequence[str]], text: str, shell: bool = False) -> bool:
|
|
9
|
+
try:
|
|
10
|
+
subprocess.run(
|
|
11
|
+
command,
|
|
12
|
+
input=text,
|
|
13
|
+
text=True,
|
|
14
|
+
check=True,
|
|
15
|
+
shell=shell,
|
|
16
|
+
stdout=subprocess.DEVNULL,
|
|
17
|
+
stderr=subprocess.DEVNULL,
|
|
18
|
+
)
|
|
19
|
+
return True
|
|
20
|
+
except Exception:
|
|
21
|
+
return False
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def copy_to_clipboard(text: str) -> bool:
|
|
25
|
+
content = text or ""
|
|
26
|
+
if sys.platform == "darwin":
|
|
27
|
+
return _run_copy(["pbcopy"], content)
|
|
28
|
+
if os.name == "nt":
|
|
29
|
+
return _run_copy("clip", content, shell=True)
|
|
30
|
+
|
|
31
|
+
if shutil.which("wl-copy"):
|
|
32
|
+
return _run_copy(["wl-copy"], content)
|
|
33
|
+
if shutil.which("xclip"):
|
|
34
|
+
return _run_copy(["xclip", "-selection", "clipboard"], content)
|
|
35
|
+
if shutil.which("xsel"):
|
|
36
|
+
return _run_copy(["xsel", "--clipboard", "--input"], content)
|
|
37
|
+
return False
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def detect_hash_types(hash_value: str) -> List[str]:
|
|
5
|
+
value = hash_value.strip()
|
|
6
|
+
if value.startswith(("$2a$", "$2b$", "$2y$")):
|
|
7
|
+
return ["bcrypt"]
|
|
8
|
+
if value.startswith("$argon2"):
|
|
9
|
+
return ["argon2"]
|
|
10
|
+
if value.startswith("scrypt$"):
|
|
11
|
+
return ["scrypt"]
|
|
12
|
+
if value.lower().startswith("0x0100"):
|
|
13
|
+
return ["mssql2005", "mssql2012"]
|
|
14
|
+
if value.startswith("md5") and len(value) == 35:
|
|
15
|
+
return ["postgres"]
|
|
16
|
+
if value.startswith("*") and len(value) == 41:
|
|
17
|
+
return ["mysql41"]
|
|
18
|
+
|
|
19
|
+
hex_value = value.lower()
|
|
20
|
+
is_hex = all(ch in "0123456789abcdef" for ch in hex_value)
|
|
21
|
+
if not is_hex:
|
|
22
|
+
return []
|
|
23
|
+
|
|
24
|
+
length_map = {
|
|
25
|
+
16: ["mysql323"],
|
|
26
|
+
32: ["md5", "md4", "ntlm"],
|
|
27
|
+
40: ["sha1", "mssql2000"],
|
|
28
|
+
56: ["sha224", "sha3_224"],
|
|
29
|
+
64: ["sha256", "sha3_256", "blake2s"],
|
|
30
|
+
96: ["sha384"],
|
|
31
|
+
128: ["sha512", "sha3_512", "blake2b"],
|
|
32
|
+
}
|
|
33
|
+
return length_map.get(len(hex_value), [])
|