You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

388 lines
11 KiB
Python

7 years ago
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Fail2Ban is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Fail2Ban; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
if sys.version_info < (2, 7):
raise ImportError("badips.py action requires Python >= 2.7")
import json
import threading
import logging
if sys.version_info >= (3, ):
from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
else:
from urllib2 import Request, urlopen, HTTPError
from urllib import urlencode
from fail2ban.server.actions import ActionBase
committing changes in /etc after apt run Package changes: -adduser 3.116 all +adduser 3.117 all -apt 1.6~alpha3 armhf -apt-listchanges 3.14 all -apt-utils 1.6~alpha3 armhf -aptitude 0.8.9-1 armhf -aptitude-common 0.8.9-1 all -avahi-daemon 0.7-3 armhf -base-files 10+rpi1 armhf +apt 1.6~beta1 armhf +apt-listchanges 3.16 all +apt-utils 1.6~beta1 armhf +aptitude 0.8.10-6 armhf +aptitude-common 0.8.10-6 all +avahi-daemon 0.7-3.1+b1 armhf +base-files 10.1+rpi1 armhf -bash 4.4-5 armhf -bash-completion 1:2.1-4.3 all -bind9 1:9.10.3.dfsg.P4-12.6 armhf -bind9-host 1:9.10.3.dfsg.P4-12.6 armhf -bind9utils 1:9.10.3.dfsg.P4-12.6 armhf -binutils 2.29.1-6+rpi1 armhf -binutils-arm-linux-gnueabihf 2.29.1-6+rpi1 armhf -binutils-common 2.29.1-6+rpi1 armhf +bash 4.4.18-1.1 armhf +bash-completion 1:2.7-1 all +bind9 1:9.11.2.P1-1 armhf +bind9-host 1:9.11.2.P1-1 armhf +bind9utils 1:9.11.2.P1-1 armhf +binutils 2.30-7+rpi1 armhf +binutils-arm-linux-gnueabihf 2.30-7+rpi1 armhf +binutils-common 2.30-7+rpi1 armhf -bluez 5.47-1 armhf -bluez-firmware 1.2-3+rpi2 all -bridge-utils 1.5-14 armhf +bluez 5.47-1+b3 armhf +bluez-firmware 1.2-3+rpt4.1 all +bridge-utils 1.5-15 armhf -bsdmainutils 9.0.14 armhf -bsdutils 1:2.30.2-0.1 armhf +bsdmainutils 11.1.2 armhf +bsdutils 1:2.31.1-0.4 armhf -certbot 0.19.0-1 all +certbot 0.21.1-1 all -console-setup 1.170 all -console-setup-linux 1.170 all -coreutils 8.26-3 armhf -cpio 2.11+dfsg-6 armhf +console-setup 1.178 all +console-setup-linux 1.178 all +coreutils 8.28-1 armhf +cpio 2.12+dfsg-6 armhf -cpp-6 6.4.0-6 armhf -cpp-7 7.2.0-12 armhf +cpp-6 6.4.0-12+rpi1 armhf +cpp-7 7.3.0-5 armhf -curl 7.56.1-1 armhf -dash 0.5.8-2.5 armhf -dbus 1.12.0-1 armhf -dc 1.06.95-9 armhf -debconf 1.5.64 all -debconf-i18n 1.5.64 all -debconf-utils 1.5.64 all -debianutils 4.8.2 armhf +curl 7.58.0-2 armhf +dash 0.5.8-2.10 armhf +dbus 1.12.6-2 armhf +dc 1.07.1-1 armhf +debconf 1.5.66 all +debconf-i18n 1.5.66 all +debconf-utils 1.5.66 all +debianutils 4.8.4 armhf -dhcpcd5 1:6.11.5-1+rpt2 armhf +dhcpcd5 1:6.11.5-1+rpt4 armhf -dirmngr 2.2.1-5 armhf +dirmngr 2.2.5-1 armhf -dmsetup 2:1.02.142-1 armhf -dnsutils 1:9.10.3.dfsg.P4-12.6 armhf +dmsetup 2:1.02.145-4.1 armhf +dnsutils 1:9.11.2.P1-1 armhf -dpkg 1.19.0.4 armhf -dpkg-dev 1.19.0.4 all -e2fslibs 1.43.7-1 armhf -e2fsprogs 1.43.7-1 armhf -e2fsprogs-l10n 1.43.7-1 all +dpkg 1.19.0.5 armhf +dpkg-dev 1.19.0.5 all +e2fslibs 1.44.0-1 armhf +e2fsprogs 1.44.0-1 armhf +e2fsprogs-l10n 1.44.0-1 all -elinks 0.12~pre6-12+b1 armhf -elinks-data 0.12~pre6-12 all -etckeeper 1.18.5-1 all -exim4-base 4.89-7 armhf -exim4-config 4.89-7 all -exim4-daemon-light 4.89-7 armhf -eyed3 0.8-1 all -fail2ban 0.9.7-2 all +elinks 0.12~pre6-13 armhf +elinks-data 0.12~pre6-13 all +etckeeper 1.18.7-1 all +exim4-base 4.90.1-1 armhf +exim4-config 4.90.1-1 all +exim4-daemon-light 4.90.1-1 armhf +eyed3 0.8.4-2 all +fail2ban 0.10.2-1 all -fakeroot 1.22-1 armhf -fbset 2.1-29 armhf -fdisk 2.30.2-0.1 armhf -file 1:5.32-1 armhf -findutils 4.6.0+git+20170729-2 armhf -firmware-atheros 1:20161130-3+rpi2 all -firmware-brcm80211 1:20161130-3+rpi2 all -firmware-libertas 1:20161130-3+rpi2 all -firmware-misc-nonfree 1:20161130-3+rpi2 all -firmware-realtek 1:20161130-3+rpi2 all -fontconfig-config 2.12.3-0.2 all +fakeroot 1.22-2 armhf +fbset 2.1-30 armhf +fdisk 2.31.1-0.4 armhf +file 1:5.32-2 armhf +findutils 4.6.0+git+20170828-2 armhf +firmware-atheros 1:20161130-3+rpt3 all +firmware-brcm80211 1:20161130-3+rpt3 all +firmware-libertas 1:20161130-3+rpt3 all +firmware-misc-nonfree 1:20161130-3+rpt3 all +firmware-realtek 1:20161130-3+rpt3 all +fontconfig-config 2.12.6-0.1 all -g++-7 7.2.0-12 armhf -gawk 1:4.1.4+dfsg-1 armhf +g++-7 7.3.0-5 armhf +gawk 1:4.1.4+dfsg-1+b1 armhf -gcc-4.9-base 4.9.3-14 armhf -gcc-5-base 5.4.1-4 armhf -gcc-6 6.4.0-6 armhf -gcc-6-base 6.4.0-6 armhf -gcc-7 7.2.0-12 armhf -gcc-7-base 7.2.0-12 armhf -gdb 7.12-6 armhf -geoip-database 20170928-1 all +gcc-4.9-base 4.9.4-2+rpi1 armhf +gcc-5-base 5.5.0-8 armhf +gcc-6 6.4.0-12+rpi1 armhf +gcc-6-base 6.4.0-12+rpi1 armhf +gcc-7 7.3.0-5 armhf +gcc-7-base 7.3.0-5 armhf +gcc-8-base 8-20180218-1+rpi1 armhf +gdb 7.12-6+b1 armhf +geoip-database 20180215-1 all -gir1.2-glib-2.0 1.54.1-2 armhf -git 1:2.14.2-1 armhf -git-man 1:2.14.2-1 all -gnupg 2.2.1-5 armhf -gnupg-agent 2.2.1-5 all -gnupg-l10n 2.2.1-5 all -gnupg-utils 2.2.1-5 armhf -gpg 2.2.1-5 armhf -gpg-agent 2.2.1-5 armhf -gpg-wks-client 2.2.1-5 armhf -gpg-wks-server 2.2.1-5 armhf -gpgconf 2.2.1-5 armhf -gpgsm 2.2.1-5 armhf -gpgv 2.2.1-5 armhf +gir1.2-glib-2.0 1.54.1-4 armhf +git 1:2.16.2-1 armhf +git-man 1:2.16.2-1 all +gnupg 2.2.5-1 armhf +gnupg-agent 2.2.5-1 all +gnupg-l10n 2.2.5-1 all +gnupg-utils 2.2.5-1 armhf +gpg 2.2.5-1 armhf +gpg-agent 2.2.5-1 armhf +gpg-wks-client 2.2.5-1 armhf +gpg-wks-server 2.2.5-1 armhf +gpgconf 2.2.5-1 armhf +gpgsm 2.2.5-1 armhf +gpgv 2.2.5-1 armhf -groff-base 1.22.3-9 armhf +groff-base 1.22.3-10 armhf -hostname 3.18 armhf -htop 2.0.2-1 armhf -i2c-tools 3.1.2-3+b1 armhf -id3tool 1.2a-7 armhf -id3v2 0.1.12-3 armhf -ifupdown 0.8.29 armhf -info 6.5.0.dfsg.1-1 armhf +hostname 3.20 armhf +htop 2.1.0-3 armhf +i2c-tools 4.0-2 armhf +id3tool 1.2a-8 armhf +id3v2 0.1.12+dfsg-1 armhf +ifupdown 0.8.31 armhf +info 6.5.0.dfsg.1-2 armhf -install-info 6.5.0.dfsg.1-1 armhf +install-info 6.5.0.dfsg.1-2 armhf -iproute2 4.9.0-2 armhf -iptables 1.6.1-2+b1 armhf +iproute2 4.15.0-2 armhf +iptables 1.6.2-1 armhf -isc-dhcp-client 4.3.5-3 armhf -isc-dhcp-common 4.3.5-3+b1 armhf -isc-dhcp-server 4.3.5-3 armhf -iso-codes 3.76-1 all -iw 4.9-0.1 armhf +isc-dhcp-client 4.3.5-3.1 armhf +isc-dhcp-common 4.3.5-3.1 armhf +isc-dhcp-server 4.3.5-3.1 armhf +iso-codes 3.79-1 all +iw 4.14-0.1 armhf -keyboard-configuration 1.170 all -keyutils 1.5.9-9 armhf -klibc-utils 2.0.4-9+rpi1 armhf -kmod 24-1 armhf -less 481-2.1 armhf +keyboard-configuration 1.178 all +keyutils 1.5.9-9.2 armhf +klibc-utils 2.0.4-11+rpi1 armhf +kmod 25-1 armhf +less 487-0.1 armhf -libalgorithm-diff-xs-perl 0.04-4+b3 armhf +libalgorithm-diff-xs-perl 0.04-5 armhf -libapparmor1 2.11.1-2 armhf -libapt-inst2.0 1.6~alpha3 armhf -libapt-pkg5.0 1.6~alpha3 armhf -libasan3 6.4.0-6 armhf -libasan4 7.2.0-12 armhf +libapparmor1 2.12-3 armhf +libapt-inst2.0 1.6~beta1 armhf +libapt-pkg5.0 1.6~beta1 armhf +libargon2-0 0~20161029-1.1 armhf +libasan3 6.4.0-12+rpi1 armhf +libasan4 7.3.0-5 armhf -libassuan0 2.4.3-3 armhf -libatomic1 7.2.0-12 armhf +libassuan0 2.5.1-2 armhf +libatomic1 8-20180218-1+rpi1 armhf -libaudit-common 1:2.8.1-1 all -libaudit1 1:2.8.1-1 armhf +libaudit-common 1:2.8.2-1 all +libaudit1 1:2.8.2-1 armhf -libavahi-common-data 0.7-3 armhf -libavahi-common3 0.7-3 armhf -libavahi-core7 0.7-3 armhf -libbabeltrace-ctf1 1.5.3-4 all -libbabeltrace1 1.5.3-4 armhf +libavahi-common-data 0.7-3.1+b1 armhf +libavahi-common3 0.7-3.1+b1 armhf +libavahi-core7 0.7-3.1+b1 armhf +libbabeltrace-ctf1 1.5.4-1 all +libbabeltrace1 1.5.4-1 armhf -libbinutils 2.29.1-6+rpi1 armhf +libbind9-160 1:9.11.2.P1-1 armhf +libbinutils 2.30-7+rpi1 armhf -libblkid1 2.30.2-0.1 armhf -libboost-filesystem1.62.0 1.62.0+dfsg-4+b2 armhf +libblkid1 2.31.1-0.4 armhf +libboost-filesystem1.62.0 1.62.0+dfsg-5 armhf -libboost-iostreams1.62.0 1.62.0+dfsg-4+b2 armhf -libboost-system1.62.0 1.62.0+dfsg-4+b2 armhf -libbsd0 0.8.6-2 armhf +libboost-iostreams1.62.0 1.62.0+dfsg-5 armhf +libboost-system1.62.0 1.62.0+dfsg-5 armhf +libbsd0 0.8.7-1 armhf -libc-bin 2.24-17 armhf -libc-dev-bin 2.24-17 armhf -libc-l10n 2.24-17 all -libc6 2.24-17 armhf -libc6-dbg 2.24-17 armhf -libc6-dev 2.24-17 armhf +libc-bin 2.27-1+rpi1 armhf +libc-dev-bin 2.27-1+rpi1 armhf +libc-l10n 2.27-1+rpi1 all +libc6 2.27-1+rpi1 armhf +libc6-dbg 2.27-1+rpi1 armhf +libc6-dev 2.27-1+rpi1 armhf -libcap2 1:2.25-1.1 armhf -libcap2-bin 1:2.25-1.1 armhf -libcc1-0 7.2.0-12 armhf -libcilkrts5 7.2.0-12 armhf -libcomerr2 1.43.7-1 armhf +libcap2 1:2.25-1.2 armhf +libcap2-bin 1:2.25-1.2 armhf +libcc1-0 8-20180218-1+rpi1 armhf +libcilkrts5 7.3.0-5 armhf +libcom-err2 1.44.0-1 armhf +libcomerr2 1.44.0-1 armhf +libcryptsetup12 2:2.0.1-1 armhf -libcurl3 7.56.1-1 armhf -libcurl3-gnutls 7.56.1-1 armhf -libcwidget3v5 0.5.17-6 armhf +libcurl3 7.58.0-2 armhf +libcurl3-gnutls 7.58.0-2 armhf +libcwidget3v5 0.5.17-7 armhf -libdbus-1-3 1.12.0-1 armhf -libdbus-glib-1-2 0.108-2 armhf -libdebconfclient0 0.232 armhf -libdevmapper1.02.1 2:1.02.142-1 armhf +libdbus-1-3 1.12.6-2 armhf +libdbus-glib-1-2 0.110-2 armhf +libdebconfclient0 0.241 armhf +libdevmapper1.02.1 2:1.02.145-4.1 armhf +libdns-export169 1:9.11.2.P1-1 armhf -libdpkg-perl 1.19.0.4 all -libdrm-common 2.4.85-1+rpi1 all -libdrm2 2.4.85-1+rpi1 armhf -libdw1 0.170-0.1 armhf +libdns169 1:9.11.2.P1-1 armhf +libdpkg-perl 1.19.0.5 all +libdrm-common 2.4.90-1+rpi1 all +libdrm2 2.4.90-1+rpi1 armhf +libdw1 0.170-0.3 armhf -libelf1 0.170-0.1 armhf +libelf1 0.170-0.3 armhf -libexpat1 2.2.3-1 armhf -libexpat1-dev 2.2.3-1 armhf -libfakeroot 1.22-1 armhf -libfastjson4 0.99.7-1 armhf -libfdisk1 2.30.2-0.1 armhf -libffi6 3.2.1-6 armhf -libfftw3-single3 3.3.6p2-2 armhf +libexpat1 2.2.5-3 armhf +libexpat1-dev 2.2.5-3 armhf +libext2fs2 1.44.0-1 armhf +libfakeroot 1.22-2 armhf +libfastjson4 0.99.8-2 armhf +libfdisk1 2.31.1-0.4 armhf +libffi6 3.2.1-8 armhf +libfftw3-single3 3.3.7-1 armhf -libfontconfig1 2.12.3-0.2 armhf -libfreetype6 2.8.1-0.1 armhf -libfreetype6-dev 2.8.1-0.1 armhf +libfontconfig1 2.12.6-0.1 armhf +libfreetype6 2.8.1-2 armhf +libfreetype6-dev 2.8.1-2 armhf -libgcc-6-dev 6.4.0-6 armhf -libgcc-7-dev 7.2.0-12 armhf -libgcc1 1:7.2.0-12 armhf -libgcrypt20 1.7.9-1 armhf +libgcc-6-dev 6.4.0-12+rpi1 armhf +libgcc-7-dev 7.3.0-5 armhf +libgcc1 1:8-20180218-1+rpi1 armhf +libgcrypt20 1.8.1-4 armhf +libgdbm-compat4 1.14.1-4 armhf -libgeoip1 1.6.11-2 armhf -libgfortran4 7.2.0-12 armhf -libgirepository-1.0-1 1.54.1-2 armhf -libglib2.0-0 2.54.1-1 armhf -libglib2.0-data 2.54.1-1 all -libgmp10 2:6.1.2+dfsg-1.1 armhf -libgnutls30 3.5.16-1 armhf -libgomp1 7.2.0-12 armhf -libgpg-error0 1.27-4 armhf -libgpm2 1.20.4-6.2 armhf -libgssapi-krb5-2 1.15.2-2 armhf -libhogweed4 3.3-2 armhf +libgdbm5 1.14.1-4 armhf +libgeoip1 1.6.12-1 armhf +libgfortran4 7.3.0-5 armhf +libgirepository-1.0-1 1.54.1-4 armhf +libglib2.0-0 2.54.3-2 armhf +libglib2.0-data 2.54.3-2 all +libgmp10 2:6.1.2+dfsg-3 armhf +libgnutls30 3.5.18-1 armhf +libgomp1 8-20180218-1+rpi1 armhf +libgpg-error0 1.27-6 armhf +libgpm2 1.20.7-5 armhf +libgssapi-krb5-2 1.16-2 armhf +libhogweed4 3.4-1 armhf -libhtml-tree-perl 5.03-2 all -libhttp-cookies-perl 6.01-1 all +libhtml-tree-perl 5.07-1 all +libhttp-cookies-perl 6.04-1 all -libhttp-message-perl 6.13-1 all +libhttp-message-perl 6.14-1 all +libi2c0 4.0-2 armhf -libidn11 1.33-2 armhf -libidn2-0 2.0.2-5 armhf +libidn11 1.33-2.1 armhf +libidn2-0 2.0.4-1.1 armhf -libio-socket-ssl-perl 2.052-1 all -libip4tc0 1.6.1-2+b1 armhf -libip6tc0 1.6.1-2+b1 armhf -libiptc0 1.6.1-2+b1 armhf +libio-socket-ssl-perl 2.056-1 all +libip4tc0 1.6.2-1 armhf +libip6tc0 1.6.2-1 armhf +libiptc0 1.6.2-1 armhf +libirs-export160 1:9.11.2.P1-1 armhf +libirs160 1:9.11.2.P1-1 armhf +libisc-export166 1:9.11.2.P1-1 armhf +libisc166 1:9.11.2.P1-1 armhf +libisccc160 1:9.11.2.P1-1 armhf +libisccfg-export160 1:9.11.2.P1-1 armhf +libisccfg160 1:9.11.2.P1-1 armhf -libjim0.77 0.77-2 armhf -libjpeg62-turbo 1:1.5.2-2 armhf +libjim0.77 0.77+dfsg0-2 armhf +libjpeg62-turbo 1:1.5.2-2+b1 armhf -libjs-sphinxdoc 1.6.5-2 all +libjs-sphinxdoc 1.6.7-1 all -libk5crypto3 1.15.2-2 armhf -libkeyutils1 1.5.9-9 armhf -libklibc 2.0.4-9+rpi1 armhf -libkmod2 24-1 armhf -libkrb5-3 1.15.2-2 armhf -libkrb5support0 1.15.2-2 armhf +libjson-c3 0.12.1-1.3 armhf +libk5crypto3 1.16-2 armhf +libkeyutils1 1.5.9-9.2 armhf +libklibc 2.0.4-11+rpi1 armhf +libkmod2 25-1 armhf +libkrb5-3 1.16-2 armhf +libkrb5support0 1.16-2 armhf +liblmdb0 0.9.21-1 armhf -liblockfile-bin 1.14-1 armhf -liblockfile1 1.14-1 armhf -liblogging-stdlog0 1.0.6-1 armhf +liblockfile-bin 1.14-1.1 armhf +liblockfile1 1.14-1.1 armhf +liblogging-stdlog0 1.0.6-3 armhf +liblwres160 1:9.11.2.P1-1 armhf -libmagic-mgc 1:5.32-1 armhf -libmagic1 1:5.32-1 armhf +libmagic-mgc 1:5.32-2 armhf +libmagic1 1:5.32-2 armhf -libmount1 2.30.2-0.1 armhf -libmpc3 1.0.3-2 armhf +libmount1 2.31.1-0.4 armhf +libmpc3 1.1.0-1 armhf +libmpfr6 4.0.0-7 armhf -libncurses5 6.0+20170902-1 armhf -libncursesw5 6.0+20170902-1 armhf +libncurses5 6.1-1 armhf +libncursesw5 6.1-1 armhf -libnet-ssleay-perl 1.80-1+b1 armhf +libnet-ssleay-perl 1.84-1 armhf -libnettle6 3.3-2 armhf -libnewt0.52 0.52.20-1+b1 armhf +libnettle6 3.4-1 armhf +libnewt0.52 0.52.20-3 armhf -libnghttp2-14 1.27.0-1 armhf -libnginx-mod-http-auth-pam 1.13.6-2 armhf -libnginx-mod-http-dav-ext 1.13.6-2 armhf -libnginx-mod-http-echo 1.13.6-2 armhf -libnginx-mod-http-geoip 1.13.6-2 armhf -libnginx-mod-http-image-filter 1.13.6-2 armhf -libnginx-mod-http-subs-filter 1.13.6-2 armhf -libnginx-mod-http-upstream-fair 1.13.6-2 armhf -libnginx-mod-http-xslt-filter 1.13.6-2 armhf -libnginx-mod-mail 1.13.6-2 armhf -libnginx-mod-stream 1.13.6-2 armhf -libnih-dbus1 1.0.3-8 armhf -libnih1 1.0.3-8 armhf +libnghttp2-14 1.31.0-1 armhf +libnginx-mod-http-auth-pam 1.13.9-1 armhf +libnginx-mod-http-dav-ext 1.13.9-1 armhf +libnginx-mod-http-echo 1.13.9-1 armhf +libnginx-mod-http-geoip 1.13.9-1 armhf +libnginx-mod-http-image-filter 1.13.9-1 armhf +libnginx-mod-http-subs-filter 1.13.9-1 armhf +libnginx-mod-http-upstream-fair 1.13.9-1 armhf +libnginx-mod-http-xslt-filter 1.13.9-1 armhf +libnginx-mod-mail 1.13.9-1 armhf +libnginx-mod-stream 1.13.9-1 armhf +libnih-dbus1 1.0.3-10+b9 armhf +libnih1 1.0.3-10+b9 armhf -libnpth0 1.5-2 armhf +libnpth0 1.5-3 armhf +libnss-systemd 237-3+b1 armhf -libpam-modules 1.1.8-3.6+rpi1 armhf -libpam-modules-bin 1.1.8-3.6+rpi1 armhf -libpam-runtime 1.1.8-3.6+rpi1 all -libpam-systemd 235-2 armhf -libpam0g 1.1.8-3.6+rpi1 armhf -libparted2 3.2-18 armhf -libpcap0.8 1.8.1-5 armhf -libpcre2-8-0 10.22-3 armhf -libpcre3 2:8.39-4 armhf -libpcsclite1 1.8.22-1 armhf -libperl5.26 5.26.1-2 armhf -libpipeline1 1.4.2-1 armhf -libplymouth4 0.9.3-1 armhf +libpam-modules 1.1.8-3.7 armhf +libpam-modules-bin 1.1.8-3.7 armhf +libpam-runtime 1.1.8-3.7 all +libpam-systemd 237-3+b1 armhf +libpam0g 1.1.8-3.7 armhf +libparted2 3.2-20 armhf +libpcap0.8 1.8.1-6 armhf +libpcre2-8-0 10.31-3 armhf +libpcre3 2:8.39-9 armhf +libpcsclite1 1.8.23-1 armhf +libperl5.26 5.26.1-5 armhf +libpipeline1 1.5.0-1 armhf +libplymouth4 0.9.3-2 armhf -libprocps6 2:3.3.12-3 armhf -libpsl5 0.18.0-4 armhf -libpython-stdlib 2.7.14-1 armhf -libpython2.7-minimal 2.7.14-2 armhf -libpython2.7-stdlib 2.7.14-2 armhf -libpython3-dev 3.6.3-2 armhf -libpython3-stdlib 3.6.3-2 armhf +libprocps6 2:3.3.12-4 armhf +libpsl5 0.19.1-5 armhf +libpython-stdlib 2.7.14-4 armhf +libpython2.7-minimal 2.7.14-6 armhf +libpython2.7-stdlib 2.7.14-6 armhf +libpython3-dev 3.6.4-1 armhf +libpython3-stdlib 3.6.4-1 armhf -libpython3.6 3.6.3-1 armhf -libpython3.6-dev 3.6.3-1 armhf -libpython3.6-minimal 3.6.3-1 armhf -libpython3.6-stdlib 3.6.3-1 armhf -libraspberrypi-bin 1.20170811-1 armhf -libraspberrypi-dev 1.20170811-1 armhf -libraspberrypi-doc 1.20170811-1 armhf -libraspberrypi0 1.20170811-1 armhf +libpython3.6 3.6.4-4 armhf +libpython3.6-dev 3.6.4-4 armhf +libpython3.6-minimal 3.6.4-4 armhf +libpython3.6-stdlib 3.6.4-4 armhf +libraspberrypi-bin 1.20180313-1 armhf +libraspberrypi-dev 1.20180313-1 armhf +libraspberrypi-doc 1.20180313-1 armhf +libraspberrypi0 1.20180313-1 armhf -libruby2.3 2.3.3-1+deb9u1+rpi1 armhf -libsamplerate0 0.1.9-1 armhf +libruby2.3 2.3.6-2+rpi1 armhf +libruby2.5 2.5.0-6+rpi1 armhf +libsamplerate0 0.1.9-2 armhf -libsigsegv2 2.11-1 armhf -libslang2 2.3.1a-1 armhf -libsmartcols1 2.30.2-0.1 armhf -libsqlite3-0 3.20.1-2 armhf -libss2 1.43.7-1 armhf +libsigsegv2 2.12-1 armhf +libslang2 2.3.2-1 armhf +libsmartcols1 2.31.1-0.4 armhf +libsqlite3-0 3.22.0-1 armhf +libss2 1.44.0-1 armhf -libssl1.0.2 1.0.2l-2 armhf +libssl1.0.2 1.0.2n-1 armhf -libstdc++-7-dev 7.2.0-12 armhf -libstdc++6 7.2.0-12 armhf +libstdc++-7-dev 7.3.0-5 armhf +libstdc++6 8-20180218-1+rpi1 armhf -libsystemd0 235-2 armhf +libsystemd0 237-3+b1 armhf -libtasn1-6 4.12-2.1 armhf -libtcl8.6 8.6.7+dfsg-1 armhf +libtasn1-6 4.13-2 armhf +libtcl8.6 8.6.8+dfsg-3 armhf -libtiff5 4.0.8-6 armhf +libtiff5 4.0.9-4 armhf -libtinfo5 6.0+20170902-1 armhf +libtinfo5 6.1-1 armhf -libtry-tiny-perl 0.28-1 all -libubsan0 7.2.0-12 armhf +libtry-tiny-perl 0.30-1 all +libubsan0 7.3.0-5 armhf -libudev1 235-2 armhf +libudev1 237-3+b1 armhf -libunistring2 0.9.7-2 armhf -liburi-perl 1.72-2 all +libunistring2 0.9.8-1 armhf +liburi-perl 1.73-1 all -libuuid1 2.30.2-0.1 armhf -libv4l-0 1.12.5-1 armhf -libv4l2rds0 1.12.5-1 armhf -libv4lconvert0 1.12.5-1 armhf -libwbclient0 2:4.7.0+dfsg-2 armhf -libwebp6 0.6.0-3 armhf +libuuid1 2.31.1-0.4 armhf +libv4l-0 1.14.2-1 armhf +libv4l2rds0 1.14.2-1 armhf +libv4lconvert0 1.14.2-1 armhf +libwbclient0 2:4.7.4+dfsg-2 armhf +libwebp6 0.6.1-2 armhf -libwww-perl 6.27-1 all +libwww-perl 6.31-1 all -libxcb1 1.12-1 armhf +libxcb1 1.13-1 armhf -libxml2 2.9.4+dfsg1-5 armhf +libxml2 2.9.4+dfsg1-6.1 armhf -libxslt1.1 1.1.29-2.2 armhf -libxtables12 1.6.1-2+b1 armhf +libxslt1.1 1.1.29-5 armhf +libxtables12 1.6.2-1 armhf -linux-libc-dev 4.9.51-1+rpi3+b1 armhf -locales 2.24-17 all +linux-libc-dev 4.15.4-1+rpi1 armhf +locales 2.27-1+rpi1 all -man-db 2.7.6.1-2 armhf -manpages 4.13-3 all -manpages-dev 4.13-3 all +man-db 2.8.2-1 armhf +manpages 4.15-1 all +manpages-dev 4.15-1 all -mount 2.30.2-0.1 armhf +mount 2.31.1-0.4 armhf -multiarch-support 2.24-17 armhf +multiarch-support 2.27-1+rpi1 armhf -nano 2.8.7-1 armhf +nano 2.9.3-2 armhf -ncurses-base 6.0+20170902-1 all -ncurses-bin 6.0+20170902-1 armhf -ncurses-term 6.0+20170902-1 all +ncurses-base 6.1-1 all +ncurses-bin 6.1-1 armhf +ncurses-term 6.1-1 all -net-tools 1.60+git20161116.90da8a0-1 armhf +net-tools 1.60+git20161116.90da8a0-2 armhf -netcat-openbsd 1.178-3 armhf +netcat-openbsd 1.187-1 armhf -nfs-common 1:1.3.4-2.1+b1 armhf -nginx 1.13.6-2 all -nginx-common 1.13.6-2 all -nginx-full 1.13.6-2 armhf +nfs-common 1:1.3.4-2.2 armhf +nginx-common 1.13.9-1 all -openssh-client 1:7.6p1-2 armhf -openssh-server 1:7.6p1-2 armhf -openssh-sftp-server 1:7.6p1-2 armhf +openssh-client 1:7.6p1-4 armhf +openssh-server 1:7.6p1-4 armhf +openssh-sftp-server 1:7.6p1-4 armhf -parted 3.2-18 armhf +parted 3.2-20 armhf -patch 2.7.5-1 armhf +patch 2.7.6-1 armhf -perl 5.26.1-2 armhf -perl-base 5.26.1-2 armhf -perl-modules-5.26 5.26.1-2 all +perl 5.26.1-5 armhf +perl-base 5.26.1-5 armhf +perl-modules-5.26 5.26.1-5 all -pi-bluetooth 0.1.6 armhf -pinentry-curses 1.0.0-3 armhf +pi-bluetooth 0.1.7 all +pinentry-curses 1.1.0-1 armhf -plymouth 0.9.3-1 armhf +plymouth 0.9.3-2 armhf -procps 2:3.3.12-3 armhf +procps 2:3.3.12-4 armhf -python 2.7.14-1 armhf -python-acme 0.19.0-1 all +python 2.7.14-4 armhf +python-acme 0.21.1-1 all -python-asn1crypto 0.22.0-1 all +python-asn1crypto 0.24.0-1 all -python-certbot 0.19.0-1 all -python-certifi 2017.7.27.1-2 all -python-cffi-backend 1.9.1-2+b1 armhf +python-certifi 2018.1.18-2 all +python-cffi-backend 1.11.5-1 armhf -python-cryptography 1.9-1 armhf -python-enum34 1.1.6-1 all -python-eyed3 0.8-1 all -python-funcsigs 1.0.2-3 all +python-cryptography 2.1.4-1 armhf +python-enum34 1.1.6-2 all +python-eyed3 0.8.4-2 all +python-funcsigs 1.0.2-4 all -python-idna 2.5-1 all +python-idna 2.6-1 all +python-josepy 1.0.1-1 all -python-minimal 2.7.14-1 armhf +python-magic 2:0.4.15-1 all +python-minimal 2.7.14-4 armhf -python-newt 0.52.20-1+b1 armhf -python-openssl 16.2.0-1 all +python-newt 0.52.20-3 armhf +python-openssl 17.5.0-1 all -python-pbr 3.1.1-2 all -python-pip-whl 9.0.1-2+rpt1 all -python-pkg-resources 36.6.0-1 all +python-pbr 3.1.1-4 all +python-pip-whl 9.0.1-2+rpt2 all +python-pkg-resources 38.5.2-1 all -python-requests 2.18.1-1 all +python-requests 2.18.4-2 all -python-setuptools 36.6.0-1 all -python-six 1.11.0-1 all -python-tz 2017.2-2 all -python-urllib3 1.21.1-1 all +python-setuptools 38.5.2-1 all +python-six 1.11.0-2 all +python-tz 2018.3-2 all +python-urllib3 1.22-1 all -python2.7 2.7.14-2 armhf -python2.7-minimal 2.7.14-2 armhf -python3 3.6.3-2 armhf +python2.7 2.7.14-6 armhf +python2.7-minimal 2.7.14-6 armhf +python3 3.6.4-1 armhf +python3-acme 0.21.1-1 all -python3-asn1crypto 0.22.0-1 all -python3-cffi-backend 1.9.1-2+b1 armhf -python3-crypto 2.6.1-7+b1 armhf -python3-cryptography 1.9-1 armhf -python3-dbus 1.2.4-1+b1 armhf -python3-debconf 1.5.64 all -python3-dev 3.6.3-2 armhf -python3-gi 3.24.1-3+rpi1 armhf -python3-idna 2.5-1 all -python3-keyring 10.4.0-1 all -python3-keyrings.alt 2.2-2 all -python3-minimal 3.6.3-2 armhf -python3-pip 9.0.1-2+rpt1 all -python3-pkg-resources 36.6.0-1 all +python3-asn1crypto 0.24.0-1 all +python3-certbot 0.21.1-1 all +python3-certifi 2018.1.18-2 all +python3-cffi-backend 1.11.5-1 armhf +python3-chardet 3.0.4-1 all +python3-configargparse 0.11.0-1 all +python3-configobj 5.0.6-2 all +python3-crypto 2.6.1-8 armhf +python3-cryptography 2.1.4-1 armhf +python3-dbus 1.2.6-1 armhf +python3-debconf 1.5.66 all +python3-dev 3.6.4-1 armhf +python3-distutils 3.6.4-4 all +python3-eyed3 0.8.4-2 all +python3-future 0.15.2-4 all +python3-gi 3.26.1-2 armhf +python3-idna 2.6-1 all +python3-josepy 1.0.1-1 all +python3-keyring 10.6.0-1 all +python3-keyrings.alt 3.0-1 all +python3-lib2to3 3.6.4-4 all +python3-magic 2:0.4.15-1 all +python3-minimal 3.6.4-1 armhf +python3-mock 2.0.0-3 all +python3-openssl 17.5.0-1 all +python3-parsedatetime 2.4-2 all +python3-pbr 3.1.1-4 all +python3-pip 9.0.1-2+rpt2 all +python3-pkg-resources 38.5.2-1 all +python3-requests 2.18.4-2 all +python3-rfc3339 1.0-4 all -python3-setuptools 36.6.0-1 all -python3-six 1.11.0-1 all +python3-setuptools 38.5.2-1 all +python3-six 1.11.0-2 all -python3-wheel 0.29.0-2 all +python3-tz 2018.3-2 all +python3-urllib3 1.22-1 all +python3-wheel 0.30.0-0.2 all +python3-zope.component 4.3.0-1 all +python3-zope.event 4.2.0-1 all +python3-zope.hookable 4.0.4-4+b2 armhf +python3-zope.interface 4.3.2-1+b1 armhf -python3.6 3.6.3-1 armhf -python3.6-dev 3.6.3-1 armhf -python3.6-minimal 3.6.3-1 armhf -rake 12.0.0-1 all -raspberrypi-bootloader 1.20170811-1 armhf -raspberrypi-kernel 1.20170811-1 armhf +python3.6 3.6.4-4 armhf +python3.6-dev 3.6.4-4 armhf +python3.6-minimal 3.6.4-4 armhf +rake 12.3.0-1 all +raspberrypi-bootloader 1.20180313-1 armhf +raspberrypi-kernel 1.20180313-1 armhf -raspberrypi-sys-mods 20170717 armhf +raspberrypi-sys-mods 20180315 armhf -raspi-config 20170926 all +raspi-config 20180228 all +rfkill 2.31.1-0.4 armhf -rsync 3.1.2-2 armhf -rsyslog 8.29.0-2 armhf -ruby 1:2.3.3 armhf +rsync 3.1.2-2.1 armhf +rsyslog 8.33.1-1 armhf +ruby 1:2.5.0 armhf -ruby2.3 2.3.3-1+deb9u1+rpi1 armhf +ruby2.3 2.3.6-2+rpi1 armhf +ruby2.5 2.5.0-6+rpi1 armhf -samba-common 2:4.7.0+dfsg-2 all +samba-common 2:4.7.4+dfsg-2 all -sed 4.4-1 armhf +sed 4.4-2 armhf -sensible-utils 0.0.10 all +sensible-utils 0.0.11 all -ssh 1:7.6p1-2 all -strace 4.19-1 armhf -sudo 1.8.21p2-2 armhf -systemd 235-2 armhf -systemd-sysv 235-2 armhf +ssh 1:7.6p1-4 all +strace 4.21-1 armhf +sudo 1.8.21p2-3 armhf +systemd 237-3+b1 armhf +systemd-sysv 237-3+b1 armhf -tasksel 3.42 all -tasksel-data 3.42 all +tasksel 3.43 all +tasksel-data 3.43 all -tmux 2.6-1 armhf +tmux 2.6-3 armhf -tzdata 2017c-1 all -ucf 3.0036 all -udev 235-2 armhf +tzdata 2018c-1 all +ucf 3.0038 all +udev 237-3+b1 armhf -usb-modeswitch 2.5.1+repack0-1+b1 armhf -usb-modeswitch-data 20170806-1 all +usb-modeswitch 2.5.2+repack0-2 armhf +usb-modeswitch-data 20170806-2 all -util-linux 2.30.2-0.1 armhf -v4l-utils 1.12.5-1 armhf +util-linux 2.31.1-0.4 armhf +v4l-utils 1.14.2-1 armhf -vim-common 2:8.0.1144-1 all -vim-nox 2:8.0.1144-1 armhf -vim-runtime 2:8.0.1144-1 all -vim-tiny 2:8.0.1144-1 armhf -vnstat 1.15-2 armhf -wget 1.19.2-1 armhf -whiptail 0.52.20-1+b1 armhf -whois 5.2.18 armhf +vim-common 2:8.0.1453-1 all +vim-nox 2:8.0.1453-1 armhf +vim-runtime 2:8.0.1453-1 all +vim-tiny 2:8.0.1453-1 armhf +vnstat 1.17-1 armhf +wget 1.19.4-1 armhf +whiptail 0.52.20-3 armhf +whois 5.3.0 armhf -wpasupplicant 2:2.4-1.1 armhf -xauth 1:1.0.9-1 armhf -xdg-user-dirs 0.15-3 armhf -xkb-data 2.19-1.1 all +wpasupplicant 2:2.6-15 armhf +xauth 1:1.0.10-1 armhf +xdg-user-dirs 0.16-1 armhf +xkb-data 2.23.1-1 all -xxd 2:8.0.1144-1 armhf +xxd 2:8.0.1453-1 armhf -zsh 5.4.2-1 armhf -zsh-common 5.4.2-1 all +zsh 5.4.2-3 armhf +zsh-common 5.4.2-3 all
7 years ago
class BadIPsAction(ActionBase): # pragma: no cover - may be unavailable
7 years ago
"""Fail2Ban action which reports bans to badips.com, and also
blacklist bad IPs listed on badips.com by using another action's
ban method.
Parameters
----------
jail : Jail
The jail which the action belongs to.
name : str
Name assigned to the action.
category : str
Valid badips.com category for reporting failures.
score : int, optional
Minimum score for bad IPs. Default 3.
age : str, optional
Age of last report for bad IPs, per badips.com syntax.
Default "24h" (24 hours)
key : str, optional
Key issued by badips.com to report bans, for later retrieval
of personalised content.
banaction : str, optional
Name of banaction to use for blacklisting bad IPs. If `None`,
no blacklist of IPs will take place.
Default `None`.
bancategory : str, optional
Name of category to use for blacklisting, which can differ
from category used for reporting. e.g. may want to report
"postfix", but want to use whole "mail" category for blacklist.
Default `category`.
bankey : str, optional
Key issued by badips.com to blacklist IPs reported with the
associated key.
updateperiod : int, optional
Time in seconds between updating bad IPs blacklist.
Default 900 (15 minutes)
agent : str, optional
User agent transmitted to server.
Default `Fail2Ban/ver.`
Raises
------
ValueError
If invalid `category`, `score`, `banaction` or `updateperiod`.
"""
TIMEOUT = 10
_badips = "http://www.badips.com"
def _Request(self, url, **argv):
return Request(url, headers={'User-Agent': self.agent}, **argv)
def __init__(self, jail, name, category, score=3, age="24h", key=None,
banaction=None, bancategory=None, bankey=None, updateperiod=900, agent="Fail2Ban",
timeout=TIMEOUT):
super(BadIPsAction, self).__init__(jail, name)
self.timeout = timeout
self.agent = agent
self.category = category
self.score = score
self.age = age
self.key = key
self.banaction = banaction
self.bancategory = bancategory or category
self.bankey = bankey
self.updateperiod = updateperiod
self._bannedips = set()
# Used later for threading.Timer for updating badips
self._timer = None
committing changes in /etc after apt run Package changes: -adduser 3.116 all +adduser 3.117 all -apt 1.6~alpha3 armhf -apt-listchanges 3.14 all -apt-utils 1.6~alpha3 armhf -aptitude 0.8.9-1 armhf -aptitude-common 0.8.9-1 all -avahi-daemon 0.7-3 armhf -base-files 10+rpi1 armhf +apt 1.6~beta1 armhf +apt-listchanges 3.16 all +apt-utils 1.6~beta1 armhf +aptitude 0.8.10-6 armhf +aptitude-common 0.8.10-6 all +avahi-daemon 0.7-3.1+b1 armhf +base-files 10.1+rpi1 armhf -bash 4.4-5 armhf -bash-completion 1:2.1-4.3 all -bind9 1:9.10.3.dfsg.P4-12.6 armhf -bind9-host 1:9.10.3.dfsg.P4-12.6 armhf -bind9utils 1:9.10.3.dfsg.P4-12.6 armhf -binutils 2.29.1-6+rpi1 armhf -binutils-arm-linux-gnueabihf 2.29.1-6+rpi1 armhf -binutils-common 2.29.1-6+rpi1 armhf +bash 4.4.18-1.1 armhf +bash-completion 1:2.7-1 all +bind9 1:9.11.2.P1-1 armhf +bind9-host 1:9.11.2.P1-1 armhf +bind9utils 1:9.11.2.P1-1 armhf +binutils 2.30-7+rpi1 armhf +binutils-arm-linux-gnueabihf 2.30-7+rpi1 armhf +binutils-common 2.30-7+rpi1 armhf -bluez 5.47-1 armhf -bluez-firmware 1.2-3+rpi2 all -bridge-utils 1.5-14 armhf +bluez 5.47-1+b3 armhf +bluez-firmware 1.2-3+rpt4.1 all +bridge-utils 1.5-15 armhf -bsdmainutils 9.0.14 armhf -bsdutils 1:2.30.2-0.1 armhf +bsdmainutils 11.1.2 armhf +bsdutils 1:2.31.1-0.4 armhf -certbot 0.19.0-1 all +certbot 0.21.1-1 all -console-setup 1.170 all -console-setup-linux 1.170 all -coreutils 8.26-3 armhf -cpio 2.11+dfsg-6 armhf +console-setup 1.178 all +console-setup-linux 1.178 all +coreutils 8.28-1 armhf +cpio 2.12+dfsg-6 armhf -cpp-6 6.4.0-6 armhf -cpp-7 7.2.0-12 armhf +cpp-6 6.4.0-12+rpi1 armhf +cpp-7 7.3.0-5 armhf -curl 7.56.1-1 armhf -dash 0.5.8-2.5 armhf -dbus 1.12.0-1 armhf -dc 1.06.95-9 armhf -debconf 1.5.64 all -debconf-i18n 1.5.64 all -debconf-utils 1.5.64 all -debianutils 4.8.2 armhf +curl 7.58.0-2 armhf +dash 0.5.8-2.10 armhf +dbus 1.12.6-2 armhf +dc 1.07.1-1 armhf +debconf 1.5.66 all +debconf-i18n 1.5.66 all +debconf-utils 1.5.66 all +debianutils 4.8.4 armhf -dhcpcd5 1:6.11.5-1+rpt2 armhf +dhcpcd5 1:6.11.5-1+rpt4 armhf -dirmngr 2.2.1-5 armhf +dirmngr 2.2.5-1 armhf -dmsetup 2:1.02.142-1 armhf -dnsutils 1:9.10.3.dfsg.P4-12.6 armhf +dmsetup 2:1.02.145-4.1 armhf +dnsutils 1:9.11.2.P1-1 armhf -dpkg 1.19.0.4 armhf -dpkg-dev 1.19.0.4 all -e2fslibs 1.43.7-1 armhf -e2fsprogs 1.43.7-1 armhf -e2fsprogs-l10n 1.43.7-1 all +dpkg 1.19.0.5 armhf +dpkg-dev 1.19.0.5 all +e2fslibs 1.44.0-1 armhf +e2fsprogs 1.44.0-1 armhf +e2fsprogs-l10n 1.44.0-1 all -elinks 0.12~pre6-12+b1 armhf -elinks-data 0.12~pre6-12 all -etckeeper 1.18.5-1 all -exim4-base 4.89-7 armhf -exim4-config 4.89-7 all -exim4-daemon-light 4.89-7 armhf -eyed3 0.8-1 all -fail2ban 0.9.7-2 all +elinks 0.12~pre6-13 armhf +elinks-data 0.12~pre6-13 all +etckeeper 1.18.7-1 all +exim4-base 4.90.1-1 armhf +exim4-config 4.90.1-1 all +exim4-daemon-light 4.90.1-1 armhf +eyed3 0.8.4-2 all +fail2ban 0.10.2-1 all -fakeroot 1.22-1 armhf -fbset 2.1-29 armhf -fdisk 2.30.2-0.1 armhf -file 1:5.32-1 armhf -findutils 4.6.0+git+20170729-2 armhf -firmware-atheros 1:20161130-3+rpi2 all -firmware-brcm80211 1:20161130-3+rpi2 all -firmware-libertas 1:20161130-3+rpi2 all -firmware-misc-nonfree 1:20161130-3+rpi2 all -firmware-realtek 1:20161130-3+rpi2 all -fontconfig-config 2.12.3-0.2 all +fakeroot 1.22-2 armhf +fbset 2.1-30 armhf +fdisk 2.31.1-0.4 armhf +file 1:5.32-2 armhf +findutils 4.6.0+git+20170828-2 armhf +firmware-atheros 1:20161130-3+rpt3 all +firmware-brcm80211 1:20161130-3+rpt3 all +firmware-libertas 1:20161130-3+rpt3 all +firmware-misc-nonfree 1:20161130-3+rpt3 all +firmware-realtek 1:20161130-3+rpt3 all +fontconfig-config 2.12.6-0.1 all -g++-7 7.2.0-12 armhf -gawk 1:4.1.4+dfsg-1 armhf +g++-7 7.3.0-5 armhf +gawk 1:4.1.4+dfsg-1+b1 armhf -gcc-4.9-base 4.9.3-14 armhf -gcc-5-base 5.4.1-4 armhf -gcc-6 6.4.0-6 armhf -gcc-6-base 6.4.0-6 armhf -gcc-7 7.2.0-12 armhf -gcc-7-base 7.2.0-12 armhf -gdb 7.12-6 armhf -geoip-database 20170928-1 all +gcc-4.9-base 4.9.4-2+rpi1 armhf +gcc-5-base 5.5.0-8 armhf +gcc-6 6.4.0-12+rpi1 armhf +gcc-6-base 6.4.0-12+rpi1 armhf +gcc-7 7.3.0-5 armhf +gcc-7-base 7.3.0-5 armhf +gcc-8-base 8-20180218-1+rpi1 armhf +gdb 7.12-6+b1 armhf +geoip-database 20180215-1 all -gir1.2-glib-2.0 1.54.1-2 armhf -git 1:2.14.2-1 armhf -git-man 1:2.14.2-1 all -gnupg 2.2.1-5 armhf -gnupg-agent 2.2.1-5 all -gnupg-l10n 2.2.1-5 all -gnupg-utils 2.2.1-5 armhf -gpg 2.2.1-5 armhf -gpg-agent 2.2.1-5 armhf -gpg-wks-client 2.2.1-5 armhf -gpg-wks-server 2.2.1-5 armhf -gpgconf 2.2.1-5 armhf -gpgsm 2.2.1-5 armhf -gpgv 2.2.1-5 armhf +gir1.2-glib-2.0 1.54.1-4 armhf +git 1:2.16.2-1 armhf +git-man 1:2.16.2-1 all +gnupg 2.2.5-1 armhf +gnupg-agent 2.2.5-1 all +gnupg-l10n 2.2.5-1 all +gnupg-utils 2.2.5-1 armhf +gpg 2.2.5-1 armhf +gpg-agent 2.2.5-1 armhf +gpg-wks-client 2.2.5-1 armhf +gpg-wks-server 2.2.5-1 armhf +gpgconf 2.2.5-1 armhf +gpgsm 2.2.5-1 armhf +gpgv 2.2.5-1 armhf -groff-base 1.22.3-9 armhf +groff-base 1.22.3-10 armhf -hostname 3.18 armhf -htop 2.0.2-1 armhf -i2c-tools 3.1.2-3+b1 armhf -id3tool 1.2a-7 armhf -id3v2 0.1.12-3 armhf -ifupdown 0.8.29 armhf -info 6.5.0.dfsg.1-1 armhf +hostname 3.20 armhf +htop 2.1.0-3 armhf +i2c-tools 4.0-2 armhf +id3tool 1.2a-8 armhf +id3v2 0.1.12+dfsg-1 armhf +ifupdown 0.8.31 armhf +info 6.5.0.dfsg.1-2 armhf -install-info 6.5.0.dfsg.1-1 armhf +install-info 6.5.0.dfsg.1-2 armhf -iproute2 4.9.0-2 armhf -iptables 1.6.1-2+b1 armhf +iproute2 4.15.0-2 armhf +iptables 1.6.2-1 armhf -isc-dhcp-client 4.3.5-3 armhf -isc-dhcp-common 4.3.5-3+b1 armhf -isc-dhcp-server 4.3.5-3 armhf -iso-codes 3.76-1 all -iw 4.9-0.1 armhf +isc-dhcp-client 4.3.5-3.1 armhf +isc-dhcp-common 4.3.5-3.1 armhf +isc-dhcp-server 4.3.5-3.1 armhf +iso-codes 3.79-1 all +iw 4.14-0.1 armhf -keyboard-configuration 1.170 all -keyutils 1.5.9-9 armhf -klibc-utils 2.0.4-9+rpi1 armhf -kmod 24-1 armhf -less 481-2.1 armhf +keyboard-configuration 1.178 all +keyutils 1.5.9-9.2 armhf +klibc-utils 2.0.4-11+rpi1 armhf +kmod 25-1 armhf +less 487-0.1 armhf -libalgorithm-diff-xs-perl 0.04-4+b3 armhf +libalgorithm-diff-xs-perl 0.04-5 armhf -libapparmor1 2.11.1-2 armhf -libapt-inst2.0 1.6~alpha3 armhf -libapt-pkg5.0 1.6~alpha3 armhf -libasan3 6.4.0-6 armhf -libasan4 7.2.0-12 armhf +libapparmor1 2.12-3 armhf +libapt-inst2.0 1.6~beta1 armhf +libapt-pkg5.0 1.6~beta1 armhf +libargon2-0 0~20161029-1.1 armhf +libasan3 6.4.0-12+rpi1 armhf +libasan4 7.3.0-5 armhf -libassuan0 2.4.3-3 armhf -libatomic1 7.2.0-12 armhf +libassuan0 2.5.1-2 armhf +libatomic1 8-20180218-1+rpi1 armhf -libaudit-common 1:2.8.1-1 all -libaudit1 1:2.8.1-1 armhf +libaudit-common 1:2.8.2-1 all +libaudit1 1:2.8.2-1 armhf -libavahi-common-data 0.7-3 armhf -libavahi-common3 0.7-3 armhf -libavahi-core7 0.7-3 armhf -libbabeltrace-ctf1 1.5.3-4 all -libbabeltrace1 1.5.3-4 armhf +libavahi-common-data 0.7-3.1+b1 armhf +libavahi-common3 0.7-3.1+b1 armhf +libavahi-core7 0.7-3.1+b1 armhf +libbabeltrace-ctf1 1.5.4-1 all +libbabeltrace1 1.5.4-1 armhf -libbinutils 2.29.1-6+rpi1 armhf +libbind9-160 1:9.11.2.P1-1 armhf +libbinutils 2.30-7+rpi1 armhf -libblkid1 2.30.2-0.1 armhf -libboost-filesystem1.62.0 1.62.0+dfsg-4+b2 armhf +libblkid1 2.31.1-0.4 armhf +libboost-filesystem1.62.0 1.62.0+dfsg-5 armhf -libboost-iostreams1.62.0 1.62.0+dfsg-4+b2 armhf -libboost-system1.62.0 1.62.0+dfsg-4+b2 armhf -libbsd0 0.8.6-2 armhf +libboost-iostreams1.62.0 1.62.0+dfsg-5 armhf +libboost-system1.62.0 1.62.0+dfsg-5 armhf +libbsd0 0.8.7-1 armhf -libc-bin 2.24-17 armhf -libc-dev-bin 2.24-17 armhf -libc-l10n 2.24-17 all -libc6 2.24-17 armhf -libc6-dbg 2.24-17 armhf -libc6-dev 2.24-17 armhf +libc-bin 2.27-1+rpi1 armhf +libc-dev-bin 2.27-1+rpi1 armhf +libc-l10n 2.27-1+rpi1 all +libc6 2.27-1+rpi1 armhf +libc6-dbg 2.27-1+rpi1 armhf +libc6-dev 2.27-1+rpi1 armhf -libcap2 1:2.25-1.1 armhf -libcap2-bin 1:2.25-1.1 armhf -libcc1-0 7.2.0-12 armhf -libcilkrts5 7.2.0-12 armhf -libcomerr2 1.43.7-1 armhf +libcap2 1:2.25-1.2 armhf +libcap2-bin 1:2.25-1.2 armhf +libcc1-0 8-20180218-1+rpi1 armhf +libcilkrts5 7.3.0-5 armhf +libcom-err2 1.44.0-1 armhf +libcomerr2 1.44.0-1 armhf +libcryptsetup12 2:2.0.1-1 armhf -libcurl3 7.56.1-1 armhf -libcurl3-gnutls 7.56.1-1 armhf -libcwidget3v5 0.5.17-6 armhf +libcurl3 7.58.0-2 armhf +libcurl3-gnutls 7.58.0-2 armhf +libcwidget3v5 0.5.17-7 armhf -libdbus-1-3 1.12.0-1 armhf -libdbus-glib-1-2 0.108-2 armhf -libdebconfclient0 0.232 armhf -libdevmapper1.02.1 2:1.02.142-1 armhf +libdbus-1-3 1.12.6-2 armhf +libdbus-glib-1-2 0.110-2 armhf +libdebconfclient0 0.241 armhf +libdevmapper1.02.1 2:1.02.145-4.1 armhf +libdns-export169 1:9.11.2.P1-1 armhf -libdpkg-perl 1.19.0.4 all -libdrm-common 2.4.85-1+rpi1 all -libdrm2 2.4.85-1+rpi1 armhf -libdw1 0.170-0.1 armhf +libdns169 1:9.11.2.P1-1 armhf +libdpkg-perl 1.19.0.5 all +libdrm-common 2.4.90-1+rpi1 all +libdrm2 2.4.90-1+rpi1 armhf +libdw1 0.170-0.3 armhf -libelf1 0.170-0.1 armhf +libelf1 0.170-0.3 armhf -libexpat1 2.2.3-1 armhf -libexpat1-dev 2.2.3-1 armhf -libfakeroot 1.22-1 armhf -libfastjson4 0.99.7-1 armhf -libfdisk1 2.30.2-0.1 armhf -libffi6 3.2.1-6 armhf -libfftw3-single3 3.3.6p2-2 armhf +libexpat1 2.2.5-3 armhf +libexpat1-dev 2.2.5-3 armhf +libext2fs2 1.44.0-1 armhf +libfakeroot 1.22-2 armhf +libfastjson4 0.99.8-2 armhf +libfdisk1 2.31.1-0.4 armhf +libffi6 3.2.1-8 armhf +libfftw3-single3 3.3.7-1 armhf -libfontconfig1 2.12.3-0.2 armhf -libfreetype6 2.8.1-0.1 armhf -libfreetype6-dev 2.8.1-0.1 armhf +libfontconfig1 2.12.6-0.1 armhf +libfreetype6 2.8.1-2 armhf +libfreetype6-dev 2.8.1-2 armhf -libgcc-6-dev 6.4.0-6 armhf -libgcc-7-dev 7.2.0-12 armhf -libgcc1 1:7.2.0-12 armhf -libgcrypt20 1.7.9-1 armhf +libgcc-6-dev 6.4.0-12+rpi1 armhf +libgcc-7-dev 7.3.0-5 armhf +libgcc1 1:8-20180218-1+rpi1 armhf +libgcrypt20 1.8.1-4 armhf +libgdbm-compat4 1.14.1-4 armhf -libgeoip1 1.6.11-2 armhf -libgfortran4 7.2.0-12 armhf -libgirepository-1.0-1 1.54.1-2 armhf -libglib2.0-0 2.54.1-1 armhf -libglib2.0-data 2.54.1-1 all -libgmp10 2:6.1.2+dfsg-1.1 armhf -libgnutls30 3.5.16-1 armhf -libgomp1 7.2.0-12 armhf -libgpg-error0 1.27-4 armhf -libgpm2 1.20.4-6.2 armhf -libgssapi-krb5-2 1.15.2-2 armhf -libhogweed4 3.3-2 armhf +libgdbm5 1.14.1-4 armhf +libgeoip1 1.6.12-1 armhf +libgfortran4 7.3.0-5 armhf +libgirepository-1.0-1 1.54.1-4 armhf +libglib2.0-0 2.54.3-2 armhf +libglib2.0-data 2.54.3-2 all +libgmp10 2:6.1.2+dfsg-3 armhf +libgnutls30 3.5.18-1 armhf +libgomp1 8-20180218-1+rpi1 armhf +libgpg-error0 1.27-6 armhf +libgpm2 1.20.7-5 armhf +libgssapi-krb5-2 1.16-2 armhf +libhogweed4 3.4-1 armhf -libhtml-tree-perl 5.03-2 all -libhttp-cookies-perl 6.01-1 all +libhtml-tree-perl 5.07-1 all +libhttp-cookies-perl 6.04-1 all -libhttp-message-perl 6.13-1 all +libhttp-message-perl 6.14-1 all +libi2c0 4.0-2 armhf -libidn11 1.33-2 armhf -libidn2-0 2.0.2-5 armhf +libidn11 1.33-2.1 armhf +libidn2-0 2.0.4-1.1 armhf -libio-socket-ssl-perl 2.052-1 all -libip4tc0 1.6.1-2+b1 armhf -libip6tc0 1.6.1-2+b1 armhf -libiptc0 1.6.1-2+b1 armhf +libio-socket-ssl-perl 2.056-1 all +libip4tc0 1.6.2-1 armhf +libip6tc0 1.6.2-1 armhf +libiptc0 1.6.2-1 armhf +libirs-export160 1:9.11.2.P1-1 armhf +libirs160 1:9.11.2.P1-1 armhf +libisc-export166 1:9.11.2.P1-1 armhf +libisc166 1:9.11.2.P1-1 armhf +libisccc160 1:9.11.2.P1-1 armhf +libisccfg-export160 1:9.11.2.P1-1 armhf +libisccfg160 1:9.11.2.P1-1 armhf -libjim0.77 0.77-2 armhf -libjpeg62-turbo 1:1.5.2-2 armhf +libjim0.77 0.77+dfsg0-2 armhf +libjpeg62-turbo 1:1.5.2-2+b1 armhf -libjs-sphinxdoc 1.6.5-2 all +libjs-sphinxdoc 1.6.7-1 all -libk5crypto3 1.15.2-2 armhf -libkeyutils1 1.5.9-9 armhf -libklibc 2.0.4-9+rpi1 armhf -libkmod2 24-1 armhf -libkrb5-3 1.15.2-2 armhf -libkrb5support0 1.15.2-2 armhf +libjson-c3 0.12.1-1.3 armhf +libk5crypto3 1.16-2 armhf +libkeyutils1 1.5.9-9.2 armhf +libklibc 2.0.4-11+rpi1 armhf +libkmod2 25-1 armhf +libkrb5-3 1.16-2 armhf +libkrb5support0 1.16-2 armhf +liblmdb0 0.9.21-1 armhf -liblockfile-bin 1.14-1 armhf -liblockfile1 1.14-1 armhf -liblogging-stdlog0 1.0.6-1 armhf +liblockfile-bin 1.14-1.1 armhf +liblockfile1 1.14-1.1 armhf +liblogging-stdlog0 1.0.6-3 armhf +liblwres160 1:9.11.2.P1-1 armhf -libmagic-mgc 1:5.32-1 armhf -libmagic1 1:5.32-1 armhf +libmagic-mgc 1:5.32-2 armhf +libmagic1 1:5.32-2 armhf -libmount1 2.30.2-0.1 armhf -libmpc3 1.0.3-2 armhf +libmount1 2.31.1-0.4 armhf +libmpc3 1.1.0-1 armhf +libmpfr6 4.0.0-7 armhf -libncurses5 6.0+20170902-1 armhf -libncursesw5 6.0+20170902-1 armhf +libncurses5 6.1-1 armhf +libncursesw5 6.1-1 armhf -libnet-ssleay-perl 1.80-1+b1 armhf +libnet-ssleay-perl 1.84-1 armhf -libnettle6 3.3-2 armhf -libnewt0.52 0.52.20-1+b1 armhf +libnettle6 3.4-1 armhf +libnewt0.52 0.52.20-3 armhf -libnghttp2-14 1.27.0-1 armhf -libnginx-mod-http-auth-pam 1.13.6-2 armhf -libnginx-mod-http-dav-ext 1.13.6-2 armhf -libnginx-mod-http-echo 1.13.6-2 armhf -libnginx-mod-http-geoip 1.13.6-2 armhf -libnginx-mod-http-image-filter 1.13.6-2 armhf -libnginx-mod-http-subs-filter 1.13.6-2 armhf -libnginx-mod-http-upstream-fair 1.13.6-2 armhf -libnginx-mod-http-xslt-filter 1.13.6-2 armhf -libnginx-mod-mail 1.13.6-2 armhf -libnginx-mod-stream 1.13.6-2 armhf -libnih-dbus1 1.0.3-8 armhf -libnih1 1.0.3-8 armhf +libnghttp2-14 1.31.0-1 armhf +libnginx-mod-http-auth-pam 1.13.9-1 armhf +libnginx-mod-http-dav-ext 1.13.9-1 armhf +libnginx-mod-http-echo 1.13.9-1 armhf +libnginx-mod-http-geoip 1.13.9-1 armhf +libnginx-mod-http-image-filter 1.13.9-1 armhf +libnginx-mod-http-subs-filter 1.13.9-1 armhf +libnginx-mod-http-upstream-fair 1.13.9-1 armhf +libnginx-mod-http-xslt-filter 1.13.9-1 armhf +libnginx-mod-mail 1.13.9-1 armhf +libnginx-mod-stream 1.13.9-1 armhf +libnih-dbus1 1.0.3-10+b9 armhf +libnih1 1.0.3-10+b9 armhf -libnpth0 1.5-2 armhf +libnpth0 1.5-3 armhf +libnss-systemd 237-3+b1 armhf -libpam-modules 1.1.8-3.6+rpi1 armhf -libpam-modules-bin 1.1.8-3.6+rpi1 armhf -libpam-runtime 1.1.8-3.6+rpi1 all -libpam-systemd 235-2 armhf -libpam0g 1.1.8-3.6+rpi1 armhf -libparted2 3.2-18 armhf -libpcap0.8 1.8.1-5 armhf -libpcre2-8-0 10.22-3 armhf -libpcre3 2:8.39-4 armhf -libpcsclite1 1.8.22-1 armhf -libperl5.26 5.26.1-2 armhf -libpipeline1 1.4.2-1 armhf -libplymouth4 0.9.3-1 armhf +libpam-modules 1.1.8-3.7 armhf +libpam-modules-bin 1.1.8-3.7 armhf +libpam-runtime 1.1.8-3.7 all +libpam-systemd 237-3+b1 armhf +libpam0g 1.1.8-3.7 armhf +libparted2 3.2-20 armhf +libpcap0.8 1.8.1-6 armhf +libpcre2-8-0 10.31-3 armhf +libpcre3 2:8.39-9 armhf +libpcsclite1 1.8.23-1 armhf +libperl5.26 5.26.1-5 armhf +libpipeline1 1.5.0-1 armhf +libplymouth4 0.9.3-2 armhf -libprocps6 2:3.3.12-3 armhf -libpsl5 0.18.0-4 armhf -libpython-stdlib 2.7.14-1 armhf -libpython2.7-minimal 2.7.14-2 armhf -libpython2.7-stdlib 2.7.14-2 armhf -libpython3-dev 3.6.3-2 armhf -libpython3-stdlib 3.6.3-2 armhf +libprocps6 2:3.3.12-4 armhf +libpsl5 0.19.1-5 armhf +libpython-stdlib 2.7.14-4 armhf +libpython2.7-minimal 2.7.14-6 armhf +libpython2.7-stdlib 2.7.14-6 armhf +libpython3-dev 3.6.4-1 armhf +libpython3-stdlib 3.6.4-1 armhf -libpython3.6 3.6.3-1 armhf -libpython3.6-dev 3.6.3-1 armhf -libpython3.6-minimal 3.6.3-1 armhf -libpython3.6-stdlib 3.6.3-1 armhf -libraspberrypi-bin 1.20170811-1 armhf -libraspberrypi-dev 1.20170811-1 armhf -libraspberrypi-doc 1.20170811-1 armhf -libraspberrypi0 1.20170811-1 armhf +libpython3.6 3.6.4-4 armhf +libpython3.6-dev 3.6.4-4 armhf +libpython3.6-minimal 3.6.4-4 armhf +libpython3.6-stdlib 3.6.4-4 armhf +libraspberrypi-bin 1.20180313-1 armhf +libraspberrypi-dev 1.20180313-1 armhf +libraspberrypi-doc 1.20180313-1 armhf +libraspberrypi0 1.20180313-1 armhf -libruby2.3 2.3.3-1+deb9u1+rpi1 armhf -libsamplerate0 0.1.9-1 armhf +libruby2.3 2.3.6-2+rpi1 armhf +libruby2.5 2.5.0-6+rpi1 armhf +libsamplerate0 0.1.9-2 armhf -libsigsegv2 2.11-1 armhf -libslang2 2.3.1a-1 armhf -libsmartcols1 2.30.2-0.1 armhf -libsqlite3-0 3.20.1-2 armhf -libss2 1.43.7-1 armhf +libsigsegv2 2.12-1 armhf +libslang2 2.3.2-1 armhf +libsmartcols1 2.31.1-0.4 armhf +libsqlite3-0 3.22.0-1 armhf +libss2 1.44.0-1 armhf -libssl1.0.2 1.0.2l-2 armhf +libssl1.0.2 1.0.2n-1 armhf -libstdc++-7-dev 7.2.0-12 armhf -libstdc++6 7.2.0-12 armhf +libstdc++-7-dev 7.3.0-5 armhf +libstdc++6 8-20180218-1+rpi1 armhf -libsystemd0 235-2 armhf +libsystemd0 237-3+b1 armhf -libtasn1-6 4.12-2.1 armhf -libtcl8.6 8.6.7+dfsg-1 armhf +libtasn1-6 4.13-2 armhf +libtcl8.6 8.6.8+dfsg-3 armhf -libtiff5 4.0.8-6 armhf +libtiff5 4.0.9-4 armhf -libtinfo5 6.0+20170902-1 armhf +libtinfo5 6.1-1 armhf -libtry-tiny-perl 0.28-1 all -libubsan0 7.2.0-12 armhf +libtry-tiny-perl 0.30-1 all +libubsan0 7.3.0-5 armhf -libudev1 235-2 armhf +libudev1 237-3+b1 armhf -libunistring2 0.9.7-2 armhf -liburi-perl 1.72-2 all +libunistring2 0.9.8-1 armhf +liburi-perl 1.73-1 all -libuuid1 2.30.2-0.1 armhf -libv4l-0 1.12.5-1 armhf -libv4l2rds0 1.12.5-1 armhf -libv4lconvert0 1.12.5-1 armhf -libwbclient0 2:4.7.0+dfsg-2 armhf -libwebp6 0.6.0-3 armhf +libuuid1 2.31.1-0.4 armhf +libv4l-0 1.14.2-1 armhf +libv4l2rds0 1.14.2-1 armhf +libv4lconvert0 1.14.2-1 armhf +libwbclient0 2:4.7.4+dfsg-2 armhf +libwebp6 0.6.1-2 armhf -libwww-perl 6.27-1 all +libwww-perl 6.31-1 all -libxcb1 1.12-1 armhf +libxcb1 1.13-1 armhf -libxml2 2.9.4+dfsg1-5 armhf +libxml2 2.9.4+dfsg1-6.1 armhf -libxslt1.1 1.1.29-2.2 armhf -libxtables12 1.6.1-2+b1 armhf +libxslt1.1 1.1.29-5 armhf +libxtables12 1.6.2-1 armhf -linux-libc-dev 4.9.51-1+rpi3+b1 armhf -locales 2.24-17 all +linux-libc-dev 4.15.4-1+rpi1 armhf +locales 2.27-1+rpi1 all -man-db 2.7.6.1-2 armhf -manpages 4.13-3 all -manpages-dev 4.13-3 all +man-db 2.8.2-1 armhf +manpages 4.15-1 all +manpages-dev 4.15-1 all -mount 2.30.2-0.1 armhf +mount 2.31.1-0.4 armhf -multiarch-support 2.24-17 armhf +multiarch-support 2.27-1+rpi1 armhf -nano 2.8.7-1 armhf +nano 2.9.3-2 armhf -ncurses-base 6.0+20170902-1 all -ncurses-bin 6.0+20170902-1 armhf -ncurses-term 6.0+20170902-1 all +ncurses-base 6.1-1 all +ncurses-bin 6.1-1 armhf +ncurses-term 6.1-1 all -net-tools 1.60+git20161116.90da8a0-1 armhf +net-tools 1.60+git20161116.90da8a0-2 armhf -netcat-openbsd 1.178-3 armhf +netcat-openbsd 1.187-1 armhf -nfs-common 1:1.3.4-2.1+b1 armhf -nginx 1.13.6-2 all -nginx-common 1.13.6-2 all -nginx-full 1.13.6-2 armhf +nfs-common 1:1.3.4-2.2 armhf +nginx-common 1.13.9-1 all -openssh-client 1:7.6p1-2 armhf -openssh-server 1:7.6p1-2 armhf -openssh-sftp-server 1:7.6p1-2 armhf +openssh-client 1:7.6p1-4 armhf +openssh-server 1:7.6p1-4 armhf +openssh-sftp-server 1:7.6p1-4 armhf -parted 3.2-18 armhf +parted 3.2-20 armhf -patch 2.7.5-1 armhf +patch 2.7.6-1 armhf -perl 5.26.1-2 armhf -perl-base 5.26.1-2 armhf -perl-modules-5.26 5.26.1-2 all +perl 5.26.1-5 armhf +perl-base 5.26.1-5 armhf +perl-modules-5.26 5.26.1-5 all -pi-bluetooth 0.1.6 armhf -pinentry-curses 1.0.0-3 armhf +pi-bluetooth 0.1.7 all +pinentry-curses 1.1.0-1 armhf -plymouth 0.9.3-1 armhf +plymouth 0.9.3-2 armhf -procps 2:3.3.12-3 armhf +procps 2:3.3.12-4 armhf -python 2.7.14-1 armhf -python-acme 0.19.0-1 all +python 2.7.14-4 armhf +python-acme 0.21.1-1 all -python-asn1crypto 0.22.0-1 all +python-asn1crypto 0.24.0-1 all -python-certbot 0.19.0-1 all -python-certifi 2017.7.27.1-2 all -python-cffi-backend 1.9.1-2+b1 armhf +python-certifi 2018.1.18-2 all +python-cffi-backend 1.11.5-1 armhf -python-cryptography 1.9-1 armhf -python-enum34 1.1.6-1 all -python-eyed3 0.8-1 all -python-funcsigs 1.0.2-3 all +python-cryptography 2.1.4-1 armhf +python-enum34 1.1.6-2 all +python-eyed3 0.8.4-2 all +python-funcsigs 1.0.2-4 all -python-idna 2.5-1 all +python-idna 2.6-1 all +python-josepy 1.0.1-1 all -python-minimal 2.7.14-1 armhf +python-magic 2:0.4.15-1 all +python-minimal 2.7.14-4 armhf -python-newt 0.52.20-1+b1 armhf -python-openssl 16.2.0-1 all +python-newt 0.52.20-3 armhf +python-openssl 17.5.0-1 all -python-pbr 3.1.1-2 all -python-pip-whl 9.0.1-2+rpt1 all -python-pkg-resources 36.6.0-1 all +python-pbr 3.1.1-4 all +python-pip-whl 9.0.1-2+rpt2 all +python-pkg-resources 38.5.2-1 all -python-requests 2.18.1-1 all +python-requests 2.18.4-2 all -python-setuptools 36.6.0-1 all -python-six 1.11.0-1 all -python-tz 2017.2-2 all -python-urllib3 1.21.1-1 all +python-setuptools 38.5.2-1 all +python-six 1.11.0-2 all +python-tz 2018.3-2 all +python-urllib3 1.22-1 all -python2.7 2.7.14-2 armhf -python2.7-minimal 2.7.14-2 armhf -python3 3.6.3-2 armhf +python2.7 2.7.14-6 armhf +python2.7-minimal 2.7.14-6 armhf +python3 3.6.4-1 armhf +python3-acme 0.21.1-1 all -python3-asn1crypto 0.22.0-1 all -python3-cffi-backend 1.9.1-2+b1 armhf -python3-crypto 2.6.1-7+b1 armhf -python3-cryptography 1.9-1 armhf -python3-dbus 1.2.4-1+b1 armhf -python3-debconf 1.5.64 all -python3-dev 3.6.3-2 armhf -python3-gi 3.24.1-3+rpi1 armhf -python3-idna 2.5-1 all -python3-keyring 10.4.0-1 all -python3-keyrings.alt 2.2-2 all -python3-minimal 3.6.3-2 armhf -python3-pip 9.0.1-2+rpt1 all -python3-pkg-resources 36.6.0-1 all +python3-asn1crypto 0.24.0-1 all +python3-certbot 0.21.1-1 all +python3-certifi 2018.1.18-2 all +python3-cffi-backend 1.11.5-1 armhf +python3-chardet 3.0.4-1 all +python3-configargparse 0.11.0-1 all +python3-configobj 5.0.6-2 all +python3-crypto 2.6.1-8 armhf +python3-cryptography 2.1.4-1 armhf +python3-dbus 1.2.6-1 armhf +python3-debconf 1.5.66 all +python3-dev 3.6.4-1 armhf +python3-distutils 3.6.4-4 all +python3-eyed3 0.8.4-2 all +python3-future 0.15.2-4 all +python3-gi 3.26.1-2 armhf +python3-idna 2.6-1 all +python3-josepy 1.0.1-1 all +python3-keyring 10.6.0-1 all +python3-keyrings.alt 3.0-1 all +python3-lib2to3 3.6.4-4 all +python3-magic 2:0.4.15-1 all +python3-minimal 3.6.4-1 armhf +python3-mock 2.0.0-3 all +python3-openssl 17.5.0-1 all +python3-parsedatetime 2.4-2 all +python3-pbr 3.1.1-4 all +python3-pip 9.0.1-2+rpt2 all +python3-pkg-resources 38.5.2-1 all +python3-requests 2.18.4-2 all +python3-rfc3339 1.0-4 all -python3-setuptools 36.6.0-1 all -python3-six 1.11.0-1 all +python3-setuptools 38.5.2-1 all +python3-six 1.11.0-2 all -python3-wheel 0.29.0-2 all +python3-tz 2018.3-2 all +python3-urllib3 1.22-1 all +python3-wheel 0.30.0-0.2 all +python3-zope.component 4.3.0-1 all +python3-zope.event 4.2.0-1 all +python3-zope.hookable 4.0.4-4+b2 armhf +python3-zope.interface 4.3.2-1+b1 armhf -python3.6 3.6.3-1 armhf -python3.6-dev 3.6.3-1 armhf -python3.6-minimal 3.6.3-1 armhf -rake 12.0.0-1 all -raspberrypi-bootloader 1.20170811-1 armhf -raspberrypi-kernel 1.20170811-1 armhf +python3.6 3.6.4-4 armhf +python3.6-dev 3.6.4-4 armhf +python3.6-minimal 3.6.4-4 armhf +rake 12.3.0-1 all +raspberrypi-bootloader 1.20180313-1 armhf +raspberrypi-kernel 1.20180313-1 armhf -raspberrypi-sys-mods 20170717 armhf +raspberrypi-sys-mods 20180315 armhf -raspi-config 20170926 all +raspi-config 20180228 all +rfkill 2.31.1-0.4 armhf -rsync 3.1.2-2 armhf -rsyslog 8.29.0-2 armhf -ruby 1:2.3.3 armhf +rsync 3.1.2-2.1 armhf +rsyslog 8.33.1-1 armhf +ruby 1:2.5.0 armhf -ruby2.3 2.3.3-1+deb9u1+rpi1 armhf +ruby2.3 2.3.6-2+rpi1 armhf +ruby2.5 2.5.0-6+rpi1 armhf -samba-common 2:4.7.0+dfsg-2 all +samba-common 2:4.7.4+dfsg-2 all -sed 4.4-1 armhf +sed 4.4-2 armhf -sensible-utils 0.0.10 all +sensible-utils 0.0.11 all -ssh 1:7.6p1-2 all -strace 4.19-1 armhf -sudo 1.8.21p2-2 armhf -systemd 235-2 armhf -systemd-sysv 235-2 armhf +ssh 1:7.6p1-4 all +strace 4.21-1 armhf +sudo 1.8.21p2-3 armhf +systemd 237-3+b1 armhf +systemd-sysv 237-3+b1 armhf -tasksel 3.42 all -tasksel-data 3.42 all +tasksel 3.43 all +tasksel-data 3.43 all -tmux 2.6-1 armhf +tmux 2.6-3 armhf -tzdata 2017c-1 all -ucf 3.0036 all -udev 235-2 armhf +tzdata 2018c-1 all +ucf 3.0038 all +udev 237-3+b1 armhf -usb-modeswitch 2.5.1+repack0-1+b1 armhf -usb-modeswitch-data 20170806-1 all +usb-modeswitch 2.5.2+repack0-2 armhf +usb-modeswitch-data 20170806-2 all -util-linux 2.30.2-0.1 armhf -v4l-utils 1.12.5-1 armhf +util-linux 2.31.1-0.4 armhf +v4l-utils 1.14.2-1 armhf -vim-common 2:8.0.1144-1 all -vim-nox 2:8.0.1144-1 armhf -vim-runtime 2:8.0.1144-1 all -vim-tiny 2:8.0.1144-1 armhf -vnstat 1.15-2 armhf -wget 1.19.2-1 armhf -whiptail 0.52.20-1+b1 armhf -whois 5.2.18 armhf +vim-common 2:8.0.1453-1 all +vim-nox 2:8.0.1453-1 armhf +vim-runtime 2:8.0.1453-1 all +vim-tiny 2:8.0.1453-1 armhf +vnstat 1.17-1 armhf +wget 1.19.4-1 armhf +whiptail 0.52.20-3 armhf +whois 5.3.0 armhf -wpasupplicant 2:2.4-1.1 armhf -xauth 1:1.0.9-1 armhf -xdg-user-dirs 0.15-3 armhf -xkb-data 2.19-1.1 all +wpasupplicant 2:2.6-15 armhf +xauth 1:1.0.10-1 armhf +xdg-user-dirs 0.16-1 armhf +xkb-data 2.23.1-1 all -xxd 2:8.0.1144-1 armhf +xxd 2:8.0.1453-1 armhf -zsh 5.4.2-1 armhf -zsh-common 5.4.2-1 all +zsh 5.4.2-3 armhf +zsh-common 5.4.2-3 all
7 years ago
@staticmethod
def isAvailable(timeout=1):
try:
response = urlopen(Request("/".join([BadIPsAction._badips]),
headers={'User-Agent': "Fail2Ban"}), timeout=timeout)
return True, ''
except Exception as e: # pragma: no cover
return False, e
7 years ago
def getCategories(self, incParents=False):
"""Get badips.com categories.
Returns
-------
set
Set of categories.
Raises
------
HTTPError
Any issues with badips.com request.
ValueError
If badips.com response didn't contain necessary information
"""
try:
response = urlopen(
self._Request("/".join([self._badips, "get", "categories"])), timeout=self.timeout)
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Failed to fetch categories. badips.com response: '%s'",
messages['err'])
raise
else:
response_json = json.loads(response.read().decode('utf-8'))
if not 'categories' in response_json:
err = "badips.com response lacked categories specification. Response was: %s" \
% (response_json,)
self._logSys.error(err)
raise ValueError(err)
categories = response_json['categories']
categories_names = set(
value['Name'] for value in categories)
if incParents:
categories_names.update(set(
value['Parent'] for value in categories
if "Parent" in value))
return categories_names
def getList(self, category, score, age, key=None):
"""Get badips.com list of bad IPs.
Parameters
----------
category : str
Valid badips.com category.
score : int
Minimum score for bad IPs.
age : str
Age of last report for bad IPs, per badips.com syntax.
key : str, optional
Key issued by badips.com to fetch IPs reported with the
associated key.
Returns
-------
set
Set of bad IPs.
Raises
------
HTTPError
Any issues with badips.com request.
"""
try:
url = "?".join([
"/".join([self._badips, "get", "list", category, str(score)]),
urlencode({'age': age})])
if key:
url = "&".join([url, urlencode({'key': key})])
response = urlopen(self._Request(url), timeout=self.timeout)
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Failed to fetch bad IP list. badips.com response: '%s'",
messages['err'])
raise
else:
return set(response.read().decode('utf-8').split())
@property
def category(self):
"""badips.com category for reporting IPs.
"""
return self._category
@category.setter
def category(self, category):
if category not in self.getCategories():
self._logSys.error("Category name '%s' not valid. "
"see badips.com for list of valid categories",
category)
raise ValueError("Invalid category: %s" % category)
self._category = category
@property
def bancategory(self):
"""badips.com bancategory for fetching IPs.
"""
return self._bancategory
@bancategory.setter
def bancategory(self, bancategory):
if bancategory not in self.getCategories(incParents=True):
self._logSys.error("Category name '%s' not valid. "
"see badips.com for list of valid categories",
bancategory)
raise ValueError("Invalid bancategory: %s" % bancategory)
self._bancategory = bancategory
@property
def score(self):
"""badips.com minimum score for fetching IPs.
"""
return self._score
@score.setter
def score(self, score):
score = int(score)
if 0 <= score <= 5:
self._score = score
else:
raise ValueError("Score must be 0-5")
@property
def banaction(self):
"""Jail action to use for banning/unbanning.
"""
return self._banaction
@banaction.setter
def banaction(self, banaction):
if banaction is not None and banaction not in self._jail.actions:
self._logSys.error("Action name '%s' not in jail '%s'",
banaction, self._jail.name)
raise ValueError("Invalid banaction")
self._banaction = banaction
@property
def updateperiod(self):
"""Period in seconds between banned bad IPs will be updated.
"""
return self._updateperiod
@updateperiod.setter
def updateperiod(self, updateperiod):
updateperiod = int(updateperiod)
if updateperiod > 0:
self._updateperiod = updateperiod
else:
raise ValueError("Update period must be integer greater than 0")
def _banIPs(self, ips):
for ip in ips:
try:
self._jail.actions[self.banaction].ban({
'ip': ip,
'failures': 0,
'matches': "",
'ipmatches': "",
'ipjailmatches': "",
})
except Exception as e:
self._logSys.error(
"Error banning IP %s for jail '%s' with action '%s': %s",
ip, self._jail.name, self.banaction, e,
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
else:
self._bannedips.add(ip)
self._logSys.info(
"Banned IP %s for jail '%s' with action '%s'",
ip, self._jail.name, self.banaction)
def _unbanIPs(self, ips):
for ip in ips:
try:
self._jail.actions[self.banaction].unban({
'ip': ip,
'failures': 0,
'matches': "",
'ipmatches': "",
'ipjailmatches': "",
})
except Exception as e:
self._logSys.info(
"Error unbanning IP %s for jail '%s' with action '%s': %s",
ip, self._jail.name, self.banaction, e,
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
else:
self._logSys.info(
"Unbanned IP %s for jail '%s' with action '%s'",
ip, self._jail.name, self.banaction)
finally:
self._bannedips.remove(ip)
def start(self):
"""If `banaction` set, blacklists bad IPs.
"""
if self.banaction is not None:
self.update()
def update(self):
"""If `banaction` set, updates blacklisted IPs.
Queries badips.com for list of bad IPs, removing IPs from the
blacklist if no longer present, and adds new bad IPs to the
blacklist.
"""
if self.banaction is not None:
if self._timer:
self._timer.cancel()
self._timer = None
try:
ips = self.getList(
self.bancategory, self.score, self.age, self.bankey)
# Remove old IPs no longer listed
self._unbanIPs(self._bannedips - ips)
# Add new IPs which are now listed
self._banIPs(ips - self._bannedips)
self._logSys.info(
"Updated IPs for jail '%s'. Update again in %i seconds",
self._jail.name, self.updateperiod)
finally:
self._timer = threading.Timer(self.updateperiod, self.update)
self._timer.start()
def stop(self):
"""If `banaction` set, clears blacklisted IPs.
"""
if self.banaction is not None:
if self._timer:
self._timer.cancel()
self._timer = None
self._unbanIPs(self._bannedips.copy())
def ban(self, aInfo):
"""Reports banned IP to badips.com.
Parameters
----------
aInfo : dict
Dictionary which includes information in relation to
the ban.
Raises
------
HTTPError
Any issues with badips.com request.
"""
try:
url = "/".join([self._badips, "add", self.category, aInfo['ip']])
if self.key:
url = "?".join([url, urlencode({'key': self.key})])
response = urlopen(self._Request(url), timeout=self.timeout)
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Response from badips.com report: '%s'",
messages['err'])
raise
else:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.info(
"Response from badips.com report: '%s'",
messages['suc'])
Action = BadIPsAction