Skip to content

Commit 6d2041b

Browse files
committed
Fix crashing mipsle modules
1 parent 0c5a021 commit 6d2041b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

modules/payloads/singles/linux/mipsbe/exec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: binary -*-
2+
13
##
24
# This module requires Metasploit: https://metasploit.com/download
35
# Current source: https://github.com/rapid7/metasploit-framework
@@ -70,7 +72,9 @@ def generate(_opts = {})
7072
shellcode = shellcode + command_string + "\x00"
7173

7274
# we need to align our shellcode to 4 bytes
73-
(shellcode = shellcode + "\x00") while shellcode.length%4 != 0
75+
while shellcode.bytesize%4 != 0
76+
shellcode = shellcode + "\x00"
77+
end
7478

7579
return super + shellcode
7680

modules/payloads/singles/linux/mipsle/exec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: binary -*-
2+
13
##
24
# This module requires Metasploit: https://metasploit.com/download
35
# Current source: https://github.com/rapid7/metasploit-framework
@@ -71,7 +73,9 @@ def generate(_opts = {})
7173
shellcode = shellcode + command_string + "\x00"
7274

7375
# we need to align our shellcode to 4 bytes
74-
(shellcode = shellcode + "\x00") while shellcode.length%4 != 0
76+
while shellcode.bytesize%4 != 0
77+
shellcode = shellcode + "\x00"
78+
end
7579

7680
return super + shellcode
7781

0 commit comments

Comments
 (0)