Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.62 KB | None | 0 0
  1. import java.io.IOException;
  2. import java.io.OutputStream;
  3. import java.net.HttpURLConnection;
  4. import java.net.InetSocketAddress;
  5. import java.net.Proxy;
  6. import java.net.URL;
  7. import java.net.URLConnection;
  8. import java.net.URLEncoder;
  9. import java.nio.charset.StandardCharsets;
  10. import java.util.HashMap;
  11. import java.util.Map;
  12. import java.util.StringJoiner;
  13.  
  14. import com.twocaptcha.api.ProxyType;
  15. import com.twocaptcha.api.TwoCaptchaService;
  16.  
  17. public class Main {
  18.  
  19.     public static void main(String[] args) throws IOException, InterruptedException {
  20.         String apiKey = "f295a8e64d0f39af7869d08e364cfcca";
  21.         String googleKey = "6Lcsv3oUAAAAAGFhlKrkRb029OHio098bbeyi_Hv";
  22.  
  23.         String pageUrl = "https://secure.runescape.com/m=account-creation/create_account?theme=oldschool";
  24.         String proxyIp = "104.168.2.211";
  25.         String proxyPort = "1080";
  26.         String proxyUser = "";
  27.         String proxyPw = "";
  28.         TwoCaptchaService service = new TwoCaptchaService(apiKey, googleKey, pageUrl, proxyIp, proxyPort, proxyUser,
  29.                 proxyPw, ProxyType.SOCKS5);
  30.         URL url = new URL("https://secure.runescape.com/m=account-creation/create_account?theme=oldschool");
  31.         Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("104.168.2.211", 1080));
  32.         URLConnection con = url.openConnection(proxy);
  33.         HttpURLConnection http = (HttpURLConnection)con;
  34.         http.setRequestMethod("PUT");
  35.         http.setDoOutput(true);
  36.         Map<String,String> arguments = new HashMap<>();
  37.         arguments.put("username1", "efuxgfhntm@oldschool.design");
  38.         arguments.put("password1", "Sukablyat2");
  39.         arguments.put("onlyOneEmail", "1");
  40.         arguments.put("onlyOnePassword", "1");
  41.         arguments.put("day", "11");
  42.         arguments.put("month", "11");
  43.         arguments.put("year", "1989");
  44.         arguments.put("create-submit", "create");
  45.         arguments.put("theme", "oldschool");
  46.         String responseToken = service.solveCaptcha();
  47.         System.out.println("The response token is: " + responseToken);
  48.         arguments.put("g-recaptcha-response", responseToken);
  49.         StringJoiner sj=new StringJoiner("&");
  50.         for(Map.Entry<String,String>entry:arguments.entrySet()) {
  51.             sj.add(URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(),"UTF-8"));
  52.         }
  53.         byte[] out=sj.toString().getBytes(StandardCharsets.UTF_8);
  54.         int length=out.length;
  55.         http.setFixedLengthStreamingMode(length);
  56.         http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  57.         http.connect();
  58.         System.out.println(arguments.get("password1").toString());
  59.         System.out.println(arguments.get("g-recaptcha-response").toString());
  60.         try(OutputStream os = http.getOutputStream()) {
  61.             os.write(out);
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement