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

Commit b2c5596

Browse files
authored
Merge pull request #46 from C0mm4nd/master
Implemented the Qup's method for checking password & hostname
2 parents 78950e0 + 7ed063c commit b2c5596

File tree

8 files changed

+350
-127
lines changed

8 files changed

+350
-127
lines changed

src/main/java/examples/ConsoleExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples;
1+
/*package examples;
22
33
import me.checkium.vhackapi.vHackAPI;
44
import me.checkium.vhackapi.vHackAPIBuilder;
@@ -24,4 +24,4 @@ public static void main(String[] args) {
2424
}
2525
}
2626
}
27-
}
27+
}*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.json.JSONObject;
77

88
import me.checkium.vhackapi.Utils;
9-
import me.checkium.vhackapi.console.ScannedNode;
9+
import me.checkium.vhackapi.console.Connection;
1010

1111
public class SpywareManager {
1212

@@ -20,13 +20,13 @@ public SpywareManager(String user, String pass, String uHash) {
2020
userHash = uHash;
2121
}
2222

23-
public SpywareUploadResult uploadSpywareTo(ScannedNode node)
23+
public SpywareUploadResult uploadSpywareTo(Connection node)
2424
{
2525
String returnString = Utils.StringRequest("user::::pass::::uhash::::target", username + "::::" + password + "::::" + userHash + "::::" + node.getIP(), "vh_spywareUpload.php");
2626
return new SpywareUploadResult(returnString);
2727
}
2828

29-
public boolean removeSpywareFrom(ScannedNode node)
29+
public boolean removeSpywareFrom(Connection node)
3030
{
3131
String returnString = Utils.StringRequest("user::::pass::::uhash::::target", username + "::::" + password + "::::" + userHash + "::::" + node.getIP(), "vh_removeSpywareRemote.php");
3232
JSONObject d = new JSONObject(returnString);

src/main/java/me/checkium/vhackapi/Utils.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Utils {
2828
* The url of the current api.<br>
2929
* As of now it is {@value url}.
3030
*/
31-
private static final String url = "https://api.vhack.cc/v/2/";
31+
private static final String url = "https://api.vhack.cc/v/3/";
3232
/**
3333
* The hashing algorithm that is used to hash data in requests.<br>
3434
* It now is {@value md5s}.
@@ -52,7 +52,28 @@ public class Utils {
5252

5353
static {
5454
assertionstatus = !Utils.class.desiredAssertionStatus();
55-
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};
55+
byt = new byte[]{(byte) 65, (byte) 66, (byte) 67,
56+
(byte) 68, (byte) 69, (byte) 70,
57+
(byte) 71, (byte) 72, (byte) 73,
58+
(byte) 74, (byte) 75, (byte) 76,
59+
(byte) 77, (byte) 78, (byte) 79,
60+
(byte) 80, (byte) 81, (byte) 82,
61+
(byte) 83, (byte) 84, (byte) 85,
62+
(byte) 86, (byte) 87, (byte) 88,
63+
(byte) 89, (byte) 90, (byte) 97,
64+
(byte) 98, (byte) 99, (byte) 100,
65+
(byte) 101, (byte) 102, (byte) 103,
66+
(byte) 104, (byte) 105, (byte) 106,
67+
(byte) 107, (byte) 108, (byte) 109,
68+
(byte) 110, (byte) 111, (byte) 112,
69+
(byte) 113, (byte) 114, (byte) 115,
70+
(byte) 116, (byte) 117, (byte) 118,
71+
(byte) 119, (byte) 120, (byte) 121,
72+
(byte) 122, (byte) 48, (byte) 49,
73+
(byte) 50, (byte) 51, (byte) 52,
74+
(byte) 53, (byte) 54, (byte) 55,
75+
(byte) 56, (byte) 57, (byte) 45,
76+
(byte) 95};
5677
}
5778

5879
/**
@@ -97,7 +118,7 @@ public JSONObject call(){
97118
JSONObject json = null;
98119
jsonTextC = Request(format, data, php);
99120
String jsonText = "";
100-
if(task != null)
121+
if(task != null)
101122
executor.submit(task);
102123
try{
103124

@@ -353,6 +374,7 @@ public static String generateURL(String format, String data, String php) {
353374
String[] split2 = data.split("::::");
354375
long currentTimeMillis = System.currentTimeMillis() / 1000;
355376
JSONObject jSONObject = new JSONObject();
377+
jSONObject.put("","");
356378
for (int i = 0; i < split.length; i++) {
357379
try {
358380
jSONObject.put(split[i], split2[i]);
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
package me.checkium.vhackapi.console;
2+
3+
import org.json.JSONObject;
4+
5+
import me.checkium.vhackapi.Utils;
6+
import me.checkium.vhackapi.Spyware.SpywareUploadResult;
7+
8+
public class Connection {
9+
private String IP;
10+
private boolean success = true;
11+
private String username,
12+
firewallLevel,
13+
antiVirusLevel,
14+
scanLevel,
15+
sdkLevel,
16+
spamLevel,
17+
money,
18+
anonymous,
19+
successRep,
20+
failRep,
21+
successRate;
22+
23+
public Connection(String[] result, String ip) {
24+
if (result.length == 1) {
25+
success = false;
26+
return;
27+
}
28+
if (result[1] == null) {
29+
success = false;
30+
} else {
31+
username = result[1].substring(26);
32+
firewallLevel = result[2].substring(26);
33+
antiVirusLevel = result[3].substring(27);
34+
scanLevel = result[4].substring(22);
35+
sdkLevel = result[5].substring(21);
36+
spamLevel = result[6].substring(22);
37+
money = result[7].substring(23);
38+
anonymous = result[9].substring(27);
39+
successRep = result[11].substring(32);
40+
failRep = result[12].substring(29);
41+
successRate = result[13].substring(39);
42+
}
43+
44+
}
45+
46+
public SpywareUploadResult spywareUpload(){
47+
48+
String returnString = Utils.StringRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_spywareUpload.php");
49+
return new SpywareUploadResult(returnString);
50+
51+
}
52+
53+
public TransferResult trojanTransfer(){
54+
55+
JSONObject json = Utils.JSONRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_trTransfer.php");
56+
return new TransferResult(json,IP);
57+
58+
}
59+
60+
public void clearLogs(){
61+
62+
Utils.StringRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_clearAccessLog.php");
63+
}
64+
65+
public String getUsername() {
66+
if (!success) return null;
67+
return username;
68+
}
69+
70+
71+
public Integer getFirewallLevel() {
72+
if (!success) return null;
73+
try {
74+
return Integer.parseInt(firewallLevel);
75+
} catch (NumberFormatException e) {
76+
return null;
77+
}
78+
}
79+
80+
81+
public Integer getAntiVirusLevel() {
82+
if (!success) return null;
83+
try {
84+
return Integer.valueOf(antiVirusLevel);
85+
} catch (NumberFormatException e) {
86+
return null;
87+
}
88+
}
89+
90+
91+
public Integer getScanLevel() {
92+
if (!success) return null;
93+
try {
94+
return Integer.valueOf(scanLevel);
95+
} catch (NumberFormatException e) {
96+
return null;
97+
}
98+
}
99+
100+
101+
public Integer getSdkLevel() {
102+
if (!success) return null;
103+
try {
104+
return Integer.valueOf(sdkLevel);
105+
} catch (NumberFormatException e) {
106+
return null;
107+
}
108+
}
109+
110+
111+
public Integer getSpamLevel() {
112+
if (!success) return null;
113+
try {
114+
return Integer.valueOf(spamLevel);
115+
} catch (NumberFormatException e) {
116+
return null;
117+
}
118+
}
119+
120+
121+
public Integer getMoney() {
122+
if (!success) return null;
123+
try {
124+
return Integer.valueOf(money);
125+
} catch (NumberFormatException e) {
126+
return null;
127+
}
128+
}
129+
130+
131+
public Boolean isAnonymous() {
132+
if (!success) return null;
133+
return "YES".equals(anonymous);
134+
}
135+
136+
137+
public Integer getSuccessRep() {
138+
if (!success) return null;
139+
try {
140+
return Integer.valueOf(successRep);
141+
} catch (NumberFormatException er) {
142+
return null;
143+
}
144+
}
145+
146+
147+
public Integer getFailRep() {
148+
if (!success) return null;
149+
try {
150+
return Integer.valueOf(failRep);
151+
} catch (NumberFormatException er) {
152+
return null;
153+
}
154+
}
155+
156+
157+
public Integer getSuccessRate() {
158+
if (!success) return 0;
159+
try {
160+
return Integer.valueOf(successRate.replace("%", ""));
161+
} catch (NumberFormatException er) {
162+
return null;
163+
}
164+
}
165+
166+
public String getIP() {
167+
return IP;
168+
}
169+
170+
public boolean getSuccess() {
171+
172+
return success;
173+
174+
}
175+
/*
176+
177+
private val success = result[1] != null
178+
val username = result[1]?.substring(26)
179+
val firewallLevel = result[2]!!.substring(26).toInt()
180+
val antiVirusLevel = result[3]!!.substring(27).toInt()
181+
val scanLevel = result[4]!!.substring(22).toInt()
182+
val sdkLevel = result[5]!!.substring(21).toInt();
183+
val spamLevel = result[6]!!.substring(22).toInt();
184+
val money = result[7]!!.substring(23).toInt();
185+
val anonymous = result[9]!!.substring(27) == "YES";
186+
val successRep = result[11]!!.substring(32).toInt();
187+
val failRep = result[12]!!.substring(29).toInt();
188+
val successRate = result[13]!!.substring(39).replace("%","").toInt();
189+
*/
190+
}

0 commit comments

Comments
 (0)