Skip to content

Commit 9f0bf67

Browse files
committed
fixing minor bugs
1 parent e908bb6 commit 9f0bf67

File tree

1 file changed

+31
-31
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher

1 file changed

+31
-31
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,19 @@ def cmd_dump_sms(*args)
107107

108108
::File.open(path, 'wb') do |fd|
109109

110-
fd.write('\n=====================\n')
111-
fd.write('[+] Sms messages dump\n')
112-
fd.write('=====================\n\n')
110+
fd.write("\n=====================\n")
111+
fd.write("[+] Sms messages dump\n")
112+
fd.write("=====================\n\n")
113113

114114
time = Time.new
115-
fd.write('Date: #{time.inspect}\n')
115+
fd.write("Date: #{time.inspect}\n")
116116
fd.write("OS: #{info['OS']}\n")
117-
fd.write('Remote IP: #{client.sock.peerhost}\n')
118-
fd.write('Remote Port: #{client.sock.peerport}\n\n')
117+
fd.write("Remote IP: #{client.sock.peerhost}\n")
118+
fd.write("Remote Port: #{client.sock.peerport}\n\n")
119119

120120
smsList.each_with_index { |a, index|
121121

122-
fd.write('##{(index.to_i + 1).to_s()}\n')
122+
fd.write("##{(index.to_i + 1).to_s()}\n")
123123

124124
type = 'Unknown'
125125
if a['type'] == '1'
@@ -143,14 +143,14 @@ def cmd_dump_sms(*args)
143143
status = 'SMS_REPLACED_BY_SC'
144144
end
145145

146-
fd.write('Type\t: #{type}\n')
146+
fd.write("Type\t: #{type}\n")
147147

148148
time = a['date'].to_i / 1000
149149
time = Time.at(time)
150150

151151
fd.write("Date\t: #{time.strftime('%Y-%m-%d %H:%M:%S')}\n")
152152
fd.write("Address\t: #{a['address']}\n")
153-
fd.write('Status\t: #{status}\n')
153+
fd.write("Status\t: #{status}\n")
154154
fd.write("Message\t: #{a['body']}\n\n")
155155
}
156156
end
@@ -162,7 +162,7 @@ def cmd_dump_sms(*args)
162162

163163
return true
164164
rescue
165-
print_error('Error getting messages')
165+
print_error("Error getting messages: #{$!}")
166166
return false
167167
end
168168
else
@@ -204,44 +204,44 @@ def cmd_dump_contacts(*args)
204204

205205
::File.open(path, 'wb') do |fd|
206206

207-
fd.write('\n======================\n')
208-
fd.write('[+] Contacts list dump\n')
209-
fd.write('======================\n\n')
207+
fd.write("\n======================\n")
208+
fd.write("[+] Contacts list dump\n")
209+
fd.write("======================\n\n")
210210

211211
time = Time.new
212-
fd.write('Date: #{time.inspect}\n')
212+
fd.write("Date: #{time.inspect}\n")
213213
fd.write("OS: #{info['OS']}\n")
214-
fd.write('Remote IP: #{client.sock.peerhost}\n')
215-
fd.write('Remote Port: #{client.sock.peerport}\n\n')
214+
fd.write("Remote IP: #{client.sock.peerhost}\n")
215+
fd.write("Remote Port: #{client.sock.peerport}\n\n")
216216

217217
contactList.each_with_index { |c, index|
218218

219-
fd.write('##{(index.to_i + 1).to_s()}\n')
219+
fd.write("##{(index.to_i + 1).to_s()}\n")
220220
fd.write("Name\t: #{c['name']}\n")
221221

222222
if c['number'].count > 0
223223
(c['number']).each { |n|
224-
fd.write('Number\t: #{n}\n')
224+
fd.write("Number\t: #{n}\n")
225225
}
226226
end
227227

228228
if c['email'].count > 0
229229
(c['email']).each { |n|
230-
fd.write('Email\t: #{n}\n')
230+
fd.write("Email\t: #{n}\n")
231231
}
232232
end
233233

234-
fd.write('\n')
234+
fd.write("\n")
235235
}
236236
end
237237

238238
path = ::File.expand_path(path)
239-
print_status('Contacts list saved to: #{path}')
239+
print_status("Contacts list saved to: #{path}")
240240
Rex::Compat.open_file(path)
241241

242242
return true
243243
rescue
244-
print_error('Error getting contacts list')
244+
print_error("Error getting contacts list: #{$!}")
245245
return false
246246
end
247247
else
@@ -320,19 +320,19 @@ def cmd_dump_calllog(*args)
320320

321321
::File.open(path, 'wb') do |fd|
322322

323-
fd.write('\n=================\n')
324-
fd.write('[+] Call log dump\n')
325-
fd.write('=================\n\n')
323+
fd.write("\n=================\n")
324+
fd.write("[+] Call log dump\n")
325+
fd.write("=================\n\n")
326326

327327
time = Time.new
328-
fd.write('Date: #{time.inspect}\n')
328+
fd.write("Date: #{time.inspect}\n")
329329
fd.write("OS: #{info['OS']}\n")
330-
fd.write('Remote IP: #{client.sock.peerhost}\n')
331-
fd.write('Remote Port: #{client.sock.peerport}\n\n')
330+
fd.write("Remote IP: #{client.sock.peerhost}\n")
331+
fd.write("Remote Port: #{client.sock.peerport}\n\n")
332332

333333
log.each_with_index { |a, index|
334334

335-
fd.write('##{(index.to_i + 1).to_s()}\n')
335+
fd.write("##{(index.to_i + 1).to_s()}\n")
336336

337337
fd.write("Number\t: #{a['number']}\n")
338338
fd.write("Name\t: #{a['name']}\n")
@@ -343,12 +343,12 @@ def cmd_dump_calllog(*args)
343343
end
344344

345345
path = ::File.expand_path(path)
346-
print_status('Call log saved to: #{path}')
346+
print_status("Call log saved to: #{path}")
347347
Rex::Compat.open_file(path)
348348

349349
return true
350350
rescue
351-
print_error('Error getting call log')
351+
print_error("Error getting call log: #{$!}")
352352
return false
353353
end
354354
else

0 commit comments

Comments
 (0)