mirror of
https://github.com/K9T33NwthTookThis/RPC-info-dumper.git
synced 2025-07-18 22:46:10 +00:00
Add exclusion for system/'root' accounts from the filtering
This commit is contained in:
parent
2ec87df8d9
commit
4cead9f433
5
info-dumper.sh
Normal file → Executable file
5
info-dumper.sh
Normal file → Executable file
@ -28,6 +28,11 @@ uptime >> /tmp/rpc-dump.txt
|
|||||||
|
|
||||||
# Remove all user names on system
|
# Remove all user names on system
|
||||||
getent passwd | while IFS=: read -r name password uid gid gecos home shell; do
|
getent passwd | while IFS=: read -r name password uid gid gecos home shell; do
|
||||||
|
# System accounts shouldn't be redacted, as well as some user accounts
|
||||||
|
if (( $uid < 1000 )); then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
cat /tmp/rpc-dump.txt | awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' | tee /tmp/rpc-dump.txt &>/dev/null
|
cat /tmp/rpc-dump.txt | awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' | tee /tmp/rpc-dump.txt &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user