-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
71 lines (63 loc) · 2.03 KB
/
index.js
File metadata and controls
71 lines (63 loc) · 2.03 KB
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
const open = require("open");
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const hostile = require("hostile");
var website = {
sitekey: "6LeoeSkTAAAAAA9rkZs5oS82l69OEYjKRZAiKdaF",
url: "http://supremenewyork.com/",
port: 3000,
};
app.use(
bodyParser.urlencoded({
extended: false,
})
);
app.listen(website.port, () =>
console.log("Listening on port " + website.port)
);
app.get("/", function (req, res) {
res.send(`<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Captcha Harvester</title>
</head>
<body style="background-color: #303030;">
<div class="g-recaptcha" data-callback="sendToken" data-sitekey="${website.sitekey}" style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"></div>
<script>
function sendToken()
{
post('/', {'g-recaptcha-response': grecaptcha.getResponse()});
}
function post(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}
</script>
<script src='https://www.google.com/recaptcha/api.js'></script>
</body>
</html>`);
});
app.post("/", function (request, response) {
console.log(request.body);
response.redirect("/");
});
hostile.set("::1", "captcha." + website.url, function (err) {
open("http://localhost" + ":" + website.port);
});