mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-19 21:03:33 -07:00
Update settings.py
compresses expanded IPv6 addresses
This commit is contained in:
parent
8953f87bbd
commit
3f5c836ba0
1 changed files with 5 additions and 1 deletions
|
@ -52,6 +52,7 @@ class Settings:
|
||||||
tab = l.split(':')
|
tab = l.split(':')
|
||||||
x = {}
|
x = {}
|
||||||
i = 0
|
i = 0
|
||||||
|
xaddr = ''
|
||||||
for byte in tab:
|
for byte in tab:
|
||||||
if byte == '':
|
if byte == '':
|
||||||
byte = '0'
|
byte = '0'
|
||||||
|
@ -70,7 +71,10 @@ class Settings:
|
||||||
for f in range(x[10], x[11]+1):
|
for f in range(x[10], x[11]+1):
|
||||||
for g in range(x[12], x[13]+1):
|
for g in range(x[12], x[13]+1):
|
||||||
for h in range(x[14], x[15]+1):
|
for h in range(x[14], x[15]+1):
|
||||||
ret.append('%x:%x:%x:%x:%x:%x:%x:%x' % (a, b, c, d, e, f, g, h))
|
xaddr = ('%x:%x:%x:%x:%x:%x:%x:%x' % (a, b, c, d, e, f, g, h))
|
||||||
|
xaddr = re.sub('(^|:)0{1,4}', ':', xaddr, count = 7)#Compresses expanded IPv6 address
|
||||||
|
xaddr = re.sub(':{3,7}', '::', xaddr, count = 7)
|
||||||
|
ret.append(xaddr.upper())
|
||||||
else:
|
else:
|
||||||
tab = l.split('.')
|
tab = l.split('.')
|
||||||
x = {}
|
x = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue