Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 2b95c62

Browse files
author
Checkium
committed
Updated to vHack 1.41
1 parent 6f1096a commit 2b95c62

File tree

4 files changed

+51
-32
lines changed

4 files changed

+51
-32
lines changed

src/me/checkium/vhackapi/Spyware/SpywareManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ public SpywareUploadResult uploadSpywareTo(ScannedNode node)
2626
return new SpywareUploadResult(returnString);
2727
}
2828

29+
public boolean removeSpywareFrom(ScannedNode node)
30+
{
31+
String returnString = Utils.StringRequest("user::::pass::::uhash::::target", username + "::::" + password + "::::" + userHash + "::::" + node.getIP(), "vh_removeSpywareRemote.php");
32+
JSONObject d = new JSONObject(returnString);
33+
if (d.getInt("result") == 0) {
34+
return true;
35+
} else {
36+
return false;
37+
}
38+
}
39+
2940
public ArrayList<Spyware> getActiveSpyware()
3041
{
3142
ArrayList<Spyware> list = new ArrayList<>();

src/me/checkium/vhackapi/Utils.java

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@
77
import java.io.Reader;
88
import java.net.URL;
99
import java.nio.charset.Charset;
10-
import java.security.GeneralSecurityException;
1110
import java.security.MessageDigest;
1211
import java.security.NoSuchAlgorithmException;
13-
import java.security.cert.X509Certificate;
14-
15-
import javax.net.ssl.HttpsURLConnection;
16-
import javax.net.ssl.SSLContext;
17-
import javax.net.ssl.TrustManager;
18-
import javax.net.ssl.X509TrustManager;
1912

2013
import org.json.JSONException;
2114
import org.json.JSONObject;
@@ -29,7 +22,7 @@ public class Utils {
2922

3023
static {
3124
assertionstatus = !Utils.class.desiredAssertionStatus();
32-
url = "https://api.vhack.cc/v/7/";
25+
url = "https://api.vhack.cc/v/8/";
3326
md5s = "MD5";
3427
secret = "aeffl";
3528
byt = new byte[]{(byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 75, (byte) 76, (byte) 77, (byte) 78, (byte) 79, (byte) 80, (byte) 81, (byte) 82, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 97, (byte) 98, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 107, (byte) 108, (byte) 109, (byte) 110, (byte) 111, (byte) 112, (byte) 113, (byte) 114, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 48, (byte) 49, (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 45, (byte) 95};
@@ -57,13 +50,7 @@ public static JSONObject JSONRequest(String format, String data, String php){
5750
public static String StringRequest(String format, String data, String php)
5851
{
5952
System.setProperty("http.agent", "Chrome");
60-
try {
61-
SSLContext sc = SSLContext.getInstance("SSL");
62-
sc.init(null, Utils.trustAllCerts, new java.security.SecureRandom());
63-
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
64-
} catch (GeneralSecurityException e) {
65-
}
66-
53+
6754
String jsonText = null;
6855
InputStream is;
6956
try {
@@ -178,21 +165,7 @@ public static byte[] assertion(byte[] bArr, int i, int i2, byte[] bArr2, int i3)
178165
throw new AssertionError();
179166
}
180167

181-
public static TrustManager[] trustAllCerts = new TrustManager[] {
182-
new X509TrustManager() {
183-
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
184-
return new X509Certificate[0];
185-
}
186-
public void checkClientTrusted(
187-
java.security.cert.X509Certificate[] certs, String authType) {
188-
}
189-
public void checkServerTrusted(
190-
java.security.cert.X509Certificate[] certs, String authType) {
191-
}
192-
}
193-
};
194-
195-
168+
196169
public static String generateURL(String str, String str2, String str3) {
197170
String[] split = str.split("::::");
198171
String[] split2 = str2.split("::::");

src/me/checkium/vhackapi/vHackAPI.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import org.json.JSONObject;
1212

13+
import me.checkium.vhackapi.Spyware.SpywareManager;
1314
import me.checkium.vhackapi.chat.Chat;
1415
import me.checkium.vhackapi.console.Console;
1516
import me.checkium.vhackapi.others.Others;
@@ -30,7 +31,11 @@ public Console getConsole() {
3031
public UpgradeManager getUpgradeManager() {
3132
UpgradeManager manager = new UpgradeManager(username, password, userHash);
3233
return manager;
33-
}
34+
}
35+
public SpywareManager getSpywareManager() {
36+
SpywareManager manager = new SpywareManager(username, password, userHash);
37+
return manager;
38+
}
3439

3540
public String getStats(Stats stat) {
3641
try {

src/me/checkium/vhackapi/vHackAPIBuilder.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package me.checkium.vhackapi;
22

3+
import java.security.GeneralSecurityException;
4+
import java.security.cert.X509Certificate;
5+
6+
import javax.net.ssl.HttpsURLConnection;
7+
import javax.net.ssl.SSLContext;
8+
import javax.net.ssl.TrustManager;
9+
import javax.net.ssl.X509TrustManager;
10+
311
import org.json.JSONObject;
412

513
public class vHackAPIBuilder {
@@ -37,8 +45,30 @@ public vHackAPIBuilder register() {
3745

3846

3947
public vHackAPI getAPI() {
40-
48+
try {
49+
SSLContext sc = SSLContext.getInstance("SSL");
50+
sc.init(null, trustAllCerts, new java.security.SecureRandom());
51+
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
52+
} catch (GeneralSecurityException e) {
53+
}
54+
4155
vHackAPI api = new vHackAPI(username, password);
4256
return api;
4357
}
58+
59+
public static TrustManager[] trustAllCerts = new TrustManager[] {
60+
new X509TrustManager() {
61+
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
62+
return new X509Certificate[0];
63+
}
64+
public void checkClientTrusted(
65+
java.security.cert.X509Certificate[] certs, String authType) {
66+
}
67+
public void checkServerTrusted(
68+
java.security.cert.X509Certificate[] certs, String authType) {
69+
}
70+
}
71+
};
72+
73+
4474
}

0 commit comments

Comments
 (0)