aliasr 1.0.0__tar.gz
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.
- aliasr-1.0.0/LICENSE +21 -0
- aliasr-1.0.0/PKG-INFO +105 -0
- aliasr-1.0.0/README.md +92 -0
- aliasr-1.0.0/aliasr/__init__.py +0 -0
- aliasr-1.0.0/aliasr/__main__.py +163 -0
- aliasr-1.0.0/aliasr/app.py +101 -0
- aliasr-1.0.0/aliasr/audit.py +788 -0
- aliasr-1.0.0/aliasr/core/bootstrap.py +114 -0
- aliasr-1.0.0/aliasr/core/cheats.py +281 -0
- aliasr-1.0.0/aliasr/core/config.py +271 -0
- aliasr-1.0.0/aliasr/core/creds.py +218 -0
- aliasr-1.0.0/aliasr/core/globals.py +294 -0
- aliasr-1.0.0/aliasr/core/inject.py +106 -0
- aliasr-1.0.0/aliasr/core/list.py +149 -0
- aliasr-1.0.0/aliasr/core/scan.py +441 -0
- aliasr-1.0.0/aliasr/core/tmux.py +52 -0
- aliasr-1.0.0/aliasr/core/variations.py +149 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/active_directory.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/bloodhound.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/bloodyad.md +62 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/certipy.md +42 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/impacket/impacket-kerberos.md +72 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/impacket/impacket-misc.md +27 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/impacket/ntlmrelayx.md +27 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/impacket/nxc-misc.md +6 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/impacket/secretsdump.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/kerbrute.md +27 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/lsass.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/netexec.md +47 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/ntlm_theft.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/powerview.md +62 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/pygpoabuse.md +9 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/remote_execution.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/rpcclient.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/targetedkerberoast.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/techniques/coercion.md +47 -0
- aliasr-1.0.0/aliasr/data/cheats/ad/techniques/relay.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/cloud/aws/aws.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/cloud/azure/aadinternals.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/cloud/azure/azure.md +32 -0
- aliasr-1.0.0/aliasr/data/cheats/cloud/gcp/gcp.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/cracking/john.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/linux_privesc.md +73 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/exiftool.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/faketime.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/grep.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/keepass.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/msfvenom.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/openssl.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/ssh-keygen.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/sshpass.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/linux/utils/username-anarchy.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/misc/git.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/misc/hackthebox.md +22 -0
- aliasr-1.0.0/aliasr/data/cheats/misc/host_discovery.md +22 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/dns.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/ftp.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/ldap.md +22 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/mssql.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/nfs.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/rdp.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/smb.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/smtp.md +22 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/snmp.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/protocols/winrm.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/variations.toml +114 -0
- aliasr-1.0.0/aliasr/data/cheats/web/ffuf.md +44 -0
- aliasr-1.0.0/aliasr/data/cheats/web/git-dumper.md +7 -0
- aliasr-1.0.0/aliasr/data/cheats/web/sqlmap.md +17 -0
- aliasr-1.0.0/aliasr/data/cheats/web/web.md +12 -0
- aliasr-1.0.0/aliasr/data/cheats/windows/dpapi.md +27 -0
- aliasr-1.0.0/aliasr/data/cheats/windows/windows_exploitation.md +31 -0
- aliasr-1.0.0/aliasr/data/cheats/windows/windows_privesc.md +88 -0
- aliasr-1.0.0/aliasr/data/config.toml +94 -0
- aliasr-1.0.0/aliasr/data/wiki/Cheats.md +122 -0
- aliasr-1.0.0/aliasr/data/wiki/Variations.md +47 -0
- aliasr-1.0.0/aliasr/tui/build_screen/build_screen.py +518 -0
- aliasr-1.0.0/aliasr/tui/build_screen/param_screen.py +318 -0
- aliasr-1.0.0/aliasr/tui/build_screen/variations_screen.py +291 -0
- aliasr-1.0.0/aliasr/tui/creds_screen/cred_editor.py +87 -0
- aliasr-1.0.0/aliasr/tui/creds_screen/creds_screen.py +311 -0
- aliasr-1.0.0/aliasr/tui/globals_screen/global_editor.py +271 -0
- aliasr-1.0.0/aliasr/tui/globals_screen/globals_screen.py +337 -0
- aliasr-1.0.0/aliasr/tui/globals_screen/new_global.py +118 -0
- aliasr-1.0.0/aliasr/tui/main.tcss +409 -0
- aliasr-1.0.0/aliasr/tui/main_screen/cheatlist.py +118 -0
- aliasr-1.0.0/aliasr/tui/main_screen/globals_grid.py +260 -0
- aliasr-1.0.0/aliasr/tui/main_screen/header.py +21 -0
- aliasr-1.0.0/aliasr/tui/main_screen/main_screen.py +561 -0
- aliasr-1.0.0/aliasr/tui/main_screen/search_bar/indicators.py +36 -0
- aliasr-1.0.0/aliasr/tui/main_screen/search_bar/search_bar.py +512 -0
- aliasr-1.0.0/aliasr/tui/theme.py +43 -0
- aliasr-1.0.0/aliasr/tui/tree_screen.py +177 -0
- aliasr-1.0.0/aliasr/tui/utils/common.py +14 -0
- aliasr-1.0.0/aliasr/tui/utils/grid_nav.py +63 -0
- aliasr-1.0.0/aliasr/tui/utils/smart_complete.py +345 -0
- aliasr-1.0.0/aliasr/tui/utils/tables.py +87 -0
- aliasr-1.0.0/aliasr.egg-info/PKG-INFO +105 -0
- aliasr-1.0.0/aliasr.egg-info/SOURCES.txt +103 -0
- aliasr-1.0.0/aliasr.egg-info/dependency_links.txt +1 -0
- aliasr-1.0.0/aliasr.egg-info/entry_points.txt +2 -0
- aliasr-1.0.0/aliasr.egg-info/requires.txt +4 -0
- aliasr-1.0.0/aliasr.egg-info/top_level.txt +1 -0
- aliasr-1.0.0/pyproject.toml +29 -0
- aliasr-1.0.0/setup.cfg +4 -0
aliasr-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mojo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
aliasr-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aliasr
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Modern TUI launcher for pentest commands
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: textual>=6.2.0
|
|
9
|
+
Requires-Dist: textual-autocomplete>=4.0.5
|
|
10
|
+
Requires-Dist: pykeepass>=4.0.0
|
|
11
|
+
Requires-Dist: pyperclip>=1.9.0
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# Aliasr
|
|
15
|
+
|
|
16
|
+
[](https://pypi.org/project/aliasr/)
|
|
17
|
+

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
**Aliasr** is a modern, feature-rich TUI launcher for penetration testing commands inspired by [Arsenal](https://github.com/Orange-Cyberdefense/arsenal), but with significantly improved functionality.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
Some of the largest improvements Aliasr implements include:
|
|
25
|
+
|
|
26
|
+
- [x] Significantly expanded tmux integration.
|
|
27
|
+
- [x] Cheat variations that allow for different authentication methods to be built into a single parameter.
|
|
28
|
+
- [x] Automatic parameter population based on history and other sources.
|
|
29
|
+
- [x] Secure KeePass integration for managing credentials.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv tool install git+https://github.com/Mojo8898/aliasr
|
|
35
|
+
pipx install git+https://github.com/Mojo8898/aliasr
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
I also highly recommend adding the following line to your `~/.zshrc`:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
alias a=aliasr
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If you intend on leveraging the extended tmux integration aliasr offers (which you should), also add the following to your `~/.tmux.conf`:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Add to ~/.tmux.conf
|
|
48
|
+
bind U split-window "aliasr send -pp"
|
|
49
|
+
bind K split-window "aliasr -e send -pp"
|
|
50
|
+
|
|
51
|
+
# Recommended tmux settings
|
|
52
|
+
set -s escape-time 0
|
|
53
|
+
set -s focus-events on
|
|
54
|
+
set -s default-terminal "tmux-256color"
|
|
55
|
+
set -as terminal-overrides ",*:Tc"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You can now use the `prefix+K` hotkey to open aliasr below the current pane and send commands automatically to the pane that was focused previously. `prefix+U` does the same but without also sending the enter key to execute the command.
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
$ aliasr -h
|
|
64
|
+
usage: aliasr [-h] [-e] {audit,send,scan,list,clear} ...
|
|
65
|
+
|
|
66
|
+
aliasr - Modern TUI launcher for pentest commands
|
|
67
|
+
|
|
68
|
+
positional arguments:
|
|
69
|
+
{audit,send,scan,list,clear}
|
|
70
|
+
audit Audit cheatsheets and configs
|
|
71
|
+
send Modify how commands are sent
|
|
72
|
+
scan Auto-populate globals from a target IP
|
|
73
|
+
list List globals or credentials
|
|
74
|
+
clear Clear session data
|
|
75
|
+
|
|
76
|
+
options:
|
|
77
|
+
-h, --help show this help message and exit
|
|
78
|
+
-e, --exec Execute the command immediately
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Note:** *Almost* all hotkeys can be found in the footer of the application when running.
|
|
82
|
+
|
|
83
|
+
## Configuration
|
|
84
|
+
|
|
85
|
+
Aliasr allows you to configure pretty much everything. Refer to the built-in `config.toml` found [here](./aliasr/data/config.toml) to see what configurations options are available.
|
|
86
|
+
|
|
87
|
+
Create your own config in `~/.config/aliasr/config.toml` to edit existing configurations and changes will automatically be merged at runtime.
|
|
88
|
+
|
|
89
|
+
**Note:** Paths set in the environment variables `XDG_CONFIG_HOME` and `ALIASR_CONFIG` will be used instead if set.
|
|
90
|
+
|
|
91
|
+
## Cheats
|
|
92
|
+
|
|
93
|
+
A detailed reference guide on writing cheats can be found [here](./aliasr/data/wiki/Cheats.md).
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
|
|
97
|
+
Contributions are welcome but make sure you if you are contributing to cheats, you follow guidelines in [Cheats Reference](./aliasr/data/wiki/Cheats.md). Also feel free to open an issue if you want to add other features.
|
|
98
|
+
|
|
99
|
+
Detailed development setup instructions can be found in the [official Textual documentation](https://textual.textualize.io/guide/devtools/).
|
|
100
|
+
|
|
101
|
+
## Acknowledgments
|
|
102
|
+
|
|
103
|
+
- Inspired by [Arsenal](https://github.com/Orange-Cyberdefense/arsenal) by Orange Cyberdefense
|
|
104
|
+
- Built with [Textual](https://github.com/Textualize/textual)
|
|
105
|
+
- Special thanks to all members of my HackTheBox team [S4U2SelfEnjoyers](https://app.hackthebox.com/teams/7014?tab=members) for beta testing and providing essential feedback.
|
aliasr-1.0.0/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Aliasr
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/aliasr/)
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**Aliasr** is a modern, feature-rich TUI launcher for penetration testing commands inspired by [Arsenal](https://github.com/Orange-Cyberdefense/arsenal), but with significantly improved functionality.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
Some of the largest improvements Aliasr implements include:
|
|
12
|
+
|
|
13
|
+
- [x] Significantly expanded tmux integration.
|
|
14
|
+
- [x] Cheat variations that allow for different authentication methods to be built into a single parameter.
|
|
15
|
+
- [x] Automatic parameter population based on history and other sources.
|
|
16
|
+
- [x] Secure KeePass integration for managing credentials.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv tool install git+https://github.com/Mojo8898/aliasr
|
|
22
|
+
pipx install git+https://github.com/Mojo8898/aliasr
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
I also highly recommend adding the following line to your `~/.zshrc`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
alias a=aliasr
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If you intend on leveraging the extended tmux integration aliasr offers (which you should), also add the following to your `~/.tmux.conf`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Add to ~/.tmux.conf
|
|
35
|
+
bind U split-window "aliasr send -pp"
|
|
36
|
+
bind K split-window "aliasr -e send -pp"
|
|
37
|
+
|
|
38
|
+
# Recommended tmux settings
|
|
39
|
+
set -s escape-time 0
|
|
40
|
+
set -s focus-events on
|
|
41
|
+
set -s default-terminal "tmux-256color"
|
|
42
|
+
set -as terminal-overrides ",*:Tc"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
You can now use the `prefix+K` hotkey to open aliasr below the current pane and send commands automatically to the pane that was focused previously. `prefix+U` does the same but without also sending the enter key to execute the command.
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
$ aliasr -h
|
|
51
|
+
usage: aliasr [-h] [-e] {audit,send,scan,list,clear} ...
|
|
52
|
+
|
|
53
|
+
aliasr - Modern TUI launcher for pentest commands
|
|
54
|
+
|
|
55
|
+
positional arguments:
|
|
56
|
+
{audit,send,scan,list,clear}
|
|
57
|
+
audit Audit cheatsheets and configs
|
|
58
|
+
send Modify how commands are sent
|
|
59
|
+
scan Auto-populate globals from a target IP
|
|
60
|
+
list List globals or credentials
|
|
61
|
+
clear Clear session data
|
|
62
|
+
|
|
63
|
+
options:
|
|
64
|
+
-h, --help show this help message and exit
|
|
65
|
+
-e, --exec Execute the command immediately
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Note:** *Almost* all hotkeys can be found in the footer of the application when running.
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
Aliasr allows you to configure pretty much everything. Refer to the built-in `config.toml` found [here](./aliasr/data/config.toml) to see what configurations options are available.
|
|
73
|
+
|
|
74
|
+
Create your own config in `~/.config/aliasr/config.toml` to edit existing configurations and changes will automatically be merged at runtime.
|
|
75
|
+
|
|
76
|
+
**Note:** Paths set in the environment variables `XDG_CONFIG_HOME` and `ALIASR_CONFIG` will be used instead if set.
|
|
77
|
+
|
|
78
|
+
## Cheats
|
|
79
|
+
|
|
80
|
+
A detailed reference guide on writing cheats can be found [here](./aliasr/data/wiki/Cheats.md).
|
|
81
|
+
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
Contributions are welcome but make sure you if you are contributing to cheats, you follow guidelines in [Cheats Reference](./aliasr/data/wiki/Cheats.md). Also feel free to open an issue if you want to add other features.
|
|
85
|
+
|
|
86
|
+
Detailed development setup instructions can be found in the [official Textual documentation](https://textual.textualize.io/guide/devtools/).
|
|
87
|
+
|
|
88
|
+
## Acknowledgments
|
|
89
|
+
|
|
90
|
+
- Inspired by [Arsenal](https://github.com/Orange-Cyberdefense/arsenal) by Orange Cyberdefense
|
|
91
|
+
- Built with [Textual](https://github.com/Textualize/textual)
|
|
92
|
+
- Special thanks to all members of my HackTheBox team [S4U2SelfEnjoyers](https://app.hackthebox.com/teams/7014?tab=members) for beta testing and providing essential feedback.
|
|
File without changes
|
|
@@ -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())
|
|
@@ -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()
|