forked from polera/rblwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'integration' into mergetrunk
Conflicts: README.md
- Loading branch information
Showing
12 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# python | ||
.idea | ||
*.pyc | ||
# distutils | ||
dist/ | ||
MANIFEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
v0.2.2, 2015-02-09 -- Extend hostname with suffix dot for valid host checking | ||
v0.2.1, 2015-01-06 -- Remove additional ahbl lists that are no longer in service | ||
v0.2.0, 2014-12-27 -- Remove tor.ahbl.org because no longer in service | ||
v0.1.0, 2014-08-28 -- Initial release with pip package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Copyright (c) 2014, James Polera | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include *.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ Python3 | |
|
||
Author | ||
== | ||
James Polera <[email protected]> | ||
- James Polera <[email protected]> | ||
- Thomas Merkel <[email protected]> | ||
|
||
Usage | ||
== | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
# vim:expandtab shiftwidth=4 softtabstop=4 tabstop=8 | ||
|
||
from rblwatch.rblwatch import RBLSearch | ||
import socket | ||
|
||
try: | ||
hostname = socket.gethostname() + '.' | ||
for response in socket.getaddrinfo(hostname, None, 0, 1): | ||
ip = response[4][0] | ||
searcher = RBLSearch(ip) | ||
listed = searcher.listed | ||
for key in listed: | ||
if key == 'SEARCH_HOST': | ||
continue | ||
if not listed[key].get('ERROR'): | ||
if listed[key]['LISTED']: | ||
print("Results for %s: %s" % (key, listed[key]['LISTED'])) | ||
print(" + Host information: %s" % \ | ||
(listed[key]['HOST'])) | ||
if 'TEXT' in listed[key].keys(): | ||
print(" + Additional information: %s" % \ | ||
(listed[key]['TEXT'])) | ||
else: | ||
pass | ||
except: | ||
print("Hostname %s can't be resolved" % hostname) | ||
ip = "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python | ||
# vim:expandtab shiftwidth=4 softtabstop=4 tabstop=8 | ||
|
||
from rblwatch.rblwatch import RBLSearch | ||
from IPy import IP | ||
import socket | ||
import sys | ||
|
||
try: | ||
if len(sys.argv) > 1: | ||
print("Looking up: %s (please wait)" % sys.argv[1]) | ||
param = sys.argv[1] | ||
ips = set() | ||
|
||
try: | ||
# Is IP | ||
ips.add(IP(param)) | ||
except ValueError: | ||
# Is maybe an hostname | ||
try: | ||
for response in socket.getaddrinfo(param, None, 0, 1): | ||
ips.add(response[4][0]) | ||
except socket.error: | ||
print("IP %s can't be resolved" % param) | ||
|
||
# Output all information to stdout | ||
for ip in ips: | ||
searcher = RBLSearch(ip) | ||
searcher.print_results() | ||
else: | ||
print("""Usage summary: | ||
rblwatch <ip address to lookup> """) | ||
except KeyboardInterrupt: | ||
pass | ||
|
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[metadata] | ||
description-file = README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from distutils.core import setup | ||
setup( | ||
name = 'rblwatch', | ||
packages = ['rblwatch'], | ||
scripts = ['bin/rblcheck', 'bin/rblwatch'], | ||
version = '0.2.2', | ||
description = 'RBL lookups with Python', | ||
author = 'James Polera', | ||
author_email = '[email protected]', | ||
maintainer = 'Thomas Merkel', | ||
maintainer_email = '[email protected]', | ||
url = 'https://github.com/drscream/rblwatch', | ||
keywords = ['rbl', 'blacklist', 'mail'], | ||
install_requires = [ | ||
'IPy == 0.81', | ||
'dnspython == 1.11.1', | ||
], | ||
) |