Skip to content

Commit

Permalink
Caching is controlled via a command line option
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebaggett committed Dec 21, 2016
1 parent 6b2bc35 commit f6dfdf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/controller/controller_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _register_commands()
TunnelDrivers.start({
:controller => self,
:driver => DriverDNS,
:args => [dns[:host], dns[:port], dns[:domains]]
:args => [dns[:host], dns[:port], dns[:domains], opts[:cache]]
})
end
)
Expand Down
5 changes: 4 additions & 1 deletion server/dnscat2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@

opt :firehose, "If set, all output goes to stdout instead of being put in windows.",
:type => :boolean, :default => false

opt :cache, "If set, caching is enabled on the server.",
:type => :boolean, :default => true
end

SWindow.set_firehose(opts[:firehose])
Expand Down Expand Up @@ -205,7 +208,7 @@
TunnelDrivers.start({
:controller => controller,
:driver => DriverDNS,
:args => [dns_settings[:host], dns_settings[:port], dns_settings[:domains]],
:args => [dns_settings[:host], dns_settings[:port], dns_settings[:domains], opts[:cache]],
})

# Wait for the input window to finish its thing
Expand Down
4 changes: 2 additions & 2 deletions server/tunnel_drivers/driver_dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ def DriverDNS.do_encoding(question, domains, response)
return response
end

def initialize(parent_window, host, port, domains)
def initialize(parent_window, host, port, domains, cache)
if(domains.nil?)
domains = []
end

# Do this as early as we can, so we can fail early
@dnser = DNSer.new(host, port, true)
@dnser = DNSer.new(host, port, cache)

@id = 'dns%d' % (@@id += 1)
@window = SWindow.new(parent_window, false, {
Expand Down

0 comments on commit f6dfdf1

Please sign in to comment.