brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: find -perm /o+w lists files that anyone can write to

Find
~/tips/tip-find-perm-world-writable

find /var/www -perm /o+w ! -type l

Lists files and folders in which the others class has write access.

A world-writable file or folder is a common cause of a hacked site. It is easy to look for.

find /var/www -perm /o+w ! -type l

With a slash, -perm /o+w matches when any of the listed bits is set, here the write bit for others. Without the slash, a dash means all listed bits must be set, and a plain mode means an exact match. Symlinks are always 777, so ! -type l removes the noise. Folders with the sticky bit, like /tmp, are meant to be writable.

Further reading: find manual page

More Find tips find / -maxdepth 1 -fstype proc find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/null find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} + find /srv/data -depth -print find /srv -xdev -samefile /srv/downloads/movie.mkv All Find tips (46) All topics

Link