Compare commits

...

12 commits
tab ... master

Author SHA1 Message Date
Knah Tsaeb 7fbdffa7d7 [add] count total per page 2015-07-21 16:02:24 +02:00
Knah Tsaeb 5563208160 [add] top ten service 2015-07-21 15:57:33 +02:00
Knah Tsaeb 58b5e86d5b [add] top ten service 2015-07-21 15:56:51 +02:00
Knah Tsaeb 772e83331d [fix] unknown flag 2015-07-21 15:49:41 +02:00
Knah Tsaeb 50ca517960 [fix] bad currentBan report 2015-07-21 15:37:55 +02:00
Knah Tsaeb dfa164d699 [fix] fuck me and my bad copy/paste 2015-07-13 09:59:01 +02:00
Knah Tsaeb 59fab70b75 [add] possibility to sort all columns 2015-07-07 17:13:49 +02:00
Knah Tsaeb 860344923c [fix] fuck distro using dash over bash 2015-07-06 13:28:54 +02:00
Knah Tsaeb af5fb34c70 [fix] using bash for system use dash over bash 2015-07-06 10:41:23 +02:00
Knah Tsaeb 3a311113b2 [chg] width of cell 2015-07-03 16:40:18 +02:00
Knah Tsaeb 8561ebc1e6 [add] if geoIP.dat exist use it 2015-07-03 16:18:06 +02:00
Knah Tsaeb 94f61fcdc6 [add] print flag 2015-07-03 16:04:10 +02:00
260 changed files with 396 additions and 63 deletions

View file

@ -49,7 +49,7 @@ body {
}
.cell {
width: 10em;
width: 12em;
padding: 0.4em;
display: table-cell;
text-align: center;

View file

@ -4,31 +4,42 @@ action=$1
ip=$2
service=$3
curDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
echo $curDir
curDir=$(dirname $0)
source $curDir/bancount.cfg
cd $curDir
source bancount.cfg
if [ -f "GeoIP.dat" ]
then
allInfoIp=`geoiplookup $ip`;
else
allInfoIp=`geoiplookup -f GeoIP.dat $ip`;
fi
geoip () {
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
echo $allInfoIp | awk -F, '{print $2}' | sed s/\ //
}
countryCode () {
echo $allInfoIp $ip | awk -F ": " '{ print $2 }' | awk -F "," '{ print $1 }' | head -n 1
}
case $action in
ban)
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO bans (ip, service, ban_date, ban_time, country) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip $ip`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO bans (ip, service, ban_date, ban_time, country, countryCode) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip`', '`countryCode`');"
;;
unban)
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO unbans (ip, service, unban_date, unban_time, country) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip $ip`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO unbans (ip, service, unban_date, unban_time, country, countryCode) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip`', '`countryCode`');"
;;
*)
cat << EOF
cat << EOF
Fail2BanCount - by k6b - MySQL logger
$(basename $0) <ban/unban> <ip>
$(basename $0) <ban/unban> <ip> <service>
Performs geoip lookup and stamps time
and date into MySQL database.

View file

@ -29,6 +29,7 @@ CREATE TABLE `bans` (
`ban_date` varchar(10) DEFAULT NULL,
`ban_time` varchar(8) DEFAULT NULL,
`country` char(50) NOT NULL DEFAULT 'Martians!',
`countryCode` char(3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@ -47,6 +48,7 @@ CREATE TABLE `unbans` (
`unban_date` varchar(10) DEFAULT NULL,
`unban_time` varchar(8) DEFAULT NULL,
`country` char(50) DEFAULT NULL,
`countryCode` char(3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

BIN
img/flag/16/ad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
img/flag/16/ae.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

BIN
img/flag/16/af.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
img/flag/16/ag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/flag/16/ai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
img/flag/16/al.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
img/flag/16/am.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

BIN
img/flag/16/an.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

BIN
img/flag/16/ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
img/flag/16/aq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/ar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

BIN
img/flag/16/as.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
img/flag/16/at.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

BIN
img/flag/16/au.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/aw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

BIN
img/flag/16/ax.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

BIN
img/flag/16/az.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

BIN
img/flag/16/ba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

BIN
img/flag/16/bb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/bd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

BIN
img/flag/16/be.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
img/flag/16/bf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
img/flag/16/bh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
img/flag/16/bi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
img/flag/16/bj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/bl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/bm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
img/flag/16/bn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
img/flag/16/bo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/br.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

BIN
img/flag/16/bs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

BIN
img/flag/16/bt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
img/flag/16/bv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

BIN
img/flag/16/bw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

BIN
img/flag/16/by.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
img/flag/16/bz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

BIN
img/flag/16/ca.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

BIN
img/flag/16/cc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/cd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

BIN
img/flag/16/cf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/flag/16/cg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/ch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/ci.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/ck.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

BIN
img/flag/16/cl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
img/flag/16/cm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/cn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
img/flag/16/co.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
img/flag/16/cr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

BIN
img/flag/16/cu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

BIN
img/flag/16/cv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
img/flag/16/cx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

BIN
img/flag/16/cy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
img/flag/16/cz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
img/flag/16/de.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
img/flag/16/dj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
img/flag/16/dk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/dm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/do.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
img/flag/16/dz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/ec.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
img/flag/16/ee.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

BIN
img/flag/16/eg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

BIN
img/flag/16/eh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

BIN
img/flag/16/er.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

BIN
img/flag/16/es.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

BIN
img/flag/16/et.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

BIN
img/flag/16/fi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

BIN
img/flag/16/fj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

BIN
img/flag/16/fk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/fm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

BIN
img/flag/16/fo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
img/flag/16/fr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/ga.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

BIN
img/flag/16/gb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

BIN
img/flag/16/gd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

BIN
img/flag/16/ge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
img/flag/16/gf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/gg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/gh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

BIN
img/flag/16/gi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
img/flag/16/gl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

BIN
img/flag/16/gm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

BIN
img/flag/16/gn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

BIN
img/flag/16/gp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/gq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/gr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
img/flag/16/gs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/gt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

BIN
img/flag/16/gu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

BIN
img/flag/16/gw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

BIN
img/flag/16/gy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
img/flag/16/hk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/hm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/hn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
img/flag/16/hr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Some files were not shown because too many files have changed in this diff Show more