Tom Kelliher, CS 325
Feb. 24, 2010
First phase of project due Friday -- think ``business presentation.''
Read 4.1-4.3.
Program security I.
Operating systems.
What do we mean? Malicious code written for a particular system, a particular application, and a particular purpose.
#!/usr/bin/perl -Tw # Copyright 2001, Thomas P. Kelliher, Goucher College. use strict; use CGI qw(:standard); ###################################################################### # Globals. # Path to mail client. my $MAILPATH = "/usr/bin/Mail"; ###################################################################### MAIN: { ... # Send the form data as an e-mail. if ($sender eq "") { open(MAIL, "|$MAILPATH -s \"$subj\" $recip"); } else { open(MAIL, "|$MAILPATH -s \"$subj\" -r \"$sender\"" . " $recip"); } for ($i = 0; $i < $numFlds; ++$i) { if ($fldn[$i] ne "") { print MAIL "$fldn[$i]:\n"; print MAIL "$fldv[$i]\n"; print MAIL "\n-----------------------------------"; print MAIL "-----------------------------------\n\n"; } } close(MAIL); ... exit(0); }
open_basedir
-- Default ``jail'' directory.
Trying to prevent jail breaks: disable_functions
(shell_exec
,
system
, etc.).
Generally, we have user=joe&password=foo
and user gets used in an
SQL statement as:
pg_send("SELECT password FROM users WHERE user = '$user';");Suppose the following is input in the user field:
' OR '' = ''; DROP TABLE users; --
DEBUG mode in sendmail.
No one notices!!!
Side-channel attacks:
Secure | Spy | |
/etc/shadow |
R | -- |
/tmp/scratch |
RW | R |
Possible covert threat -- theoretically, spy has access to
/etc/shadow
.
According to this, any Linux process running as root could be a covert channel.
How useful in analyzing inter-process communication?
Oct 3 18:32:16 phoenix su(pam_unix)[32298]: authentication failure; logname=ckonradi uid=509 euid=0 tty=pts/3 ruser=ckonradi rhost= user=root Oct 3 18:47:52 phoenix last message repeated 12 times