-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
64 lines (54 loc) · 2.48 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(async()=>{
"use strict";
// Dependencies
const request = require("request-async")
// Variables
const args = process.argv.slice(2)
// Functions
async function getUserProfile(){
const response = await request(`https://api.github.com/users/${args[0]}`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/86.0.4240.183 Safari/537.36"
}
})
return JSON.parse(response.body)
}
async function getUserOrgs(){
const response = await request(`https://api.github.com/users/${args[0]}/orgs`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/86.0.4240.183 Safari/537.36"
}
})
return JSON.parse(response.body)
}
async function getUserLeakedEmails(){
const response = await request(`https://api.github.com/users/${args[0]}/events?per_page=100`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/86.0.4240.183 Safari/537.36"
}
})
const emails = []
for( const event of JSON.parse(response.body) ) if(event.payload.hasOwnProperty("commits")) if(!emails.includes(event.payload.commits[0].author.email)) emails.push(event.payload.commits[0].author.email)
return emails
}
// Main
if(!args.length) return console.log("usage: node index.js <username>")
console.log("Doing some recon on the user, please wait...")
const userProfile = await getUserProfile()
const userOrgs = await getUserOrgs()
const userLE = await getUserLeakedEmails()
console.clear()
console.log("Username:", args[0])
console.log("Name:", userProfile.name)
console.log("User ID:", userProfile.id)
console.log("Avatar URL:", userProfile.avatar_url)
console.log("Location:", userProfile.location)
console.log("BIO:", userProfile.bio)
if(userProfile.company) console.log("Company:", userProfile.company)
console.log("Followers:", userProfile.followers)
console.log("Following:", userProfile.following)
console.log("Created At:", userProfile.created_at)
console.log("Updated At:", userProfile.updated_at)
if(userOrgs.length) console.log("Organizations:", userOrgs.map((d)=>d.login).join(", "))
console.log("Leaked Emails:", userLE.join(", "))
})()