#!/usr/bin/perl -w # # Demo script accompanying TD09 presentation # Developing and Deploying Securely # # This script is the left hand side (mostly superuser commands) # for the privileges portion of the talk. # $prompt = "[global 0]: \$"; $user = $ENV{"USER"}; #-------------------------------------------------- sub command { printf ("$prompt "); system ("typer \"$pcmd\""); system(wait4enter); system($xcmd); printf("$prompt ") ; system(wait4enter); } #-------------------------------------------------- # main # slide 8 system(clear); $pcmd="echo pgrep -U $user -n cat "; $xcmd=$pcmd; command(); printf("\n"); $pcmd="echo ppriv -S `pgrep -U $user -n cat`"; $xcmd=$pcmd; command(); # slide 10 system(clear); $pcmd="echo pgrep -U $user -n ping "; $xcmd=$pcmd; command(); printf("\n"); $pcmd="echo ppriv -S `pgrep -U $user -n ping`"; $xcmd=$pcmd; command(); # slide 11 system(clear); $pcmd="ppriv -lv basic"; $xcmd=$pcmd; command(); # slide 20 system(clear); $pcmd="tail -f /var/adm/messages"; $xcmd=$pcmd; command(); # slide 21, first example system(clear); $pcmd="echo dtrace -l \| grep priv-"; $xcmd=$pcmd; command(); # slide 21, second example - SKIPPING THIS EXAMPLE IN THIS DEMO ## system(clear); ## $pcmd="echo dtrace -n 'sdt:::priv-*'"; ## $xcmd=$pcmd; command(); # slide 21, third example system(clear); $pcmd="echo dtrace -n \'sdt:::priv-* { printf(\\\"%d %d %s\\\", arg0, pid, execname); }\'"; $xcmd="echo dtrace -n 'sdt:::priv-* { printf(\"%d %d %s\", arg0, pid, execname); }'"; command(); # slide 22, first example system(clear); $pcmd="echo privdebug.pl -n sshd -f -v"; $xcmd=$pcmd; command(); # slide 22, second example system(clear); $pcmd="echo privdebug.pl -n cat -f -v"; $xcmd=$pcmd; command(); #--------------------------------------------------