Commit 536568b7 authored by Hardik Zinzuvadiya's avatar Hardik Zinzuvadiya
Browse files

Fix 12 issues from Copilot PR review (#590)

post_exploitation.py:
- Rename INSTALL_OS -> SUPPORTED_OS in Havoc class (typo, field was ignored)
- Sliver: replace curl|sudo bash pipe with download-then-execute pattern

ddos.py:
- Add DDoSTool() to DDOSTools.TOOLS list (was defined but unreachable)

phishing_attack.py:
- Rename class Evilginx2 -> Evilginx3 (installs v3 via go install)
- Update instance in TOOLS list to match
- Fix stale comment: wireless_attack_tools.py -> wireless_attack.py

forensics.py:
- Remove installable=False from Guymager (conflicted with INSTALL_COMMANDS)

tool_manager.py:
- Skip sudo prefix when already root (os.geteuid() == 0), matching
  the pattern already used in install.py

install.py:
- Add chown -R root:root after cp -a to prevent git "dubious ownership"
  errors when the source clone has different ownership

update.sh:
- Add git config safe.directory before pull to prevent dubious ownership
- Add --upgrade flag to pip install so dependencies actually update

os_detect.py:
- Add pkg (FreeBSD) entries to PACKAGE_INSTALL_CMDS, PACKAGE_UPDATE_CMDS,
  and REQUIRED_PACKAGES — was detected but had no command mappings (KeyError)

Skipped (not applicable):
- #1 subprocess import: already fixed in prior commit
- #11 Path.home() under sudo: by design (installer runs as root)
parent 73980f11
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ def install_source() -> bool:
        if APP_INSTALL_DIR.exists():
            subprocess.run(["rm", "-rf", str(APP_INSTALL_DIR)], check=True)
        subprocess.run(["cp", "-a", str(source_dir), str(APP_INSTALL_DIR)], check=True)
        # Fix ownership so git doesn't complain about "dubious ownership"
        subprocess.run(["chown", "-R", "root:root", str(APP_INSTALL_DIR)], check=False)
        console.print("[success]✔ Source copied (no re-clone needed)[/success]")
        return True

+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ PACKAGE_INSTALL_CMDS: dict[str, str] = {
    "zypper":  "zypper install -y {packages}",
    "apk":     "apk add {packages}",
    "brew":    "brew install {packages}",
    "pkg":     "pkg install -y {packages}",
}

PACKAGE_UPDATE_CMDS: dict[str, str] = {
@@ -89,6 +90,7 @@ PACKAGE_UPDATE_CMDS: dict[str, str] = {
    "zypper":  "zypper update -y",
    "apk":     "apk update && apk upgrade",
    "brew":    "brew update && brew upgrade",
    "pkg":     "pkg update && pkg upgrade -y",
}

# Core system packages needed per package manager
@@ -101,6 +103,7 @@ REQUIRED_PACKAGES: dict[str, list[str]] = {
                "ruby", "golang", "php", "java-17-openjdk-headless"],
    "zypper":  ["git", "python3-pip", "curl", "wget", "ruby", "go", "php"],
    "brew":    ["git", "python3", "curl", "wget", "ruby", "go", "php"],
    "pkg":     ["git", "python3", "py39-pip", "curl", "wget", "ruby", "go", "php83"],
}


+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ class Saphyra(HackingTool):

class DDOSTools(HackingToolsCollection):
    TITLE = "DDOS Attack Tools"
    TOOLS = [SlowLoris(), Asyncrone(), UFONet(), GoldenEye(), Saphyra()]
    TOOLS = [DDoSTool(), SlowLoris(), Asyncrone(), UFONet(), GoldenEye(), Saphyra()]


if __name__ == "__main__":
+0 −2
Original line number Diff line number Diff line
@@ -73,8 +73,6 @@ class Guymager(HackingTool):
    RUN_COMMANDS = ["sudo guymager"]
    PROJECT_URL = "https://guymager.sourceforge.io/"

    def __init__(self):
        super().__init__(installable=False)


class Toolsley(HackingTool):
+3 −3
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ class HiddenEye(HackingTool):
    PROJECT_URL = "https://github.com/Morsmalleo/HiddenEye"


class Evilginx2(HackingTool):
class Evilginx3(HackingTool):
    TITLE = "Evilginx3"
    SUPPORTED_OS = ["linux"]
    DESCRIPTION = (
@@ -136,7 +136,7 @@ class QRJacking(HackingTool):
    PROJECT_URL = "https://github.com/cryptedwolf/ohmyqr"


# Bug 10 fix: WifiPhisher removed from phishing tools — it belongs in wireless_attack_tools.py
# Bug 10 fix: WifiPhisher removed from phishing tools — it belongs in wireless_attack.py


class BlackEye(HackingTool):
@@ -237,7 +237,7 @@ class PhishingAttackTools(HackingToolsCollection):
        Setoolkit(),
        SocialFish(),
        HiddenEye(),
        Evilginx2(),
        Evilginx3(),
        ISeeYou(),
        SayCheese(),
        QRJacking(),
Loading