alienrecon 3.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.
Files changed (92) hide show
  1. alienrecon-3.0.0/PKG-INFO +187 -0
  2. alienrecon-3.0.0/README.md +163 -0
  3. alienrecon-3.0.0/pyproject.toml +51 -0
  4. alienrecon-3.0.0/src/alienrecon/__init__.py +1 -0
  5. alienrecon-3.0.0/src/alienrecon/__main__.py +5 -0
  6. alienrecon-3.0.0/src/alienrecon/agent/__init__.py +0 -0
  7. alienrecon-3.0.0/src/alienrecon/agent/assistant.py +88 -0
  8. alienrecon-3.0.0/src/alienrecon/agent/brain.py +317 -0
  9. alienrecon-3.0.0/src/alienrecon/agent/instructor.py +592 -0
  10. alienrecon-3.0.0/src/alienrecon/api.py +188 -0
  11. alienrecon-3.0.0/src/alienrecon/cli.py +323 -0
  12. alienrecon-3.0.0/src/alienrecon/core/__init__.py +0 -0
  13. alienrecon-3.0.0/src/alienrecon/core/exceptions.py +44 -0
  14. alienrecon-3.0.0/src/alienrecon/core/flag_celebrator.py +126 -0
  15. alienrecon-3.0.0/src/alienrecon/core/input_validator.py +431 -0
  16. alienrecon-3.0.0/src/alienrecon/curriculum/__init__.py +0 -0
  17. alienrecon-3.0.0/src/alienrecon/curriculum/profile.py +178 -0
  18. alienrecon-3.0.0/src/alienrecon/curriculum/rooms.py +229 -0
  19. alienrecon-3.0.0/src/alienrecon/data/README.md +80 -0
  20. alienrecon-3.0.0/src/alienrecon/data/ctf_info/htb_lame.yaml +23 -0
  21. alienrecon-3.0.0/src/alienrecon/data/ctf_info/test_box.yaml +11 -0
  22. alienrecon-3.0.0/src/alienrecon/data/ctf_info/thm_basic_pentesting.yaml +24 -0
  23. alienrecon-3.0.0/src/alienrecon/data/prompts/mcp_system_prompt.txt +253 -0
  24. alienrecon-3.0.0/src/alienrecon/data/rooms/index.yaml +134 -0
  25. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-activerecon.yaml +322 -0
  26. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-authenticationbypass.yaml +395 -0
  27. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-boilerctf.yaml +706 -0
  28. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-breachingad.yaml +955 -0
  29. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-bruteit.yaml +454 -0
  30. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-burpsuitebasics.yaml +371 -0
  31. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-burpsuiteextensions.yaml +129 -0
  32. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-burpsuiteintruder.yaml +421 -0
  33. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-burpsuiteom.yaml +314 -0
  34. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-burpsuiterepeater.yaml +289 -0
  35. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-careersincyber.yaml +347 -0
  36. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-chillhack.yaml +876 -0
  37. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-contentdiscovery.yaml +539 -0
  38. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-cyborg.yaml +485 -0
  39. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-defensivesecurityintro.yaml +380 -0
  40. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-exploitingavulnerabilityv2.yaml +349 -0
  41. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-fileinc.yaml +410 -0
  42. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-fowsniff.yaml +640 -0
  43. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-h4cked.yaml +708 -0
  44. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-hackpark.yaml +783 -0
  45. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-idor.yaml +300 -0
  46. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-internal.yaml +506 -0
  47. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-introtoc2.yaml +680 -0
  48. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-introtoshells.yaml +829 -0
  49. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-lazyadmin.yaml +451 -0
  50. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-linprivesc.yaml +985 -0
  51. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-linuxprivesc.yaml +1347 -0
  52. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-metasploitexploitation.yaml +460 -0
  53. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-metasploitintro.yaml +517 -0
  54. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-meterpreter.yaml +539 -0
  55. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-netsecchallenge.yaml +286 -0
  56. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-nmap01.yaml +636 -0
  57. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-nmap02.yaml +569 -0
  58. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-nmap03.yaml +623 -0
  59. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-nmap04.yaml +609 -0
  60. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-offensivesecurityintro.yaml +314 -0
  61. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-oscommandinjection.yaml +239 -0
  62. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-passiverecon.yaml +260 -0
  63. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-pentestingfundamentals.yaml +373 -0
  64. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-principlesofsecurity.yaml +389 -0
  65. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-protocolsandservers.yaml +367 -0
  66. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-protocolsandservers2.yaml +443 -0
  67. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-raceconditionsattacks.yaml +260 -0
  68. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-relevant.yaml +642 -0
  69. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-solar.yaml +866 -0
  70. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-sqlinjectionlm.yaml +957 -0
  71. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-ssrfqi.yaml +283 -0
  72. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-subdomainenumeration.yaml +327 -0
  73. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-ultratech.yaml +572 -0
  74. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-vulnerabilities101.yaml +325 -0
  75. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-vulnerabilitycapstone.yaml +305 -0
  76. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-walkinganapplication.yaml +487 -0
  77. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-windowsprivesc20.yaml +741 -0
  78. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-wreath.yaml +1966 -0
  79. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-xss.yaml +415 -0
  80. alienrecon-3.0.0/src/alienrecon/data/rooms/thm-yearoftherabbit.yaml +687 -0
  81. alienrecon-3.0.0/src/alienrecon/data/templates/ctf_notes_template.md +118 -0
  82. alienrecon-3.0.0/src/alienrecon/display/__init__.py +0 -0
  83. alienrecon-3.0.0/src/alienrecon/display/ui.py +140 -0
  84. alienrecon-3.0.0/src/alienrecon/prompts/system_prompt.txt +246 -0
  85. alienrecon-3.0.0/src/alienrecon/prompts/terminal_simulation_prompt.txt +46 -0
  86. alienrecon-3.0.0/src/alienrecon/prompts/welcome_message.txt +7 -0
  87. alienrecon-3.0.0/src/alienrecon/prompts/welcome_message_with_target.txt +7 -0
  88. alienrecon-3.0.0/src/alienrecon/tools/__init__.py +0 -0
  89. alienrecon-3.0.0/src/alienrecon/tools/checker.py +93 -0
  90. alienrecon-3.0.0/src/alienrecon/tools/vpn.py +166 -0
  91. alienrecon-3.0.0/src/alienrecon/wordlists/dns-fast-clean.txt +58 -0
  92. alienrecon-3.0.0/src/alienrecon/wordlists/dns-fast.txt +58 -0
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: alienrecon
3
+ Version: 3.0.0
4
+ Summary: AI-powered CTF instructor. Guided walkthroughs for TryHackMe rooms.
5
+ License: MIT
6
+ Keywords: ctf,hacking,security,instructor,pentesting,cybersecurity
7
+ Author: Russell J. Adams
8
+ Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Requires-Dist: httpx (>=0.25.0)
16
+ Requires-Dist: python-dotenv (>=1.0.0,<1.1.0)
17
+ Requires-Dist: pyyaml (>=6.0.1,<6.1.0)
18
+ Requires-Dist: rich (>=13.7.0,<13.8.0)
19
+ Requires-Dist: typer[all] (>=0.16.0,<0.17.0)
20
+ Project-URL: Homepage, https://alien37.com
21
+ Project-URL: Repository, https://github.com/russelljadams/alienrecon
22
+ Description-Content-Type: text/markdown
23
+
24
+ # AlienRecon
25
+
26
+ Your guide through the box. Hack first. Understand after.
27
+
28
+ AlienRecon is a CLI that walks you through cybersecurity rooms step by step. You pick a room, it runs the tools, shows you the output, and teaches you what is happening along the way.
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pip install alienrecon
34
+ ```
35
+
36
+ Requires Python 3.11+.
37
+
38
+ ## Setup
39
+
40
+ ### 1. Get a Claude API key
41
+
42
+ Sign up at [console.anthropic.com](https://console.anthropic.com) and grab an API key.
43
+
44
+ ### 2. Set it
45
+
46
+ ```bash
47
+ export ANTHROPIC_API_KEY=your-key-here
48
+ ```
49
+
50
+ Add it to your shell profile (`~/.bashrc`, `~/.zshrc`) so it persists.
51
+
52
+ ### 3. Install pentesting tools
53
+
54
+ AlienRecon calls real tools on your machine. You need at least:
55
+
56
+ | Tool | What it does |
57
+ |------|-------------|
58
+ | `nmap` | Port scanning |
59
+ | `gobuster` | Directory brute-forcing |
60
+ | `nikto` | Web vulnerability scanning |
61
+ | `hydra` | Password brute-forcing |
62
+ | `curl` | HTTP requests |
63
+ | `openvpn` | VPN connections (TryHackMe / HackTheBox) |
64
+
65
+ Optional but useful: `sqlmap`, `john`, `hashcat`, `ffuf`, `whatweb`, `wpscan`, `searchsploit`, `enum4linux-ng`
66
+
67
+ On Kali or Parrot, most of these come pre-installed. On Debian/Ubuntu:
68
+
69
+ ```bash
70
+ sudo apt install nmap nikto hydra curl openvpn
71
+ ```
72
+
73
+ ### 4. Check your setup
74
+
75
+ ```bash
76
+ alienrecon doctor
77
+ ```
78
+
79
+ Tells you what is installed and what is missing.
80
+
81
+ ## Usage
82
+
83
+ ### Start a room
84
+
85
+ ```bash
86
+ alienrecon start -r lazyadmin
87
+ ```
88
+
89
+ Loads the walkthrough for that room and teaches you through it. It runs commands, explains output, asks you questions, and moves on when you understand.
90
+
91
+ ### Let the curriculum pick
92
+
93
+ ```bash
94
+ alienrecon start
95
+ ```
96
+
97
+ Picks the next room based on your progress.
98
+
99
+ ### Resume where you left off
100
+
101
+ ```bash
102
+ alienrecon start --resume
103
+ ```
104
+
105
+ ### Free recon mode
106
+
107
+ ```bash
108
+ alienrecon recon -t 10.10.10.10
109
+ ```
110
+
111
+ No walkthrough. Just you and the assistant against a target.
112
+
113
+ ### Check your progress
114
+
115
+ ```bash
116
+ alienrecon profile
117
+ ```
118
+
119
+ ### Browse available rooms
120
+
121
+ ```bash
122
+ alienrecon curriculum
123
+ ```
124
+
125
+ ### Reset your profile
126
+
127
+ ```bash
128
+ alienrecon reset
129
+ ```
130
+
131
+ ## How it works
132
+
133
+ Each room has a YAML walkthrough with every phase, step, command, expected output, and answer. The instructor uses this as a cheat sheet — it knows what to do, but teaches you like a conversation, not a script.
134
+
135
+ The instructor:
136
+ - Runs real tools on real machines (nmap, gobuster, nikto, etc.)
137
+ - Explains what each command does and why
138
+ - Asks you questions before revealing answers
139
+ - Adapts to your responses
140
+ - Does not move on until you get it
141
+
142
+ Claude Sonnet under the hood, using tool_use for running commands, showing hints, checking answers, and advancing through steps.
143
+
144
+ ## Rooms
145
+
146
+ 40 guided walkthroughs covering:
147
+
148
+ - Network fundamentals and enumeration
149
+ - Web application attacks
150
+ - Privilege escalation (Linux + Windows)
151
+ - Brute forcing and credential attacks
152
+ - SQL injection
153
+ - Active Directory basics
154
+ - Metasploit
155
+
156
+ List them with `alienrecon curriculum` or browse at [alien37.com/rooms](https://alien37.com/rooms).
157
+
158
+ ## Project structure
159
+
160
+ ```
161
+ src/alienrecon/
162
+ ├── cli.py # CLI entry point (Typer)
163
+ ├── agent/
164
+ │ ├── instructor.py # Guided walkthrough agent
165
+ │ ├── assistant.py # Free recon mode
166
+ │ └── brain.py # Claude API + tool definitions
167
+ ├── curriculum/
168
+ │ ├── rooms.py # Room database + YAML loader
169
+ │ └── profile.py # Student progress tracking
170
+ ├── display/
171
+ │ └── ui.py # Rich terminal output
172
+ ├── tools/
173
+ │ ├── checker.py # Environment checker (doctor)
174
+ │ └── vpn.py # VPN management
175
+ └── data/
176
+ └── rooms/ # 40 YAML walkthroughs
177
+ ```
178
+
179
+ ## Legal
180
+
181
+ Offensive security education tool. Use it on machines you have permission to test. TryHackMe, HackTheBox — you are good. Do not be stupid.
182
+
183
+ ## Links
184
+
185
+ - [alien37.com](https://alien37.com)
186
+ - [GitHub](https://github.com/russelljadams/alienrecon)
187
+
@@ -0,0 +1,163 @@
1
+ # AlienRecon
2
+
3
+ Your guide through the box. Hack first. Understand after.
4
+
5
+ AlienRecon is a CLI that walks you through cybersecurity rooms step by step. You pick a room, it runs the tools, shows you the output, and teaches you what is happening along the way.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install alienrecon
11
+ ```
12
+
13
+ Requires Python 3.11+.
14
+
15
+ ## Setup
16
+
17
+ ### 1. Get a Claude API key
18
+
19
+ Sign up at [console.anthropic.com](https://console.anthropic.com) and grab an API key.
20
+
21
+ ### 2. Set it
22
+
23
+ ```bash
24
+ export ANTHROPIC_API_KEY=your-key-here
25
+ ```
26
+
27
+ Add it to your shell profile (`~/.bashrc`, `~/.zshrc`) so it persists.
28
+
29
+ ### 3. Install pentesting tools
30
+
31
+ AlienRecon calls real tools on your machine. You need at least:
32
+
33
+ | Tool | What it does |
34
+ |------|-------------|
35
+ | `nmap` | Port scanning |
36
+ | `gobuster` | Directory brute-forcing |
37
+ | `nikto` | Web vulnerability scanning |
38
+ | `hydra` | Password brute-forcing |
39
+ | `curl` | HTTP requests |
40
+ | `openvpn` | VPN connections (TryHackMe / HackTheBox) |
41
+
42
+ Optional but useful: `sqlmap`, `john`, `hashcat`, `ffuf`, `whatweb`, `wpscan`, `searchsploit`, `enum4linux-ng`
43
+
44
+ On Kali or Parrot, most of these come pre-installed. On Debian/Ubuntu:
45
+
46
+ ```bash
47
+ sudo apt install nmap nikto hydra curl openvpn
48
+ ```
49
+
50
+ ### 4. Check your setup
51
+
52
+ ```bash
53
+ alienrecon doctor
54
+ ```
55
+
56
+ Tells you what is installed and what is missing.
57
+
58
+ ## Usage
59
+
60
+ ### Start a room
61
+
62
+ ```bash
63
+ alienrecon start -r lazyadmin
64
+ ```
65
+
66
+ Loads the walkthrough for that room and teaches you through it. It runs commands, explains output, asks you questions, and moves on when you understand.
67
+
68
+ ### Let the curriculum pick
69
+
70
+ ```bash
71
+ alienrecon start
72
+ ```
73
+
74
+ Picks the next room based on your progress.
75
+
76
+ ### Resume where you left off
77
+
78
+ ```bash
79
+ alienrecon start --resume
80
+ ```
81
+
82
+ ### Free recon mode
83
+
84
+ ```bash
85
+ alienrecon recon -t 10.10.10.10
86
+ ```
87
+
88
+ No walkthrough. Just you and the assistant against a target.
89
+
90
+ ### Check your progress
91
+
92
+ ```bash
93
+ alienrecon profile
94
+ ```
95
+
96
+ ### Browse available rooms
97
+
98
+ ```bash
99
+ alienrecon curriculum
100
+ ```
101
+
102
+ ### Reset your profile
103
+
104
+ ```bash
105
+ alienrecon reset
106
+ ```
107
+
108
+ ## How it works
109
+
110
+ Each room has a YAML walkthrough with every phase, step, command, expected output, and answer. The instructor uses this as a cheat sheet — it knows what to do, but teaches you like a conversation, not a script.
111
+
112
+ The instructor:
113
+ - Runs real tools on real machines (nmap, gobuster, nikto, etc.)
114
+ - Explains what each command does and why
115
+ - Asks you questions before revealing answers
116
+ - Adapts to your responses
117
+ - Does not move on until you get it
118
+
119
+ Claude Sonnet under the hood, using tool_use for running commands, showing hints, checking answers, and advancing through steps.
120
+
121
+ ## Rooms
122
+
123
+ 40 guided walkthroughs covering:
124
+
125
+ - Network fundamentals and enumeration
126
+ - Web application attacks
127
+ - Privilege escalation (Linux + Windows)
128
+ - Brute forcing and credential attacks
129
+ - SQL injection
130
+ - Active Directory basics
131
+ - Metasploit
132
+
133
+ List them with `alienrecon curriculum` or browse at [alien37.com/rooms](https://alien37.com/rooms).
134
+
135
+ ## Project structure
136
+
137
+ ```
138
+ src/alienrecon/
139
+ ├── cli.py # CLI entry point (Typer)
140
+ ├── agent/
141
+ │ ├── instructor.py # Guided walkthrough agent
142
+ │ ├── assistant.py # Free recon mode
143
+ │ └── brain.py # Claude API + tool definitions
144
+ ├── curriculum/
145
+ │ ├── rooms.py # Room database + YAML loader
146
+ │ └── profile.py # Student progress tracking
147
+ ├── display/
148
+ │ └── ui.py # Rich terminal output
149
+ ├── tools/
150
+ │ ├── checker.py # Environment checker (doctor)
151
+ │ └── vpn.py # VPN management
152
+ └── data/
153
+ └── rooms/ # 40 YAML walkthroughs
154
+ ```
155
+
156
+ ## Legal
157
+
158
+ Offensive security education tool. Use it on machines you have permission to test. TryHackMe, HackTheBox — you are good. Do not be stupid.
159
+
160
+ ## Links
161
+
162
+ - [alien37.com](https://alien37.com)
163
+ - [GitHub](https://github.com/russelljadams/alienrecon)
@@ -0,0 +1,51 @@
1
+ [project]
2
+ name = "alienrecon"
3
+ version = "3.0.0"
4
+ description = "AI-powered CTF instructor. Guided walkthroughs for TryHackMe rooms."
5
+ authors = [{name = "Russell J. Adams"}]
6
+ license = {text = "MIT"}
7
+ readme = "README.md"
8
+ keywords = ["ctf", "hacking", "security", "instructor", "pentesting", "cybersecurity"]
9
+ requires-python = ">=3.11,<4.0"
10
+ dependencies = [
11
+ "rich~=13.7.0",
12
+ "typer[all]~=0.16.0",
13
+ "pyyaml~=6.0.1",
14
+ "python-dotenv~=1.0.0",
15
+ "httpx>=0.25.0",
16
+ ]
17
+
18
+ [project.urls]
19
+ "Homepage" = "https://alien37.com"
20
+ "Repository" = "https://github.com/russelljadams/alienrecon"
21
+
22
+ [project.scripts]
23
+ alienrecon = "alienrecon.cli:main"
24
+
25
+ [tool.poetry.group.dev.dependencies]
26
+ ruff = "^0.11.9"
27
+ mypy = "^1.15.0"
28
+ pytest = "^8.0.0"
29
+ pytest-cov = "^5.0.0"
30
+
31
+ [build-system]
32
+ requires = ["poetry-core>=1.0.0"]
33
+ build-backend = "poetry.core.masonry.api"
34
+
35
+ [tool.ruff]
36
+ line-length = 88
37
+ target-version = "py311"
38
+
39
+ [tool.ruff.lint]
40
+ select = ["E", "F", "W", "I", "UP"]
41
+ ignore = ["E501", "UP007"]
42
+
43
+ [tool.mypy]
44
+ python_version = "3.11"
45
+ check_untyped_defs = true
46
+ ignore_missing_imports = true
47
+ show_error_codes = true
48
+
49
+ [tool.pytest.ini_options]
50
+ testpaths = ["tests"]
51
+ python_files = ["test_*.py"]
@@ -0,0 +1 @@
1
+ __version__ = "3.0.0"
@@ -0,0 +1,5 @@
1
+ """Main entry point for alienrecon when run as a module."""
2
+ from alienrecon.cli import main
3
+
4
+ if __name__ == "__main__":
5
+ main()
File without changes
@@ -0,0 +1,88 @@
1
+ """Free mode assistant — student picks target, agent assists."""
2
+
3
+ import logging
4
+ from typing import Optional
5
+
6
+ from rich.console import Console
7
+ from rich.panel import Panel
8
+
9
+ from ..curriculum.profile import StudentProfile
10
+
11
+ logger = logging.getLogger(__name__)
12
+ console = Console()
13
+
14
+
15
+ class Assistant:
16
+ """Assistant for free-form reconnaissance."""
17
+
18
+ def __init__(self, profile: StudentProfile, dry_run: bool = False):
19
+ self.profile = profile
20
+ self.dry_run = dry_run
21
+
22
+ def start(self, target: str):
23
+ """Start a free-form recon session."""
24
+ from ..core.input_validator import InputValidator
25
+
26
+ # Validate target
27
+ try:
28
+ validated = InputValidator.validate_target(target)
29
+ except Exception as e:
30
+ console.print(f"[red]Invalid target: {e}[/red]")
31
+ return
32
+
33
+ console.print(Panel(
34
+ f"[green]Target:[/green] {validated}\n"
35
+ f"[dim]Free mode — you lead, I assist.[/dim]\n\n"
36
+ f"Type commands to run, or ask me questions.\n"
37
+ f"Type [cyan]help[/cyan] for options, [cyan]exit[/cyan] to quit.",
38
+ title="Free Recon",
39
+ border_style="cyan",
40
+ ))
41
+
42
+ # Interactive loop
43
+ while True:
44
+ try:
45
+ cmd = console.input("\n[green] alienrecon> [/green]")
46
+ except (KeyboardInterrupt, EOFError):
47
+ console.print("\n[yellow]Session ended.[/yellow]")
48
+ break
49
+
50
+ cmd = cmd.strip()
51
+ if not cmd:
52
+ continue
53
+
54
+ if cmd.lower() in ("exit", "quit", "q"):
55
+ console.print("[yellow]Session ended.[/yellow]")
56
+ break
57
+
58
+ if cmd.lower() == "help":
59
+ self._show_help()
60
+ continue
61
+
62
+ # For now, basic command pass-through
63
+ # TODO: Add smart suggestions and explanations
64
+ if self.dry_run:
65
+ console.print(f"[dim][dry-run] Would execute: {cmd}[/dim]")
66
+ else:
67
+ import subprocess
68
+ try:
69
+ result = subprocess.run(
70
+ cmd, shell=True, capture_output=True, text=True, timeout=300
71
+ )
72
+ output = result.stdout + result.stderr
73
+ if output.strip():
74
+ console.print(Panel(output.strip()[:5000], title="Output", border_style="dim"))
75
+ except subprocess.TimeoutExpired:
76
+ console.print("[red]Command timed out.[/red]")
77
+ except Exception as e:
78
+ console.print(f"[red]Error: {e}[/red]")
79
+
80
+ def _show_help(self):
81
+ console.print(Panel(
82
+ "[cyan]help[/cyan] — Show this help\n"
83
+ "[cyan]exit[/cyan] — End session\n"
84
+ "[cyan]<command>[/cyan] — Run a shell command\n\n"
85
+ "[dim]Tip: Try nmap, gobuster, nikto, wpscan, etc.[/dim]",
86
+ title="Commands",
87
+ border_style="cyan",
88
+ ))