Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    DenyHost 0.5.1 with pfsense 1.2.3

    pfSense Packages
    5
    5
    3483
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      clauded last edited by

      The package DenyHost 0.5.1 don't work out of the box on pfsense 1.2.3. I had to do the following to make it work :

      Install Python 2.5 :

      pkg_add -r python
      

      Copy DenyHost files to Python 2.5 location :

      cp -R /usr/local/lib/python2.4/site-packages/DenyHosts/ /usr/local/lib/python2.5/site-packages/DenyHosts/
      

      Create /usr/local/etc/denyhosts.conf as it's not created by the package :

             ############ THESE SETTINGS ARE REQUIRED ############
      
      ########################################################################
      #
      # SECURE_LOG: the log file that contains sshd logging info
      # if you are not sure, grep "sshd:" /var/log/*
      #
      # The file to process can be overridden with the --file command line
      # argument
      #
      # Redhat or Fedora Core:
      #SECURE_LOG = /var/log/secure
      #
      # Mandrake, FreeBSD or OpenBSD: 
      SECURE_LOG = /var/log/system.log
      #
      # SuSE:
      #SECURE_LOG = /var/log/messages
      #
      # Mac OS X (v10.4 or greater - 
      #   also refer to:   http://www.denyhosts.net/faq.html#macos
      #SECURE_LOG = /private/var/log/asl.log
      #
      # Mac OS X (v10.3 or earlier):
      #SECURE_LOG=/private/var/log/system.log
      #
      ########################################################################
      
      ########################################################################
      #
      # HOSTS_DENY: the file which contains restricted host access information
      #
      # Most operating systems:
      HOSTS_DENY = /etc/hosts.deniedssh
      #
      # Some BSD (FreeBSD) Unixes:
      #HOSTS_DENY = /etc/hosts.allow
      #
      # Another possibility (also see the next option):
      #HOSTS_DENY = /etc/hosts.evil
      #######################################################################
      
      ########################################################################
      #
      # PURGE_DENY: removed HOSTS_DENY entries that are older than this time
      #             when DenyHosts is invoked with the --purge flag
      #
      #      format is: i[dhwmy]
      #      Where 'i' is an integer (eg. 7) 
      #            'm' = minutes
      #            'h' = hours
      #            'd' = days
      #            'w' = weeks
      #            'y' = years
      #
      # never purge:
      PURGE_DENY = 
      #
      # purge entries older than 1 week
      #PURGE_DENY = 1w
      #
      # purge entries older than 5 days
      #PURGE_DENY = 5d
      #######################################################################
      
      #######################################################################
      #
      # PURGE_THRESHOLD: defines the maximum times a host will be purged.  
      # Once this value has been exceeded then this host will not be purged. 
      # Setting this parameter to 0 (the default) disables this feature.
      #
      # default: a denied host can be purged/re-added indefinitely
      #PURGE_THRESHOLD = 0
      #
      # a denied host will be purged at most 2 times. 
      #PURGE_THRESHOLD = 2 
      #
      #######################################################################
      
      #######################################################################
      #
      # BLOCK_SERVICE: the service name that should be blocked in HOSTS_DENY
      # 
      # man 5 hosts_access for details
      #
      # eg.   sshd: 127.0.0.1  # will block sshd logins from 127.0.0.1
      #
      # To block all services for the offending host:
      BLOCK_SERVICE = ALL
      # To block only sshd:
      #BLOCK_SERVICE  = sshd
      # To only record the offending host and nothing else (if using
      # an auxilary file to list the hosts).  Refer to: 
      # http://denyhosts.sourceforge.net/faq.html#aux
      #BLOCK_SERVICE =    
      #
      #######################################################################
      
      #######################################################################
      #
      # DENY_THRESHOLD_INVALID: block each host after the number of failed login 
      # attempts has exceeded this value.  This value applies to invalid
      # user login attempts (eg. non-existent user accounts)
      #
      DENY_THRESHOLD_INVALID = 5
      #
      #######################################################################
      
      #######################################################################
      #
      # DENY_THRESHOLD_VALID: block each host after the number of failed 
      # login attempts has exceeded this value.  This value applies to valid
      # user login attempts (eg. user accounts that exist in /etc/passwd) except
      # for the "root" user
      #
      DENY_THRESHOLD_VALID = 10
      #
      #######################################################################
      
      #######################################################################
      #
      # DENY_THRESHOLD_ROOT: block each host after the number of failed 
      # login attempts has exceeded this value.  This value applies to 
      # "root" user login attempts only.
      #
      DENY_THRESHOLD_ROOT = 1
      #
      #######################################################################
      
      #######################################################################
      #
      # DENY_THRESHOLD_RESTRICTED: block each host after the number of failed 
      # login attempts has exceeded this value.  This value applies to 
      # usernames that appear in the WORK_DIR/restricted-usernames file only.
      #
      DENY_THRESHOLD_RESTRICTED = 1
      #
      #######################################################################
      
      #######################################################################
      #
      # WORK_DIR: the path that DenyHosts will use for writing data to
      # (it will be created if it does not already exist).  
      #
      # Note: it is recommended that you use an absolute pathname
      # for this value (eg. /home/foo/denyhosts/data)
      #
      WORK_DIR = /usr/local/share/denyhosts/
      #
      #######################################################################
      
      #######################################################################
      #
      # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS
      #
      # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES|NO
      # If set to YES, if a suspicious login attempt results from an allowed-host
      # then it is considered suspicious.  If this is NO, then suspicious logins 
      # from allowed-hosts will not be reported.  All suspicious logins from 
      # ip addresses that are not in allowed-hosts will always be reported.
      #
      SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES
      ######################################################################
      
      ######################################################################
      #
      # HOSTNAME_LOOKUP
      #
      # HOSTNAME_LOOKUP=YES|NO
      # If set to YES, for each IP address that is reported by Denyhosts,
      # the corresponding hostname will be looked up and reported as well
      # (if available).
      #
      HOSTNAME_LOOKUP=NO
      #
      ######################################################################
      
      ######################################################################
      #
      # LOCK_FILE
      #
      # LOCK_FILE=/path/denyhosts
      # If this file exists when DenyHosts is run, then DenyHosts will exit
      # immediately.  Otherwise, this file will be created upon invocation
      # and deleted upon exit.  This ensures that only one instance is
      # running at a time.
      #
      # Redhat/Fedora:
      #LOCK_FILE = /var/lock/subsys/denyhosts
      #
      # Debian (and FreeBSD)
      LOCK_FILE = /var/run/denyhosts.pid
      #
      # Misc
      #LOCK_FILE = /tmp/denyhosts.lock
      #
      ######################################################################
      
             ############ THESE SETTINGS ARE OPTIONAL ############
      
      #######################################################################
      #
      # ADMIN_EMAIL: if you would like to receive emails regarding newly
      # restricted hosts and suspicious logins, set this address to 
      # match your email address.  If you do not want to receive these reports
      # leave this field blank (or run with the --noemail option)
      #
      # Multiple email addresses can be delimited by a comma, eg:
      # ADMIN_EMAIL = foo@bar.com, bar@foo.com, etc@foobar.com
      #
      ADMIN_EMAIL = 
      #
      #######################################################################
      
      #######################################################################
      #
      # SMTP_HOST and SMTP_PORT: if DenyHosts is configured to email 
      # reports (see ADMIN_EMAIL) then these settings specify the 
      # email server address (SMTP_HOST) and the server port (SMTP_PORT)
      # 
      #
      SMTP_HOST = localhost
      SMTP_PORT = 25
      #
      #######################################################################
      
      #######################################################################
      # 
      # SMTP_USERNAME and SMTP_PASSWORD: set these parameters if your 
      # smtp email server requires authentication
      #
      #SMTP_USERNAME=foo
      #SMTP_PASSWORD=bar
      #
      ######################################################################
      
      #######################################################################
      #
      # SMTP_FROM: you can specify the "From:" address in messages sent
      # from DenyHosts when it reports thwarted abuse attempts
      #
      SMTP_FROM = DenyHosts <nobody@localhost>#
      #######################################################################
      
      #######################################################################
      #
      # SMTP_SUBJECT: you can specify the "Subject:" of messages sent
      # by DenyHosts when it reports thwarted abuse attempts
      SMTP_SUBJECT = DenyHosts Report
      #
      ######################################################################
      
      ######################################################################
      #
      # SMTP_DATE_FORMAT: specifies the format used for the "Date:" header
      # when sending email messages.
      #
      # for possible values for this parameter refer to: man strftime
      #
      # the default:
      #
      #SMTP_DATE_FORMAT = %a, %d %b %Y %H:%M:%S %z
      #
      ######################################################################
      
      ######################################################################
      #
      # SYSLOG_REPORT
      #
      # SYSLOG_REPORT=YES|NO
      # If set to yes, when denied hosts are recorded the report data
      # will be sent to syslog (syslog must be present on your system).
      # The default is: NO
      #
      #SYSLOG_REPORT=NO
      #
      #SYSLOG_REPORT=YES
      #
      ######################################################################
      
      ######################################################################
      #
      # ALLOWED_HOSTS_HOSTNAME_LOOKUP
      #
      # ALLOWED_HOSTS_HOSTNAME_LOOKUP=YES|NO
      # If set to YES, for each entry in the WORK_DIR/allowed-hosts file,
      # the hostname will be looked up.  If your versions of tcp_wrappers
      # and sshd sometimes log hostnames in addition to ip addresses
      # then you may wish to specify this option.
      # 
      #ALLOWED_HOSTS_HOSTNAME_LOOKUP=NO
      #
      ######################################################################
      
      ###################################################################### 
      # 
      # AGE_RESET_VALID: Specifies the period of time between failed login
      # attempts that, when exceeded will result in the failed count for 
      # this host to be reset to 0\.  This value applies to login attempts 
      # to all valid users (those within /etc/passwd) with the 
      # exception of root.  If not defined, this count will never
      # be reset.
      #
      # See the comments in the PURGE_DENY section (above) 
      # for details on specifying this value or for complete details 
      # refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
      #
      AGE_RESET_VALID=5d
      #
      ######################################################################
      
      ###################################################################### 
      # 
      # AGE_RESET_ROOT: Specifies the period of time between failed login
      # attempts that, when exceeded will result in the failed count for 
      # this host to be reset to 0\.  This value applies to all login 
      # attempts to the "root" user account.  If not defined,
      # this count will never be reset.
      #
      # See the comments in the PURGE_DENY section (above) 
      # for details on specifying this value or for complete details 
      # refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
      #
      AGE_RESET_ROOT=25d
      #
      ######################################################################
      
      ###################################################################### 
      # 
      # AGE_RESET_RESTRICTED: Specifies the period of time between failed login
      # attempts that, when exceeded will result in the failed count for 
      # this host to be reset to 0\.  This value applies to all login 
      # attempts to entries found in the WORK_DIR/restricted-usernames file.  
      # If not defined, the count will never be reset.
      #
      # See the comments in the PURGE_DENY section (above) 
      # for details on specifying this value or for complete details 
      # refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
      #
      AGE_RESET_RESTRICTED=25d
      #
      ######################################################################
      
      ###################################################################### 
      # 
      # AGE_RESET_INVALID: Specifies the period of time between failed login
      # attempts that, when exceeded will result in the failed count for 
      # this host to be reset to 0\.  This value applies to login attempts 
      # made to any invalid username (those that do not appear 
      # in /etc/passwd).  If not defined, count will never be reset.
      #
      # See the comments in the PURGE_DENY section (above) 
      # for details on specifying this value or for complete details 
      # refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
      #
      AGE_RESET_INVALID=10d
      #
      ######################################################################
      
      ######################################################################
      #
      # RESET_ON_SUCCESS: If this parameter is set to "yes" then the
      # failed count for the respective ip address will be reset to 0
      # if the login is successful.  
      #
      # The default is RESET_ON_SUCCESS = no
      #
      #RESET_ON_SUCCESS = yes
      #
      #####################################################################
      
      ######################################################################
      #
      # PLUGIN_DENY: If set, this value should point to an executable
      # program that will be invoked when a host is added to the
      # HOSTS_DENY file.  This executable will be passed the host
      # that will be added as it's only argument.
      #
      #PLUGIN_DENY=/usr/bin/true
      #
      ######################################################################
      
      ######################################################################
      #
      # PLUGIN_PURGE: If set, this value should point to an executable
      # program that will be invoked when a host is removed from the
      # HOSTS_DENY file.  This executable will be passed the host
      # that is to be purged as it's only argument.
      #
      #PLUGIN_PURGE=/usr/bin/true
      #
      ######################################################################
      
      ######################################################################
      #
      # USERDEF_FAILED_ENTRY_REGEX: if set, this value should contain
      # a regular expression that can be used to identify additional
      # hackers for your particular ssh configuration.  This functionality
      # extends the built-in regular expressions that DenyHosts uses.
      # This parameter can be specified multiple times.
      # See this faq entry for more details:
      #    http://denyhosts.sf.net/faq.html#userdef_regex
      #
      #USERDEF_FAILED_ENTRY_REGEX=
      #
      #
      ######################################################################
      
         ######### THESE SETTINGS ARE SPECIFIC TO DAEMON MODE  ##########
      
      #######################################################################
      #
      # DAEMON_LOG: when DenyHosts is run in daemon mode (--daemon flag)
      # this is the logfile that DenyHosts uses to report it's status.
      # To disable logging, leave blank.  (default is: /var/log/denyhosts)
      #
      DAEMON_LOG = /var/log/denyhosts
      #
      # disable logging:
      #DAEMON_LOG = 
      #
      ######################################################################
      
      #######################################################################
      # 
      # DAEMON_LOG_TIME_FORMAT: when DenyHosts is run in daemon mode 
      # (--daemon flag) this specifies the timestamp format of 
      # the DAEMON_LOG messages (default is the ISO8061 format:
      # ie. 2005-07-22 10:38:01,745)
      #
      # for possible values for this parameter refer to: man strftime
      #
      # Jan 1 13:05:59   
      #DAEMON_LOG_TIME_FORMAT = %b %d %H:%M:%S
      #
      # Jan 1 01:05:59 
      #DAEMON_LOG_TIME_FORMAT = %b %d %I:%M:%S
      #
      ###################################################################### 
      
      #######################################################################
      # 
      # DAEMON_LOG_MESSAGE_FORMAT: when DenyHosts is run in daemon mode 
      # (--daemon flag) this specifies the message format of each logged
      # entry.  By default the following format is used:
      #
      # %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
      #
      # Where the "%(asctime)s" portion is expanded to the format
      # defined by DAEMON_LOG_TIME_FORMAT
      #
      # This string is passed to python's logging.Formatter contstuctor.
      # For details on the possible format types please refer to:
      # http://docs.python.org/lib/node357.html
      #
      # This is the default:
      #DAEMON_LOG_MESSAGE_FORMAT = %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
      #
      #
      ###################################################################### 
      
      #######################################################################
      #
      # DAEMON_SLEEP: when DenyHosts is run in daemon mode (--daemon flag)
      # this is the amount of time DenyHosts will sleep between polling
      # the SECURE_LOG.  See the comments in the PURGE_DENY section (above)
      # for details on specifying this value or for complete details
      # refer to:    http://denyhosts.sourceforge.net/faq.html#timespec
      # 
      #
      DAEMON_SLEEP = 30s
      #
      #######################################################################
      
      #######################################################################
      #
      # DAEMON_PURGE: How often should DenyHosts, when run in daemon mode,
      # run the purge mechanism to expire old entries in HOSTS_DENY
      # This has no effect if PURGE_DENY is blank.
      #
      DAEMON_PURGE = 1h
      #
      #######################################################################
      
         #########   THESE SETTINGS ARE SPECIFIC TO     ##########
         #########       DAEMON SYNCHRONIZATION         ##########
      
      #######################################################################
      #
      # Synchronization mode allows the DenyHosts daemon the ability
      # to periodically send and receive denied host data such that 
      # DenyHosts daemons worldwide can automatically inform one
      # another regarding banned hosts.   This mode is disabled by
      # default, you must uncomment SYNC_SERVER to enable this mode.
      #
      # for more information, please refer to: 
      #        http:/denyhosts.sourceforge.net/faq.html#sync 
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_SERVER: The central server that communicates with DenyHost
      # daemons.  Currently, denyhosts.net is the only available server
      # however, in the future, it may be possible for organizations to
      # install their own server for internal network synchronization
      #
      # To disable synchronization (the default), do nothing. 
      #
      # To enable synchronization, you must uncomment the following line:
      SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_INTERVAL: the interval of time to perform synchronizations if
      # SYNC_SERVER has been uncommented.  The default is 1 hour.
      # 
      #SYNC_INTERVAL = 1h
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_UPLOAD: allow your DenyHosts daemon to transmit hosts that have
      # been denied?  This option only applies if SYNC_SERVER has
      # been uncommented.
      # The default is SYNC_UPLOAD = yes
      #
      #SYNC_UPLOAD = no
      #SYNC_UPLOAD = yes
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_DOWNLOAD: allow your DenyHosts daemon to receive hosts that have
      # been denied by others?  This option only applies if SYNC_SERVER has
      # been uncommented.
      # The default is SYNC_DOWNLOAD = yes
      #
      #SYNC_DOWNLOAD = no
      #SYNC_DOWNLOAD = yes
      #
      #
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_DOWNLOAD_THRESHOLD: If SYNC_DOWNLOAD is enabled this parameter
      # filters the returned hosts to those that have been blocked this many
      # times by others.  That is, if set to 1, then if a single DenyHosts
      # server has denied an ip address then you will receive the denied host.
      # 
      # See also SYNC_DOWNLOAD_RESILIENCY
      #
      #SYNC_DOWNLOAD_THRESHOLD = 10
      #
      # The default is SYNC_DOWNLOAD_THRESHOLD = 3 
      #
      #SYNC_DOWNLOAD_THRESHOLD = 3
      #
      #######################################################################
      
      #######################################################################
      #
      # SYNC_DOWNLOAD_RESILIENCY:  If SYNC_DOWNLOAD is enabled then the
      # value specified for this option limits the downloaded data
      # to this resiliency period or greater.
      #
      # Resiliency is defined as the timespan between a hackers first known 
      # attack and it's most recent attack.  Example:
      # 
      # If the centralized   denyhosts.net server records an attack at 2 PM 
      # and then again at 5 PM, specifying a SYNC_DOWNLOAD_RESILIENCY = 4h 
      # will not download this ip address.
      #
      # However, if the attacker is recorded again at 6:15 PM then the 
      # ip address will be downloaded by your DenyHosts instance.  
      #
      # This value is used in conjunction with the SYNC_DOWNLOAD_THRESHOLD 
      # and only hosts that satisfy both values will be downloaded.  
      # This value has no effect if SYNC_DOWNLOAD_THRESHOLD = 1 
      #
      # The default is SYNC_DOWNLOAD_RESILIENCY = 5h (5 hours)
      #
      # Only obtain hackers that have been at it for 2 days or more:
      #SYNC_DOWNLOAD_RESILIENCY = 2d
      #
      # Only obtain hackers that have been at it for 5 hours or more:
      #SYNC_DOWNLOAD_RESILIENCY = 5h
      #
      #######################################################################</nobody@localhost> 
      

      It would be nice if the package be fixed to avoid these manual patches.

      1 Reply Last reply Reply Quote 0
      • R
        Roodawakening last edited by

        I tried this step-by-step and still can't get it up and running. I've been trying to get DenyHosts going since it "broke" ten months ago. Any other suggestions?

        1 Reply Last reply Reply Quote 0
        • T
          ToxIcon last edited by

          I tried this step-by-step and it seems to work DenyHost is up and running I see this in the log but i am not sure if its blocking because I see some errors.

          2010-07-11 18:21:52,682 - denyhosts  : INFO    DenyHosts launched with the following args:
          2010-07-11 18:21:52,682 - denyhosts  : INFO        /usr/local/bin/denyhosts.py –config /usr/local/etc/denyhosts.conf --daemon
          2010-07-11 18:21:52,682 - prefs      : INFO    DenyHosts configuration settings:
          2010-07-11 18:21:52,682 - prefs      : INFO        ADMIN_EMAIL: [None]
          2010-07-11 18:21:52,682 - prefs      : INFO        AGE_RESET_INVALID: [864000]
          2010-07-11 18:21:52,683 - prefs      : INFO        AGE_RESET_RESTRICTED: [2160000]
          2010-07-11 18:21:52,683 - prefs      : INFO        AGE_RESET_ROOT: [2160000]
          2010-07-11 18:21:52,683 - prefs      : INFO        AGE_RESET_VALID: [432000]
          2010-07-11 18:21:52,683 - prefs      : INFO        ALLOWED_HOSTS_HOSTNAME_LOOKUP: [no]
          2010-07-11 18:21:52,683 - prefs      : INFO        BLOCK_SERVICE: [ALL]
          2010-07-11 18:21:52,683 - prefs      : INFO        DAEMON_LOG: [/var/log/denyhosts]
          2010-07-11 18:21:52,683 - prefs      : INFO        DAEMON_LOG_MESSAGE_FORMAT: [%(asctime)s - %(name)-12s: %(levelname)-8s %(message)s]
          2010-07-11 18:21:52,684 - prefs      : INFO        DAEMON_LOG_TIME_FORMAT: [None]
          2010-07-11 18:21:52,684 - prefs      : INFO        DAEMON_PURGE: [3600]
          2010-07-11 18:21:52,684 - prefs      : INFO        DAEMON_SLEEP: [30]
          2010-07-11 18:21:52,684 - prefs      : INFO        DENY_THRESHOLD_INVALID: [5]
          2010-07-11 18:21:52,684 - prefs      : INFO        DENY_THRESHOLD_RESTRICTED: [1]
          2010-07-11 18:21:52,684 - prefs      : INFO        DENY_THRESHOLD_ROOT: [1]
          2010-07-11 18:21:52,684 - prefs      : INFO        DENY_THRESHOLD_VALID: [10]
          2010-07-11 18:21:52,684 - prefs      : INFO        FAILED_ENTRY_REGEX: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        FAILED_ENTRY_REGEX2: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        FAILED_ENTRY_REGEX3: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        FAILED_ENTRY_REGEX4: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        FAILED_ENTRY_REGEX5: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        FAILED_ENTRY_REGEX6: [None]
          2010-07-11 18:21:52,685 - prefs      : INFO        HOSTNAME_LOOKUP: [NO]
          2010-07-11 18:21:52,685 - prefs      : INFO        HOSTS_DENY: [/etc/hosts.deniedssh]
          2010-07-11 18:21:52,686 - prefs      : INFO        LOCK_FILE: [/var/run/denyhosts.pid]
          2010-07-11 18:21:52,686 - prefs      : INFO        PLUGIN_DENY: [None]
          2010-07-11 18:21:52,686 - prefs      : INFO        PLUGIN_PURGE: [None]
          2010-07-11 18:21:52,686 - prefs      : INFO        PURGE_DENY: [None]
          2010-07-11 18:21:52,686 - prefs      : INFO        PURGE_THRESHOLD: [0]
          2010-07-11 18:21:52,686 - prefs      : INFO        RESET_ON_SUCCESS: [no]
          2010-07-11 18:21:52,686 - prefs      : INFO        SECURE_LOG: [/var/log/system.log]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_DATE_FORMAT: [%a, %d %b %Y %H:%M:%S %z]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_FROM: [DenyHosts nobody@localhost]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_HOST: [localhost]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_PASSWORD: [None]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_PORT: [25]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_SUBJECT: [DenyHosts Report]
          2010-07-11 18:21:52,687 - prefs      : INFO        SMTP_USERNAME: [None]
          2010-07-11 18:21:52,688 - prefs      : INFO        SSHD_FORMAT_REGEX: [None]
          2010-07-11 18:21:52,688 - prefs      : INFO        SUCCESSFUL_ENTRY_REGEX: [None]
          2010-07-11 18:21:52,688 - prefs      : INFO        SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS: [YES]
          2010-07-11 18:21:52,688 - prefs      : INFO        SYNC_DOWNLOAD: [yes]
          2010-07-11 18:21:52,688 - prefs      : INFO        SYNC_DOWNLOAD_RESILIENCY: [18000]
          2010-07-11 18:21:52,688 - prefs      : INFO        SYNC_DOWNLOAD_THRESHOLD: [3]
          2010-07-11 18:21:52,688 - prefs      : INFO        SYNC_INTERVAL: [3600]
          2010-07-11 18:21:52,688 - prefs      : INFO        SYNC_SERVER: [None]
          2010-07-11 18:21:52,689 - prefs      : INFO        SYNC_UPLOAD: [yes]
          2010-07-11 18:21:52,689 - prefs      : INFO        SYSLOG_REPORT: [no]
          2010-07-11 18:21:52,689 - prefs      : INFO        WORK_DIR: [/usr/local/share/denyhosts]
          2010-07-11 18:21:52,689 - denyhosts  : INFO    restricted: set([])
          2010-07-11 18:21:52,690 - denyhosts  : INFO    launching DenyHosts daemon (version 2.5)…
          2010-07-11 18:21:52,694 - denyhosts  : INFO    DenyHosts daemon is now running, pid: 52797
          2010-07-11 18:21:52,694 - denyhosts  : INFO    send daemon process a TERM signal to terminate cleanly
          2010-07-11 18:21:52,695 - denyhosts  : INFO      eg.  kill -TERM 52797
          2010-07-11 18:21:52,695 - denyhosts  : INFO    monitoring log: /var/log/system.log
          2010-07-11 18:21:52,695 - denyhosts  : INFO    sync_time: 3600
          2010-07-11 18:21:52,695 - denyhosts  : INFO    purging of /etc/hosts.deniedssh is disabled
          2010-07-11 18:21:52,696 - denyhosts  : INFO    denyhosts synchronization disabled
          2010-07-11 18:22:56,201 - sync        : INFO    received 50 new hosts
          2010-07-11 18:22:56,201 - denyhosts  : INFO    received new hosts: ['203.155.137.3', '202.109.115.169', '221.7.151.222', '222.177.24.34', '190.210.77.99', '58.223.246.2', '62.172.208.29', '119.147.50.62', '211.141.203.66', '65.60.9.226', '83.14.198.229', '81.242.4.88', '114.142.141.22', '58.30.255.11', '123.127.246.59', '210.21.243.170', '24.5.64.170', '132.248.84.161', '208.253.84.204', '164.77.68.42', '195.228.146.4', '110.45.146.240', '58.210.77.98', '203.144.129.6', '222.221.12.104', '125.88.104.107', '187.12.252.170', '216.110.238.18', '92.87.160.138', '200.29.97.52', '60.209.234.238', '194.44.217.2', '202.201.5.139', '84.123.125.44', '62.128.135.119', '202.108.143.2', '200.246.37.73', '124.92.251.2', '200.30.188.12', '88.84.129.249', '118.129.166.120', '58.42.245.66', '211.190.230.2', '202.103.52.147', '202.181.242.246', '74.63.208.18', '66.199.228.142', '99.2.230.149', '98.0.6.74', '219.159.184.173']
          2010-07-11 18:23:38,175 - sync        : INFO    received 5 new hosts
          2010-07-11 18:23:38,175 - denyhosts  : INFO    received new hosts: ['150.254.111.151', '116.228.139.242', '202.109.115.169', '222.239.223.105', '187.4.67.74']
          2010-07-11 19:01:53,186 - sync        : INFO    received 50 new hosts
          2010-07-11 19:01:53,186 - denyhosts  : INFO    received new hosts: ['147.188.146.155', '122.155.16.228', '211.115.234.143', '190.2.44.189', '196.11.235.120', '173.230.147.114', '122.180.99.195', '61.152.160.207', '219.141.69.93', '61.233.9.12', '84.31.21.107', '125.77.107.212', '119.147.50.61', '116.228.164.3', '125.76.194.33', '218.248.46.172', '58.223.237.4', '220.178.16.99', '123.49.35.195', '61.152.207.5', '89.232.105.189', '74.53.145.38', '220.231.122.114', '80.34.131.161', '124.92.251.2', '85.207.158.25', '61.152.207.6', '218.29.97.144', '200.43.187.196', '83.14.71.252', '122.224.97.88', '218.4.205.201', '125.46.63.134', '200.68.5.94', '212.192.189.42', '74.92.201.19', '88.149.193.70', '113.17.144.161', '189.3.48.21', '222.188.117.3', '67.79.150.190', '217.67.22.144', '88.87.1.6', '218.248.66.185', '218.87.16.135', '83.15.183.234', '221.236.6.201', '210.51.240.146', '190.26.212.18', '219.141.179.195']
          2010-07-11 19:08:52,679 - sync        : ERROR    <fault 1:="" "exceptions.keyerror:'timestamp'"="">Traceback (most recent call last):
            File "/usr/local/lib/python2.5/site-packages/DenyHosts/sync.py", line 117, in receive_new_hosts
              self.__prefs.get("SYNC_DOWNLOAD_RESILIENCY"))
            File "/usr/local/lib/python2.5/xmlrpclib.py", line 1147, in call
              return self.__send(self.__name, args)
            File "/usr/local/lib/python2.5/xmlrpclib.py", line 1437, in __request
              verbose=self.__verbose
            File "/usr/local/lib/python2.5/xmlrpclib.py", line 1201, in request
              return self._parse_response(h.getfile(), sock)
            File "/usr/local/lib/python2.5/xmlrpclib.py", line 1340, in _parse_response
              return u.close()
            File "/usr/local/lib/python2.5/xmlrpclib.py", line 787, in close
              raise Fault(**self._stack[0])
          Fault: <fault 1:="" "exceptions.keyerror:'timestamp'"="">2010-07-11 19:22:56,433 - sync        : INFO    received 50 new hosts
          2010-07-11 19:22:56,433 - denyhosts  : INFO    received new hosts: ['78.30.235.253', '132.248.84.161', '200.195.138.52', '196.217.243.59', '195.251.251.177', '195.238.176.8', '124.254.31.109', '218.205.223.253', '60.191.34.152', '211.151.88.74', '192.194.86.156', '200.171.45.221', '123.113.47.191', '124.104.77.155', '190.26.122.107', '120.132.134.249', '114.247.18.14', '125.77.107.212', '202.69.15.126', '64.17.70.19', '190.242.17.10', '202.91.241.246', '121.34.252.124', '88.149.193.70', '121.54.116.22', '190.210.77.99', '211.115.234.143', '58.223.246.2', '202.127.112.118', '58.210.77.98', '221.11.1.81', '61.233.9.58', '211.155.130.137', '201.200.190.171', '119.188.7.155', '163.23.200.26', '222.177.24.35', '124.160.91.69', '80.224.43.54', '200.83.250.218', '195.182.194.221', '211.20.132.176', '140.127.114.171', '69.159.198.21', '121.34.248.27', '217.37.71.209', '114.34.128.228', '218.4.205.201', '200.210.134.130', '62.128.135.119']</fault></fault>/nobody@localhost

          1 Reply Last reply Reply Quote 0
          • C
            chadr last edited by

            Unfortunately the fix doesn't fix the problem. Denyhosts is undeniably broken and while I would love to see it fixed and working (really really love to see it) the package should probably be pulled from the distro as it stands.

            1 Reply Last reply Reply Quote 0
            • G
              g4m3c4ck last edited by

              @ToxIcon:

              2010-07-11 19:08:52,679 - sync        : ERROR    <fault 1:="" "exceptions.keyerror:'timestamp'"="">Traceback (most recent call last):
                File "/usr/local/lib/python2.5/site-packages/DenyHosts/sync.py", line 117, in receive_new_hosts
                  self.__prefs.get("SYNC_DOWNLOAD_RESILIENCY"))
                File "/usr/local/lib/python2.5/xmlrpclib.py", line 1147, in call
                  return self.__send(self.__name, args)
                File "/usr/local/lib/python2.5/xmlrpclib.py", line 1437, in __request
                  verbose=self.__verbose
                File "/usr/local/lib/python2.5/xmlrpclib.py", line 1201, in request
                  return self._parse_response(h.getfile(), sock)
                File "/usr/local/lib/python2.5/xmlrpclib.py", line 1340, in _parse_response
                  return u.close()
                File "/usr/local/lib/python2.5/xmlrpclib.py", line 787, in close
                  raise Fault(**self._stack[0])
              Fault: <fault 1:="" "exceptions.keyerror:'timestamp'"=""></fault></fault>

              Looks like the problem is not python. From the FAQ Denyhosts was written for 2.3 and 2.4.

              This might help someone but I don't use it because VPNs are a we bit safer  ;)

              DenyHosts requires Python v2.3 or later. If you are using an earlier version of Python then you should install a newer version of Python on your system. Multiple versions of Python can safely co-exist on your server so you do not need to worry about breaking any dependencies. You should obtain the latest version of Python and install it on your system. Depending on the method of download, your latest Python executable is typically installed in /usr/local/bin or /usr/bin.
              If you downloaded version Python v2.3, then the executable is python2.3. If you downloaded Python v2.4 then the executable is python2.4.

              If you will be using DenyHosts in daemon mode, then you will need to edit the daemon-control-dist script. You will want to copy this file to "daemon-control" such that future DenyHosts upgrades will preserve your edits.

              $ cp daemon-control-dist daemon-control

              Assuming you installed Python v2.4 and the executable is in /usr/bin then you will need to make the following changes to your daemon-control script:

              Line # From To
              1 #!/usr/bin/env python #!/usr/bin/python2.4
              18 PYTHON_BIN = "/usr/bin/env python" PYTHON_BIN = "/usr/bin/python2.4"
              You may need to modify the above paths to reflect the actual installation location and version of Python that you installed.

              If you are not using DenyHosts in daemon mode then to execute DenyHosts you would do the following:

              $ python2.4 denyhosts … args...

              -or-

              $ python2.3 denyhosts ... args...

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Products

              • Platform Overview
              • TNSR
              • pfSense
              • Appliances

              Services

              • Training
              • Professional Services

              Support

              • Subscription Plans
              • Contact Support
              • Product Lifecycle
              • Documentation

              News

              • Media Coverage
              • Press
              • Events

              Resources

              • Blog
              • FAQ
              • Find a Partner
              • Resource Library
              • Security Information

              Company

              • About Us
              • Careers
              • Partners
              • Contact Us
              • Legal
              Our Mission

              We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

              Subscribe to our Newsletter

              Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

              © 2021 Rubicon Communications, LLC | Privacy Policy