@@ -107,19 +107,19 @@ def cmd_dump_sms(*args)
107
107
108
108
::File . open ( path , 'wb' ) do |fd |
109
109
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 " )
113
113
114
114
time = Time . new
115
- fd . write ( ' Date: #{time.inspect}\n' )
115
+ fd . write ( " Date: #{ time . inspect } \n " )
116
116
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 " )
119
119
120
120
smsList . each_with_index { |a , index |
121
121
122
- fd . write ( ' ##{(index.to_i + 1).to_s()}\n' )
122
+ fd . write ( " ##{ ( index . to_i + 1 ) . to_s ( ) } \n " )
123
123
124
124
type = 'Unknown'
125
125
if a [ 'type' ] == '1'
@@ -143,14 +143,14 @@ def cmd_dump_sms(*args)
143
143
status = 'SMS_REPLACED_BY_SC'
144
144
end
145
145
146
- fd . write ( ' Type\t: #{type}\n' )
146
+ fd . write ( " Type\t : #{ type } \n " )
147
147
148
148
time = a [ 'date' ] . to_i / 1000
149
149
time = Time . at ( time )
150
150
151
151
fd . write ( "Date\t : #{ time . strftime ( '%Y-%m-%d %H:%M:%S' ) } \n " )
152
152
fd . write ( "Address\t : #{ a [ 'address' ] } \n " )
153
- fd . write ( ' Status\t: #{status}\n' )
153
+ fd . write ( " Status\t : #{ status } \n " )
154
154
fd . write ( "Message\t : #{ a [ 'body' ] } \n \n " )
155
155
}
156
156
end
@@ -162,7 +162,7 @@ def cmd_dump_sms(*args)
162
162
163
163
return true
164
164
rescue
165
- print_error ( ' Error getting messages' )
165
+ print_error ( " Error getting messages: #{ $! } " )
166
166
return false
167
167
end
168
168
else
@@ -204,44 +204,44 @@ def cmd_dump_contacts(*args)
204
204
205
205
::File . open ( path , 'wb' ) do |fd |
206
206
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 " )
210
210
211
211
time = Time . new
212
- fd . write ( ' Date: #{time.inspect}\n' )
212
+ fd . write ( " Date: #{ time . inspect } \n " )
213
213
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 " )
216
216
217
217
contactList . each_with_index { |c , index |
218
218
219
- fd . write ( ' ##{(index.to_i + 1).to_s()}\n' )
219
+ fd . write ( " ##{ ( index . to_i + 1 ) . to_s ( ) } \n " )
220
220
fd . write ( "Name\t : #{ c [ 'name' ] } \n " )
221
221
222
222
if c [ 'number' ] . count > 0
223
223
( c [ 'number' ] ) . each { |n |
224
- fd . write ( ' Number\t: #{n}\n' )
224
+ fd . write ( " Number\t : #{ n } \n " )
225
225
}
226
226
end
227
227
228
228
if c [ 'email' ] . count > 0
229
229
( c [ 'email' ] ) . each { |n |
230
- fd . write ( ' Email\t: #{n}\n' )
230
+ fd . write ( " Email\t : #{ n } \n " )
231
231
}
232
232
end
233
233
234
- fd . write ( '\n' )
234
+ fd . write ( " \n " )
235
235
}
236
236
end
237
237
238
238
path = ::File . expand_path ( path )
239
- print_status ( ' Contacts list saved to: #{path}' )
239
+ print_status ( " Contacts list saved to: #{ path } " )
240
240
Rex ::Compat . open_file ( path )
241
241
242
242
return true
243
243
rescue
244
- print_error ( ' Error getting contacts list' )
244
+ print_error ( " Error getting contacts list: #{ $! } " )
245
245
return false
246
246
end
247
247
else
@@ -320,19 +320,19 @@ def cmd_dump_calllog(*args)
320
320
321
321
::File . open ( path , 'wb' ) do |fd |
322
322
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 " )
326
326
327
327
time = Time . new
328
- fd . write ( ' Date: #{time.inspect}\n' )
328
+ fd . write ( " Date: #{ time . inspect } \n " )
329
329
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 " )
332
332
333
333
log . each_with_index { |a , index |
334
334
335
- fd . write ( ' ##{(index.to_i + 1).to_s()}\n' )
335
+ fd . write ( " ##{ ( index . to_i + 1 ) . to_s ( ) } \n " )
336
336
337
337
fd . write ( "Number\t : #{ a [ 'number' ] } \n " )
338
338
fd . write ( "Name\t : #{ a [ 'name' ] } \n " )
@@ -343,12 +343,12 @@ def cmd_dump_calllog(*args)
343
343
end
344
344
345
345
path = ::File . expand_path ( path )
346
- print_status ( ' Call log saved to: #{path}' )
346
+ print_status ( " Call log saved to: #{ path } " )
347
347
Rex ::Compat . open_file ( path )
348
348
349
349
return true
350
350
rescue
351
- print_error ( ' Error getting call log' )
351
+ print_error ( " Error getting call log: #{ $! } " )
352
352
return false
353
353
end
354
354
else
0 commit comments