Skip to content

Instantly share code, notes, and snippets.

@jossef
Last active April 15, 2017 08:06
Show Gist options
  • Select an option

  • Save jossef/dc34770c4ca7ba4f5ad079c37fbb96bc to your computer and use it in GitHub Desktop.

Select an option

Save jossef/dc34770c4ca7ba4f5ad079c37fbb96bc to your computer and use it in GitHub Desktop.
icloud phishing site random data generator
#!/usr/bin/env python
import random
import string
from threading import Thread
import requests
from bs4 import BeautifulSoup
user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
url = 'http://icloudpages.com'
def get_random_proxy():
r = requests.get('https://gimmeproxy.com/api/getProxy?get=true&user-agent=true&post=true&maxCheckPeriod=3600')
r.raise_for_status()
response = r.json()
return response['ipPort']
def get_csrf_token(url, proxy):
r = requests.get(url, headers={'User-Agent': user_agent}, proxies={"http": proxy})
r.raise_for_status()
data = r.text
soup = BeautifulSoup(data, "html.parser")
for element in soup.find_all('input', attrs={'name': 'csrf_test_name'}):
return element['value']
running = True
def worker():
while running:
try:
proxy = get_random_proxy()
csrf_token = get_csrf_token(url, proxy)
print proxy, 'using csrf token', csrf_token
counter = 0
while running:
username = random_string(random.randint(10, 20))
password = random_string(random.randint(10, 9999))
email_provider = random.choice(['gmail.com', 'walla.com', 'icloud.com'])
body = 'csrf_test_name={0}&apple_add=&apple_id={1}%40{2}&apple_pwd={3}'.format(csrf_token, username, email_provider, password)
headers = {
'User-Agent': user_agent,
'X-Requested-With': 'XMLHttpRequest'
}
r = requests.post(url + '/save.php', headers=headers, data=body, proxies={"http": proxy})
r.raise_for_status()
counter += 1
print proxy, counter
except Exception as e:
print e
def random_string(length):
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(length))
def main():
threads = []
threads_count = 5
for i in xrange(threads_count):
thread = Thread(target=worker)
thread.start()
threads.append(thread)
for thread in threads:
thread.join()
if __name__ == '__main__':
try:
main()
except:
running = False
raise
@jossef
Copy link
Author

jossef commented Apr 14, 2017

this is a script to troll a phishing site with random data

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