The following bash one-line command is useful when you need to replace a string in multiple files (say, every .html file):
find . -type f -name '*.html' -exec sed -i -e 's/SEARCHTEXT/REPLACETEXT/g' {} \;
Notes on penetration testing journeys
The following bash one-line command is useful when you need to replace a string in multiple files (say, every .html file):
find . -type f -name '*.html' -exec sed -i -e 's/SEARCHTEXT/REPLACETEXT/g' {} \;
On most linux systems we can use tree
to dump the directory structure, but if for some reason the tree command isn’t available, we can use the following one-line command:
find / -type d | perl -lne 'print tr:/::, " $_"' | sort -n | cut -d' ' -f2
After accessing a system, one of the first things to do is to find executables with SUID set. Use the following command:
find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -la {} \;