-
Notifications
You must be signed in to change notification settings - Fork 5
/
spammer.py
130 lines (105 loc) · 3.91 KB
/
spammer.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
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
# IMPORTS
import requests
import os
import random
import string
import json
import shutil
import sys
import platform
from random import randrange
#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
#Choose settings file generated from 'settings-generator.py'
settingsfilejson = input('Settings file (If empty = settings.json) => ')
#If user didn't choose a settings file, use 'settings.json' as default
if settingsfilejson == '': settingsfilejson = 'settings.json'
#Checks if filename input has the extension .json
root, ext = os.path.splitext(settingsfilejson)
if not ext:
ext = '.json'
settingsfilejson = root + ext
#Loads .json files. //Settings, names and passwords
settings = json.loads(open(settingsfilejson).read())
names = json.loads(open(settings['namesJson']).read())
passwords = json.loads(open(settings['passwordsJson']).read())
#Clears terminal
if(platform.system() == 'Windows'):
os.system('cls')
else:
os.system('clear')
#Variables/Dicts
domains = settings['domains']
version = settings['version']
url = settings['targetUrl']
#Makes terminal sexy
COLORS = {\
"red": "\u001b[31;1m",
"magenta":"\u001b[35m",
"reset":"\u001b[0m",
}
#Random variables
random.seed = (os.urandom(1024))
#Declares color rules for the terminal
def colorText(text):
for color in COLORS:
text = text.replace("[[" + color + "]]", COLORS[color])
return text
#Terminal header
title = 'Velip Spam Bot' + version
print(drawLine('-'))
print(str.center(title, allign_center(title)))
print(str.center('github.com/v3lip/PhishingSpammer', allign_center('github.com/v3lip/PhishingSpammer')))
print(drawLine('-'))
#Int for counting the loop
run = 0
#Program
try:
while True:
#Random email generator
chance = random.randint(1, 100)
atdomain = '@' + random.choice(domains)
if 1 <= chance <= 5:
username = random.choice(names) + atdomain
if 6 <= chance <= 20:
name_extra = str(randrange(0, 99))
username = random.choice(names) + name_extra + atdomain
if 21 <= chance <= 42:
name_extra = str(randrange(0, 99))
username = random.choice(names) + '_' + name_extra + atdomain
if 43 <= chance <= 50:
name_extra = str(randrange(0, 99))
username = random.choice(names) + '_' + random.choice(names) + name_extra + atdomain
if 51 <= chance <= 70:
username = random.choice(names) + '.' + random.choice(names) + atdomain
if 71 <= chance <= 80:
name_extra = str(randrange(0, 99))
username = random.choice(names) + random.choice(names) + name_extra + atdomain
if 81 <= chance <= 100:
name_extra = str(randrange(0, 99))
username = random.choice(names) + name_extra + atdomain
username = username.lower()
#Picks random password from the Rockyou passwords file
password = random.choice(passwords)
#Sending username and password to the victim
requests.post(url, allow_redirects=False, data={
settings['postUsername']: username,
settings['postPassword']: password
})
#Prints out current count and username/password sent to the site
run = run+1
print (colorText('{}) Sending username [[red]]{}[[reset]] and password [[magenta]]{}[[reset]]..').format(run, username, password))
except KeyboardInterrupt:
#Shows the total number of spammed login attempts
print(drawLine('-'))
print(colorText('Done! Spammed [[red]]{}[[reset]] times to [[red]]{}[[reset]]!'.format(run, url)))
print('github.com/v3lip/PhishingSpammer')