#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# Display a FORM to select default config options to give the user
# control over the knobs and dials

#
# First figure out what radio buttons etc. should be "on". Note: the
# variables below are global. Perhaps we should hide in our own package
# name space.
#
require "config/sara.cf";
@cf_attack_level = ();	$cf_attack_level[$attack_level] = "checked";
@cf_timeout = ();	$cf_timeout[$timeout] = "checked";
@cf_sub_zero = ();	$cf_sub_zero[$sub_zero_proximity] = "checked";
@cf_attack_proximate = ();
	$cf_attack_proximate[$attack_proximate_subnets] = "checked";
@cf_dont_nslookup = ();	$cf_dont_nslookup[$dont_use_nslookup] = "checked";
@cf_dont_ping = ();	$cf_dont_ping[$dont_use_ping] = "checked";
@cf_untrusted = ();	$cf_untrusted[$untrusted_host] = "checked";
@cf_firewall_flag = ();	$cf_firewall_flag[$firewall_flag] = "checked";
@cf_custom0 =();	$cf_custom0[$custom0_mode] = "checked";
@cf_custom1 =();        $cf_custom1[$custom1_mode] = "checked";
@cf_custom2 =();        $cf_custom2[$custom2_mode] = "checked";

#
# Check the custom0 boxes
#
$cf_dns0 = $cf_smb0 = $cf_http0 = $cf_mail0 = $cf_tel0 = $cf_ftp0 = $cf_rpc0 ="";
$cf_dns0  = "checked" if $dns0  eq "on"; 
$cf_smb0  = "checked" if $smb0  eq "on";
$cf_http0 = "checked" if $http0 eq "on";
$cf_mail0 = "checked" if $mail0 eq "on";
$cf_tel0  = "checked" if $tel0  eq "on";
$cf_ftp0  = "checked" if $ftp0  eq "on";
$cf_rpc0  = "checked" if $rpc0  eq "on";
$dns0 = $smb0 = $http0 = $mail0 = $tel0 = $ftp0 = $rpc0 ="";

$cf_dns1 = $cf_smb1 = $cf_http1 = $cf_mail1 = $cf_tel1 = $cf_ftp1 = $cf_rpc1 ="";
$cf_dns1  = "checked" if $dns1  eq "on";
$cf_smb1  = "checked" if $smb1  eq "on";
$cf_http1 = "checked" if $http1 eq "on";
$cf_mail1 = "checked" if $mail1 eq "on";
$cf_tel1  = "checked" if $tel1  eq "on";
$cf_ftp1  = "checked" if $ftp1  eq "on";
$cf_rpc1  = "checked" if $rpc1  eq "on";
$dns1 = $smb1 = $http1 = $mail1 = $tel1 = $ftp1 = $rpc1 ="";

$cf_dns2 = $cf_smb2 = $cf_http2 = $cf_mail2 = $cf_tel2 = $cf_ftp2 = $cf_rpc2 ="";
$cf_dns2  = "checked" if $dns2  eq "on";
$cf_smb2  = "checked" if $smb2  eq "on";
$cf_http2 = "checked" if $http2 eq "on";
$cf_mail2 = "checked" if $mail2 eq "on";
$cf_tel2  = "checked" if $tel2  eq "on";
$cf_ftp2  = "checked" if $ftp2  eq "on";
$cf_rpc2  = "checked" if $rpc2  eq "on";
$dns2 = $smb2 = $http2 = $mail2 = $tel2 = $ftp2 = $rpc2 ="";

print CLIENT <<EOF;
<HTML>
<HEAD>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
<TITLE>SARA Configuration Management</TITLE>
<LINK REV="made" HREF="mailto:satan@\fish.com">
<LINK REV="updated" HREF="mailto:sara\@arc.com">

<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>

</HEAD>
<BODY>
EOF
if ($pi_menu) {
  $screen = &$pi_menu;
} else {
  $screen = print_menu();
}
$screen =~ s/\\n/\n/g;
print CLIENT $screen;
print CLIENT <<EOF;
</TD><TD valign=top>
<TABLE BORDER="0" WIDTH="650">
<TR><TD BGCOLOR="#000000">
<FONT Color="#FFFFFF">
<H2><Center>SARA Configuration Management</Center></H2>
</TD><TR></TABLE>
<UL>
<FORM METHOD=GET ACTION=sara_cf_action.pl>
<input Type=hidden Name=sequence Value="$seq">

<H2>Scanning levels and timeouts</H2>

<STRONG>What directory should I store the data in?</STRONG>
<DL compact>
<DT><DD><INPUT SIZE=25 NAME=sara_data VALUE=$sara_data>
SARA data directory
</DL>
<P>

<STRONG>What probe level should I use?</STRONG>
<DL compact>
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=0 $cf_attack_level[0]>
Light [attack level 0]
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=1 $cf_attack_level[1]>
Normal [attack level 1]
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=2 $cf_attack_level[2]>
Heavy [attack level 2]
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=3 $cf_attack_level[3]>
Extreme [attack level 3]
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=4 $cf_attack_level[4]>
Custom-0 [attack level 4] (defined below)
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=4 $cf_attack_level[5]>
Custom-1 [attack level 5] (defined below)
<DT><DD><INPUT TYPE="radio" NAME=attack_level VALUE=4 $cf_attack_level[6]>
Custom-2 [attack level 6] (defined below)
</DL>
<P>
<STRONG>What are my custom attack level definitions?</STRONG>
<P>
<UL>
<B>Custom-0 Attack Level 4</B>
<P>
<DT><DD><INPUT TYPE="radio" NAME=custom0_mode VALUE=0 $cf_custom0[0]>
Discovery only
<DT><DD><INPUT TYPE="radio" NAME=custom0_mode VALUE=1 $cf_custom0[1]>
Select from 
<INPUT TYPE="checkbox" NAME="dns0"  VALUE="on" $cf_dns0>DNS 
<INPUT TYPE="checkbox" NAME="smb0"  VALUE="on" $cf_smb0>SMB   
<INPUT TYPE="checkbox" NAME="http0" VALUE="on" $cf_http0>Web
<INPUT TYPE="checkbox" NAME="mail0" VALUE="on" $cf_mail0>Mail
<INPUT TYPE="checkbox" NAME="tel0"  VALUE="on" $cf_tel0>Telnet
<INPUT TYPE="checkbox" NAME="ftp0"  VALUE="on" $cf_ftp0>FTP   
<INPUT TYPE="checkbox" NAME="rpc0"  VALUE="on" $cf_rpc0>RPC  
<DT><DD><INPUT TYPE="radio" NAME=custom0_mode VALUE=2 $cf_custom0[2]>
Select port scan ranges
<INPUT SIZE=8 NAME=custom0_tcp VALUE=$custom0_tcp>TCP ports
<INPUT SIZE=8 NAME=custom0_udp VALUE=$custom0_udp>UDP ports 

<P>
<B>Custom-1 Attack Level 5</B>
<P>
<DT><DD><INPUT TYPE="radio" NAME=custom1_mode VALUE=0 $cf_custom1[0]>
Discovery only
<DT><DD><INPUT TYPE="radio" NAME=custom1_mode VALUE=1 $cf_custom1[1]>
Select from
<INPUT TYPE="checkbox" NAME="dns1"  VALUE="on" $cf_dns1>DNS 
<INPUT TYPE="checkbox" NAME="smb1"  VALUE="on" $cf_smb1>SMB 
<INPUT TYPE="checkbox" NAME="http1" VALUE="on" $cf_http1>Web
<INPUT TYPE="checkbox" NAME="mail1" VALUE="on" $cf_mail1>Mail
<INPUT TYPE="checkbox" NAME="tel1"  VALUE="on" $cf_tel1>Telnet
<INPUT TYPE="checkbox" NAME="ftp1"  VALUE="on" $cf_ftp1>FTP 
<INPUT TYPE="checkbox" NAME="rpc1"  VALUE="on" $cf_rpc1>RPC  

<DT><DD><INPUT TYPE="radio" NAME=custom1_mode VALUE=2 $cf_custom1[2]>
Select port scan ranges
<INPUT SIZE=8 NAME=custom1_tcp VALUE=$custom1_tcp>TCP ports
<INPUT SIZE=8 NAME=custom1_udp VALUE=$custom1_udp>UDP ports
<P>
<B>Custom-2 Attack Level 6</B>
<P>
<DT><DD><INPUT TYPE="radio" NAME=custom2_mode VALUE=0 $cf_custom2[0]>
Discovery only
<DT><DD><INPUT TYPE="radio" NAME=custom2_mode VALUE=1 $cf_custom2[1]>
Select from 
<INPUT TYPE="checkbox" NAME="dns2"  VALUE="on" $cf_dns2>DNS 
<INPUT TYPE="checkbox" NAME="smb2"  VALUE="on" $cf_smb2>SMB   
<INPUT TYPE="checkbox" NAME="http2" VALUE="on" $cf_http2>Web
<INPUT TYPE="checkbox" NAME="mail2" VALUE="on" $cf_mail2>Mail
<INPUT TYPE="checkbox" NAME="tel2"  VALUE="on" $cf_tel2>Telnet
<INPUT TYPE="checkbox" NAME="ftp2"  VALUE="on" $cf_ftp2>FTP   
<INPUT TYPE="checkbox" NAME="rpc2"  VALUE="on" $cf_rpc2>RPC  
<DT><DD><INPUT TYPE="radio" NAME=custom2_mode VALUE=2 $cf_custom2[2]>
Select port scan ranges
<INPUT SIZE=8 NAME=custom2_tcp VALUE=$custom2_tcp>TCP ports
<INPUT SIZE=8 NAME=custom2_udp VALUE=$custom2_udp>UDP ports
<P>
</UL>
<STRONG>What timeout values should I use?</STRONG>
<DL compact>
<DT><DD><INPUT SIZE=3 NAME=long_timeout VALUE=$long_timeout> Slow
<DT><DD><INPUT SIZE=3 NAME=med_timeout VALUE=$med_timeout> Medium
<DT><DD><INPUT SIZE=3 NAME=short_timeout VALUE=$short_timeout> Fast
</DL>

<P>
<STRONG>What signal should I send to kill a tool process when it times out?</STRONG>
<DL compact>
<DT><DD><INPUT SIZE=3 NAME=timeout_kill VALUE=$timeout_kill>Kill signal
</DL>

<P>
<STRONG>How far out from the original target should I probe?</STRONG>
(Under no circumstances should this be higher than "2" unless you're
POSITIVE you know what you're doing!)
<DL compact>
<DT><DD><INPUT SIZE=3 NAME=max_proximity_level VALUE=$max_proximity_level>
Maximal proximity
</DL>

<P>
<STRONG>As I move out to less proximate hosts, how much should I drop
the probe level?</STRONG>
<DL compact>
<DT><DD><INPUT SIZE=3 NAME=proximity_descent VALUE=$proximity_descent>
Proximity descent
</DL>

<P>
<STRONG>When I go below 0 probe level, should I:</STRONG>
<DL compact>
<DT><DD><INPUT TYPE="radio" NAME=sub_zero_proximity VALUE=0 $cf_sub_zero[0]>Stop
<DT><DD><INPUT TYPE="radio" NAME=sub_zero_proximity VALUE=1 $cf_sub_zero[1]>Go on
</DL>

<P>
<STRONG>Should I do subnet expansion; that is, should I probe just the
target or its entire subnet?</STRONG>
<DL compact>
<DT><DD><INPUT TYPE="radio" NAME=attack_proximate_subnets VALUE=0
	$cf_attack_proximate[0]>Just the target
<DT><DD><INPUT TYPE="radio" NAME=attack_proximate_subnets VALUE=1
	$cf_attack_proximate[1]>The entire subnet
</DL>

<P>
<STRONG>Does $THIS_HOST appear in <i>rhosts, hosts.equiv</i> or
<i>NFS exports</i> files of hosts being probed?
</STRONG>

<DL compact>
<DT><DD><INPUT TYPE="radio" NAME=untrusted_host VALUE=0 $cf_untrusted[0]>
You are running SARA from a possibly trusted host
<DT><DD><INPUT TYPE="radio" NAME=untrusted_host VALUE=1 $cf_untrusted[1]>
You are running SARA from an untrusted host
</DL>

<HR>

<h2>Patterns specifying hosts to limit the probe to</h2>

If you only want to probe hosts within a specific domain, you could use,
for example:
<PRE>
	podunk.edu
</PRE>
<p>
If you only want to probe sites on a particular subnet, you could use,
for example:
<PRE>
	192.9.9
</PRE>
<p>
<INPUT SIZE=48 NAME=only_attack_these VALUE="$only_attack_these">
<p>
You can specify multiple shell-like patterns, separated by whitespace
or commas, and you may mix networks and domains. A host will be
scanned when it matches <i>any</i> pattern: either a network number prefix
or an internet domain suffix.

<hr>

<h2>Patterns specifying hosts to NOT probe</h2>

If you don't want to probe any military or governmental sites, you could use:
<PRE>
	mil, gov
</PRE>
<p>
<INPUT SIZE=48 NAME=dont_attack_these VALUE="$dont_attack_these">
<p>
You can specify multiple shell-like patterns, separated by whitespace
or commas, and you may mix networks and domains. A host will be
skipped when it matches <i>any</i> pattern: either a network number prefix
or an internet domain suffix.

<hr>
<INPUT TYPE="submit" VALUE="Change the configuration file">
</UL></UL>
</TD></TR></TABLE>
</FORM>
</BODY>
</HTML>
EOF
