Skip to content

Pentesting reports

Notes on penetration testing journeys

Category: Bash one-liners

Practical one-liner bash commands I’m using

PGP: encrypt file content to stdout

Posted on 2019/01/08 - 2019/01/10 by trouble
Pentesting Journeys

Sometimes I don’t simply want to encrypt files, I need to encrypt plain text only, e.g. to send it in the body of an email. I’m using PGP (Pretty Good Privacy) because it’s widely used and it can be installed on Linux, Windows and OSX machines. Well, on *nix machines the program is called GPG (Gnu Privacy Guard) but it’s the only difference. Furthermore, instead of creating To encrypt file content (not the file itself!) use this bash one-line commands:

cat PLAINFILE | gpg -a -o - -r RECIPIENT -e -

It will dump the encrypted content, additionally with ascii armature (option -a or --armor), to stdout (option -o -); therefore no data, altough encrypted, will be ever written on disk. Use this bash one-line command to decrypt pgp’ed data to stdout rather than a file.

Posted in Bash one-linersTagged bash, encrypt, gpg, pgp

PGP: decrypt file contents to stdout

Posted on 2019/01/08 - 2019/01/10 by trouble

Using the following bash one-line command, the decrypted content will be shown in stdout rather than wrote to a file:

gpg -o - -d ENCRYPTEDFILE

To encrypt file content (not the file itself) with pgp and dump the output to stdout use this bash one-line command.

Posted in Bash one-linersTagged bash, decrypt, gpg, pgp

Bash one-line command: find files and replace strings into them

Posted on 2019/01/08 - 2019/01/08 by trouble

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' {} \;
Posted in Bash one-linersTagged bash, find, sed

Bash one-line command: dump directory structure

Posted on 2019/01/08 - 2019/01/08 by trouble

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
Posted in Bash one-linersTagged bash, find

Bash one-line command: find suid executables

Posted on 2019/01/08 - 2019/01/08 by trouble

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 {} \;
Posted in Bash one-linersTagged bash, find

Music from Soundcloud

Pages

  • Manifesto
  • Get in touch

Categories

  • Arbitrary file download
  • Bash one-liners
  • Bypass login
  • PHP snippets

RSS feed: RSS Feed from Exploit DB RSS Feed from Exploit DB

  • [remote] CVE-2026-42167 - ProFTPD mod_sql post-authentication SQLi - RCE
  • [remote] PCMan 2.0.7 - Buffer Overflow
  • [webapps] Linuxfabrik monitoring_plugins_6.0.0 - SSRF
  • [webapps] Nodemailer 9.0.0 - File Read/ SSRF
  • [webapps] flyto-core 2.26.7 - Arbitrary File Write
  • [dos] NanaZip 6.5 - DoS
  • [remote] D-Link DNS_340L - OS Command Injection
  • [remote] ipTIME A3004T - Remote Code Execution
  • [webapps] Duplicati 2.2.0.3 - JWT Signing Key Leak
  • [dos] Nmap 7.99 - Extension Header Integer Underflow

RSS feed: RSS Feed from Packetstorm RSS Feed from Packetstorm

RSS feed: Rss Feed from Nist Rss Feed from Nist

Proudly powered by WordPress | Theme: micro, developed by DevriX.