-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate-module-menu-entries.py
More file actions
executable file
Β·187 lines (148 loc) Β· 5.98 KB
/
create-module-menu-entries.py
File metadata and controls
executable file
Β·187 lines (148 loc) Β· 5.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/bin/env python3
"""
NullSec Linux - Module Desktop Entry Generator v1.0
Creates .desktop files for all modules grouped by exploit type.
Generates proper freedesktop.org compliant desktop entries.
GitHub: https://github.com/bad-antics/nullsec
"""
__version__ = "1.0"
__author__ = "bad-antics"
import os
import json
from pathlib import Path
# Category definitions
CATEGORIES = {
'Network': 'π',
'Web': 'π',
'Wireless': 'π‘',
'Exploitation': 'π£',
'Password': 'π',
'Social Engineering': 'π',
'IoT': 'π±',
'Cloud': 'βοΈ',
'Active Directory': 'π’',
'Database': 'ποΈ',
'Mobile': 'π²',
'Forensics': 'π',
'Misc': 'β‘'
}
def get_module_category(script_name):
"""Determine category based on script name patterns"""
name_lower = script_name.lower()
# Network-based
if any(x in name_lower for x in ['port', 'network', 'tcp', 'udp', 'nmap', 'dns', 'snmp', 'route', 'smb', 'ssh', 'ftp', 'vnc', 'rdp']):
return 'Network'
# Web-based
elif any(x in name_lower for x in ['web', 'http', 'sql', 'xss', 'csrf', 'xxe', 'ssrf', 'lfi', 'rfi', 'api', 'cms', 'wordpress', 'joomla', 'drupal']):
return 'Web'
# Wireless
elif any(x in name_lower for x in ['wifi', 'wireless', 'bluetooth', 'wpa', 'wep', 'aircrack', 'kismet']):
return 'Wireless'
# Exploitation
elif any(x in name_lower for x in ['exploit', 'shellcode', 'buffer', 'overflow', 'rop', 'metasploit', 'vmware', 'kernel']):
return 'Exploitation'
# Password/Credentials
elif any(x in name_lower for x in ['pass', 'crack', 'hash', 'brute', 'john', 'hydra', 'credential', 'mimikatz', 'kerberos']):
return 'Password'
# Social Engineering
elif any(x in name_lower for x in ['phish', 'social', 'pretex', 'vishing', 'smishing']):
return 'Social Engineering'
# IoT/ICS
elif any(x in name_lower for x in ['iot', 'scada', 'modbus', 'mqtt', 'coap', 'zigbee']):
return 'IoT'
# Cloud
elif any(x in name_lower for x in ['cloud', 'aws', 's3', 'azure', 'gcp', 'docker', 'kubernetes', 'container']):
return 'Cloud'
# Active Directory
elif any(x in name_lower for x in ['ad-', 'ldap', 'domain', 'kerberos', 'ntlm', 'bloodhound']):
return 'Active Directory'
# Database
elif any(x in name_lower for x in ['mysql', 'postgres', 'mongo', 'redis', 'oracle', 'mssql', 'database']):
return 'Database'
# Mobile
elif any(x in name_lower for x in ['android', 'ios', 'mobile', 'apk']):
return 'Mobile'
# Forensics
elif any(x in name_lower for x in ['forensic', 'memory', 'disk', 'volatility']):
return 'Forensics'
else:
return 'Misc'
def create_desktop_entry(module_name, script_path, category, output_dir):
"""Create a .desktop file for a module"""
# Clean name
display_name = module_name.replace('.sh', '').replace('-', ' ').title()
icon = CATEGORIES.get(category, 'β‘')
# Check if JSON config exists
json_path = script_path.replace('.sh', '.json')
has_config = os.path.exists(json_path)
# Get description from JSON if available
description = f"{category} attack module"
if has_config:
try:
with open(json_path, 'r') as f:
config = json.load(f)
description = config.get('description', description)
except:
pass
# Create desktop entry content
desktop_content = f"""[Desktop Entry]
Version=1.0
Type=Application
Name={icon} {display_name}
Comment={description}
Exec=bash -c 'cd {os.path.dirname(script_path)} && bash {script_path}; read -p "Press Enter to close..."'
Icon=/usr/share/icons/hicolor/256x256/apps/nullsec.png
Terminal=true
Categories=NullSecTools;{category.replace(' ', '')};
Keywords=nullsec;pentesting;security;{category.lower()};
StartupNotify=false
"""
# Sanitize filename
safe_name = module_name.replace('.sh', '').replace(' ', '-').lower()
desktop_file = f"nullsec-{safe_name}.desktop"
output_path = os.path.join(output_dir, desktop_file)
with open(output_path, 'w') as f:
f.write(desktop_content)
return output_path
def main():
print("\n" + "="*75)
print(" NullSec Linux - Module Desktop Entry Generator")
print("="*75 + "\n")
# Paths
modules_dir = os.path.expanduser("~/nullsec/nullsecurity")
output_dir = os.path.expanduser("~/.local/share/applications/nullsec-modules")
# Create output directory
os.makedirs(output_dir, exist_ok=True)
# Get all .sh files
modules = sorted([f for f in os.listdir(modules_dir) if f.endswith('.sh')])
print(f"[*] Found {len(modules)} modules")
print(f"[*] Output directory: {output_dir}\n")
# Group by category
categorized = {}
for module in modules:
category = get_module_category(module)
if category not in categorized:
categorized[category] = []
categorized[category].append(module)
# Create desktop entries
total_created = 0
for category, mods in sorted(categorized.items()):
print(f"\n{CATEGORIES.get(category, 'β‘')} {category}: {len(mods)} modules")
for mod in mods:
script_path = os.path.join(modules_dir, mod)
desktop_file = create_desktop_entry(mod, script_path, category, output_dir)
total_created += 1
print(f" β {mod}")
print(f"\n" + "="*75)
print(f" β
Created {total_created} desktop entries")
print(f" π Location: {output_dir}")
print("="*75 + "\n")
# Create category summary
print("\nπ Category Distribution:\n")
for category, mods in sorted(categorized.items(), key=lambda x: len(x[1]), reverse=True):
icon = CATEGORIES.get(category, 'β‘')
bar = "β" * min(50, len(mods))
print(f" {icon} {category:20s} [{len(mods):3d}] {bar}")
print("\n")
if __name__ == "__main__":
main()