0x0

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit def5d9802f375b1ba9da443d8a889c175e2bdd3f
parent 2e509a1faf3f005da1291b3a31c79ed568f9370f
Author: Martin Herkt <lachs0r@srsfckn.biz>
Date:   Fri, 27 Oct 2017 02:21:33 +0200

Add querybl command to query uploads by addresses in blacklist

Diffstat:
Mfhost.py | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/fhost.py b/fhost.py @@ -438,5 +438,16 @@ def queryaddr(a): for f in res: query(su.enbase(f.id, 1)) +@manager.command +def querybl(): + if os.path.isfile(app.config["FHOST_UPLOAD_BLACKLIST"]): + with open(app.config["FHOST_UPLOAD_BLACKLIST"], "r") as bl: + for l in bl.readlines(): + if not l.startswith("#"): + if not ":" in l: + queryaddr("::ffff:" + l.rstrip()) + else: + queryaddr(l.strip()) + if __name__ == "__main__": manager.run()