OpticFusion1/MCAntiMalware

Make these a separate check

github-actions opened this issue · 1 comments

Make these a separate check

            if (result == WhitelistResult.INVALID_FILE || result == WhitelistResult.WHITELISTED) {
                return;
            }

            // TODO: Make this a separate check
            if (Files.exists(rootFolder.resolve("dev/jnic/lib/"))) {
                sendNotification(file, new CheckResult("Spigot", "JNIC", "A"));
                return;
            }

            // TODO: Make these a separate check
            if (Files.exists(rootFolder.resolve("plugin-config.bin"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "A"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/gradle/org/apache/commons/local-info.hdm"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "B"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/gradle/io/netty/netty-locals.netd"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "C"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/org/apache/logging/log4j/Log4j-events.dtd"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "D"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/gradle/org/apache/logging/log4j/Log4j-events.dtd"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "E"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/gradle/org.json/json/json.xsd"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "F"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/org/apache/commons/api-catch.dir"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "G"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/org/apache/commons/local-dir.hum"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "H"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/org/apache/commons/local-info.hdm"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "I"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/com/google/code/gson/gson/maven.data"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "J"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/gradle/com.google.code.gson/gson/maven.data"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "K"));
                return;
            }

            if (Files.exists(rootFolder.resolve("META-INF/maven/org.json/json/gson.xsd"))) {
                sendNotification(file, new CheckResult("Spigot", "SG", "L"));
                return;
            }


            boolean possiblyMalicious = false;
            Stream<Path> validClasses = walkThroughFiles(rootFolder);
            Iterator<Path> validClassIterator = validClasses.iterator();

8c449db20ee3a907cb0a0ef10c26ac6bbffe8d51

This will be properly done in the paper fork.