|
|
@ -59,7 +59,7 @@ def textToDns(text):
|
|
|
|
if match:
|
|
|
|
if match:
|
|
|
|
return match
|
|
|
|
return match
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return None
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
def searchIP(text):
|
|
|
|
def searchIP(text):
|
|
|
|
""" Search if an IP address if directly available and return
|
|
|
|
""" Search if an IP address if directly available and return
|
|
|
@ -69,7 +69,7 @@ def searchIP(text):
|
|
|
|
if match:
|
|
|
|
if match:
|
|
|
|
return match
|
|
|
|
return match
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return None
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
def textToIp(text):
|
|
|
|
def textToIp(text):
|
|
|
|
""" Return the IP of DNS found in a given text.
|
|
|
|
""" Return the IP of DNS found in a given text.
|
|
|
@ -77,9 +77,8 @@ def textToIp(text):
|
|
|
|
ipList = list()
|
|
|
|
ipList = list()
|
|
|
|
# Search for plain IP
|
|
|
|
# Search for plain IP
|
|
|
|
plainIP = searchIP(text)
|
|
|
|
plainIP = searchIP(text)
|
|
|
|
if plainIP:
|
|
|
|
for element in plainIP:
|
|
|
|
for element in plainIP:
|
|
|
|
ipList.append(element)
|
|
|
|
ipList.append(element)
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Try to get IP from possible DNS
|
|
|
|
# Try to get IP from possible DNS
|
|
|
|
dnsList = textToDns(text)
|
|
|
|
dnsList = textToDns(text)
|
|
|
|