Hello,

I am going a perl file called snacktime.pl I got from:

http://www.planb-security.net/wp/snacktime.html

I do not understand how the "shift and die" line works in the following code section:

--snip--
# Filling in all the options.

my %options;
getopts('hvVmt:p:f:w:D:s:P:I:',\%options) || usage();

# Don't bother if you're not root. Really.
my $uid = `id -u`; chomp $uid;
die "You must be root to get a snack. Sorry.\n" if $uid > 0;

if ($options{h} || not $options{t}) {
        print "Snacktime, alpha release v0.5, Jun/2003. (GNU GPL, version 
2).\n";
        usage();
}

shift and die "Missing some options. Try $0 -h for help.\n";  
# Complain if there's anything unexpected.

my $alarmtimeout = $options{w} || 65; # Seconds to wait after the last syn-ack.
my $target = $options{t} || "192.168.1.1";            # Target we want to 
fingerprint.
my $dport  = $options{p} || 80;                         # Target's listening 
port.
my $device = $options{D} || rdev($options{t});          # Ethernet device.
my $source = $options{s} || ${ifaddrlist()}{$device}; # Source address. Required for arpspoof method.
my $sport  = $options{P} || int rand 30000 + 1024;      # Your source port.
my $verbose = $options{v} || $options{V};               # See times, runner up 
scores.
my $veryverbose = $options {V}; # See scoring details and more packet info.
my $morestuff = $options{m};                            # Check more stuff 
(winsize and ttl)

--snip--

Thanks

Michael

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to