autoimprover: simplify linpeas checks (#769)

Co-authored-by: HackTricks PEASS Autoimprover <[email protected]>
This commit is contained in:
SirBroccoliandHackTricks PEASS Autoimprover authored and GitHub committed 2026-10-11 16:02:47 +02:00
1 parent 4764948e4f
commit 95505dc15b
4 files changed
+29 -39

No files matched your search

@@ -6,24 +6,13 @@
# License: GNU GPL
# Version: 1.0
# Mitre: T1040
# Functions Used: print_2title, print_3title, print_info, warn_exec
# Functions Used: print_2title, print_3title, print_info, warn_exec, check_command
# Global Variables: $EXTRA_CHECKS, $E, $SED_RED, $SED_GREEN, $SED_RED_YELLOW
# Initial Functions:
# Generated Global Variables: $tools_found, $tool, $interfaces, $interfaces_found, $iface, $cmd, $pattern, $patterns, $dumpcap_test_file
# Generated Global Variables: $tools_found, $tool, $interfaces, $interfaces_found, $iface, $pattern, $patterns, $dumpcap_test_file
# Fat linpeas: 0
# Small linpeas: 1
# Function to check if a command exists and is executable
check_command() {
local cmd=$1
if command -v "$cmd" >/dev/null 2>&1; then
if [ -x "$(command -v "$cmd")" ]; then
return 0
fi
fi
return 1
}
# Function to check if we can sniff on an interface
check_interface_sniffable() {
local iface=$1
@@ -6,24 +6,13 @@
# License: GNU GPL
# Version: 1.0
# Mitre: T1016
# Functions Used: print_2title, print_3title, warn_exec, echo_not_found
# Functions Used: print_2title, print_3title, warn_exec, echo_not_found, check_command
# Global Variables: $EXTRA_CHECKS, $E, $SED_RED, $SED_GREEN, $SED_YELLOW, $SED_RED_YELLOW
# Initial Functions:
# Generated Global Variables: $rules_file, $cmd, $tool, $config_file, $sysctl_var
# Generated Global Variables: $rules_file, $tool, $config_file, $sysctl_var
# Fat linpeas: 0
# Small linpeas: 1
# Function to check if a command exists and is executable
check_command() {
local cmd=$1
if command -v "$cmd" >/dev/null 2>&1; then
if [ -x "$(command -v "$cmd")" ]; then
return 0
fi
fi
return 1
}
# Function to analyze iptables rules
analyze_iptables() {
echo ""
@@ -6,24 +6,13 @@
# License: GNU GPL
# Version: 1.0
# Mitre: T1049
# Functions Used: print_2title, print_3title, warn_exec, echo_not_found, lp_trusted_version_path
# Functions Used: print_2title, print_3title, warn_exec, echo_not_found, lp_trusted_version_path, check_command
# Global Variables: $EXTRA_CHECKS, $E, $SED_RED, $SED_GREEN, $SED_YELLOW
# Initial Functions:
# Generated Global Variables: $inetd_service, $log_file, $cmd, $service_name, $conf_file, $service_dir, $service_file, $file, $inetd_command, $inetd_telnet_probe_count, $service, $socket, $protocol, $user, $server, $checked_binary, $trusted_server, $version_output, $version, $major, $minor, $patch, $rest
# Generated Global Variables: $inetd_service, $log_file, $service_name, $conf_file, $service_dir, $service_file, $file, $inetd_command, $inetd_telnet_probe_count, $service, $socket, $protocol, $user, $server, $checked_binary, $trusted_server, $version_output, $version, $major, $minor, $patch, $rest
# Fat linpeas: 0
# Small linpeas: 0
# Function to check if a command exists and is executable
check_command() {
local cmd=$1
if command -v "$cmd" >/dev/null 2>&1; then
if [ -x "$(command -v "$cmd")" ]; then
return 0
fi
fi
return 1
}
inetd_telnet_upstream_affected() {
local major=$1 minor=$2 patch=$3
if [ "$major" -eq 1 ]; then
@@ -0,0 +1,23 @@
# Title: Function - check_command
# ID: check_command
# Author: PEASS-ng contributors
# Last Update: 10-10-2026
# Description: Check whether a command resolves to an executable file.
# License: GNU GPL
# Version: 1.0
# Functions Used:
# Global Variables:
# Initial Functions:
# Generated Global Variables: $cmd
# Fat linpeas: 0
# Small linpeas: 1
check_command() {
local cmd=$1
if command -v "$cmd" >/dev/null 2>&1; then
if [ -x "$(command -v "$cmd")" ]; then
return 0
fi
fi
return 1
}