From 7fa5b1e16e8112a11df2b5b07b7fc4c439897522 Mon Sep 17 00:00:00 2001 From: Emilio Pinna Date: Sun, 17 Jun 2018 11:28:23 +0100 Subject: [PATCH] Use valid Mbox file for mail --- _gtfobins/mail.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/_gtfobins/mail.md b/_gtfobins/mail.md index 96ada3f..c6f46d1 100644 --- a/_gtfobins/mail.md +++ b/_gtfobins/mail.md @@ -1,11 +1,17 @@ --- functions: execute-interactive: - - code: | - mail -f /etc/hosts + - description: This creates a valid Mbox file which may be required by the binary. + code: | + TF=$(mktemp) + echo "From nobody@localhost $(date)" > $TF + mail -f $TF !/bin/sh sudo-enabled: - - code: | - sudo mail -f /etc/hosts + - description: This creates a valid Mbox file which may be required by the binary. + code: | + TF=$(mktemp) + echo "From nobody@localhost $(date)" > $TF + sudo mail -f $TF !/bin/sh ---