diff --git a/agent-smith/.idea/.gitignore b/agent-smith/.idea/.gitignore new file mode 100644 index 0000000..241e1a4 --- /dev/null +++ b/agent-smith/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/../../../../../../../:\Users\xerox\Desktop\winscrape-master\agent-smith\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/agent-smith/.idea/artifacts/agent_smith_jar.xml b/agent-smith/.idea/artifacts/agent_smith_jar.xml index 4ca0002..453dcda 100644 --- a/agent-smith/.idea/artifacts/agent_smith_jar.xml +++ b/agent-smith/.idea/artifacts/agent_smith_jar.xml @@ -3,9 +3,9 @@ $PROJECT_DIR$/out/artifacts/agent_smith_jar - - - + + + \ No newline at end of file diff --git a/agent-smith/.idea/misc.xml b/agent-smith/.idea/misc.xml index 5217e29..91063aa 100644 --- a/agent-smith/.idea/misc.xml +++ b/agent-smith/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/agent-smith/.idea/workspace.xml b/agent-smith/.idea/workspace.xml index b4771e4..86a46d2 100644 --- a/agent-smith/.idea/workspace.xml +++ b/agent-smith/.idea/workspace.xml @@ -22,26 +22,28 @@ + - + + + - + - - - + + + @@ -58,6 +60,7 @@ + @@ -68,77 +71,17 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + \ No newline at end of file diff --git a/agent-smith/CabParser-2.9.jar b/agent-smith/CabParser-2.9.jar new file mode 100644 index 0000000..63392c3 Binary files /dev/null and b/agent-smith/CabParser-2.9.jar differ diff --git a/agent-smith/Utilities-1.2.jar b/agent-smith/Utilities-1.2.jar new file mode 100644 index 0000000..49b365c Binary files /dev/null and b/agent-smith/Utilities-1.2.jar differ diff --git a/agent-smith/jsoup-1.13.1.jar b/agent-smith/jsoup-1.13.1.jar new file mode 100644 index 0000000..bb1237c Binary files /dev/null and b/agent-smith/jsoup-1.13.1.jar differ diff --git a/agent-smith/src/DriverDownloader.java b/agent-smith/src/DriverDownloader.java index d50207c..d856161 100644 --- a/agent-smith/src/DriverDownloader.java +++ b/agent-smith/src/DriverDownloader.java @@ -10,6 +10,7 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.stream.Collectors; @@ -84,24 +85,18 @@ public class DriverDownloader extends Thread { sb.append((char) ch); var driverImports = sb.toString().split(","); - Arrays.stream(driverImports).parallel().forEach(driverImport -> { - Arrays.stream(this.imports).parallel().forEach(searchImport -> { - if(searchImport.equals(driverImport)) { - try { - var driverPath = path.split("\\\\"); - System.out.printf("[+++] %s imports %s!!!!\n", driverPath[driverPath.length - 1], searchImport); - Arrays.stream(driverImports).parallel().forEach(v -> System.out.printf("\t[Import] %s\n", v)); - // move the file to results/[uuid]/driver_name.sys - Files.move( - new File(path).toPath(), - new File("results/" - .concat(uuid) - .concat(driverPath[driverPath.length - 1])) // just in case the driver is in a sub folder - .toPath()); - } catch (IOException e) { } - } - }); - }); + if (Arrays.asList(driverImports).containsAll(Arrays.asList(this.imports))) { + System.out.println("[+] found with all desired imports...."); + try { + var driverPath = path.split("\\\\"); + Files.move( + new File(path).toPath(), + new File("results/" + .concat(uuid) + .concat(driverPath[driverPath.length - 1])) // just in case the driver is in a sub folder + .toPath()); + } catch (IOException e) { } + } } catch (Exception e) { e.printStackTrace(); } });