-
Notifications
You must be signed in to change notification settings - Fork 25
/
breakfold.py
executable file
·115 lines (64 loc) · 2.3 KB
/
breakfold.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
#!/usr/bin/env python3
import sys
import platform
ver = platform.python_version()
if (ver <= '3'):
print("\033[91m Breakfold isn't compatible with python2 use python 3.x\033[00m")
sys.exit(1)
import random
import time
import os
try:
from stem import Signal
from stem.control import Controller
import requests
except ImportError:
print("\033[91m Install stem and requests with pip\033[00m")
sys.exit(1)
print("""\033[91m
_ _ __ _ _
| | | | / _| | | | |
| |__ _ __ ___ __ _| | _| |_ ___ | | __| |
| '_ \| '__/ _ \/ _` | |/ / _/ _ \| |/ _` |
| |_) | | | __/ (_| | <| || (_) | | (_| |
|_.__/|_| \___|\__,_|_|\_\_| \___/|_|\__,_|\033[00m
\033[93mv.1.0
By chaskar_shubham\033[00m
""")
#tor_password = input("\033[92m Enter your tor password: \033[00m")
address = input("\033[92m Enter blog address: \033[00m")
views = int(input("\033[92m How many views you want: \033[00m"))
# signal Tor for new identity
def renew_connection():
with Controller.from_port(address="127.0.0.1", port = 9051) as controller:
controller.authenticate(password="") #password can be found in torrc file(HashedControlPassword)
controller.signal(Signal.NEWNYM)
controller.signal(Signal.HUP)
time.sleep(5)
def tor_session():
#setup proxies
session = requests.session()
session.proxies = {}
session.proxies['http'] = 'socks5://localhost:9050'
session.proxies['https'] = 'socks5://localhost:9050'
return session
def visit():
#file which contains user-agent lists
with open('agents.txt','r') as file:
lines = open('agents.txt').read().splitlines()
for num in range(views):
header_value = random.choice(lines)
header = {}
header['User-Agent'] = header_value
session = tor_session()
session.get(address, headers=header) #visiting the URL given by the user
print("\033[92m-\033[00m" * 150)
print("\033[92m Page Visited with following ip with user-agent..\033[00m")
print(session.get('http://httpbin.org/ip').text) #display current ip
print(session.get('http://httpbin.org/user-agent', headers=header).text) #display current user-agent
renew_connection()
if num == (views - 1):
print("\033[92m-\033[00m " * 150)
print("\033[01m\033[93m successfully visited website ",views, "times\033[00m")
sys.exit(0)
visit()