Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
routersploit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
czos-dpend
routersploit
Commits
6941fb47
Commit
6941fb47
authored
Apr 19, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding mute() decorator that suppress functions from printing to sys.stdout.
parent
78c76930
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
__init__.py
routersploit/__init__.py
+1
-0
ar_1004g_password_disclosure.py
...it/modules/exploits/asmax/ar_1004g_password_disclosure.py
+2
-0
utils.py
routersploit/utils.py
+17
-0
No files found.
routersploit/__init__.py
View file @
6941fb47
...
...
@@ -9,6 +9,7 @@ from routersploit.utils import (
random_text
,
http_request
,
boolify
,
mute
,
)
from
routersploit
import
exploits
...
...
routersploit/modules/exploits/asmax/ar_1004g_password_disclosure.py
View file @
6941fb47
...
...
@@ -8,6 +8,7 @@ from routersploit import (
print_success
,
print_table
,
http_request
,
mute
,
)
...
...
@@ -62,6 +63,7 @@ class Exploit(exploits.Exploit):
else
:
print_error
(
"Credentials could not be found"
)
@mute
def
check
(
self
):
url
=
sanitize_url
(
"{}:{}/password.cgi"
.
format
(
self
.
target
,
self
.
port
))
...
...
routersploit/utils.py
View file @
6941fb47
...
...
@@ -87,6 +87,23 @@ def stop_after(space_number):
return
_outer_wrapper
class
DummyFile
(
object
):
""" Mocking file object. Optimalization for the "mute" decorator. """
def
write
(
self
,
x
):
pass
def
mute
(
fn
):
""" Suppress function from printing to sys.stdout """
@wraps
(
fn
)
def
wrapper
(
self
,
*
args
,
**
kwargs
):
sys
.
stdout
=
DummyFile
()
try
:
return
fn
(
self
,
*
args
,
**
kwargs
)
finally
:
sys
.
stdout
=
sys
.
__stdout__
return
wrapper
def
__cprint
(
*
args
,
**
kwargs
):
""" Color print()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment