Sign in to follow this  
dowjones2k18

simple python script for searching admin pages

Recommended Posts

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:

 

[hide]

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

[/hide]


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this