aliasr 1.0.0__py3-none-any.whl

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.
Files changed (100) hide show
  1. aliasr/__init__.py +0 -0
  2. aliasr/__main__.py +163 -0
  3. aliasr/app.py +101 -0
  4. aliasr/audit.py +788 -0
  5. aliasr/core/bootstrap.py +114 -0
  6. aliasr/core/cheats.py +281 -0
  7. aliasr/core/config.py +271 -0
  8. aliasr/core/creds.py +218 -0
  9. aliasr/core/globals.py +294 -0
  10. aliasr/core/inject.py +106 -0
  11. aliasr/core/list.py +149 -0
  12. aliasr/core/scan.py +441 -0
  13. aliasr/core/tmux.py +52 -0
  14. aliasr/core/variations.py +149 -0
  15. aliasr/data/cheats/ad/active_directory.md +12 -0
  16. aliasr/data/cheats/ad/bloodhound.md +12 -0
  17. aliasr/data/cheats/ad/bloodyad.md +62 -0
  18. aliasr/data/cheats/ad/certipy.md +42 -0
  19. aliasr/data/cheats/ad/impacket/impacket-kerberos.md +72 -0
  20. aliasr/data/cheats/ad/impacket/impacket-misc.md +27 -0
  21. aliasr/data/cheats/ad/impacket/ntlmrelayx.md +27 -0
  22. aliasr/data/cheats/ad/impacket/nxc-misc.md +6 -0
  23. aliasr/data/cheats/ad/impacket/secretsdump.md +17 -0
  24. aliasr/data/cheats/ad/kerbrute.md +27 -0
  25. aliasr/data/cheats/ad/lsass.md +7 -0
  26. aliasr/data/cheats/ad/netexec.md +47 -0
  27. aliasr/data/cheats/ad/ntlm_theft.md +7 -0
  28. aliasr/data/cheats/ad/powerview.md +62 -0
  29. aliasr/data/cheats/ad/pygpoabuse.md +9 -0
  30. aliasr/data/cheats/ad/remote_execution.md +7 -0
  31. aliasr/data/cheats/ad/rpcclient.md +12 -0
  32. aliasr/data/cheats/ad/targetedkerberoast.md +7 -0
  33. aliasr/data/cheats/ad/techniques/coercion.md +47 -0
  34. aliasr/data/cheats/ad/techniques/relay.md +7 -0
  35. aliasr/data/cheats/cloud/aws/aws.md +12 -0
  36. aliasr/data/cheats/cloud/azure/aadinternals.md +7 -0
  37. aliasr/data/cheats/cloud/azure/azure.md +32 -0
  38. aliasr/data/cheats/cloud/gcp/gcp.md +7 -0
  39. aliasr/data/cheats/cracking/john.md +7 -0
  40. aliasr/data/cheats/linux/linux_privesc.md +73 -0
  41. aliasr/data/cheats/linux/utils/exiftool.md +7 -0
  42. aliasr/data/cheats/linux/utils/faketime.md +7 -0
  43. aliasr/data/cheats/linux/utils/grep.md +7 -0
  44. aliasr/data/cheats/linux/utils/keepass.md +12 -0
  45. aliasr/data/cheats/linux/utils/msfvenom.md +12 -0
  46. aliasr/data/cheats/linux/utils/openssl.md +12 -0
  47. aliasr/data/cheats/linux/utils/ssh-keygen.md +7 -0
  48. aliasr/data/cheats/linux/utils/sshpass.md +7 -0
  49. aliasr/data/cheats/linux/utils/username-anarchy.md +12 -0
  50. aliasr/data/cheats/misc/git.md +7 -0
  51. aliasr/data/cheats/misc/hackthebox.md +22 -0
  52. aliasr/data/cheats/misc/host_discovery.md +22 -0
  53. aliasr/data/cheats/protocols/dns.md +17 -0
  54. aliasr/data/cheats/protocols/ftp.md +17 -0
  55. aliasr/data/cheats/protocols/ldap.md +22 -0
  56. aliasr/data/cheats/protocols/mssql.md +12 -0
  57. aliasr/data/cheats/protocols/nfs.md +17 -0
  58. aliasr/data/cheats/protocols/rdp.md +17 -0
  59. aliasr/data/cheats/protocols/smb.md +17 -0
  60. aliasr/data/cheats/protocols/smtp.md +22 -0
  61. aliasr/data/cheats/protocols/snmp.md +12 -0
  62. aliasr/data/cheats/protocols/winrm.md +12 -0
  63. aliasr/data/cheats/variations.toml +114 -0
  64. aliasr/data/cheats/web/ffuf.md +44 -0
  65. aliasr/data/cheats/web/git-dumper.md +7 -0
  66. aliasr/data/cheats/web/sqlmap.md +17 -0
  67. aliasr/data/cheats/web/web.md +12 -0
  68. aliasr/data/cheats/windows/dpapi.md +27 -0
  69. aliasr/data/cheats/windows/windows_exploitation.md +31 -0
  70. aliasr/data/cheats/windows/windows_privesc.md +88 -0
  71. aliasr/data/config.toml +94 -0
  72. aliasr/data/wiki/Cheats.md +122 -0
  73. aliasr/data/wiki/Variations.md +47 -0
  74. aliasr/tui/build_screen/build_screen.py +518 -0
  75. aliasr/tui/build_screen/param_screen.py +318 -0
  76. aliasr/tui/build_screen/variations_screen.py +291 -0
  77. aliasr/tui/creds_screen/cred_editor.py +87 -0
  78. aliasr/tui/creds_screen/creds_screen.py +311 -0
  79. aliasr/tui/globals_screen/global_editor.py +271 -0
  80. aliasr/tui/globals_screen/globals_screen.py +337 -0
  81. aliasr/tui/globals_screen/new_global.py +118 -0
  82. aliasr/tui/main.tcss +409 -0
  83. aliasr/tui/main_screen/cheatlist.py +118 -0
  84. aliasr/tui/main_screen/globals_grid.py +260 -0
  85. aliasr/tui/main_screen/header.py +21 -0
  86. aliasr/tui/main_screen/main_screen.py +561 -0
  87. aliasr/tui/main_screen/search_bar/indicators.py +36 -0
  88. aliasr/tui/main_screen/search_bar/search_bar.py +512 -0
  89. aliasr/tui/theme.py +43 -0
  90. aliasr/tui/tree_screen.py +177 -0
  91. aliasr/tui/utils/common.py +14 -0
  92. aliasr/tui/utils/grid_nav.py +63 -0
  93. aliasr/tui/utils/smart_complete.py +345 -0
  94. aliasr/tui/utils/tables.py +87 -0
  95. aliasr-1.0.0.dist-info/METADATA +105 -0
  96. aliasr-1.0.0.dist-info/RECORD +100 -0
  97. aliasr-1.0.0.dist-info/WHEEL +5 -0
  98. aliasr-1.0.0.dist-info/entry_points.txt +2 -0
  99. aliasr-1.0.0.dist-info/licenses/LICENSE +21 -0
  100. aliasr-1.0.0.dist-info/top_level.txt +1 -0
aliasr/__init__.py ADDED
File without changes
aliasr/__main__.py ADDED
@@ -0,0 +1,163 @@
1
+ import os
2
+ import argparse
3
+
4
+
5
+ def _parser() -> argparse.ArgumentParser:
6
+ p = argparse.ArgumentParser(
7
+ prog="aliasr",
8
+ description="aliasr - Modern TUI launcher for pentest commands",
9
+ )
10
+ p.add_argument(
11
+ "-e",
12
+ "--exec",
13
+ dest="execute",
14
+ action="store_true",
15
+ help="Execute the command immediately",
16
+ )
17
+
18
+ sub = p.add_subparsers(dest="cmd")
19
+
20
+ # ---------- Audit ----------
21
+
22
+ audit = sub.add_parser("audit", help="Audit cheatsheets and configs")
23
+ audit.add_argument(
24
+ "-l", "--list-all", action="store_true", help="List individual cheats"
25
+ )
26
+ audit_sub = audit.add_subparsers(dest="audit_cmd", help="Audit specific components")
27
+ audit_sub.add_parser("refs", help="Audit parameter references in cheatsheets")
28
+ audit_sub.add_parser("vars", help="Audit variations (variations.toml)")
29
+ audit_sub.add_parser("conf", help="Audit configuration (config.toml)")
30
+
31
+ # ---------- Send ----------
32
+
33
+ send = sub.add_parser("send", help="Modify how commands are sent")
34
+ send_mx = send.add_mutually_exclusive_group()
35
+ send_mx.add_argument("-c", "--copy", action="store_true", help="Copy to clipboard")
36
+ send_mx.add_argument("-o", "--outfile", metavar="FILE", help="Write to file")
37
+ send_mx.add_argument(
38
+ "-p", "--pane", metavar="PANE", nargs="?", const="0", help="Send to tmux pane"
39
+ )
40
+ send_mx.add_argument(
41
+ "-pp", "--previous-pane", action="store_true", help="Send to previous tmux pane"
42
+ )
43
+
44
+ # ---------- Scan ----------
45
+
46
+ scan = sub.add_parser("scan", help="Auto-populate globals from a target IP")
47
+ scan.add_argument(
48
+ "ip",
49
+ metavar="IP",
50
+ help="Target IP address to scan"
51
+ )
52
+ scan.add_argument(
53
+ "-u", "--user",
54
+ metavar="USER",
55
+ help="Username for authenticated scan"
56
+ )
57
+
58
+ # Authentication options (mutually exclusive)
59
+ auth_group = scan.add_mutually_exclusive_group()
60
+ auth_group.add_argument(
61
+ "-p", "--password",
62
+ metavar="PASSWORD",
63
+ help="Password for authenticated scan"
64
+ )
65
+ auth_group.add_argument(
66
+ "-H", "--hash",
67
+ metavar="HASH",
68
+ help="NT hash for authenticated scan"
69
+ )
70
+ auth_group.add_argument(
71
+ "-k", "--kerberos",
72
+ action="store_true",
73
+ help="Use Kerberos authentication (ccache)"
74
+ )
75
+
76
+ # ---------- List ----------
77
+
78
+ list_cmd = sub.add_parser("list", help="List globals or credentials")
79
+ list_sub = list_cmd.add_subparsers(dest="list_cmd", required=True, help="What to list")
80
+ list_sub.add_parser("globals", help="List all globals and their current values")
81
+ list_sub.add_parser("creds", help="List all saved credentials")
82
+ list_sub.add_parser("all", help="List both globals and credentials")
83
+
84
+ # ---------- Clear ----------
85
+
86
+ clear = sub.add_parser(
87
+ "clear", help="Clear session data"
88
+ )
89
+ clear_sub = clear.add_subparsers(dest="clear_cmd", required=True)
90
+ clear_sub.add_parser(
91
+ "cache", help="Clear cheats cache (mandatory if cheats have been updated)"
92
+ )
93
+ clear_sub.add_parser("globals", help="Clear globals")
94
+ clear_sub.add_parser("creds", help="Clear credentials")
95
+ clear_sub.add_parser("all", help="Clear everything")
96
+
97
+ p.set_defaults(copy=False, outfile=None, pane=None, previous_pane=False)
98
+ return p
99
+
100
+
101
+ def main() -> int:
102
+ args = _parser().parse_args()
103
+
104
+ if args.cmd == "clear":
105
+ from aliasr.core.bootstrap import clear_flags
106
+
107
+ clear_cache = args.clear_cmd in ("cache", "all")
108
+ clear_globals = args.clear_cmd in ("globals", "all")
109
+ clear_creds = args.clear_cmd in ("creds", "all")
110
+ clear_flags(clear_cache, clear_globals, clear_creds)
111
+ return 0
112
+
113
+ if args.cmd == "audit":
114
+ from aliasr.audit import run_audit_cli
115
+
116
+ return run_audit_cli(args.list_all, args.audit_cmd)
117
+
118
+ if args.cmd == "list":
119
+ from aliasr.core.list import run_list
120
+ return run_list(args.list_cmd)
121
+
122
+ if args.cmd == "scan":
123
+ from aliasr.core.scan import run_scan_cli
124
+ return run_scan_cli(
125
+ args.ip,
126
+ args.user,
127
+ args.password,
128
+ getattr(args, 'hash', None),
129
+ getattr(args, 'kerberos', False)
130
+ )
131
+
132
+ os.environ.setdefault("COLORTERM", "truecolor")
133
+
134
+ from aliasr.core.bootstrap import launch_app
135
+
136
+ app = launch_app(
137
+ execute=args.execute,
138
+ pane=args.pane,
139
+ previous=args.previous_pane,
140
+ )
141
+
142
+ app.run()
143
+
144
+ # ---------- Delivery ----------
145
+
146
+ cmd = getattr(app, "pending_inject", None)
147
+ if not cmd:
148
+ return 0
149
+
150
+ from aliasr.core.inject import inject
151
+
152
+ return inject(
153
+ cmd=cmd,
154
+ copy=args.copy,
155
+ outfile=args.outfile,
156
+ using_tmux=app.in_tmux,
157
+ execute=app.execute_cmd,
158
+ pane_index=app.tmux_target_pane,
159
+ )
160
+
161
+
162
+ if __name__ == "__main__":
163
+ raise SystemExit(main())
aliasr/app.py ADDED
@@ -0,0 +1,101 @@
1
+ from importlib.resources import files
2
+ from pathlib import Path
3
+ from threading import Thread
4
+
5
+ from textual.app import App
6
+ from textual.binding import Binding
7
+ from textual.widgets import Input
8
+
9
+ from aliasr.core.config import kb_root, THEME
10
+ from aliasr.tui.main_screen.globals_grid import GlobalsGrid
11
+ from aliasr.tui.main_screen.main_screen import MainScreen
12
+ from aliasr.tui.theme import BUNDLED_THEMES
13
+
14
+
15
+ class Aliasr(App[None]):
16
+ CSS_PATH = Path(files("aliasr") / "tui" / "main.tcss")
17
+
18
+ BINDINGS = [
19
+ Binding(
20
+ "escape",
21
+ "safe_exit",
22
+ ),
23
+ Binding(
24
+ "ctrl+q",
25
+ "safe_exit",
26
+ priority=True,
27
+ ),
28
+ Binding(
29
+ kb_root("quit"),
30
+ "safe_exit",
31
+ "Quit",
32
+ priority=True,
33
+ ),
34
+ Binding(
35
+ kb_root("copy_input"),
36
+ "copy_input",
37
+ "Copy",
38
+ priority=True,
39
+ tooltip="Copy the value of the currently focused input.",
40
+ ),
41
+ ]
42
+
43
+ def __init__(
44
+ self,
45
+ *,
46
+ in_tmux: bool = False,
47
+ execute_cmd: bool = False,
48
+ tmux_current_pane: str | None = None,
49
+ tmux_target_pane: str | None = None,
50
+ ) -> None:
51
+ super().__init__()
52
+ self.animation_level = "none"
53
+ self.pending_inject: str | None = None
54
+ self.in_tmux = in_tmux
55
+ self.execute_cmd = execute_cmd
56
+ self.tmux_current_pane = tmux_current_pane
57
+ self.tmux_target_pane = tmux_target_pane
58
+ self.globals: dict[str, str] = {}
59
+ self.cheats: list = []
60
+
61
+ # ---------- UI ----------
62
+
63
+ def on_mount(self) -> None:
64
+ theme = BUNDLED_THEMES.get(THEME.name)
65
+ if theme:
66
+ self.register_theme(theme)
67
+ try:
68
+ self.theme = THEME.name
69
+ except Exception:
70
+ self.register_theme(BUNDLED_THEMES["aliasr"])
71
+ self.theme = "aliasr"
72
+
73
+ def _background_load():
74
+ from aliasr.core.creds import load_creds
75
+ from aliasr.core.variations import load_variations
76
+
77
+ load_creds()
78
+ load_variations()
79
+
80
+ Thread(target=_background_load, daemon=True).start()
81
+
82
+ # ---------- Actions ----------
83
+
84
+ def action_copy_input(self) -> None:
85
+ w = self.focused
86
+ if isinstance(w, Input):
87
+ from aliasr.core.inject import copy_to_clipboard
88
+
89
+ if w.value:
90
+ copy_to_clipboard(w.value or "")
91
+ self.notify("Copied Input Value!", severity="success", timeout=2.5)
92
+
93
+ def action_safe_exit(self) -> None:
94
+ for grid in self.query(GlobalsGrid):
95
+ grid.commit_all_modified()
96
+ self.exit()
97
+
98
+ # ---------- Public API ----------
99
+
100
+ def get_default_screen(self) -> MainScreen:
101
+ return MainScreen()