Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- 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.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/create_account?theme=oldschool";
- 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/create_account?theme=oldschool");
- Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("104.168.2.211", 1080));
- URLConnection con = url.openConnection(proxy);
- HttpURLConnection http = (HttpURLConnection)con;
- http.setRequestMethod("PUT");
- http.setDoOutput(true);
- Map<String,String> arguments = new HashMap<>();
- arguments.put("username1", "efuxgfhntm@oldschool.design");
- arguments.put("password1", "Sukablyat2");
- arguments.put("onlyOneEmail", "1");
- arguments.put("onlyOnePassword", "1");
- arguments.put("day", "11");
- arguments.put("month", "11");
- arguments.put("year", "1989");
- arguments.put("create-submit", "create");
- arguments.put("theme", "oldschool");
- String responseToken = service.solveCaptcha();
- System.out.println("The response token is: " + responseToken);
- arguments.put("g-recaptcha-response", responseToken);
- StringJoiner sj=new StringJoiner("&");
- for(Map.Entry<String,String>entry:arguments.entrySet()) {
- sj.add(URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(),"UTF-8"));
- }
- 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");
- http.connect();
- System.out.println(arguments.get("password1").toString());
- System.out.println(arguments.get("g-recaptcha-response").toString());
- try(OutputStream os = http.getOutputStream()) {
- os.write(out);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement