Updating dns_resolved module

resolved_file
Chris Truncer 2015-02-27 15:48:27 -05:00
parent 30c4e12a2e
commit feddbbc3e8
2 changed files with 10 additions and 4 deletions

View File

@ -34,7 +34,7 @@ class Client:
while (byte_reader < len(data_to_transmit) + self.length): while (byte_reader < len(data_to_transmit) + self.length):
encoded_data = base64.b64encode(data_to_transmit[byte_reader:byte_reader + self.length]) encoded_data = base64.b64encode(data_to_transmit[byte_reader:byte_reader + self.length])
encoded_data = encoded_data.replace("=", ".--") encoded_data = encoded_data.replace("=", ".---")
# calcalate total packets # calcalate total packets
if ((len(data_to_transmit) % self.length) == 0): if ((len(data_to_transmit) % self.length) == 0):

View File

@ -25,8 +25,14 @@ class Server:
if packet.haslayer(DNSQR): if packet.haslayer(DNSQR):
dnsqr_strings = repr(packet[DNSQR]) dnsqr_strings = repr(packet[DNSQR])
try: try:
incoming_data = base64.b64decode(dnsqr_strings.split('\'')[1].rstrip('.')) incoming_data = dnsqr_strings.split('\'')[1].rstrip('.')
print incoming_data number_equals = incoming_data.count('.--')
if '.---' in incoming_data:
encoded_data = incoming_data.split('.')[0] + "=" * number_equals
else:
encoded_data = incoming_data.split('.')[0]
print encoded_data
except TypeError: except TypeError:
pass pass
@ -48,4 +54,4 @@ class Server:
print "[*] DNS server started!" print "[*] DNS server started!"
sniff(prn=self.customAction) sniff(prn=self.customAction)
return return