From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: "Ron Natalie" <ron@ronnatalie.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: shell escapes in utilities
Date: Tue, 01 Aug 2023 23:52:44 +0200 [thread overview]
Message-ID: <20230801215244.WTv6e%steffen@sdaoden.eu> (raw)
In-Reply-To: <em4ad243a6-02bf-4d7e-924a-3fe4a00e2c06@a70c2ae8.com>
Ron Natalie wrote in
<em4ad243a6-02bf-4d7e-924a-3fe4a00e2c06@a70c2ae8.com>:
|Even without shell escapes there are fun and cames with abusing setuid
|(but accessible) programs.
|Things like opening all the available file descriptors, closing
|stdin/out/err before invocation, doing things to overrun buffers, etc…
Of course. Even experienced programmers still make errors, or
kernel bugs introduce problems which even such a programmer did
not take into account. (Like that isatty(3) uses "a" IOCTL, and
a Linux bug caused local root exploit of any SETUID program that
uses C stdio's stdout (testing ISO C's "whether output shall be
line or fully buffered"), as seen earlier this year i think.)
This is for my convenience, one could "overlayfs them away".
..And my user account has a number of capabilities, starting X,
accessing audio and video, starting QEMU instances, changing files
under /x/{src,iso,os,doc} etc.
$ groups
audio video cdrom input kvm _icmp users steffen ports doc backups shared media vm code
And brute forcing/attacking the encfs ~/.sic where keys are stored
to access more one could.
At least, via the ACPI that Linux thankfully supports on this box,
all (other) encfs are unloaded, and (all) X displays are locked
(via slock, requiring password to unlock) when the display is
closed.
And all keys are removed from all SSH agents, even though this is
hard because even root cannot simply signal this as would be
possible with gnupg based agents. Ie.
act 'pkill -HUP gpg-agent >/dev/null 2>&1 &'
inc
vs
for a in /tmp/ssh-*/agent.*; do
[ -e "$a" ] || continue
act "SSH_AUTH_SOCK=\"$a\" ssh-add -D </dev/null >/dev/null 2>&1 &"
inc 1 2
done
which prevents personal /tmp directories (or requires work).
(Asynchronousity of signals hopefully no attack vector / problem.)
No healing in sight for this.
On the server there is only
# find /sbin /bin /usr/sbin /usr/bin -perm /4000
/bin/bbsuid
but most daemons will not even be able to find that, or much in
their /dev/ etc. Like my local web browser, which is, except for
armed perpetrators, the far biggest attack surface here.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
next prev parent reply other threads:[~2023-08-01 21:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 5:47 [TUHS] " ron minnich
2023-08-01 11:38 ` [TUHS] " Leah Neukirchen
2023-08-01 12:31 ` G. Branden Robinson
2023-08-01 20:33 ` Dave Horsfall
2023-08-01 20:40 ` arnold
2023-08-01 14:29 ` Skip Tavakkolian
2023-08-01 15:30 ` ron minnich
2023-08-01 18:43 ` Ron Natalie
2023-08-01 18:55 ` Niklas Karlsson
2023-08-01 20:48 ` Steffen Nurpmeso
2023-08-01 21:11 ` Ron Natalie
2023-08-01 21:52 ` Steffen Nurpmeso [this message]
2023-08-01 21:13 ` Niklas Karlsson
2023-08-01 21:19 ` Dave Horsfall
2023-08-02 3:01 ` Grant Taylor via TUHS
2023-08-02 3:42 ` Niklas Karlsson
2023-08-02 2:59 ` Grant Taylor via TUHS
2023-08-02 10:49 ` Rich Salz
2023-08-02 14:49 ` Grant Taylor via TUHS
2023-08-02 14:20 ` Clem Cole
2023-09-19 16:56 ` Ori Bernstein
2023-09-19 17:04 ` ron minnich
2023-08-01 15:36 ` Phil Budne
2023-08-01 15:37 ` Clem Cole
2023-08-01 15:37 ` Grant Taylor via TUHS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801215244.WTv6e%steffen@sdaoden.eu \
--to=steffen@sdaoden.eu \
--cc=ron@ronnatalie.com \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).