Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.net.HttpURLConnection;
- import java.net.InetSocketAddress;
- import java.net.Proxy;
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.URLEncoder;
- import java.nio.charset.StandardCharsets;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.Scanner;
- import java.util.StringJoiner;
- import com.twocaptcha.api.ProxyType;
- import com.twocaptcha.api.TwoCaptchaService;
- public class Main {
- public static void main(String[] args) throws IOException, InterruptedException {
- String apiKey = "f295a8e64d0f39af7869d08e364cfcca";
- String googleKey = "6Lcsv3oUAAAAAGFhlKrkRb029OHio098bbeyi_Hv";
- String pageUrl = "https://secure.runescape.com/m=account-creation/g=oldscape/create_account";
- String proxyIp = "104.168.2.211";
- String proxyPort = "1080";
- String proxyUser = "";
- String proxyPw = "";
- TwoCaptchaService service = new TwoCaptchaService(apiKey, googleKey, pageUrl, proxyIp, proxyPort, proxyUser,
- proxyPw, ProxyType.SOCKS5);
- URL url = new URL("https://secure.runescape.com/m=account-creation/g=oldscape/create_account");
- Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(proxyIp, 1080));
- URLConnection con = url.openConnection(proxy);
- HttpURLConnection http = (HttpURLConnection) con;
- http.setRequestMethod("POST");
- http.setDoOutput(true);
- Map<String, String> arguments = new HashMap<>();
- File acc = new File("C:\\Users\\jacob\\OneDrive\\Desktop\\accounts for osrs\\accounts_friendly.txt");
- File prox = new File("C:\\Users\\jacob\\OneDrive\\Desktop\\accounts for osrs\\Proxies edited.txt");
- Scanner scanner = new Scanner(new FileInputStream(acc));
- Scanner scanner1 = new Scanner(new FileInputStream(prox));
- // int iteration = 0;
- // while (scanner.hasNext()) {
- // if (iteration >= 3) {
- // if (scanner1.hasNext()) {
- // iteration = 0;
- // proxyIp = scanner1.next();
- // proxyIp = scanner1.next();
- // System.out.println(proxyIp);
- // }
- // } else {
- // String email1 = scanner.next();
- // arguments.put("email1", email1);
- // if (scanner.hasNext()) {
- // arguments.put("password1", scanner.next());
- // }
- int maxm = 12;
- int minm = 1;
- int rangem = maxm - minm + 1;
- int maxd = 25;
- int mind = 1;
- int ranged = maxd - mind + 1;
- int maxy = 2000;
- int miny = 1940;
- int rangey = maxy - miny + 1;
- int ny = (int) (Math.random() * rangey) + miny;
- int nm = (int) (Math.random() * rangem) + minm;
- int nd = (int) (Math.random() * ranged) + mind;
- arguments.put("email1", "nbeczsrkjt@oldschool.design");
- arguments.put("password1", "Sukablyat2");
- arguments.put("onlyOneEmail", "1");
- arguments.put("onlyOnePassword", "1");
- arguments.put("day", "" + nd);
- arguments.put("month", "" + nm);
- arguments.put("year", "" + ny);
- arguments.put("create-submit", "create");
- arguments.put("theme", "oldschool");
- String responseToken = service.solveCaptcha();
- // System.out.println("The response token is: " + responseToken);
- StringJoiner sj = new StringJoiner("&");
- byte[] out = sj.toString().getBytes(StandardCharsets.UTF_8);
- int length = out.length;
- http.setFixedLengthStreamingMode(length);
- http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
- arguments.put("g-recaptcha-response", responseToken);
- for (Map.Entry<String, String> entry : arguments.entrySet()) {
- sj.add(URLEncoder.encode(entry.getKey(), "UTF-8") + "="
- + URLEncoder.encode(entry.getValue(), "UTF-8"));
- }
- http.getOutputStream().write(out);
- System.out.println("Password " + arguments.get("password1").toString());
- System.out.println("Email " + arguments.get("email1").toString());
- System.out.println("Captcha key " + arguments.get("g-recaptcha-response").toString());
- System.out.println("Proxy " + proxyIp);
- Thread.sleep(5000);
- }
- // }
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement