Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
surykatka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
surykatka
Commits
0b516822
Commit
0b516822
authored
Feb 17, 2020
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bot: Correctly group IPs per URLs and DOMAINs
parent
72bcbb48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
38 deletions
+43
-38
src/surykatka/bot.py
src/surykatka/bot.py
+43
-38
No files found.
src/surykatka/bot.py
View file @
0b516822
...
@@ -249,20 +249,20 @@ class WebBot:
...
@@ -249,20 +249,20 @@ class WebBot:
url_dict
[
url
].
append
(
network_change
[
"ip"
])
url_dict
[
url
].
append
(
network_change
[
"ip"
])
# Report the SSL status
# Report the SSL status
result_dict
[
"ssl_certificate"
]
=
[]
for
ip_
,
domain_list_
in
server_ip_dict
.
items
():
query
=
reportSslCertificate
(
query
=
reportSslCertificate
(
self
.
_db
,
self
.
_db
,
ip
=
ip_
,
port
=
443
,
hostname
=
domain_list_
,
ip
=
[
x
for
x
in
server_ip_dict
.
keys
()],
port
=
443
,
hostname
=
domain_list
,
)
)
result_dict
[
"ssl_certificate"
]
=
[]
for
ssl_certificate
in
query
.
dicts
().
iterator
():
for
ssl_certificate
in
query
.
dicts
().
iterator
():
result_dict
[
"ssl_certificate"
].
append
(
result_dict
[
"ssl_certificate"
].
append
(
{
{
"hostname"
:
ssl_certificate
[
"hostname"
],
"hostname"
:
ssl_certificate
[
"hostname"
],
"ip"
:
ssl_certificate
[
"ip"
],
"ip"
:
ssl_certificate
[
"ip"
],
"port"
:
ssl_certificate
[
"port"
],
"port"
:
ssl_certificate
[
"port"
],
"sha1_fingerprint"
:
ssl_certificate
[
"sha1_fingerprint"
],
"sha1_fingerprint"
:
ssl_certificate
[
"sha1_fingerprint"
],
"subject"
:
ssl_certificate
[
"subject"
],
"subject"
:
ssl_certificate
[
"subject"
],
"issuer"
:
ssl_certificate
[
"issuer"
],
"issuer"
:
ssl_certificate
[
"issuer"
],
"not_before"
:
rfc822
(
ssl_certificate
[
"not_before"
])
"not_before"
:
rfc822
(
ssl_certificate
[
"not_before"
])
...
@@ -282,13 +282,18 @@ class WebBot:
...
@@ -282,13 +282,18 @@ class WebBot:
if
root_url
in
url_dict
:
if
root_url
in
url_dict
:
url_dict
[
url
]
=
url_dict
[
root_url
]
url_dict
[
url
]
=
url_dict
[
root_url
]
# map IP to URLs for less queries during fetching results
ip_to_url_dict
=
{}
for
url
,
ip_list
in
url_dict
.
items
():
for
ip
in
ip_list
:
ip_to_url_dict
.
setdefault
(
ip
,
[])
if
url
not
in
ip_to_url_dict
[
ip
]:
ip_to_url_dict
[
ip
].
append
(
url
)
# Get the list of HTTP servers to check
# Get the list of HTTP servers to check
query
=
reportHttp
(
self
.
_db
,
ip
=
[
x
for
x
in
server_ip_dict
.
keys
()],
url
=
[
x
for
x
in
url_dict
.
keys
()],
)
result_dict
[
"http_query"
]
=
[]
result_dict
[
"http_query"
]
=
[]
for
ip
,
url_list
in
ip_to_url_dict
.
items
():
query
=
reportHttp
(
self
.
_db
,
ip
=
ip
,
url
=
url_list
)
for
network_change
in
query
.
dicts
().
iterator
():
for
network_change
in
query
.
dicts
().
iterator
():
result_dict
[
"http_query"
].
append
(
result_dict
[
"http_query"
].
append
(
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment