Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gsauthof-utility
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
external
gsauthof-utility
Commits
66782922
Commit
66782922
authored
1 year ago
by
Georg Sauthoff
Browse files
Options
Downloads
Patches
Plain Diff
blacklist blocklist for ipv6
parent
bc68faed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check-dnsbl.py
+8
-0
8 additions, 0 deletions
check-dnsbl.py
gms-utils.spec
+1
-1
1 addition, 1 deletion
gms-utils.spec
with
9 additions
and
1 deletion
check-dnsbl.py
+
8
−
0
View file @
66782922
...
@@ -16,6 +16,9 @@ import sys
...
@@ -16,6 +16,9 @@ import sys
import
time
import
time
ipv6_incapable
=
{
'
bl.0spam.org
'
,
'
rbl.0spam.org
'
,
'
nbl.0spam.org
'
}
default_blacklists
=
[
default_blacklists
=
[
(
'
zen.spamhaus.org
'
,
'
Spamhaus SBL, XBL and PBL
'
,
'
https://www.spamhaus.org
'
),
(
'
zen.spamhaus.org
'
,
'
Spamhaus SBL, XBL and PBL
'
,
'
https://www.spamhaus.org
'
),
(
'
dnsbl.sorbs.net
'
,
'
SORBS aggregated
'
,
'
http://www.sorbs.net
'
),
(
'
dnsbl.sorbs.net
'
,
'
SORBS aggregated
'
,
'
http://www.sorbs.net
'
),
...
@@ -394,6 +397,8 @@ def check_dnsbl(addr, bl):
...
@@ -394,6 +397,8 @@ def check_dnsbl(addr, bl):
def
check_rdns
(
addrs
):
def
check_rdns
(
addrs
):
errs
=
0
errs
=
0
for
(
addr
,
domain
)
in
addrs
:
for
(
addr
,
domain
)
in
addrs
:
if
domain
is
None
:
continue
log
.
debug
(
'
Check if there is a reverse DNS record that maps address {} to {}
'
log
.
debug
(
'
Check if there is a reverse DNS record that maps address {} to {}
'
.
format
(
addr
,
domain
))
.
format
(
addr
,
domain
))
try
:
try
:
...
@@ -449,6 +454,9 @@ def check_bls(addrs, bls, dest, retries):
...
@@ -449,6 +454,9 @@ def check_bls(addrs, bls, dest, retries):
t
=
max
(
i
*
23
-
max
(
now
-
ts
,
0
),
0
)
t
=
max
(
i
*
23
-
max
(
now
-
ts
,
0
),
0
)
time
.
sleep
(
t
)
time
.
sleep
(
t
)
try
:
try
:
if
'
:
'
in
addr
and
bl
[
0
]
in
ipv6_incapable
:
log
.
debug
(
f
"
Ignoring
{
bl
[
0
]
}
because it doesn
'
t support IPv6 (
{
addr
}
)
"
)
continue
log
.
debug
(
f
'
Checking if address
{
addr
}
(via
{
dest
}
) is listed in
{
bl
[
0
]
}
(
{
bl
[
1
]
}
)
'
)
log
.
debug
(
f
'
Checking if address
{
addr
}
(via
{
dest
}
) is listed in
{
bl
[
0
]
}
(
{
bl
[
1
]
}
)
'
)
s
=
check_dnsbl
(
addr
,
bl
[
0
])
s
=
check_dnsbl
(
addr
,
bl
[
0
])
if
s
:
if
s
:
...
...
This diff is collapsed.
Click to expand it.
gms-utils.spec
+
1
−
1
View file @
66782922
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
%endif
%endif
Name: gms-utils
Name: gms-utils
Version: 0.6.
2
Version: 0.6.
3
Release: 1%{?dist}
Release: 1%{?dist}
Summary: Collection of command line utilities
Summary: Collection of command line utilities
URL: https://github.com/gsauthof/utility
URL: https://github.com/gsauthof/utility
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment