Merge pull request #94 from HomeSen/linpeas_fix_ss_bug

Fixed empty "Active Ports" output of LinPEAS, when ss is used
This commit is contained in:
Carlos Polop 2021-01-07 10:12:29 +01:00 committed by GitHub
commit 11618a488a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1448,7 +1448,7 @@ if [ "`echo $CHECKS | grep Net`" ]; then
#-- NI) Ports #-- NI) Ports
printf $Y"[+] "$GREEN"Active Ports\n"$NC printf $Y"[+] "$GREEN"Active Ports\n"$NC
printf $B"[i] "$Y"https://book.hacktricks.xyz/linux-unix/privilege-escalation#open-ports\n"$NC printf $B"[i] "$Y"https://book.hacktricks.xyz/linux-unix/privilege-escalation#open-ports\n"$NC
(netstat -punta || ss --ntpu || (netstat -a -p tcp && netstat -a -p udp) | grep -i listen) 2>/dev/null | sed -E "s,127.0.[0-9]+.[0-9]+,${C}[1;31m&${C}[0m," (netstat -punta || ss -ntpu || (netstat -a -p tcp && netstat -a -p udp) | grep -i listen) 2>/dev/null | sed -E "s,127.0.[0-9]+.[0-9]+,${C}[1;31m&${C}[0m,"
echo "" echo ""
#-- NI) tcpdump #-- NI) tcpdump