librex 0.0.47 → 0.0.48

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -3,7 +3,7 @@
3
3
  A non-official re-packaging of the Rex library as a gem for easy of usage of the Metasploit REX framework in a non Metasploit application. I received permission from HDM to create this package.
4
4
 
5
5
  Currently based on:
6
- SVN Revision: 13604
6
+ SVN Revision: 13637
7
7
 
8
8
  # Credits
9
9
  The Metasploit development team <http://www.metasploit.com>
@@ -1,4 +1,4 @@
1
- # $Id: server.rb 13577 2011-08-18 00:18:43Z scriptjunkie $
1
+ # $Id: server.rb 13629 2011-08-24 21:28:31Z scriptjunkie $
2
2
 
3
3
  require 'rex/socket'
4
4
  require 'rex/proto/dhcp'
@@ -91,6 +91,7 @@ class Server
91
91
  self.leasetime = 600
92
92
  self.relayip = "\x00\x00\x00\x00" # relay ip - not currently suported
93
93
  self.pxeconfigfile = "update2"
94
+ self.pxealtconfigfile = "update0"
94
95
  self.pxepathprefix = ""
95
96
  self.pxereboottime = 2000
96
97
  end
@@ -120,7 +121,7 @@ class Server
120
121
  # Set an option
121
122
  def set_option(opts)
122
123
  allowed_options = [
123
- :serveOnce, :servePXE, :relayip, :leasetime, :dnsserv,
124
+ :serveOnce, :pxealtconfigfile, :servePXE, :relayip, :leasetime, :dnsserv,
124
125
  :pxeconfigfile, :pxepathprefix, :pxereboottime, :router,
125
126
  :give_hostname, :served_hostname, :served_over, :serveOnlyPXE
126
127
  ]
@@ -149,7 +150,7 @@ class Server
149
150
  attr_accessor :listen_host, :listen_port, :context, :leasetime, :relayip, :router, :dnsserv
150
151
  attr_accessor :sock, :thread, :myfilename, :ipstring, :served, :serveOnce
151
152
  attr_accessor :current_ip, :start_ip, :end_ip, :broadcasta, :netmaskn
152
- attr_accessor :servePXE, :pxeconfigfile, :pxepathprefix, :pxereboottime, :serveOnlyPXE
153
+ attr_accessor :servePXE, :pxeconfigfile, :pxealtconfigfile, :pxepathprefix, :pxereboottime, :serveOnlyPXE
153
154
  attr_accessor :give_hostname, :served_hostname, :served_over
154
155
 
155
156
  protected
@@ -267,7 +268,7 @@ protected
267
268
  # if serveOnce & PXE, don't reply to another PXE request
268
269
  # if serveOnce & ! PXE, don't reply to anything
269
270
  if self.serveOnce == true and self.served.has_key?(buf[28..43]) and
270
- self.served[buf[28..43]][1] and (pxeclient == true or self.servePXE == false)
271
+ self.served[buf[28..43]][1] and (pxeclient == false or self.servePXE == false)
271
272
  return
272
273
  end
273
274
  elsif messageType == DHCPRequest #DHCP Request - send DHCP ACK
@@ -292,7 +293,12 @@ protected
292
293
  pkt << dhcpoption(OpDns, self.dnsserv)
293
294
  if self.servePXE # PXE options
294
295
  pkt << dhcpoption(OpPXEMagic, PXEMagic)
295
- pkt << dhcpoption(OpPXEConfigFile, self.pxeconfigfile)
296
+ if self.serveOnce == true and self.served.has_key?(buf[28..43]) and
297
+ self.served[buf[28..43]][1] and pxeclient == true
298
+ pkt << dhcpoption(OpPXEConfigFile, self.pxealtconfigfile)
299
+ else
300
+ pkt << dhcpoption(OpPXEConfigFile, self.pxeconfigfile)
301
+ end
296
302
  pkt << dhcpoption(OpPXEPathPrefix, self.pxepathprefix)
297
303
  pkt << dhcpoption(OpPXERebootTime, [self.pxereboottime].pack('N'))
298
304
  if ( self.give_hostname == true )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.47
4
+ version: 0.0.48
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,10 +10,10 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-08-21 00:00:00.000000000Z
13
+ date: 2011-08-25 00:00:00.000000000Z
14
14
  dependencies: []
15
15
  description: Rex provides a variety of classes useful for security testing and exploit
16
- development. Based on SVN Revision 13604
16
+ development. Based on SVN Revision 13637
17
17
  email:
18
18
  - hdm@metasploit.com
19
19
  - jacob.hammack@hammackj.com