myl-discovery 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {myl_discovery-0.3.0.dist-info → myl_discovery-0.3.1.dist-info}/METADATA +1 -1
- myl_discovery-0.3.1.dist-info/RECORD +10 -0
- myldiscovery/discovery.py +28 -2
- myl_discovery-0.3.0.dist-info/RECORD +0 -10
- {myl_discovery-0.3.0.dist-info → myl_discovery-0.3.1.dist-info}/LICENSE +0 -0
- {myl_discovery-0.3.0.dist-info → myl_discovery-0.3.1.dist-info}/WHEEL +0 -0
- {myl_discovery-0.3.0.dist-info → myl_discovery-0.3.1.dist-info}/entry_points.txt +0 -0
- {myl_discovery-0.3.0.dist-info → myl_discovery-0.3.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
myldiscovery/__init__.py,sha256=zzTVte4vTiupxCcjgQBkifnFjkNnZX_Sf4Ys2C5ufZQ,95
|
2
|
+
myldiscovery/__main__.py,sha256=fr-CFAsvUaq-F1nICslExsfLggcTfrfCuU_MUBrHZdQ,58
|
3
|
+
myldiscovery/discovery.py,sha256=BojZR0UoOFX5d6j1nu3TTdIoyh4bVMgQ-Qj4z_8MXNs,3575
|
4
|
+
myldiscovery/main.py,sha256=sdh2FeE54uVYiUA8QVK-ocdK0-g5v9gGw9F4NVD4tyk,1732
|
5
|
+
myl_discovery-0.3.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
+
myl_discovery-0.3.1.dist-info/METADATA,sha256=PR-ONO9qKdGvu30HjHoAxa30fUDkZbF1kGu4NhNVWe4,41317
|
7
|
+
myl_discovery-0.3.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
8
|
+
myl_discovery-0.3.1.dist-info/entry_points.txt,sha256=nyyAyvgvu6iO9mPEA6uVrPfd0lIrUyo9AQWeH2asEY0,52
|
9
|
+
myl_discovery-0.3.1.dist-info/top_level.txt,sha256=v_h72JexaacqBNY6iOMD9PpGg8lnGoL-pkmUIzxdiVU,13
|
10
|
+
myl_discovery-0.3.1.dist-info/RECORD,,
|
myldiscovery/discovery.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import logging
|
2
|
+
import os
|
2
3
|
import re
|
4
|
+
import shutil
|
3
5
|
|
4
6
|
import dns.resolver
|
5
7
|
import requests
|
@@ -8,9 +10,33 @@ import xmltodict
|
|
8
10
|
LOGGER = logging.getLogger(__name__)
|
9
11
|
|
10
12
|
|
13
|
+
def is_termux():
|
14
|
+
if os.getenv("TERMUX_VERSION"):
|
15
|
+
return True
|
16
|
+
|
17
|
+
return shutil.which("termux-info") is not None
|
18
|
+
|
19
|
+
|
20
|
+
def resolve(*args, **kwargs):
|
21
|
+
termux = is_termux()
|
22
|
+
dns.resolver.default_resolver = dns.resolver.Resolver(
|
23
|
+
# Do not attempt to read /etc/resolv.conf on Termux
|
24
|
+
configure=not termux
|
25
|
+
)
|
26
|
+
if termux:
|
27
|
+
# Default to Google DNS on Termux
|
28
|
+
dns.resolver.default_resolver.nameservers = [
|
29
|
+
"8.8.8.8",
|
30
|
+
"2001:4860:4860::8888",
|
31
|
+
"8.8.4.4",
|
32
|
+
"2001:4860:4860::8844",
|
33
|
+
]
|
34
|
+
return dns.resolver.resolve(*args, **kwargs)
|
35
|
+
|
36
|
+
|
11
37
|
def resolve_txt(domain, criteria="^mailconf="):
|
12
38
|
regex = re.compile(criteria)
|
13
|
-
answers =
|
39
|
+
answers = resolve(domain, "TXT")
|
14
40
|
for rdata in answers:
|
15
41
|
for txt_string in rdata.strings:
|
16
42
|
txt_record = txt_string.decode("utf-8")
|
@@ -19,7 +45,7 @@ def resolve_txt(domain, criteria="^mailconf="):
|
|
19
45
|
|
20
46
|
|
21
47
|
def resolve_srv(domain):
|
22
|
-
answers =
|
48
|
+
answers = resolve(domain, "SRV")
|
23
49
|
data = []
|
24
50
|
for rdata in answers:
|
25
51
|
entry = {
|
@@ -1,10 +0,0 @@
|
|
1
|
-
myldiscovery/__init__.py,sha256=zzTVte4vTiupxCcjgQBkifnFjkNnZX_Sf4Ys2C5ufZQ,95
|
2
|
-
myldiscovery/__main__.py,sha256=fr-CFAsvUaq-F1nICslExsfLggcTfrfCuU_MUBrHZdQ,58
|
3
|
-
myldiscovery/discovery.py,sha256=LGCExQPRldvsQ3WtI8IYTGjVa7ez807caV9SMwgcctU,2951
|
4
|
-
myldiscovery/main.py,sha256=sdh2FeE54uVYiUA8QVK-ocdK0-g5v9gGw9F4NVD4tyk,1732
|
5
|
-
myl_discovery-0.3.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
-
myl_discovery-0.3.0.dist-info/METADATA,sha256=httmQt7oKBH8xdZPjwzge8iAwglmK9GOHkpnNk41sp4,41317
|
7
|
-
myl_discovery-0.3.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
8
|
-
myl_discovery-0.3.0.dist-info/entry_points.txt,sha256=nyyAyvgvu6iO9mPEA6uVrPfd0lIrUyo9AQWeH2asEY0,52
|
9
|
-
myl_discovery-0.3.0.dist-info/top_level.txt,sha256=v_h72JexaacqBNY6iOMD9PpGg8lnGoL-pkmUIzxdiVU,13
|
10
|
-
myl_discovery-0.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|