You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
595 B
30 lines
595 B
8 years ago
|
#
|
||
|
#
|
||
|
#
|
||
|
|
||
|
import netdb
|
||
|
|
||
|
|
||
|
from argparse import ArgumentParser as AP
|
||
|
|
||
|
from . import settings
|
||
|
from . import filter
|
||
|
from . import processor
|
||
|
|
||
|
def main():
|
||
|
ap = AP()
|
||
|
ap.add_argument("--settings", default="baddies.ini")
|
||
|
|
||
|
args = ap.parse_args()
|
||
|
s = settings.load(args.settings)
|
||
|
fmax = s.get("thresholds", "max_floodfills_per_ip", fallback=5)
|
||
|
f = filter.FloodfillFilter(fmax)
|
||
|
p = processor.BaddieProcessor([f])
|
||
|
netdb.inspect(p.hook)
|
||
|
with open(s.get("output", "file", fallback="baddies.txt"), 'w') as f:
|
||
|
p.write_blocklist(f)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|