#!/usr/bin/perl -w # # Demo script accompanying TD09 presentation # Developing and Deploying Securely # # This script is the right hand side (mostly user commands) # for the privileges portion of the talk. # $prompt = "[global 1]: \$"; # $prompt = "\$"; #-------------------------------------------------- sub command { printf ("$prompt "); system ("typer \"$pcmd\""); system(wait4enter); system($xcmd); printf("$prompt ") ; system(wait4enter); } #-------------------------------------------------- # main # slide 8 system(clear); $pcmd="cat"; $xcmd=$pcmd; command(); # close command "cat" out with a CTRL-D # slide 10 system(clear); $pcmd="ping www.sun.com"; $xcmd=$pcmd; command(); # slide 20 system(clear); $pcmd="ppriv -e -D cat /etc/shadow"; $xcmd="date;$pcmd"; command(); # slide 22, first example system(clear); $pcmd="ssh localhost"; $xcmd=$pcmd; command(); # slide 22, second example printf("\n"); $pcmd="cat /etc/shadow"; $xcmd=$pcmd; command(); #--------------------------------------------------