Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
may be kinda buggy for some clients like Oracle SSH and PM2 cause of some functions might not exist? In that case open an issue and I'll respond and make a commit later.
  • Loading branch information
listingclown3 authored Apr 27, 2023
0 parents commit 18823fb
Show file tree
Hide file tree
Showing 4 changed files with 1,444 additions and 0 deletions.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
--------------------

# Pterodactyl-Credit-Maker
Headless chrome browser that will stay generate credits for you on Pterodactyl/Jexacytl/Whatever other Pterodactyl copies that allow AFK Coins gaining.

--------------------

# Security
NONE of your data/discord tokens are stored ANYWHERE, and by making this source open on GitHub, it provides clarity and trust between the developer and client.
But, providers CAN see the logs in terminal, so be careful with your hosts.

--------------------

# Hosting
Input the OAuth Link into the console, such as neronodes.net's oauth

--------------------

# How It Works
1. Using Puppeteer, the client will use your Discord token to log into Pterodactyl account through Discord OAuth
2. Input the necessary information to start the client
3. Depending on the credit amount you want to earn, puppeteer will stand idle on the page for "x" amount of minutes <- (credit amount)
4. Once the process is done waiting, it will shut off
5. Enjoy your new credits completely automated, cheap, and amazing!

--------------------

# Prerequisite
Must have already made an account at https://neronodes.net, linked your discord account, and authorized the Nero Backend OAuth in Discord.

Must have also already download Chromium and NodeJS on any of the production machines you are going to use with this client.

[Install Chromium](https://www.omgubuntu.co.uk/2019/08/install-chromium-browser-ubuntu)

[Installing any necessary packages in accordance to any errors thrown](https://gist.github.com/winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01)

--------------------

# How to Deploy
**WARNING: DO NOT USE THE NERONODES INSTANCE TO GAIN COINS, IT IS VERY SUSPICIOUS AND CAN JEOPARDIZE YOUR EXPERIENCE AND OTHERS**

1. Clone this repository on another production server, [How To Clone A Git Repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
2. Install any necessary packages (npm i discord.js puppeteer)
3. Run `npm run start`, if errors occur, please check prerequisites
4. Enter in the amount of credits to gain
5. Enter in your discord token, [How To Get Your Discord User Token](https://www.youtube.com/watch?v=YEgFvgg7ZPI)
6. Let it run!

--------------------

# Miscellaneous
--------------------
If you are running this on a production server such as Replit, consider also adding an Express port and UpTimeRobot to keep the server online

When running on Servers such as Oracle, Google, AWS, or other providers, consider installing pm2 and keeping your server online when you disconnect from your SSH client
[How to Host your Discord Bot 24/7 on Oracle Always Free](https://www.youtube.com/watch?v=90JbCrB3m3I&t=200s&ab_channel=LOGISTACK)

--------------------

How to get the OAuth Link for a Pterodactyl Server

In this example we will be using [NeroNodes](https://neronodes.net/)

1. Go to the login portal, [Login](https://portal.neronodes.net/auth/login)
2. Click "Authenticate With Discord", [Authenticate With Discord](https://portal.neronodes.net/auth/discord)
3. Click the, "Connect with Discord" button
4. Navigate to the top and copy the OAuth App Link, [OAuth Link for NeroNodes](https://discord.com/oauth2/authorize?client_id=967941169650745375&redirect_uri=https://portal.neronodes.net/auth/discord/callback&response_type=code&scope=identify%20email%20guilds%20guilds.join&prompt=none)
5. There you go, you now have the OAuth Link!

Please remember to read prerequisites before running client.

--------------------
177 changes: 177 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
const puppeteer = require('puppeteer');
const readline = require('readline');
const { EmbedBuilder, WebhookClient, AttachmentBuilder } = require('discord.js');
const fs = require('fs')
const bfile = new AttachmentBuilder(__dirname + "/begin.png");
const ffile = new AttachmentBuilder(__dirname + "/final.png");

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});

const LOGO = `[Puppeteer]: `

function print(message) {
console.log(`${LOGO}${message}`)

}


(async () => {

console.log("-------------------------------------------------------------------------------------------------------------")

const oauth = await new Promise((resolve) => {
rl.question(LOGO + 'Enter the OAuth Link for the Pterodactyl Server: ', (answer) => {
resolve(answer);
});
});

const minutes = await new Promise((resolve) => {
rl.question(LOGO + 'How many credits do you want?: ', (answer) => {
resolve(answer);
});
});

const discordToken = await new Promise((resolve) => {
rl.question(LOGO + 'What is your discord token?: ', (answer) => {
resolve(answer);
});
});

const discordLink = await new Promise((resolve) => {
rl.question(LOGO + 'What webhook would you like to send data to?: ', (answer) => {
resolve(answer);
});
});

const embed = new EmbedBuilder()
.setTitle("Discord Authentication Screenshot")
.setDescription("Graphical photo of headless browser interface to ensure successful authentication with Discord Application\n\n**Result:**")
.setColor("Green")
.setTimestamp()
.setImage("attachment://begin.png")
.setFooter({ text: "Puppeteer Client Interface", iconURL: 'https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png' })

const startEmbed = new EmbedBuilder()
.setTitle("Puppeteer Client was started...")
.setColor("Green")
.setTimestamp()
.addFields(
{ name: 'Credits to be earned', value: `${minutes}`, inline: false },

)
.setFooter({ text: "Puppeteer Client Interface", iconURL: 'https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png' })

const endEmbed = new EmbedBuilder()
.setTitle("Puppeteer Client was finished the process")
.setColor("Green")
.setTimestamp()
.addFields(
{ name: 'Credits earned', value: minutes + "\n\n**Result:**", inline: false },
)
.setImage("attachment://final.png")
.setFooter({ text: "Puppeteer Client Interface", iconURL: 'https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png' })

console.log("-------------------------------------------------------------------------------------------------------------")
console.log('@@@@@5 ..... 5@@@@@\n@@@@@5 ^B#BBBBY: !7. 5@@@@@\n@@@@@5 ^@@~::J@#.:^. .^^ .^^:~!~. .^^:~!~. .~!!^ .~&@?^. :~!!: .~!!^ :^.^!~ 5@@@@@\n@@@@@5 ^@@[email protected]@! !@B ^@&BPP#&J ^@&BPP#&J .5&GY5#B^^G&@BP^.P#PYP&P: Y#GY5#B~ P@BGGJ 5@@@@@\n@@@@@5 ^@@P55J~ B@! !@B ^@&: .#@!^@&: .#@~J@&5YYG&Y #@~ 5@#YYYG&77@&5YYG&5 P@5 5@@@@@\n@@@@@5 ^@@: P@5^~G@B ^@@J~~J@#:^@@J~~J@#:~@&?~!55^ B@J~.7@#7~!5Y.~&&?~!Y5^ P@J 5@@@@@\n@@@@@5 :55. :YGG5?PY ^@&YPGGJ: ^@&YPGGJ: ^JPGG57. ~5GG~ ^YPGG5! :JPGGP7. ?P! 5@@@@@\n@@@@@5 ^@&. ^@&. 5@@@@@\n@@@@@5 .7! .7! 5@@@@@\n@@@@@5 5@@@@@')
console.log("-------------------------------------------------------------------------------------------------------------")

print("Starting Puppeteer instance...")

// Launch Puppeteer and navigate to Discord's login page
const browser = await puppeteer.launch({headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']});
const page = await browser.newPage();

const webhookLink = new WebhookClient({ url: discordLink })


await webhookLink.send({
username: "Puppeteer Client Interface",
avatarURL: "https://st2.depositphotos.com/4199035/6594/v/950/depositphotos_65942573-stock-illustration-puppet-cartoon-illustration-isolated-on.jpg",
embeds: [startEmbed]
})

const bypassLocalStorageOverride = (page) => page.evaluateOnNewDocument(() => {

// preserve localStorage as separate var to keep it before any overrides
let __ls = localStorage

// restrict closure overrides to break global context reference to localStorage
Object.defineProperty(window, 'localStorage', { writable: false, configurable: false, value: __ls })

})

print("Redirecting to https://discord.com/app ... (May take a few seconds)")

bypassLocalStorageOverride(page)
await page.goto('https://discord.com/app', { timeout: 0 });

await page.evaluate((token) => {
localStorage.setItem('token', `"${token}"`);
}, discordToken);


// Navigate to a page where you want to use the local storage value
await page.goto(oauth, { timeout: 0 });
print("Successfully logged in...")
await page.waitForTimeout(5000)

await page.screenshot({ path: 'begin.png' })
print("Generated success screenshot...")

await page.waitForTimeout(5000)

webhookLink.send({
username: "Puppeteer Client Interface",
avatarURL: 'https://st2.depositphotos.com/4199035/6594/v/950/depositphotos_65942573-stock-illustration-puppet-cartoon-illustration-isolated-on.jpg',
embeds: [embed],
files: [bfile]
})

print("Sent screenshot to webhook...")

async function countDown(minutes) {
let seconds = minutes * 60;
process.stdout.write(LOGO + `Time remaining: ${Math.floor(seconds / 60)}:${seconds % 60 < 10 ? '0' : ''}${seconds % 60}`);
while (seconds > 0) {
await page.waitForTimeout(1000);
seconds--;
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(LOGO + `Time remaining: ${Math.floor(seconds / 60)}:${seconds % 60 < 10 ? '0' : ''}${seconds % 60}`);
}
process.stdout.clearLine();
process.stdout.cursorTo(0);

await page.screenshot({ path: 'final.png' })

print("Took a final screenshot, overriding old version...")

await webhookLink.send({
username: "Puppeteer Client Interface",
avatarURL: "https://st2.depositphotos.com/4199035/6594/v/950/depositphotos_65942573-stock-illustration-puppet-cartoon-illustration-isolated-on.jpg",
embeds: [endEmbed],
files: [ffile]
})

print("Sent end embed...")

fs.unlinkSync('begin.png')
fs.unlinkSync('final.png')

print("Deleted screenshot...")

print("Finished waiting on process, now closing...")
console.log("-------------------------------------------------------------------------------------------------------------")
}

await countDown(minutes)

await browser.close()
await process.exit()


})();
Loading

0 comments on commit 18823fb

Please sign in to comment.