-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgencombos_base64.py
More file actions
48 lines (37 loc) · 1.23 KB
/
Copy pathgencombos_base64.py
File metadata and controls
48 lines (37 loc) · 1.23 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
import base64
import fire
from os.path import exists
def gen(w1: str, w2: str, o: str):
"""
Custom Combos Wordlist Generator
:param w1: Wordlist 1 - A wordlist file for the left side.
:param w2: Wordlist 2 - A wordlist file for the right side.
:param o: Output File - Specify the name of the output file.
"""
# Check if file exists
if not exists(w1):
error_file_not_found(w1)
return
if not exists(w2):
error_file_not_found(w2)
return
if exists(o):
print("Error the Output File Already Exists: \"" + o + "\".\nPlease use the other name.")
return
# Read the given wordlists
with open(w1, 'r', errors='replace') as words1:
wordlist_1 = words1.read().splitlines()
with open(w2, 'r', errors='replace') as words2:
wordlist_2 = words2.read().splitlines()
# Generate the custom combos and save it
with open(o, 'a') as output:
for a in wordlist_1:
for b in wordlist_2:
combo = a + ':' + b
combo_base64 = base64.b64encode(combo.encode())
output.write(combo_base64.decode() + "\n")
print("Completed! Custom combos generated successfully!\n" + "Output-> \"" + o + "\"")
def error_file_not_found(file_name):
print("Error! File not found: " + "\""+ file_name + "\"")
if __name__ == '__main__':
fire.Fire(gen)