Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
persisthunt — Linux Persistence Detection, Hunting and Artifact Collection script | Kitploit
उपकरण/GitHubGitHub/raj3shp/persisthunt
Privilege EscalationReconnaissanceContainer SecurityPersistence MechanismsScripting & AutomationForensicsMalware AnalysisDigital ForensicsIncident Response
GitHubraj3shp/persisthunt

persisthunt

Linux Persistence Detection, Hunting and Artifact Collection script

2511 महीना पहलेKitploit द्वारा समीक्षित

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें
रिपॉजिटरी देखें
अनुरोधित भाषा में सामग्री उपलब्ध नहीं है। अंग्रेज़ी संस्करण दिखाया जा रहा है।

Linux Persistence Detection, Hunting and Artifact Collection

  • Summary
  • Usage
  • Example Detections
  • Table of Techniques

Summary

persisthunt.sh helps speed up investigations by collecting targeted persistence-related artifacts and highlighting suspicious patterns commonly associated with Linux persistence techniques.

The script assists in persistence detection, threat hunting, and artifact collection across well-known Linux persistence mechanisms. Findings are categorized into three levels - High, Low, and Informational based on confidence and severity. Examples include suspicious autorun entries referencing /tmp/, /home/, /dev/tcp, curl, or detection of active bind/reverse shells.

It is designed as a flexible foundation that defenders can customize for their environments by adding or removing detection logic and keywords. The output can be large and may require environment-specific analysis, but it is also suitable for review and summarization using LLMs or AI agents.

Usage

Run as root user and redirect output to a file

root@kitploit:~
sudo persisthunt.sh > output.log

Run on a remote host via SSH

root@kitploit:~
ssh [email protected] 'bash -s' < persisthunt.sh > output.log 2>&1

Example Detections

root@kitploit:~
=== [HIGH] Active reverse shell ===
bob      3889906  0.0  0.0   2800  1848 pts/2    S+   06:38   0:00 sh -i

=== [HIGH] Active bind shell ===
LISTEN 0      1                                     0.0.0.0:4444  0.0.0.0:* users:(("python3",pid=3891687,fd=3))
bob      3891687  0.7  0.3  19540 12320 pts/3    S+   06:41   0:00 python3 -c exec("""import socket as s,subprocess as sp;s1=s.socket(s.AF_INET,s.SOCK_STREAM);s1.setsockopt(s.SOL_SOCKET,s.SO_REUSEADDR, 1);s1.bind(("0.0.0.0",4444));s1.listen(1);c,a=s1.accept(); while True: d=c.recv(1024).decode();p=sp.Popen(d,shell=True,stdout=sp.PIPE,stderr=sp.PIPE,stdin=sp.PIPE);c.sendall(p.stdout.read()+p.stderr.read())""")

=== [HIGH] eBPF programs with raw network sockets (possible BPFdoor persistence) ===
PID: 3903559, Executable: bpfdoorpoc, Stack trace: /proc/3903559/stack:[<0>] packet_recvmsg+0x6e/0x5c0

=== [LOW] Recent ELF binary in tmp/home/hidden dirs ===
/var/tmp/.test

Techniques

टूल डाउनलोड करें
ConfidenceTechniqueDescription
HighAT Job PersistenceLegit 'at' jobs are uncommon; unexpected entries in /var/spool/at are highly suspicious.
HighCron entry referencing a suspicious keywordCron files that reference curl/wget/nc/ncat/socat or paths like /tmp, /var/tmp, /dev/shm, /home, or hidden files.
HighActive bind shellDetect interpreter processes (bash/sh/zsh/dash/ksh/python*/perl/nc/ncat/socat) that are listening on network sockets (bind shells).
HighActive reverse shellDetect processes whose stdin and stdout are redirected to sockets, indicating reverse shells.
HighPersistence using eBPF raw network socketRootkits such as BPFdoor use eBPF programs with raw network sockets for persistent backdoor. Read more
HighSystemd service/timer referencing a suspicious keywordSearch .service and .timer files under systemd paths (including user units under ~/.config/systemd/user/) for suspicious keywords.
HighInit/rc.local/profile script referencing a suspicious keywordInit scripts and rc.local/profile files that reference suspicious keywords or network/tools in persistence paths.
HighMOTD script referencing a suspicious keywordMOTD scripts that reference suspicious keywords or persistence tooling.
HighShell profile referencing a suspicious keywordShell profiles (/etc/profile, /etc/profile.d, ~/.bashrc, ~/.profile, etc.) containing suspicious commands or paths.
HighD-BUS service files referencing a suspicious keywordD-BUS service files found in path */dbus-1/* referencing suspicious keywords
HighNetworkManager dispatcher scripts referencing a suspicious keywordNetworkManager dispatcher scripts found in path */NetworkManager/dispatcher.d/* referencing suspicious keywords
HighHidden ELF executable files in tmp/home/hidden dirsHidden dotfiles (names beginning with a dot) in /tmp, /var/tmp, /home, /dev/shm that are ELF executables.
HighRunning processesRunning processes referencing a suspicious keyword
HighSUID/SGID/world-writable ELF binaryWorld-writable files with SUID or SGID bits set that are ELF binaries (potential privilege escalation/backdoor).
HighHidden process detected in /proc (possible rootkit)Enumerate /proc PIDs and compare against ps output to find processes hidden by rootkits (e.g., Diamorphine); includes notes on how attackers backdoor ps to hide PIDs.
HighHidden process with bind mount trickDetect mounts that bind over /proc/ (e.g., mount -o bind mydir /proc/1234) which can hide process entries from ps.
HighLD_PRELOAD configured system widePresence or modification of /etc/ld.so.preload which can be abused by rootkits for persistence.
LowFiles with capabilitiesFiles on the system with POSIX capabilities set (from getcap) — lower-confidence indicator but worth checking.
LowRecent ELF binary in tmp/home/hidden dirsRecently modified or created executable ELF binaries (within 7 days) in /tmp, /var/tmp, /dev/shm, /home — lower-confidence indicator.
LowGit config or hooks fileNon-sample git config or hooks files (e.g., .git/config or .git/hooks/*) which could be abused for persistence.
LowAPT HooksAPT Hooks could be abused for persistence.
LowYum/DNF pluginsYum/DNF plugins referencing a suspicious keyword
Low.pth file with suspicious content (Python persistence).pth files containing executed imports or calls like import, os.system, exec() which run on Python module import.
Lowudev rulesUdev rules with RUN key (possible persistence)
LowPAM modulesPAM modules referencing pam_exec which could be abused for persistence
LowHijacking system binariesRecent modified binary files in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin/
InformationalAll cron entries (manual review)Print all cron-related files and their (non-comment) contents for manual review.
InformationalAll shell profiles (manual review)Print contents of all system and user shell profile files for manual inspection.
InformationalAll init.d and rc.local scripts (manual review)Print init.d and rc.local scripts for manual inspection.
InformationalAll MOTD files (manual review)Print MOTD and update-motd.d scripts/files for manual review.
InformationalRecent (7 days) ELF binaries (manual review)List recent executable ELF files (7 days) for manual review.
InformationalList all dotfiles in home directories (manual review)Enumerate dotfiles in user home directories for manual review.
InformationalSSH authorized keys in home directories (manual review)Print non-empty authorized_keys files in /root and /home for manual inspection.
InformationalLocal users and groups (manual review)List local users and groups via getent for manual review.
InformationalMounts (manual review)Print current mounts for manual inspection.
InformationalActive Network connections (manual review)Show active network connections (ss -tunap) for manual review.
InformationalSystemd services (manual review)List running systemd services (systemctl list-units --type=service --state=running).
InformationalD-BUS service files (manual review)Find D-BUS service files under dbus-1 directories for review.
InformationalNetworkManager dispatcher scriptsNetworkManager-dispatcher runs scripts on network changes; check dispatcher.d executable scripts under NetworkManager for potential persistence.
InformationalContainer images and running containersList all container images and running containers with Docker, Podman and Containerd
InformationalInstalled packagesList all installed packages with dpkg/rpm/dnf
InformationalLoaded kernel modulesList all loaded kernel modules