Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. /*******************************************************************************
  3. ** Basic Analysis and Security Engine (BASE)
  4. ** Copyright (C) 2004 BASE Project Team
  5. ** Copyright (C) 2000 Carnegie Mellon University
  6. **
  7. ** (see the file "base_main.php" for license details)
  8. **
  9. ** Project Leads: Kevin Johnson <kjohnson@secureideas.net>
  10. ** Built upon work by Roman Danyliw <rdd@cert.org>, <roman@danyliw.com>
  11. **
  12. ** Purpose: Vanilla Config file
  13. ********************************************************************************
  14. ** Authors:
  15. ********************************************************************************
  16. ** Kevin Johnson <kjohnson@secureideas.net
  17. **
  18. ********************************************************************************
  19. */
  20.     session_start();
  21.     $BASE_VERSION = '1.4.5 (lilias)';
  22.    
  23.     /*
  24.      Set the below to the language you would like people to use while viewing
  25.      your install of BASE.
  26.     */
  27.     $BASE_Language = 'portuguese';
  28.    
  29.     /*
  30.      Set the $Use_Auth_System variable to 1 if you would like to force users to
  31.      authenticate to use the system.  Only turn this off if the system is not
  32.      accessible to the public or the network at large.  i.e. a home user testing it
  33.      out!
  34.     */
  35.    
  36.     $Use_Auth_System = 1;
  37.    
  38.     /*
  39.      Set the below to 0 to remove the links from the display of alerts.
  40.     */
  41.     $BASE_display_sig_links = 1;
  42.  
  43.     /*
  44.      Set the base_urlpath to the url location that is the root of your BASE install.
  45.      This must be set for BASE to function! Do not include a trailing slash!
  46.      But also put the preceding slash. e.g. Your URL is http://127.0.0.1/base
  47.      set this to /base
  48.  
  49.      */
  50.     $BASE_urlpath = '/base';
  51.  
  52.     /* Unique BASE ID.  The below variable, if set, will append its value to the
  53.      * title bar of the browser.  This is for people who manage multiple installs
  54.      * of BASE and want a simple way to differentiate them on the task bar.
  55.      */
  56.  
  57.     $BASE_installID = '';
  58.  
  59.     /*
  60.      * Create a unique cookie name for each BASE installation.
  61.      */
  62.  
  63.     $sessionName = str_replace(' ', '_', $BASE_installID . session_name());
  64.     session_name($sessionName);
  65.  
  66.  
  67.     /* Custom footer addition.  The below variable, if set, will cause
  68.     *  base_main.php to include what ever file is specified.
  69.     *  A sample custom footer file is in the contrib directory
  70.     */
  71.    $base_custom_footer = '';
  72.  
  73.     /* Path to the DB abstraction library
  74.      *  (Note: DO NOT include a trailing backslash after the directory)
  75.      *   e.g. $foo = '/tmp'      [OK]
  76.      *        $foo = '/tmp/'     [OK]
  77.      *        $foo = 'c:\tmp'    [OK]
  78.      *        $foo = 'c:\tmp\'   [WRONG]
  79.      */
  80.     $DBlib_path = '/var/www/htdocs/adodb';
  81.    
  82.     /* The type of underlying alert database
  83.      *
  84.      *  MySQL       : 'mysql'
  85.      *  PostgresSQL : 'postgres'
  86.      *  MS SQL Server : 'mssql'
  87.      *  Oracle      : 'oci8'
  88.      */
  89.     $DBtype = 'mysql';
  90.    
  91.     /* Alert DB connection parameters
  92.      *   - $alert_dbname   : MySQL database name of Snort alert DB
  93.      *   - $alert_host     : host on which the DB is stored
  94.      *   - $alert_port     : port on which to access the DB
  95.      *   - $alert_user     : login to the database with this user
  96.      *   - $alert_password : password of the DB user
  97.      *
  98.      *  This information can be gleaned from the Snort database
  99.      *  output plugin configuration.
  100.      */
  101.     $alert_dbname   = 'snort';
  102.     $alert_host     = 'localhost';
  103.     $alert_port     = '3306';
  104.     $alert_user     = 'snort';
  105.     $alert_password = 'amnet2009';
  106.    
  107.     /* Archive DB connection parameters */
  108.     $archive_exists   = ''; # Set this to 1 if you have an archive DB
  109.    $archive_dbname   = '';
  110.     $archive_host     = '';
  111.     $archive_port     = '';
  112.     $archive_user     = '';
  113.     $archive_password = '';
  114.    
  115.     /* Type of DB connection to use
  116.      *   1  : use a persistant connection (pconnect)
  117.      *   2  : use a normal connection (connect)
  118.      */
  119.     $db_connect_method = 1;
  120.    
  121.     /* Use referential integrity
  122.      *   1  : use
  123.      *   0  : ignore (not installed)
  124.      *
  125.      * Note: Only PostgreSQL and MS-SQL Server databases support
  126.      *       referential integrity.  Use the associated
  127.      *       create_acid_tbls_?_extra.sql script to add this
  128.      *       functionality to the database.
  129.      *
  130.      *       Referential integrity will greatly improve the
  131.      *       speed of record deletion, but also slow record
  132.      *       insertion.
  133.      */
  134.         $use_referential_integrity = 0;
  135.  
  136.         /* SMTP Email Alert action
  137.      *
  138.      * Requires the Pear-Mail package to be installed like so:
  139.      *
  140.      * # pear install --alldeps mail
  141.      *
  142.      *
  143.      * - action_email_smtp_host : Which smtp server to use
  144.      * - action_email_smtp_localhost : What name to use for this server in the
  145.      *   SMTP HELO statement. You will likely need to replace this with the name
  146.      *   of the machine running BASE when connecting to a remote mail server.
  147.      * - action_email_smtp_auth : Whether or not to authenticate with
  148.      *                            the smtp server
  149.      *     0: We do NOT authenticate ourselves towards the smtp host
  150.      *     1: We DO authenticate ourselves towards the smtp host
  151.      *        with the following credentials:
  152.      * - action_email_smtp_user : The user name with the smtp host
  153.      * - action_email_smtp_pw : The password for this mail account
  154.      * - action_email_from : email address to use in the FROM field of the mail message
  155.      *                       MUST be the same email address as used for the SMTP account
  156.      * - action_email_subject : subject to use for the mail message
  157.      * - action_email_msg : additional text to include in the body of the mail message
  158.      * - action_email_mode : specifies how the alert information should be enclosed
  159.      *     0 : all emailed alerts should be in the body of the message
  160.      *     1 : all emailed alerts should be enclosed in an attachment
  161.      */
  162.      $action_email_smtp_host = 'smtp.example.com';
  163.      $action_email_smtp_localhost = 'localhost';
  164.      $action_email_smtp_auth = 1;
  165.      $action_email_smtp_user = 'username';
  166.      $action_email_smtp_pw = 'password';
  167.      $action_email_from = 'smtpuser@example.com';
  168.      $action_email_subject = 'BASE Incident Report';
  169.      $action_email_msg = '';
  170.      $action_email_mode = 0;
  171.  
  172.         /* Variable to start the ability to handle themes... */
  173.         $base_style = 'base_style.css';
  174.  
  175.         /* Chart default colors - (red, green, blue)
  176.          *    - $chart_bg_color_default    : background color of chart
  177.          *    - $chart_lgrid_color_default : gridline color of chart
  178.          *    - $chart_bar_color_default   : bar/line color of chart
  179.          */
  180.         $chart_bg_color_default     = array(255,255,255);
  181.         $chart_lgrid_color_default  = array(205,205,205);
  182.         $chart_bar_color_default    = array(190, 5, 5);
  183.  
  184.         /* Maximum number of rows per criteria element */
  185.         $MAX_ROWS = 10;
  186.  
  187.         /* Number of rows to display for any query results */
  188.         $show_rows = 48;
  189.  
  190.         /* Number of items to return during a snapshot
  191.          *  Last _X_ # of alerts/unique alerts/ports/IP
  192.          */
  193.         $last_num_alerts = 15;
  194.         $last_num_ualerts = 15;
  195.         $last_num_uports = 15;
  196.         $last_num_uaddr = 15;
  197.  
  198.         /* Number of items to return during a snapshot
  199.          *  Most Frequent unique alerts/IPs/ports
  200.          */
  201.         $freq_num_alerts = 5;
  202.         $freq_num_uaddr = 15;
  203.         $freq_num_uports = 15;
  204.  
  205.         /* Number of scroll buttons to use when displaying query results */
  206.         $max_scroll_buttons = 12;
  207.  
  208.         /* Debug mode     - how much debugging information should be shown
  209.          * Timing mode    - display timing information
  210.          * SQL trace mode - log SQL statements
  211.          *   0 : no extra information
  212.          *   1 : debugging information
  213.          *   2 : extended debugging information
  214.          *
  215.          * HTML no cache - whether a no-cache directive should be sent
  216.          *                 to the browser (should be = 1 for IE)
  217.          *
  218.          * SQL trace file - file to log SQL traces
  219.          */
  220.         $debug_mode = 0;
  221.         $debug_time_mode = 1;
  222.         $html_no_cache = 1;
  223.         $sql_trace_mode = 0;
  224.         $sql_trace_file = '';
  225.  
  226.         /* Auto-Screen refresh
  227.          * - Refresh_Stat_Page - Should certain statistics pages refresh?
  228.          * - refresh_all_pages - Should all the pages trigger the http refresh,
  229.          *                       as well?
  230.          *                       0: No, they should not.
  231.          *                       1: Yes, even these pages should refresh.
  232.          * - Stat_Page_Refresh_Time - refresh interval (in seconds)
  233.          */
  234.         $refresh_stat_page = 1;
  235.         $refresh_all_pages = 0;
  236.         $stat_page_refresh_time = 180;
  237.  
  238.         /* Display First/Previous/Last timestamps for alerts or
  239.          * just First/Last on the Unique Alert listing.
  240.          *    1: yes
  241.          *    0: no
  242.          */
  243.         $show_previous_alert = 0;
  244.  
  245.         /* Sets maximum execution time (in seconds) of any particular page.
  246.          * Note: this overrides the PHP configuration file variable
  247.          *       max_execution_time.  Thus script can run for a total of
  248.          *       ($max_script_runtime + max_execution_time) seconds
  249.          */
  250.         $max_script_runtime = 180;
  251.    
  252.     /* How should the IP address criteria be entered in the Search screen?
  253.      *   1 : each octet is a separate field
  254.      *   2 : entire address is as a single field
  255.      */
  256.     $ip_address_input = 2;
  257.    
  258.     /* Should a combo box with possible signatures be displayed on the
  259.      * search form. (Requires Javascript)
  260.      *   0 : disabled
  261.      *   1 : show only non pre-processor signatures (e.g., ignore portscans)
  262.      *   2 : show all signatures
  263.      */
  264.     $use_sig_list = 0;
  265.    
  266.     /* Resolve IP to FQDN (on certain queries?)
  267.      *    1 : yes
  268.      *    0 : no
  269.      */
  270.     $resolve_IP = 0;
  271.    
  272.     /* automatically expand the IP Criteria and Payload Criteria sections on the Search screen?)  
  273.      *    1 : yes
  274.      *    0 : no - you need to click on them to see them
  275.      */
  276.     $show_expanded_query = 0;    
  277.  
  278.     /* Should summary stats be calculated on every Query Results page
  279.      * (Enabling this option will slow page loading time)
  280.      */
  281.     $show_summary_stats = 0;
  282.    
  283.     /* DNS cache lifetime (in minutes) */
  284.     $dns_cache_lifetime = 20160;
  285.    
  286.     /* Whois information cache lifetime (in minutes) */
  287.     $whois_cache_lifetime = 40320;
  288.    
  289.     /* Snort spp_portscan log file */
  290.     $portscan_file = '';
  291.  
  292.     /* Show part of portscan payload in signature */
  293.     $portscan_payload_in_signature = '1';
  294.  
  295.     /* Event cache Auto-update
  296.      *
  297.      *  Should the event cache be verified and updated on every
  298.      *  page log?  Otherwise, the cache will have to be explicitly
  299.      *  updated from the 'cache and status' page.
  300.      *
  301.      *  Note: enabling this option could substantially slow down
  302.      *  the page loading time when there are many uncached alerts.
  303.      *  However, this is only a one-time penalty.
  304.      *
  305.      *   1 : yes
  306.      *   0 : no
  307.      */
  308.     $event_cache_auto_update = 1;
  309.    
  310.     /* Maintain a history of the visited pages so that the 'Back'
  311.      * button can be used.
  312.      *
  313.      * Note: Enabling this option will cause the PHP-session to
  314.      * grow substantially after many pages have been viewed causing
  315.      * a slow down in page loading time. Periodically return to the
  316.      * main page to clear the history.
  317.      *
  318.      *   1 : yes
  319.      *   0 : no
  320.      */
  321.     $maintain_history = 1;
  322.    
  323.     /* Level of detail to display on the main page.
  324.      *
  325.      * Note: The presence of summary statistics will slow page loading time
  326.      *
  327.      *   1 : show both the links and summary statistics
  328.      *   0 : show only the links and a count of the number of alerts
  329.      */
  330.     $main_page_detail = 1;
  331.    
  332.     /* avoid count(*) whenever possible
  333.      *
  334.      * Note: On some databases (e.g., postgres) this can greatly increase
  335.      * performance if you have a large number of events. On other databases
  336.      * (e.g., mysql) this will have little to no effect. Enabling this
  337.      * option will prevent the number of events in the database from being
  338.      * shown on the main screen and will remove the percentages associated
  339.      * with the number of events on the alert screen.
  340.      */
  341.     $avoid_counts = 0;
  342.    
  343.     /* show links to first/last/previous event on alert screen
  344.      *
  345.      * Note: Enabling this can slow down loading of the alert screen on large
  346.      * databases
  347.      */
  348.     $show_first_last_links = 0;
  349.    
  350.     /*
  351.      * External URLs
  352.      */
  353.    
  354.     /* Whois query */
  355.     $external_whois_link = 'http://www.dnsstuff.com/tools/whois.ch?ip=';
  356.    
  357.  
  358.     /* Local whois */
  359.         /* IP addresses of whois servers. Updated on Aug, 1st 2009.
  360.          *
  361.          * Name:    whois.arin.net
  362.          * Addresses:  199.212.0.43
  363.          *
  364.          * Name:    whois4.apnic.net
  365.          * Address:  202.12.29.13
  366.          * Aliases:  whois.apnic.net
  367.          *
  368.          * Name:    whois.ripe.net
  369.          * Address:  193.0.6.135
  370.          *
  371.          * Name:    whois.nic.ad.jp
  372.          * Address:  192.41.192.40
  373.          *
  374.          */
  375.  
  376.       $arin_ip  = "199.212.0.43";
  377.     $apnic_ip = "202.12.29.13";
  378.       $ripe_ip  = "193.0.6.135";
  379.     $jnic_ip  = "192.41.192.40";
  380.  
  381.  
  382.      /* DNS query */
  383.     $external_dns_link = 'http://www.dnsstuff.com/tools/ptr.ch?ip=';
  384.    
  385.     /* SamSpade 'all' query */
  386.     $external_all_link = 'http://www.whois.sc/';
  387.    
  388.     /* TCP/UDP port database */
  389.     $external_port_link = array('sans'     => 'http://isc.sans.org/port.html?port=',                            
  390.                                 'tantalo'  => 'http://ports.tantalo.net/?q=',
  391.                                 'sstats'   => 'http://www.securitystats.com/tools/portsearch.php?type=port&amp;select=any&amp;Submit=Submit&amp;input=');
  392.    
  393.     /* Signature references */
  394.     $external_sig_link = array('bugtraq'   => array('http://www.securityfocus.com/bid/', ''),
  395.                                'snort'     => array('http://www.snort.org/search/sid/', ''),
  396.                                'cve'       => array('http://cve.mitre.org/cgi-bin/cvename.cgi?name=', ''),
  397.                                'arachnids' => array('http://www.whitehats.com/info/ids', ''),
  398.                                'mcafee'    => array('http://vil.nai.com/vil/content/v_', '.htm'),
  399.                                'icat'      => array('http://icat.nist.gov/icat.cfm?cvename=CAN-', ''),
  400.                                'nessus'    => array('http://www.nessus.org/plugins/index.php?view=single&amp;id=', ''),
  401.                                'url'       => array('http://', ''),
  402.                                'local'     => array('signatures/', '.txt'),
  403.                                'local_rules_dir' => array('rules/', '.rules'),
  404.                                'EmThreats'  => array('http://docs.emergingthreats.net/', ''));
  405.    
  406.    
  407.     /* Custom (user) PHP session handlers
  408.      *
  409.      * - use_user_session : sets whether user PHP session can be used (configured
  410.      *                      with the session.save_handler variable in php.ini)
  411.      *      0 : no
  412.      *      1 : yes (assuming that 'user_session_path' and 'user_session_function'
  413.      *               are configured correctly)
  414.      * - user_session_path : file to include that implements the custom PHP session
  415.      *                       handler
  416.      * - user_session_function : function to invoke in the custom session
  417.      *                           implementation that will register the session handler
  418.      *                           functions
  419.      */
  420.     $use_user_session = 0;
  421.     $user_session_path = '';
  422.     $user_session_function = '';
  423.    
  424.     /**
  425.      * This option is used to set if BASE will use colored results
  426.      * based on the priority of alerts
  427.      * 0 : no
  428.      * 1 : yes
  429.      */
  430.     $colored_alerts = 0;
  431.  
  432.     // Red, yellow, orange, gray, white, blue
  433.     $priority_colors = array ('FF0000','FFFF00','FF9900','999999','FFFFFF','006600');
  434.  
  435.  
  436.         /** Choose a font name for the BASE charts (graph alert graphics)
  437.          *
  438.          * The fonts in the PEAR::Image::Graph / PEAR::Image::Canvas libraries
  439.          * are broken.
  440.          *
  441.          * Better would be a scalable font, like DejaVuSans or Verdana.  A scalable
  442.          * font would allow us to get different (more appropriate) font sizes.  
  443.          * However, this won't work without minor or major modifications of
  444.          * these libraries.
  445.          * See docs/README.graph_alert_data for details.
  446.          *
  447.          * If you do NOT manage to tweak these libraries to get a proper font,
  448.          * choose "Image_Graph_Font".  However, this font is not scalable,
  449.          * i.e. a headline would have the same font size as a small label.
  450.          *
  451.          * Image_Graph_Font used to be a fail-safe font name.  But for php
  452.          * versions >= 5.3 even this does not seem to be true, any more.  
  453.          * So, as last resort, choose an empty string.
  454.          */
  455.         // $graph_font_name = "Verdana";
  456.     $graph_font_name = "DejaVuSans";
  457.         // $graph_font_name = "Image_Graph_Font";
  458.         // $graph_font_name = "";
  459.  
  460.  
  461.     /** IP address to country support
  462.      *
  463.      * 1. First method for the mapping of ip addresses to country names:
  464.      *
  465.      * If you have installed the perl module Geo::IPfree
  466.      * http://search.cpan.org/CPAN/authors/id/G/GM/GMPASSOS/Geo-IPfree-0.2.tar.gz
  467.      * then generate the country database in readable ASCII format,
  468.      * similarly to this:
  469.      *         cd /usr/lib/perl5/site_perl/5.8.8/Geo/
  470.      *         perl ipct2txt.pl ./ipscountry.dat /var/www/html/ips-ascii.txt
  471.      *
  472.      * Set the absolute path to this database accordingly:
  473.      */
  474.      //$Geo_IPfree_file_ascii = "/var/www/html/ips-ascii.txt";
  475.    
  476.     /** 2. Second method for the mapping of ip addresses to country names:
  477.      *
  478.      * If you have installed the perl module IP::Country
  479.      * http://search.cpan.org/dist/IP-Country/
  480.      * (requires Geography::Countries as well),
  481.      * then uncomment and correct the absolute path to this perl executable:
  482.      */
  483.      //$IP2CC = "/usr/bin/ip2cc";
  484.  
  485.  
  486.     /*
  487.      The below line should not be changed!
  488.      */
  489.     $BASE_path = dirname(__FILE__);
  490.    
  491.     // _BASE_INC is a variable set to prevent direct access to certain include files....
  492.     define( '_BASE_INC', 1 );
  493.    
  494.     // Include for languages
  495.     include("$BASE_path/languages/$BASE_Language.lang.php");
  496.     ?>
  497.