diff --git a/protocols/clients/dns_resolved.py b/protocols/clients/dns_resolved.py index 2e19497..1a88878 100644 --- a/protocols/clients/dns_resolved.py +++ b/protocols/clients/dns_resolved.py @@ -34,7 +34,7 @@ class Client: while (byte_reader < len(data_to_transmit) + 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 if ((len(data_to_transmit) % self.length) == 0): diff --git a/protocols/servers/dns_resolved.py b/protocols/servers/dns_resolved.py index 1d32134..2161aa4 100644 --- a/protocols/servers/dns_resolved.py +++ b/protocols/servers/dns_resolved.py @@ -25,8 +25,14 @@ class Server: if packet.haslayer(DNSQR): dnsqr_strings = repr(packet[DNSQR]) try: - incoming_data = base64.b64decode(dnsqr_strings.split('\'')[1].rstrip('.')) - print incoming_data + incoming_data = dnsqr_strings.split('\'')[1].rstrip('.') + 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: pass @@ -48,4 +54,4 @@ class Server: print "[*] DNS server started!" sniff(prn=self.customAction) - return + return \ No newline at end of file