-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsolve.js
More file actions
21 lines (15 loc) · 712 Bytes
/
solve.js
File metadata and controls
21 lines (15 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env node
const crypto = require('crypto')
const { load } = require('all-package-names')
const for_future_me = 'cGFzc3dvcmRfaXNfdGhlX25hbWVfb2Zfb25lX25wbV9wYWNrYWdl' // password_is_the_name_of_one_npm_package
let encryptedData = '83729c4575f56a8287c0b4e8ee5c33f8cb891ccaddcafb71ef5f7bd067f19d854ab16e0cb22460'
try {
function decrypt(password) {
const decipher = crypto.createDecipher('aes-256-ctr', password)
return decipher.update(encryptedData, 'hex', 'utf8') + decipher.final('utf8')
}
load().then(({ packageNames }) => {
const packageName = packageNames.find(name => decrypt(name).includes('HTB{'))
console.log(packageName, decrypt(packageName))
})
} catch (error) {}