GTFOBins.github.io/_gtfobins
Andrea Cardaci 8eaf595fe6 Make interactive execute whenever possible
Here the trick is to restore those file descriptors (0, 1, 2) that have been
redirected (`dup2`) by the parent process.

First we need to determine which one has been redirected, for example by looking
at `ls -l /proc/$$/fd/`. Then we can use `0<&x`, `1>&x` or `2>&x` to restore 0,
1 or 2 respectively, where `x` is any file descriptor number that points to the
TTY.

It may happen that no file descriptor is unchanged, in that case we can use
`tty` to perform the redirection: sh <$(tty) >$(tty) 2>$(tty)
2018-09-07 01:11:06 +02:00
..
.dir-locals.el Make Emacs treat _gtfobins Markdown files like YAML 2018-05-25 02:16:18 +02:00
apt-get.md Add apt, apt-get, mysql and smbclient 2018-08-31 11:09:19 +02:00
apt.md Add apt, apt-get, mysql and smbclient 2018-08-31 11:09:19 +02:00
ash.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
awk.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
base64.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
bash.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
busybox.md Fix description long lines 2018-09-06 19:18:22 +02:00
cat.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
chmod.md Add chmod and chown as suggested in #20 2018-09-05 17:59:07 +01:00
chown.md Add chmod and chown as suggested in #20 2018-09-05 17:59:07 +01:00
cp.md Remove file-read and file-write from cp and mv 2018-09-05 17:38:32 +01:00
cpulimit.md Add nice, cpulimit and pg 2018-08-24 11:33:15 +02:00
crontab.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
csh.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
curl.md Add suid-enabled and sudo-enabled to curl, dd, and wget 2018-07-22 14:30:03 +01:00
cut.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
dash.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
date.md Add date 2018-09-06 17:08:01 +02:00
dd.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
diff.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
docker.md Remove docker interactive-execute 2018-08-19 11:14:16 +01:00
ed.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
emacs.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
env.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
expand.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
expect.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
facter.md Add facter 2018-09-04 13:42:37 +02:00
find.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
flock.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
fmt.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
fold.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
ftp.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
gdb.md Fix description long lines 2018-09-06 19:18:22 +02:00
git.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
head.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
ionice.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
jq.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
ksh.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
ld.so.md Fix description long lines 2018-09-06 19:18:22 +02:00
less.md Fix SUID for less and pg 2018-08-24 13:30:23 +02:00
ltrace.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
lua.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
mail.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
make.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
man.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
more.md Fix more YAML 2018-08-24 12:08:37 +02:00
mount.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
mv.md Remove file-read and file-write from cp and mv 2018-09-05 17:38:32 +01:00
mysql.md Add apt, apt-get, mysql and smbclient 2018-08-31 11:09:19 +02:00
nano.md Make nano/pico execute-interactive by using exec 2018-09-06 21:36:20 +02:00
nc.md Reorder functions in git, lua, and nc 2018-07-22 15:42:43 +01:00
nice.md Add nice, cpulimit and pg 2018-08-24 11:33:15 +02:00
nl.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
nmap.md Fix nmap suid-limited 2018-08-23 23:45:07 +01:00
node.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
od.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
perl.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
pg.md Fix SUID for less and pg 2018-08-24 13:30:23 +02:00
php.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
pico.md Make nano/pico execute-interactive by using exec 2018-09-06 21:36:20 +02:00
pip.md Fix Python link in pip 2018-09-06 19:18:12 +02:00
puppet.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
python2.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
python3.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
red.md Fix red YAML 2018-08-31 10:17:36 +02:00
rlwrap.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
rpm.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
rpmquery.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
rsync.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
ruby.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
scp.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
sed.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
setarch.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
sftp.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
shuf.md Fix shuf YAML 2018-08-31 15:51:14 +02:00
smbclient.md Add apt, apt-get, mysql and smbclient 2018-08-31 11:09:19 +02:00
socat.md Add sudo-enabled and suid-limited to socat 2018-07-22 15:49:15 +01:00
sort.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
sqlite3.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
ssh.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
stdbuf.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
strace.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
tail.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
tar.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
taskset.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
tclsh.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
tcpdump.md Avoid output file for tcpdump 2018-09-07 00:29:58 +02:00
tee.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
telnet.md Use the portable -u option for mktemp instead of removing the file 2018-07-31 12:44:16 +02:00
tftp.md Add suid-enabled and sudo-enabled to tftp 2018-07-22 18:24:39 +01:00
time.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
timeout.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
ul.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
unexpand.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
uniq.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
unshare.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
vi.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
vim.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
watch.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
wget.md Add suid-enabled and sudo-enabled to curl, dd, and wget 2018-07-22 14:30:03 +01:00
whois.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
wish.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00
xargs.md Make interactive execute whenever possible 2018-09-07 01:11:06 +02:00
xxd.md Use DATA as a placeholder for file-write operations 2018-08-20 15:00:34 +02:00
zip.md Use temporary files in zip functions 2018-08-19 11:32:48 +01:00
zsh.md Fix YAMLs according to YAMLlint 2018-07-16 15:01:50 +02:00