-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
151 lines (146 loc) · 4.75 KB
/
index.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
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PicoWQuack</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
color: white;
overflow: hidden;
}
.container {
background-color: black;
height: auto;
width: 400px;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
.textarea {
color: white;
resize: none;
width: 100%;
height: 400px;
max-width: 100%;
padding: 15px;
border-color: #87CEEB;
border-radius: 4px;
background: #000000;
font-family: "Courier New", Courier, monospace;
box-sizing: border-box;
margin-bottom: 10px;
overflow-y: auto;
}
button {
color: white;
padding: 14px 20px;
margin: 5px 10px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 25%;
}
.run {
background-color: #00AB66;
}
.upload {
background-color: #FFC72C;
color: black;
}
.save {
background-color: #FF033E;
}
.clear {
background-color: #7CB9E8;
}
.title {
font-size: 1.5rem;
margin-bottom: 1rem;
color: white;
border: 2px solid orange;
padding: 10px;
border-radius: 5px;
letter-spacing: 5px;
}
button:hover {
opacity: 0.8;
}
input[type="file"] {
display: none;
}
.buttons {
display: flex;
justify-content: center;
width: 100%;
}
</style>
</head>
<body>
<script>
function sendHttpRequest(data) {
console.log(data);
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://192.168.4.1/execute", true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
console[xhr.status === 200 ? 'log' : 'error'](
xhr.status === 200 ? "Request sent successfully!" : "Request failed. Status: " + xhr.status
);
}
};
xhr.send(JSON.stringify(data));
}
function main() {
var content = document.getElementById("content").value;
sendHttpRequest({ username: "Payload", content: content });
}
function handleFileSelect(event) {
var file = event.target.files[0];
var reader = new FileReader();
reader.onload = function(event) {
document.getElementById('content').value = event.target.result;
};
reader.readAsText(file);
}
function saveFile() {
var content = document.getElementById("content").value;
var blob = new Blob([content], { type: "text/plain;charset=utf-8" });
var link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = "payload.txt";
link.click();
}
function clearTextArea() {
document.getElementById("content").value = '';
}
function triggerFileInput() {
document.getElementById('fileInput').click();
}
</script>
<div class="container">
<div class="title">PicoWQuack</div>
<textarea id="content" class="textarea" placeholder="Enter text"></textarea>
<div class="buttons">
<button class="run" onclick="main()">Run</button>
<button class="upload" onclick="triggerFileInput()">Upload</button>
<input type="file" id="fileInput" onchange="handleFileSelect(event)">
<button class="save" onclick="saveFile()">Save</button>
<button class="clear" onclick="clearTextArea()">Clear</button>
</div>
</div>
</body>
</html>