iagox86 / dnscat2

BSD 3-Clause "New" or "Revised" License
3.43k stars 601 forks source link

crash if nmap scanned #108

Open luca-m opened 7 years ago

luca-m commented 7 years ago

Hi, Maybe some exception handling may be improved If you try to nmap -Pn -sU -p53 XXXXXX a dnscat server it crashes like that:

dnscat2> Protocol exception caught in dnscat DNS module (for more information, check window 'dns1'):
#<DnscatException: Received a packet with no questions>
Caught an error: undefined method `serialize' for nil:NilClass
/home/ubuntu/dnscat2/server/libs/dnser.rb:678:in `block in serialize'
/home/ubuntu/dnscat2/server/libs/dnser.rb:677:in `each'
/home/ubuntu/dnscat2/server/libs/dnser.rb:677:in `serialize'
/home/ubuntu/dnscat2/server/libs/dnser.rb:819:in `reply!'
/home/ubuntu/dnscat2/server/libs/dnser.rb:775:in `error!'
/home/ubuntu/dnscat2/server/tunnel_drivers/driver_dns.rb:357:in `rescue in block in initialize'
/home/ubuntu/dnscat2/server/tunnel_drivers/driver_dns.rb:293:in `block in initialize'
/home/ubuntu/dnscat2/server/libs/dnser.rb:872:in `block (2 levels) in on_request'
/home/ubuntu/dnscat2/server/libs/dnser.rb:843:in `loop'
/home/ubuntu/dnscat2/server/libs/dnser.rb:843:in `block in on_request'
/home/ubuntu/dnscat2/server/libs/dnser.rb:876:in `rescue in block (2 levels) in on_request': undefined method `response_template' for #<DNSer::Transaction:0x007fa7781e6b18> (NoMethodError)
Did you mean?  respond_to?
        from /home/ubuntu/dnscat2/server/libs/dnser.rb:871:in `block (2 levels) in on_request'
        from /home/ubuntu/dnscat2/server/libs/dnser.rb:843:in `loop'
        from /home/ubuntu/dnscat2/server/libs/dnser.rb:843:in `block in on_request'

(running 80525f4f277e3cff972aa9a3f0b60f16556b3ab2)

wb4r commented 6 years ago

I can confirm it's still happening. Any updates?

iagox86 commented 6 years ago

Sorry, it's been some time since I've had time to update. I'm working on a major revision that will solve this, but I don't have an ETA. Probably not soon, sadly. Life's too busy these days.

On Fri, Feb 16, 2018 at 2:33 PM, willem_tee notifications@github.com wrote:

I can confirm it's still happening. Any updates?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iagox86/dnscat2/issues/108#issuecomment-366378131, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgITKziVFhJkv7HWtGQYfvHgjkE4iIzks5tVgJLgaJpZM4NMOAX .