-
Notifications
You must be signed in to change notification settings - Fork 5
/
settings-generator.py
101 lines (90 loc) · 2.68 KB
/
settings-generator.py
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
#IMPORTS
import json
import string
import os
import objdict
import random
import platform
#Functions
def drawLine(symbol):
rows, columns = os.get_terminal_size()
i = symbol
for x in range(2, rows):
i += symbol
return i
def allign_center(text):
rows, columns = os.get_terminal_size()
devided = rows - 1
return devided
#Clears terminal
if(platform.system() == 'Windows'):
os.system('cls')
else:
os.system('clear')
#Terminal header
title = 'Velip Spam Bot - Settings Generator'
print(drawLine('-'))
print(str.center(title, allign_center(title)))
print(drawLine('-'))
#Inputs
#Save file with a custom name
jsonFilename = input('Save file as => ')
#If no filename input, generate one
if jsonFilename == "":
jsonFilename = "settings_"
for i in range(6):
jsonFilename = jsonFilename + random.choice(string.ascii_letters)
jsonFilename = jsonFilename.lower()
#Checks if filename input has the extension .json
root, ext = os.path.splitext(jsonFilename)
if not ext:
ext = '.json'
jsonFilename = root + ext
#Inputs
targetUrl = input('Target URL (http://example.com/login.php) => ')
namesJson = input('Names JSON File (If empty = names.json) => ')
if namesJson == "": namesJson = "names.json"
root, ext = os.path.splitext(namesJson)
if not ext:
ext = '.json'
namesJson = root + ext
passwordsJson = input('Passwords JSON File (If empty = passwords.json) => ')
if passwordsJson == "": passwordsJson = "passwords.json"
#Checks if filename input has the extension .json
root, ext = os.path.splitext(passwordsJson)
if not ext:
ext = '.json'
passwordsJson = root + ext
postUsername = input('Form username HTML name (If empty = username) => ')
if postUsername == "": postUsername = "username"
postPassword = input('Form password HTML name (If empty = password) => ')
if postPassword == "": postPassword = "password"
#Generation user input to .json file
print('\nGenerating..')
myDictObj = { \
"title" : "https://github.com/v3lip/PhishingSpammer/",
"version" : "V1.4",
"targetUrl" : targetUrl,
"namesJson" : namesJson,
"passwordsJson" : passwordsJson,
"postUsername" : postUsername,
"postPassword" : postPassword,
"domains" : [
"hotmail.com",
"gmail.com",
"outlook.com",
"live.com",
"email.com",
"yahoo.com",
"icloud.com",
"msn.com",
"edu.com",
"free.fr",
"web.de",
"mail.ru"
]
}
#Puts data in to the json file
with open(jsonFilename, 'w') as outfile:
json.dump(myDictObj, outfile)
print('\nJSON was saved as {}!'.format(jsonFilename))