Advertisement
Guest User

Untitled

a guest
May 21st, 2017
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.57 KB | None | 0 0
  1. <?php
  2.  
  3. /////////////////////////////////////////////////////////////////////////////////////
  4. // IPTable log analyzer
  5. // Copyright (C) 2002 Gerald GARCIA
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with this program; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Plac<B2>e - Suite 330, Boston, MA 02111-1307, USA.
  20. //
  21. // This release put together by: junk@futurewest.ca
  22. // Contact original author : gege@gege.org
  23. /////////////////////////////////////////////////////////////////////////////////////
  24.  
  25. // $Id: config.php.default,v 1.3 2007/02/23 22:44:52 tarbuck Exp $
  26.  
  27. # Host of the MySQL database
  28. $db_host="localhost";
  29. # User of the MySQL database
  30. $db_user="iptablelog_user";
  31.  
  32. # Password of the MySQL database
  33. $db_password="nottelling";
  34.  
  35. # Name of the database
  36. $db_name="iptablelog";
  37.  
  38. # Table format (ulog or native, native is default)
  39. # Note: ulog schema is not compatible with ignored ports
  40. $host_resolution_avail = 1;
  41.  
  42. # URL Path to your installation
  43. $url_base="/iptablelog/";
  44.  
  45. # File Path to your installation
  46. $file_base="/var/www/htdocs/iptablelog"; # i.e. "/var/www/html/iptablelog"
  47.  
  48. #debug mode
  49. $debug=1;
  50.  
  51. #The default number of record displayed
  52. $default_number=50;
  53.  
  54. #The default chain displayed
  55. $default_chain="ALL";
  56.  
  57. #The default date for packets (10000 means any)
  58. $default_date=10000;
  59.  
  60. #The default ignored ports
  61. $default_ignored_ports= array();
  62.  
  63. #############################
  64. # CACHE CONFIGURATION
  65. #############################
  66.  
  67. #The cache directory (set it to "" means no cache)
  68. $cache_dir="/tmp/.iptables";
  69.  
  70. #The cache delay (items younger than $cache_delay in second will not be regenerated)
  71. $cache_delay = 300;
  72.  
  73. #############################
  74. # COLUMNS TO BE DISPLAYED
  75. #############################
  76.  
  77. #Display netfilter host in listings (0->no - 1->yes)
  78. $display_netfilter_host_default=1;
  79.  
  80. #Display netfilter interface in listings (0->no - 1->yes)
  81. $display_netfilter_interface_default=1;
  82.  
  83. #Display netfilter source port in listings (0->no - 1->yes)
  84. $display_netfilter_srcprt_default=0;
  85.  
  86. #Display netfilter destination in listings (0->no - 1->yes)
  87. $display_netfilter_destination_default=1;
  88.  
  89. #Default number of domain components (with 3, a.b.c.d gives domain of c.d - with 4, domain is b.c.d)
  90. $domain_len_default = 3;
  91.  
  92. #############################
  93. # MODULES TO BE DISPLAYED
  94. #############################
  95.  
  96. #Modules visibility (0->no - 1->yes)
  97. $module_display_default["TopHosts"]=1;
  98. $module_display_default["TopProto"]=1;
  99. $module_display_default["TopPorts"]=1;
  100. $module_display_default["TopDomains"]=1;
  101. $module_display_default["DatabaseStats"]=1;
  102.  
  103. #############################
  104. # CSS STYLES
  105. #############################
  106. $css_style_default="blue";
  107.  
  108. $css_styles["green"]="iptables";
  109. $css_styles["blue"]="iptables_blue";
  110.  
  111. # Newly added stuff
  112.  
  113. # Just in case someone decides to write a pgsql plugin
  114. $db_style = "mysql";
  115. # get the requires out of the way here, so we don't have to
  116. # worry about it later
  117. require_once("$file_base/utils/db_$db_style.php");
  118. require_once("$file_base/utils/Messages.php");
  119. require_once("$file_base/utils/Misc.php");
  120. require_once("$file_base/modules/TopDomains.php");
  121. require_once("$file_base/modules/DatabaseStats.php");
  122. require_once("$file_base/modules/TopProto.php");
  123. require_once("$file_base/modules/TopPorts.php");
  124. require_once("$file_base/modules/TopHosts.php");
  125. require_once("$file_base/modules/PacketSelector.php");
  126. require_once("$file_base/utils/Layout.php");
  127. require_once("$file_base/utils/Context.php");
  128.  
  129. # create a message class so other plugins can return info
  130. # to the user
  131. $messages = new Message;
  132.  
  133. # connect to the database
  134. db_connect($db_host, $db_name, $db_user, $db_password);
  135.  
  136. if (count($ignored_ports) != 0) {
  137. $ignored_list="and port_dest not in (";
  138. $first=1;
  139. foreach(array_keys($ignored_ports) as $ignored_port) {
  140.  
  141. if ($first) {
  142. $ignored_list=$ignored_list.$ignored_port;
  143. $first=0;
  144. } else {
  145. $ignored_list=$ignored_list.",".$ignored_port;
  146. }
  147. }
  148. $ignored_list=$ignored_list.")";
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement