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

Implemented the Qup's method for checking password & hostname #46

Merged
merged 3 commits into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/examples/ConsoleExample.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package examples;
/*package examples;

import me.checkium.vhackapi.vHackAPI;
import me.checkium.vhackapi.vHackAPIBuilder;
Expand All @@ -24,4 +24,4 @@ public static void main(String[] args) {
}
}
}
}
}*/
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.json.JSONObject;

import me.checkium.vhackapi.Utils;
import me.checkium.vhackapi.console.ScannedNode;
import me.checkium.vhackapi.console.Connection;

public class SpywareManager {

Expand All @@ -20,13 +20,13 @@ public SpywareManager(String user, String pass, String uHash) {
userHash = uHash;
}

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

public boolean removeSpywareFrom(ScannedNode node)
public boolean removeSpywareFrom(Connection node)
{
String returnString = Utils.StringRequest("user::::pass::::uhash::::target", username + "::::" + password + "::::" + userHash + "::::" + node.getIP(), "vh_removeSpywareRemote.php");
JSONObject d = new JSONObject(returnString);
Expand Down
28 changes: 25 additions & 3 deletions src/main/java/me/checkium/vhackapi/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Utils {
* The url of the current api.<br>
* As of now it is {@value url}.
*/
private static final String url = "https://api.vhack.cc/v/2/";
private static final String url = "https://api.vhack.cc/v/3/";
/**
* The hashing algorithm that is used to hash data in requests.<br>
* It now is {@value md5s}.
Expand All @@ -52,7 +52,28 @@ public class Utils {

static {
assertionstatus = !Utils.class.desiredAssertionStatus();
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};
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};
}

/**
Expand Down Expand Up @@ -97,7 +118,7 @@ public JSONObject call(){
JSONObject json = null;
jsonTextC = Request(format, data, php);
String jsonText = "";
if(task != null)
if(task != null)
executor.submit(task);
try{

Expand Down Expand Up @@ -353,6 +374,7 @@ public static String generateURL(String format, String data, String php) {
String[] split2 = data.split("::::");
long currentTimeMillis = System.currentTimeMillis() / 1000;
JSONObject jSONObject = new JSONObject();
jSONObject.put("","");
for (int i = 0; i < split.length; i++) {
try {
jSONObject.put(split[i], split2[i]);
Expand Down
190 changes: 190 additions & 0 deletions src/main/java/me/checkium/vhackapi/console/Connection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
package me.checkium.vhackapi.console;

import org.json.JSONObject;

import me.checkium.vhackapi.Utils;
import me.checkium.vhackapi.Spyware.SpywareUploadResult;

public class Connection {
private String IP;
private boolean success = true;
private String username,
firewallLevel,
antiVirusLevel,
scanLevel,
sdkLevel,
spamLevel,
money,
anonymous,
successRep,
failRep,
successRate;

public Connection(String[] result, String ip) {
if (result.length == 1) {
success = false;
return;
}
if (result[1] == null) {
success = false;
} else {
username = result[1].substring(26);
firewallLevel = result[2].substring(26);
antiVirusLevel = result[3].substring(27);
scanLevel = result[4].substring(22);
sdkLevel = result[5].substring(21);
spamLevel = result[6].substring(22);
money = result[7].substring(23);
anonymous = result[9].substring(27);
successRep = result[11].substring(32);
failRep = result[12].substring(29);
successRate = result[13].substring(39);
}

}

public SpywareUploadResult spywareUpload(){

String returnString = Utils.StringRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_spywareUpload.php");
return new SpywareUploadResult(returnString);

}

public TransferResult trojanTransfer(){

JSONObject json = Utils.JSONRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_trTransfer.php");
return new TransferResult(json,IP);

}

public void clearLogs(){

Utils.StringRequest("user::::pass::::uhash::::target", Console.user + "::::" + Console.pass + "::::" + Console.uHash + "::::" + IP, "vh_clearAccessLog.php");
}

public String getUsername() {
if (!success) return null;
return username;
}


public Integer getFirewallLevel() {
if (!success) return null;
try {
return Integer.parseInt(firewallLevel);
} catch (NumberFormatException e) {
return null;
}
}


public Integer getAntiVirusLevel() {
if (!success) return null;
try {
return Integer.valueOf(antiVirusLevel);
} catch (NumberFormatException e) {
return null;
}
}


public Integer getScanLevel() {
if (!success) return null;
try {
return Integer.valueOf(scanLevel);
} catch (NumberFormatException e) {
return null;
}
}


public Integer getSdkLevel() {
if (!success) return null;
try {
return Integer.valueOf(sdkLevel);
} catch (NumberFormatException e) {
return null;
}
}


public Integer getSpamLevel() {
if (!success) return null;
try {
return Integer.valueOf(spamLevel);
} catch (NumberFormatException e) {
return null;
}
}


public Integer getMoney() {
if (!success) return null;
try {
return Integer.valueOf(money);
} catch (NumberFormatException e) {
return null;
}
}


public Boolean isAnonymous() {
if (!success) return null;
return "YES".equals(anonymous);
}


public Integer getSuccessRep() {
if (!success) return null;
try {
return Integer.valueOf(successRep);
} catch (NumberFormatException er) {
return null;
}
}


public Integer getFailRep() {
if (!success) return null;
try {
return Integer.valueOf(failRep);
} catch (NumberFormatException er) {
return null;
}
}


public Integer getSuccessRate() {
if (!success) return 0;
try {
return Integer.valueOf(successRate.replace("%", ""));
} catch (NumberFormatException er) {
return null;
}
}

public String getIP() {
return IP;
}

public boolean getSuccess() {

return success;

}
/*

private val success = result[1] != null
val username = result[1]?.substring(26)
val firewallLevel = result[2]!!.substring(26).toInt()
val antiVirusLevel = result[3]!!.substring(27).toInt()
val scanLevel = result[4]!!.substring(22).toInt()
val sdkLevel = result[5]!!.substring(21).toInt();
val spamLevel = result[6]!!.substring(22).toInt();
val money = result[7]!!.substring(23).toInt();
val anonymous = result[9]!!.substring(27) == "YES";
val successRep = result[11]!!.substring(32).toInt();
val failRep = result[12]!!.substring(29).toInt();
val successRate = result[13]!!.substring(39).replace("%","").toInt();
*/
}
Loading