0

I'm trying to send a "scammer" a bunch of fake email and passwords but i get this output:

Milan
[email protected]

this is the script:

import requests
import random

val = 1
url = 'https://repens.serveo.net/login.php'

while val == 1:
   file = open("/home/user/Documents/scam/names.json").readlines()
   random_name = random.choice(file)
   random_number = random.randint(0, 99)
   email_provider = ["@yahoo.com", "@gmail.com", "@walla.com"]
   random_email_provider = random.choice(email_provider)
   name = random_name
   username = "%s%s%s" % (name, random_number, random_email_provider)
   password = random.randint(0, 9999999)
   print(username)

    requests.post(url, allow_redirects=False, data={
        'username': username,
        'password': password    })

this is what my names file look like:

Liam Noah William James Logan

I also tried:

[ "Liam", "Noah", "William", "James", "Logan", ]

4
  • 2
    try a .strip() on the random_name Commented Feb 1, 2019 at 9:26
  • There may be a /n new line character in username. Strip it off as @chris mentioned Commented Feb 1, 2019 at 9:27
  • 1
    Possible duplicate of Python: avoid new line with print command Commented Feb 1, 2019 at 9:43
  • Share your names.json file Commented Feb 1, 2019 at 9:45

2 Answers 2

1

to get the 3 strings appended in a single line, you need to get the name without the next line character. You are getting the name from a file which is split by readlines(). You can put the names in a space separated format so you can get your names like this:

names = list(map(file.read().split()))



you could also do something like this for getting your names from the file:

with open('data.txt', 'r') as myfile:
    data=myfile.read().replace('\n', '')

reference : How to read a text file into a string variable?

Sign up to request clarification or add additional context in comments.

Comments

1

output


import requests
import random
import string
import json
import os


# setting variables
chars = string.ascii_letters + string.digits + '!@#$%^&*()'
random.seed = (os.urandom(1024))


# setting up different domain extensions
domain = ['.com', '.gov', '.us', '.edu', '.org', '.ru', '.tw', '.live', '.io', '.blog', '.biz', '.blog', '.co']


# url to overflow
url = 'https://www.stealmylogin.com/demo.html'

# loading and reading json files
names = json.loads(open('names.json').read())
org = json.loads(open('domain.json').read())

# setting up random users and password
for name in names:
    name_extra = ''.join(random.choice(string.digits))
    userId = name.lower() + name_extra + '@' + random.choice(org) + random.choice(domain)
    userPassword = ''.join(random.choice(chars) for i in range(8))

# sending user/password to url above
    requests.post(url, allow_redirects=False, data={
        'auid2yjauysd2uasdasdasd': userId,
        'kjauysd6sAJSDhyui2yasd': userPassword
    })


# print the results  - example: sending username [email protected] and password ankCRzk8
    print('sending username %s and password %s' % (userId, userPassword)).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.