Skip to content

Instantly share code, notes, and snippets.

@Fweak
Created September 19, 2023 20:49
Show Gist options
  • Save Fweak/666427fe5642aba99c3e3d9effca4711 to your computer and use it in GitHub Desktop.
Save Fweak/666427fe5642aba99c3e3d9effca4711 to your computer and use it in GitHub Desktop.
Plancke.io profile (last login) retrieval. Uses cloudflare bypass (lmao imagine)...
const htmlParser = require('node-html-parser')
const http2 = require('http2')
const tls = require('tls')
const randstr = require('randomstring')
const readline = require('readline')
const rl = readline.createInterface(process.stdin, process.stdout)
const question = str => new Promise(_ => rl.question(str, answer => _(answer)))
const generateChars = (set, len) =>
randstr.generate({ length: len, charset: set })
const spoof = () =>
`${generateChars('102345', 3)}.${generateChars('102345', 3)}.${generateChars(
'012345',
5
)}`
const cplist = [
'RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
'ECDHE-RSA-AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
'ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!AESGCM:!CAMELLIA:!3DES:!EDH'
]
const httpClient = http2.connect('https://plancke.io', {
createConnection: () =>
tls.connect({
port: 443,
host: 'plancke.io',
ciphers: cplist[Math.floor(Math.random() * cplist.length)],
secureProtocol: 'TLS_method',
servername: 'plancke.io',
secure: true,
rejectUnauthorized: false,
ALPNProtocols: ['h2']
})
})
const fetchPlanckeProfile = async username => {
let data = ''
let hold = true
const req = httpClient.request({
':method': 'GET',
':authority': 'plancke.io',
':path': '/hypixel/player/stats/' + username,
':scheme': 'https',
'Cache-Control': 'max-age=0',
Referer: 'https://plancke.io',
'X-Forwarded-For': spoof(),
'Content-Type': 'text/plain',
'User-agent':
'Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) lt-GtkLauncher'
})
req
.setEncoding('utf8')
.on('data', chunk => (data += chunk))
.on('end', () => (hold = false && req.end() && req.destroy()))
// idk men leave me alone
while (hold) {
await new Promise(_ => setTimeout(_, 100))
}
const $ = htmlParser.parse(data)
const cardBox = $.querySelector('.card-box.m-b-10')
const children = cardBox.childNodes.filter(s => {
if (s.rawTagName !== 'b') return false
if (s.childNodes.length < 1) return false
if (s.childNodes[0]._rawText == 'Last login: ') return true
})[0]
return new Date(children.nextSibling._rawText)
}
;(async function () {
const username = await question('[Account Username] -> ')
const loginTime = await fetchPlanckeProfile(username)
console.log(loginTime)
console.log(loginTime.toLocaleString())
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment