You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
dotfiles/.aliases.d/security.sh

24 lines
1.7 KiB

alias findblanks='sudo awk -F: '\''($2 == "") {print}'\'' /etc/shadow'
alias findrootusers='sudo awk -F: '\''($3 == "0") {print}'\'' /etc/passwd'
alias findusers='sudo awk -F: '\''($3 >=1000) {print $1,$6}'\'' /etc/passwd'
alias findnobody-files='find / -path /proc -prune -o -path /sys -prune -o -path /dev -prune -o \( -nouser -o -nogroup \) -ls 2> /dev/null'
alias mempass='shuf -n 3 /usr/share/dict/british-english | sed "s/./\u&/" | tr -cd "[A-Za-z]"; echo $(shuf -i0-999 -n 1)'
alias uchecker='curl -s -L https://kernelcare.com/uchecker | sudo python'
alias find-ow='find / -perm -o=w ! -type l ! -path "/proc/*" ! -path "/sys/*" ! -path "/run/*" ! -path "/dev/*" ! -path "/tmp/*" 2>/dev/null'
alias find-sticky='find /bin/ -perm /4000 -user root'
# Pass the username to these:
alias belongstouser='find / -user'
taruserdata() {
find / -user "$1" -not -path '/proc/*' -not -path '/sys/*' -not -path '/run/*' -not -path "*/.git/*" -not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/nbproject/*" -not -path "*/logs/*" -not -path "*/tmp/*" -not -path "*/cache/*" -not -path "*/trash/*" -not -path "*/.gvfs/*" -exec tar -rf "$1".tar {} \;
}
userdata() {
find / -user "$1" -not -path '/proc/*' -not -path '/sys/*' -not -path '/run/*' -not -path "*/.git/*" -not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/nbproject/*" -not -path "*/logs/*" -not -path "*/tmp/*" -not -path "*/cache/*" -not -path "*/trash/*" -not -path "*/.gvfs/*" 2> /dev/null
}
alias userprocess='ps -aux | grep'
alias pwdinfo='chage -l'
# Look inside of programs to see what payload it has.
str() {
strings "$1" | less
}
alias vscan='/usr/bin/sudo /usr/bin/clamscan -v --move=/var/lib/clamav/quarantine --log=/var/log/clamav/results.log'