Advertisement
intriguingideas

[JavaScript] reCaptcha Harvester

Nov 23rd, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //By AscendingBridges
  2. //Dependencies
  3. const Open = require("open");
  4. const Express = require("express")
  5. const Hostile = require("hostile")
  6. const bodyParser = require("body-parser")
  7. const Application = Express();
  8.  
  9. var WebsiteData = {
  10.     Sitekey: '6LeWwRkUAAAAAOBsau7KpuC9AV-6J8mhw4AjC3Xz', //Sitekey for reCaptcha it's different on all sites.
  11.     Url: 'supremenewyork.com',
  12. }
  13.  
  14. Application.use(bodyParser.urlencoded({
  15.     extended: true
  16. }))
  17.  
  18. //Listens at default port, 80
  19. Application.listen(80, () => {
  20.     console.log("Listening at port 80.");
  21. });
  22. Application.get('/', async function (Request, Result) {
  23.     Result.send(`<html>
  24.     <!-- Written by AscendingBridges -->
  25.     <head>
  26.         <title>Captcha Harvester</title>
  27.         <meta charset="utf-8">
  28.         <style type="text/css">
  29.             body {
  30.                 max-width: 500px;
  31.                 margin: auto;
  32.             }
  33.     </style>
  34. </head>
  35. <body style="background-color:grey;"> <!-- Set the background color to grey. -->
  36. <center>
  37. <b><p style="font-size:20px">
  38. reCaptcha Harvester by AscendingBridges</span></p></b>
  39.  
  40.     <div class="g-recaptcha" data-callback="sendResponse" data-sitekey="${WebsiteData.Sitekey}" style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"></div>
  41.     <script>
  42.     function sendResponse() {
  43.         postData('/', {'Recaptcha Response': grecaptcha.getResponse()}); <!-- Post the data -->
  44.         grecaptcha.reset(); <!-- Reset the captcha -->
  45.     }
  46.     function postData(Path, Params, Method) {
  47.         Method = Method || "post";
  48.         var Form = document.createElement("form");
  49.         Form.setAttribute("Method", Method);
  50.         Form.setAttribute("action", Path);
  51.         for(var Key in Params) {
  52.             if(Params.hasOwnProperty(Key)) {
  53.                 var hiddenField = document.createElement("input");
  54.                 hiddenField.setAttribute("type", "hidden");
  55.                 hiddenField.setAttribute("name", Key);
  56.                 hiddenField.setAttribute("value", Params[Key]);
  57.                 Form.appendChild(hiddenField);
  58.             }
  59.         }
  60.         document.body.appendChild(Form);
  61.         Form.submit(); <!-- Submit the form -->
  62.     }
  63.     </script>
  64.     <form action="/submit" Method="post" style="margin-top: 250px;">
  65.         <div id="captchaFrame">
  66.             <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>
  67.     </div>
  68.     </form>
  69.     </center>
  70. </html>`)
  71. });
  72.  
  73. Application.post('/', async function (Request, Response) { //Post and output the body and headers.
  74.     console.log(Request.headers);
  75.     console.log(Request.body);
  76. });
  77.  
  78. Hostile.set("::1", "captcha." + WebsiteData.Url, () => {
  79.     Open('http://captcha.' + WebsiteData.Url); //Open a new browser
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement