Commit c3f817ab by fwkz

Adding boolify() helper function.

parent dbe56604
...@@ -8,6 +8,7 @@ from routersploit.utils import ( ...@@ -8,6 +8,7 @@ from routersploit.utils import (
LockedIterator, LockedIterator,
random_text, random_text,
http_request, http_request,
boolify,
) )
from routersploit import exploits from routersploit import exploits
......
...@@ -11,6 +11,7 @@ from routersploit import ( ...@@ -11,6 +11,7 @@ from routersploit import (
LockedIterator, LockedIterator,
print_success, print_success,
print_table, print_table,
boolify,
) )
...@@ -35,6 +36,7 @@ class Exploit(exploits.Exploit): ...@@ -35,6 +36,7 @@ class Exploit(exploits.Exploit):
credentials = [] credentials = []
def run(self): def run(self):
print self.verbosity
self.credentials = [] self.credentials = []
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
...@@ -70,7 +72,7 @@ class Exploit(exploits.Exploit): ...@@ -70,7 +72,7 @@ class Exploit(exploits.Exploit):
print_error("Credentials not found") print_error("Credentials not found")
def target_function(self, running, data): def target_function(self, running, data):
module_verbosity = bool(self.verbosity) module_verbosity = boolify(self.verbosity)
name = threading.current_thread().name name = threading.current_thread().name
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
......
from __future__ import print_function from __future__ import print_function
import threading import threading
from functools import wraps from functools import wraps
from distutils.util import strtobool
import sys import sys
import random import random
import string import string
...@@ -272,3 +273,7 @@ def http_request(method, url, **kwargs): ...@@ -272,3 +273,7 @@ def http_request(method, url, **kwargs):
except requests.RequestException as error: except requests.RequestException as error:
print_error(error) print_error(error)
return return
def boolify(value):
return strtobool(value)
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