mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-14 02:27:12 -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(':')
|
||||
x = {}
|
||||
i = 0
|
||||
xaddr = ''
|
||||
for byte in tab:
|
||||
if byte == '':
|
||||
byte = '0'
|
||||
|
@ -70,7 +71,10 @@ class Settings:
|
|||
for f in range(x[10], x[11]+1):
|
||||
for g in range(x[12], x[13]+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:
|
||||
tab = l.split('.')
|
||||
x = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue