Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!

cracked.io | Best Forum Around | Free Premium Accounts




 550

simple python script for searching admin pages

by dowjones2k18 - 28 January, 2019 - 04:36 PM
This post is by a banned member (dowjones2k18) - Unhide
9
Posts
1
Threads
5 Years of service
#1
I wrote a simple python script for searching admins.

It is still damp and slow, because it works only in one stream. But it works.

1. The script works through the Tor browser. You need to install Tor and run it.
2. Add your url to the domains.txt file
3. Create a login.txt file and add the paths of possible admins https://pastebin.com/qU41LC8s
4. Result in file result.csv : http://ipic.su/img/img7/fs/kiss_17kb.1548686047.png

script:


Hidden Content
You must register or login to view this content.


Code:
import socks
import socket
import requests
from bs4 import BeautifulSoup
from requests_html import HTMLSession
from urllib.parse import urlparse
from fake_useragent import UserAgent


def host_from_url(url):
parsed_uri = urlparse(url)
result = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
# print('function host_from_url' + result)
return result


def admin_finder(host, path):
with HTMLSession() as session:
r = session.get(f'{host}{path}', headers={'User-Agent': UserAgent().chrome})
# print(UserAgent().chrome)
# print(host + path)
# print(str(r.status_code))
if r.status_code == 200:
print(f'Find page;{r.status_code};{host}{path}')
result = (f'Find page;{r.status_code};{host}{path}')
return result
else:
print(f'None;{r.status_code};{host}{path}')


def checkIP():
ip = requests.get('http://checkip.dyndns.org').content
soup = BeautifulSoup(ip, 'html.parser')
print(soup.find('body').text)


socks.set_default_proxy(socks.SOCKS5, "localhost", 9150)
socket.socket = socks.socksocket

checkIP()


with open('domains.txt', 'r', encoding='utf-8') as url_list:
with open('result.csv', 'a', encoding='utf-8') as res_file:
for url in url_list:
with open('login.txt', 'r', encoding='utf-8') as pathses:
for path in pathses:
url = url.replace('\n', '')
path = path.replace('\n', '')
domain = host_from_url(url)
res = admin_finder(domain, path)
if res != None:
res_file.write(str(res) + '\n')
else:
continue
This post is by a banned member (marter14) - Unhide
marter14  
Registered
417
Posts
0
Threads
#2
Th

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)