Skip to content

Instantly share code, notes, and snippets.

@AdriDevelopsThings
Last active January 6, 2021 17:09
Show Gist options
  • Save AdriDevelopsThings/a6532153e301d96b4d2b1d4ed5c4cd65 to your computer and use it in GitHub Desktop.
Save AdriDevelopsThings/a6532153e301d96b4d2b1d4ed5c4cd65 to your computer and use it in GitHub Desktop.
Spam phishing site.
from argparse import ArgumentParser
from threading import Thread, Lock
from time import sleep
requires = ["names", "PySocks", "requests"]
import random
import sys
import names
import requests
a = "bcdfghjklmnpqrstvwxyz"
u = "aeiou"
pw_charset = (
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:,;-_+*'#/$§&="
)
email_provider = [
"gmail.com",
"web.de",
"gmx.de",
"gmx.net",
"yahoo.com",
"hotmail.com",
"aol.com",
"hotmail.co.uk",
"msn.com",
]
def getrandomchars(length):
if random.random() > 0.5:
b = random.choice(a)
else:
b = random.choice(u)
while len(b) < length:
if b[len(b) - 1] in a or random.random() > 0.7:
b += random.choice(u)
else:
b += random.choice(a)
return b
def get_domain():
if random.random() > 0.6:
domain = getrandomchars(random.randint(5, 13))
top_level_domain = random.choice(
[
".de",
".com",
".net",
".it",
".co",
".lgbt",
".gay",
".org",
".info",
".online",
]
)
if random.random() > 0.6:
domain += random.choice(["-", ".", "0", "a"])
if random.random() > 0.6:
n = names.get_last_name()
if random.random() > 0.76:
n = n[0].upper() + n[1:]
else:
n = getrandomchars(random.randint(6, 10))
if random.random() > 0.76:
n = n[0].upper() + n[1:]
domain += n
domain += top_level_domain
else:
domain = random.choice(email_provider)
if random.random() > 0.9:
domain = domain[0].upper() + domain[1:]
return domain
def get_random_mail():
firstname, lastname = names.get_full_name().split(" ")
if random.random() > 0.2:
f = firstname
else:
f = getrandomchars(random.randint(5, 11))
if random.random() > 0.3:
l = lastname
else:
l = getrandomchars(random.randint(6, 14))
if random.random() > 0.4:
f = f[0].upper() + f[1:]
if random.random() > 0.9:
l = l[0].upper() + l[1:]
return f"{l + random.choice(['_', '.', '0', '+', 'm', 'M', 'a', '1', '5']) + f}@{get_domain()}"
def random_password(length):
if random.random() > 0.6:
pw = ""
while len(pw) < length:
pw += random.choice(list(pw_charset))
return pw
elif random.random() > 0.6:
return (
getrandomchars(length / 2 - 1)
+ random.choice(list("*%&123456789013"))
+ random.choice(list("*%&123456789041"))
+ getrandomchars(length / 2 - 1)
)
else:
return getrandomchars(length)
counter = 0
class AdvancedLogger:
def __init__(self):
self.lock = Lock()
def send(self, t_id, t_text):
if not args.advanced_logging:
return
self.lock.acquire()
print(f"{counter} : T{t_id} : {t_text}")
self.lock.release()
advanced_logger = AdvancedLogger()
class Worker(Thread):
def __init__(self, t_id):
super().__init__()
self.t_id = t_id
self.stopped = False
self.session = requests.session()
self.session.proxies["http"] = "socks5h://localhost:9050/"
self.session.proxies["https"] = "socks5h://localhost:9050/"
def stop(self):
self.stopped = True
def run(self):
global counter
while not self.stopped:
payload = {
"email": get_random_mail(),
"password": random_password(random.randint(4, 15)),
}
self.session.post(
"https://chalkwoodhouse.co.za/dss/next.php",
allow_redirects=False,
data=payload,
)
sleep(random.random() / 10)
counter += 1
advanced_logger.send(self.t_id, f"Mail {payload['email']} Password: {payload['password']}")
default_threads = 6
try:
import psutil
default_threads = psutil.cpu_count()
except ImportError:
pass
parser = ArgumentParser()
parser.add_argument("-t", "--threads", type=int, default=default_threads)
parser.add_argument("-al", "--advanced-logging", action="store_true")
threads = []
args = parser.parse_args()
if __name__ == "__main__":
for i in range(args.threads):
threads.append(Worker(i))
for t in threads:
t.start()
try:
while True:
if not args.advanced_logging:
sys.stdout.write("\rRequest count: " + str(counter))
sys.stdout.flush()
sleep(0.01)
except KeyboardInterrupt:
print("Workers will be stopped...")
for t in threads:
t.stop()
for t in threads:
t.join()
print("Exit")
@ToasterUwU
Copy link

Packages that are needed to be downloaded: names, PySocks

@AdriBloober maybe you should add PySocks to the "required"

@AdriDevelopsThings
Copy link
Author

I added PySocks and requests to required.

CC @ToasterUwU

@mschultheiss83
Copy link

add maybe

# tor --hash-password "<new_password>"
# sudo nano /etc/tor/torrc
# find & uncomment ControlPort 9051
# find & uncomment HashedControlPassword <add_your_hash_here> from first command
# set your "new_password" down in renew_connection

from stem import Signal
from stem.control import Controller

# signal TOR for a new connection
def renew_connection():
    with Controller.from_port(port=9051) as controller:
        controller.authenticate(password="new_password")
        controller.signal(Signal.NEWNYM)


# make use of 
renew_connection()
# before time.sleep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment