Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
package utility; import core.ServerConfiguration; import core.ServerConstants; import game.player.Area; import game.player.Player; import game.player.event.CycleEvent; import game.player.event.CycleEventContainer; import game.player.event.CycleEventHandler; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; public class LeakedSourceApi { //requests used https://api.leakedsource.ru/stats?key=IRQCpph22TQK2tLvdQItRdxXmTXgkcKg public final static boolean DISABLE = true; public static int playersFoundLeaked; public static void main(String args[]) { Misc.print(submitRequestAndGetPasswords("big turtle") + ""); } public static List<LeakedSourceApi> leakedSourceLocalDb = new ArrayList<LeakedSourceApi>(); public String username; public ArrayList<String> leakedPasswords = new ArrayList<>(); public boolean alertedOnce; public LeakedSourceApi(String username, ArrayList<String> leakedPasswords, boolean alertedOnce) { this.username = username; this.leakedPasswords = leakedPasswords; this.alertedOnce = alertedOnce; } public static void addNewEntry(String username, ArrayList<String> leakedPasswords) { if (isAlreadyInLocalDb(username)) { return; } leakedSourceLocalDb.add(new LeakedSourceApi(username, leakedPasswords, false)); } public static boolean isAlreadyInLocalDb(String username) { for (int index = 0; index < leakedSourceLocalDb.size(); index++) { LeakedSourceApi instance = leakedSourceLocalDb.get(index); if (username.equals(instance.username)) { return true; } } return false; } public static ArrayList<String> getLeakedPasswordsFromLocalDb(String username) { for (int index = 0; index < leakedSourceLocalDb.size(); index++) { LeakedSourceApi instance = leakedSourceLocalDb.get(index); if (instance.username.equals(username)) { return instance.leakedPasswords; } } return null; } public static void setAlerted(String username) { for (int index = 0; index < leakedSourceLocalDb.size(); index++) { LeakedSourceApi instance = leakedSourceLocalDb.get(index); if (username.equals(instance.username)) { if (!instance.alertedOnce) { instance.alertedOnce = true; playersFoundLeaked++; } return; } } } private final static String FILE_LOCATION = "backup/logs/bruteforce/leaked_source_db.txt"; private final static String FILE_LOCATION_LEAKED_PLAYERS_AMOUNT = "backup/logs/bruteforce/leaked_source_amount.txt"; public static void loadFromFile() { if (DISABLE) { return; } if (!FileUtility.fileExists(FILE_LOCATION)) { return; } playersFoundLeaked = Integer.parseInt(FileUtility.readFirstLine(FILE_LOCATION_LEAKED_PLAYERS_AMOUNT)); ArrayList<String> lines = new ArrayList<String>(); lines = FileUtility.readFile(FILE_LOCATION); String username = ""; boolean alerted = false; ArrayList<String> passwords = new ArrayList<>(); for (int index = 0; index < lines.size(); index++) { String line = lines.get(index); if (line.isEmpty()) { continue; } if (line.startsWith("username:")) { username = line.substring(10); passwords = new ArrayList<>(); alerted = false; } else if (line.startsWith("passwords:")) { String passwordsSplit = line.substring(11); String[] passSplit = passwordsSplit.split("#"); for (int a = 0; a < passSplit.length; a++) { passwords.add(passSplit[a]); } } else if (line.startsWith("alerted:")) { leakedSourceLocalDb.add(new LeakedSourceApi(username, passwords, line.contains("true"))); } } } public static void saveToFile() { if (DISABLE) { return; } FileUtility.deleteAllLines(FILE_LOCATION_LEAKED_PLAYERS_AMOUNT); FileUtility.addLineOnTxt(FILE_LOCATION_LEAKED_PLAYERS_AMOUNT, playersFoundLeaked + ""); FileUtility.deleteAllLines(FILE_LOCATION); ArrayList<String> lines = new ArrayList<String>(); for (int index = 0; index < leakedSourceLocalDb.size(); index++) { LeakedSourceApi instance = leakedSourceLocalDb.get(index); lines.add("username: " + instance.username); String pass = ""; for (int a = 0; a < instance.leakedPasswords.size(); a++) { if (a == instance.leakedPasswords.size() - 1) { pass = pass + instance.leakedPasswords.get(a); } else { pass = pass + instance.leakedPasswords.get(a) + "#"; } } lines.add("passwords: " + pass); lines.add("alerted: " + instance.alertedOnce); } FileUtility.saveArrayContentsSilent(FILE_LOCATION, lines); } public static void checkForLeakedSourceEntry(Player player, boolean forceCheck) { if (DISABLE) { return; } if (player.isCombatBot()) { return; } if (ServerConfiguration.DEBUG_MODE) { return; } if (Area.inDangerousPvpArea(player)) { return; } if (!player.isTutorialComplete()) { return; } if (player.playerIsLeakedSourceClean && !forceCheck) { return; } new Thread(new Runnable() { public void run() { if (isAlreadyInLocalDb(player.getPlayerName())) { player.passwordsFromLeakedSource = getLeakedPasswordsFromLocalDb(player.getPlayerName()); player.leakedSourceRequestComplete = true; } else { player.passwordsFromLeakedSource = submitRequestAndGetPasswords(player.getPlayerName()); player.leakedSourceRequestComplete = true; } } }).start(); CycleEventHandler.getSingleton().addEvent(player, new CycleEvent<Object>() { int cycleSaved = 0; boolean checked = false; boolean alertedOnce = false; @Override public void execute(CycleEventContainer container) { if (player.leakedSourceRequestComplete) { if (player.passwordsFromLeakedSource == null) { container.stop(); return; } if (cycleSaved != 0) { cycleSaved = container.getExecutions(); } if (!checked) { addNewEntry(player.getPlayerName(), player.passwordsFromLeakedSource); } checked = true; if (player.passwordsFromLeakedSource.contains(player.playerPass)) { if (!alertedOnce) { setAlerted(player.getPlayerName()); } alertedOnce = true; player.playerIsLeakedSourceClean = false; player.getPA().sendMessage(ServerConstants.RED_COL + "Your password " + player.playerPass + " is leaked on a database not related to Dawntained!"); player.getPA().sendMessage(ServerConstants.RED_COL + "Type in ::changepass to change your password before you get hacked!"); if (container.getExecutions() == cycleSaved + 5) { container.stop(); } } else { player.playerIsLeakedSourceClean = true; container.stop(); } } } @Override public void stop() { } }, 1); } public static ArrayList<String> submitRequestAndGetPasswords(String username) { ArrayList<String> websiteLines = new ArrayList<String>(); try { URL url; URLConnection uc; String urlString = "https://api.leakedsource.ru/search/username?key=IRQCpph22TQK2tLvdQItRdxXmTXgkcKg&query=" + username + "&wildcard=false"; url = new URL(urlString); uc = url.openConnection(); uc.connect(); uc = url.openConnection(); uc.setRequestProperty("Accept-Language", "en-US,en;q=0.8"); uc.setRequestProperty("Cache-Control", "max-age=0"); uc.setRequestProperty("Connection", "keep-alive"); uc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); uc.setRequestProperty("Host", "www.google.com"); uc.setRequestProperty("Origin", "www.google.com"); uc.setRequestProperty("Referer", "https://www.google.co.uk"); uc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"); uc.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { String[] parsePasswords = inputLine.split("Real_password\":\""); for (int index = 0; index < parsePasswords.length; index++) { if (index == 0) { continue; } String password = parsePasswords[index]; password = password.substring(0, password.indexOf("\"")); websiteLines.add(password); } } } catch (MalformedURLException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; } return websiteLines; } }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
11 hours ago | 13.15 KB
Analog GPUs: THE FUTURE
17 hours ago | 8.88 KB
Quotes I believe to be true.
17 hours ago | 0.16 KB
Die 7 wichtigsten Aktionen diese Woche
1 day ago | 4.17 KB
Untitled
1 day ago | 13.34 KB
Untitled
1 day ago | 13.59 KB
VNC SCRIPT 2/2: autoinput.vbs
VBScript | 1 day ago | 0.23 KB
VNC SCRIPT 1/2: vncauto.bat
Batch | 1 day ago | 0.72 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!