Auto-merge PR #750 (Chack Agent)

Co-authored-by: Carlos Polop <[email protected]>
This commit is contained in:
SirBroccoliandCarlos Polop authored and GitHub committed 2026-10-05 15:20:11 +00:00
1 parent 7cff6dc5ae
commit 9f5d6128ad
29 files changed
+31 -31

No files matched your search

+1 -1
View File
@@ -2019,7 +2019,7 @@ search:
config:
auto_check: True
exec:
- ipa_exists="$(command -v ipa)"; if [ "$ipa_exists" ]; then print_info "https://book.hacktricks.wiki/en/linux-hardening/freeipa-pentesting.html"; fi
- ipa_exists="$(command -v ipa)"; if [ "$ipa_exists" ]; then print_info "https://book.hacktricks.wiki/en/linux-hardening/software-information/freeipa-pentesting.html"; fi
files:
- name: "ipa"
@@ -34,7 +34,7 @@
# Small linpeas: 1
print_2title "Operative system" "T1082"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#kernel-exploits"
print_info "https://book.hacktricks.wiki/en/linux-hardening/main-system-information/kernel-vulnerability-assessment.html"
(cat /proc/version || uname -a ) 2>/dev/null | sed -${E} "s,$kernelDCW_Ubuntu_Precise_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_5,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_6,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Xenial,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel7,${SED_RED_YELLOW}," | sed -${E} "s,$kernelB,${SED_RED},"
warn_exec lsb_release -a 2>/dev/null
if [ "$MACPEAS" ]; then
@@ -21,7 +21,7 @@ containerCheck
if [ "$inContainer" ]; then
echo ""
print_2title "Container - Writable bind mounts w/o nosuid (SUID persistence risk)" "T1611"
print_info "https://book.hacktricks.wiki/en/linux-hardening/containers-namespaces/container-security/privileged-containers.html#writable-bind-mounts"
print_info "https://book.hacktricks.wiki/en/linux-hardening/containers-namespaces/container-security/sensitive-host-mounts.html"
if [ -r /proc/self/mountinfo ]; then
CT_RW_bind_mounts_matches=$(grep -E "(^| )bind( |$)" /proc/self/mountinfo 2>/dev/null | grep -E "(^|,)rw(,|$)" | grep -v "nosuid" || true)
@@ -15,7 +15,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Services and Service Files" "T1543.002,T1007"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#services"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/process-enumeration-and-service-paths.html#follow-the-service-execution-chain"
checkSystemdWritableExecPaths
@@ -20,7 +20,7 @@
if ! [ "$IAMROOT" ]; then
print_2title "Analyzing .socket files" "T1559"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#sockets"
print_info "https://book.hacktricks.wiki/en/linux-hardening/network-information/local-network-and-socket-triage.html#unix-socket-interaction-and-command-injection"
# Function to check if path is relative
is_relative_path() {
@@ -21,7 +21,7 @@
if ! [ "$IAMROOT" ]; then
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Unix Sockets Analysis" "T1571,T1049"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#sockets"
print_info "https://book.hacktricks.wiki/en/linux-hardening/network-information/local-network-and-socket-triage.html#unix-socket-interaction-and-command-injection"
# Function to get socket permissions
@@ -21,7 +21,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "D-Bus Analysis" "T1559.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#d-bus"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/d-bus-enumeration-and-command-injection-privilege-escalation.html"
# Function to check for dangerous methods
@@ -18,7 +18,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Crontab UI (root) misconfiguration checks" "T1053.003"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#scheduledcron-jobs"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/cron-and-systemd-timers.html#enumerate-schedules"
# Collect candidate services referencing crontab-ui
candidates=""
@@ -18,7 +18,7 @@ if ! [ "$SEARCH_IN_FOLDER" ]; then
if [ "$NOUSEPS" ]; then
printf ${BLUE}"[i]$GREEN Looks like ps is not finding processes, going to read from /proc/ and not going to monitor 1min of processes\n"$NC
fi
print_info "Check weird & unexpected processes run by root: https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#processes"
print_info "Check weird & unexpected processes run by root: https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/process-enumeration-and-service-paths.html#map-processes-and-ownership"
if [ -f "/etc/fstab" ] && cat /etc/fstab | grep -q "hidepid=2"; then
echo "Looks like /etc/fstab has hidepid=2, so ps will not show processes of other users"
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
if [ "$NOUSEPS" ]; then
print_2title "Binary processes permissions (non 'root root' and not belonging to current user)" "T1574,T1554"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#processes"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/process-enumeration-and-service-paths.html#map-processes-and-ownership"
# Get list of writable binaries
binW=""
@@ -17,7 +17,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
if ! [ "$FAST" ] && ! [ "$SUPERFAST" ]; then
print_2title "Different processes executed during 1 min (interesting is low number of repetitions)" "T1057"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#frequent-cron-jobs"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/cron-and-systemd-timers.html#observe-short-lived-work"
temp_file=$(mktemp)
if [ "$(ps -e -o user,command 2>/dev/null)" ]; then
for i in $(seq 1 1210); do
@@ -15,7 +15,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Check for vulnerable cron jobs" "T1053.003"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#scheduledcron-jobs"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/cron-and-systemd-timers.html#enumerate-schedules"
print_3title "Cron jobs list" "T1053.003"
command -v crontab 2>/dev/null || echo_not_found "crontab"
@@ -262,7 +262,7 @@ if ! [ "$SEARCH_IN_FOLDER" ]; then
#fi
else
print_2title "Cron jobs" "T1053.003"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#scheduledcron-jobs"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/cron-and-systemd-timers.html#enumerate-schedules"
find "$SEARCH_IN_FOLDER" '(' -type d -or -type f ')' '(' -name "cron*" -or -name "anacron" -or -name "anacrontab" -or -name "incron.d" -or -name "incron" -or -name "at" -or -name "periodic" ')' -exec echo {} \; -exec ls -lR {} \;
fi
echo ""
@@ -15,7 +15,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "System timers" "T1053.003"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#timers"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/cron-and-systemd-timers.html#enumerate-schedules"
# Function to check timer content for privilege escalation vectors
check_timer_content() {
@@ -108,7 +108,7 @@ parse_proc_net_ports() {
# Function to get open ports information
get_open_ports() {
print_2title "Active Ports" "T1049"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#open-ports"
print_info "https://book.hacktricks.wiki/en/linux-hardening/network-information/local-network-and-socket-triage.html#loopback-and-local-service-enumeration"
# Try standard tools first
if command -v netstat >/dev/null 2>&1; then
@@ -15,6 +15,6 @@
print_2title "My user" "T1033"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#users"
print_info "https://book.hacktricks.wiki/en/linux-hardening/user-information/user-and-session-triage.html#enumerate-identities-and-group-based-access"
(id || (whoami && groups)) 2>/dev/null | sed -${E} "s,$groupsB,${SED_RED},g" | sed -${E} "s,$groupsVB,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN},g" | sed "s,$USER,${SED_LIGHT_MAGENTA},g" | sed -${E} "s,$nosh_usrs,${SED_BLUE},g" | sed -${E} "s,$knw_usrs,${SED_GREEN},g" | sed "s,root,${SED_RED}," | sed -${E} "s,$knw_grps,${SED_GREEN},g" | sed -${E} "s,$idB,${SED_RED},g"
echo ""
@@ -15,7 +15,7 @@
print_2title "PGP Keys and Related Files" "T1552.004"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#pgp-keys"
print_info "https://book.hacktricks.wiki/en/linux-hardening/user-information/user-and-session-triage.html#review-user-artifacts"
# Check for GPG
echo "GPG:" | sed -${E} "s,.*,${SED_LIGHT_CYAN},g"
@@ -14,7 +14,7 @@
# Small linpeas: 1
print_2title "Browser Profiles" "T1539,T1217"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#browser-data"
print_info "https://book.hacktricks.wiki/en/generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/browser-artifacts.html"
echo ""
@@ -16,7 +16,7 @@
if [ "$DEBUG" ] || { [ "$TIMEOUT" ] && [ "$(command -v psql 2>/dev/null || echo -n '')" ]; }; then
print_2title "PostgreSQL event trigger ownership & postgres_fdw hooks" "T1505.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#postgresql-event-triggers"
print_info "https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-postgresql.html#event-trigger-privilege-escalation-during-postgres_fdw-extension-installs"
psql_bin="$(command -v psql 2>/dev/null || echo -n '')"
if [ "$TIMEOUT" ] && [ "$psql_bin" ]; then
@@ -18,7 +18,7 @@ if ! [ "$SEARCH_IN_FOLDER" ]; then
runc=$(command -v runc || echo -n '')
if [ "$runc" ] || [ "$DEBUG" ]; then
print_2title "Checking if runc is available" "T1613,T1611"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#runc--privilege-escalation"
print_info "https://book.hacktricks.wiki/en/linux-hardening/containers-namespaces/runc-privilege-escalation.html"
if [ "$runc" ]; then
echo "runc was found in $runc, you may be able to escalate privileges with it" | sed -${E} "s,.*,${SED_RED},"
fi
@@ -15,7 +15,7 @@
print_2title "SUID - Check easy privesc, exploits and write perms" "T1548.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#sudo-and-suid"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/suid-sgid-and-acl-triage.html#enumerate-privileged-executables"
if ! [ "$STRINGS" ]; then
echo_not_found "strings"
fi
@@ -15,7 +15,7 @@
print_2title "SGID" "T1548.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#sudo-and-suid"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/suid-sgid-and-acl-triage.html#enumerate-privileged-executables"
sgids_files=$(find $ROOT_FOLDER -perm -2000 -type f ! -path "/dev/*" 2>/dev/null)
printf "%s\n" "$sgids_files" | while IFS= read -r sfile; do
[ -z "$sfile" ] && continue
@@ -15,7 +15,7 @@
print_2title "Files with ACLs (limited to 50)" "T1222"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#acls"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/suid-sgid-and-acl-triage.html#inspect-acls-and-sensitive-paths"
if ! [ "$SEARCH_IN_FOLDER" ]; then
( (getfacl -t -s -R -p /bin /etc $HOMESEARCH /opt /sbin /usr /tmp /root 2>/dev/null) || echo_not_found "files with acls in searched folders" ) | head -n 70 | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED}," | sed -${E} "s,$writeVB,${SED_RED_YELLOW},g" | sed -${E} "s,$writeB,${SED_RED},g"
else
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Capabilities" "T1548.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#capabilities"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/linux-capabilities.html"
if [ "$(command -v capsh || echo -n '')" ]; then
is_hex_cap_value() {
case "$1" in
@@ -16,7 +16,7 @@
if [ -f "/etc/security/capability.conf" ] || [ "$DEBUG" ] || grep -Rqs "pam_cap\.so" /etc/pam.d /etc/pam.conf 2>/dev/null; then
print_2title "Users with capabilities" "T1548.001"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#capabilities"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/linux-capabilities.html"
if [ -f "/etc/security/capability.conf" ]; then
grep -v '^#\|none\|^$' /etc/security/capability.conf 2>/dev/null | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED}," | sed -${E} "s,$capsB,${SED_RED},g"
else echo_not_found "/etc/security/capability.conf"
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ] && ! [ "$IAMROOT" ]; then
print_2title "Checking misconfigurations of ld.so" "T1574.006"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#ldso"
print_info "https://book.hacktricks.wiki/en/linux-hardening/interesting-files-permissions/ld.so.conf-example.html"
if [ -f "/etc/ld.so.conf" ] && [ -w "/etc/ld.so.conf" ]; then
echo "You have write privileges over /etc/ld.so.conf" | sed -${E} "s,.*,${SED_RED_YELLOW},";
printf $RED$ITALIC"/etc/ld.so.conf\n"$NC;
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Files (scripts) in /etc/profile.d/" "T1546.004"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#profiles-files"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/shell-startup-aliases-and-history.html#review-startup-and-history-files"
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
(ls -la /etc/profile.d/ 2>/dev/null | sed -${E} "s,$profiledG,${SED_GREEN},") || echo_not_found "/etc/profile.d/"
check_critial_root_path "/etc/profile"
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title "Permissions in init, init.d, systemd, and rc.d" "T1543.002"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#init-initd-systemd-and-rcd"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/process-enumeration-and-service-paths.html#follow-the-service-execution-chain"
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
check_critial_root_path "/etc/init/"
check_critial_root_path "/etc/init.d/"
@@ -16,7 +16,7 @@
if ! [ "$SEARCH_IN_FOLDER" ]; then
print_2title ".sh files in path" "T1574.007"
print_info "https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#scriptbinaries-in-path"
print_info "https://book.hacktricks.wiki/en/linux-hardening/processes-crontab-systemd-dbus/process-enumeration-and-service-paths.html#follow-the-service-execution-chain"
echo $PATH | tr ":" "\n" | while read d; do
for f in $(find "$d" -name "*.sh" -o -name "*.sh.*" 2>/dev/null); do
if ! [ "$IAMROOT" ] && [ -O "$f" ]; then
+2 -2
View File
@@ -38,7 +38,7 @@ There is a **maximun of 3 levels of sections**.
}
],
"infos": [
"https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#kernel-exploits"
"https://book.hacktricks.wiki/en/linux-hardening/main-system-information/kernel-vulnerability-assessment.html"
]
},
"infos": []
@@ -65,7 +65,7 @@ There is a **maximun of 3 levels of sections**.
}
],
"infos": [
"https://book.hacktricks.wiki/en/linux-hardening/linux-basics/linux-privilege-escalation/index.html#kernel-exploits"
"https://book.hacktricks.wiki/en/linux-hardening/main-system-information/kernel-vulnerability-assessment.html"
]
},
"infos": []