iagox86 / dnscat2

BSD 3-Clause "New" or "Revised" License
3.4k stars 599 forks source link

Is Encryption Broken? #156

Closed connectedway closed 2 years ago

connectedway commented 4 years ago

It does not appear that encryption works at all. Am I missing something.

In the client in the routine encryptor_encrypt_buffer, it packs the buffer with header, nonce, and buffer.

In the server in the routine _decrypt_packet_internal it unpacks header, signature, nonce, body. If the signature doesn't match, it raises an error.

This causes the parsing of the synbody to fail because the synbody is encrypted yet the decrypt routine was unable to decrypt it. I can only get things to work if I build the client with NO_ENCRYPTION