3 ms·
That's truly evil. echo "README: No such file or directory" > README
by imglorp 5y ago
That's truly evil.
echo "README: No such file or directory" > README
- gpvos 5y agoBack when security was less of a thing and the default $PATH usually included the current directory: echo 'echo ls: command not found' >ls; chmod 755 ls
- mrmattyboy 5y agoHaha nice, so maybe: notfound() { echo "$1: $2: No such file or directory"; } f_cat() { notfound cat "$1"; } f_ls() { notfound ls "$1"; } alias cat=f_cat alias ls=f_ls :D And then why not obfuscate ;) . <(cat <<'EOF' | base64 -d bm90Zm91bmQoKSB7IGVjaG8gIiQxOiAkMjogTm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeSI7IH0K Zl9jYXQoKSB7IG5vdGZvdW5kIGNhdCAiJDEiOyB9CmZfbHMoKSB7IG5vdGZvdW5kIGxzICIkMSI7 IH0KYWxpYXMgY2F0PWZfY2F0CmFsaWFzIGxzPWZfbHMK EOF )
- Sohcahtoa82 5y agoA friend of mine was doing a CTF that puts you into a chroot jail. He could see the flag.txt, but trying to `cat flag.txt` was saying "cat: flag.txt: No such file or directory." He was absolutely stumped. I just said, "what if 'cat: flag.txt [...]' is the flag?" Sure enough. That was actually the flag.
- krallja 5y agohexdump -C flag.txt
- Sohcahtoa82 5y agoThe chroot jail did not have access to hexdump. Or vi. Or basically anything other than ls and cat.