librex 0.0.48 → 0.0.49

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: 13637
6
+ SVN Revision: 13642
7
7
 
8
8
  # Credits
9
9
  The Metasploit development team <http://www.metasploit.com>
@@ -1,4 +1,4 @@
1
- # $Id: server.rb 13629 2011-08-24 21:28:31Z scriptjunkie $
1
+ # $Id: server.rb 13639 2011-08-25 22:48:33Z scriptjunkie $
2
2
 
3
3
  require 'rex/socket'
4
4
  require 'rex/proto/dhcp'
@@ -96,6 +96,9 @@ class Server
96
96
  self.pxereboottime = 2000
97
97
  end
98
98
 
99
+ def report(&block)
100
+ self.reporter = block
101
+ end
99
102
 
100
103
  # Start the DHCP server
101
104
  def start
@@ -151,7 +154,7 @@ class Server
151
154
  attr_accessor :sock, :thread, :myfilename, :ipstring, :served, :serveOnce
152
155
  attr_accessor :current_ip, :start_ip, :end_ip, :broadcasta, :netmaskn
153
156
  attr_accessor :servePXE, :pxeconfigfile, :pxealtconfigfile, :pxepathprefix, :pxereboottime, :serveOnlyPXE
154
- attr_accessor :give_hostname, :served_hostname, :served_over
157
+ attr_accessor :give_hostname, :served_hostname, :served_over, :reporter
155
158
 
156
159
  protected
157
160
 
@@ -293,10 +296,15 @@ protected
293
296
  pkt << dhcpoption(OpDns, self.dnsserv)
294
297
  if self.servePXE # PXE options
295
298
  pkt << dhcpoption(OpPXEMagic, PXEMagic)
299
+ # We already got this one, serve localboot file
296
300
  if self.serveOnce == true and self.served.has_key?(buf[28..43]) and
297
301
  self.served[buf[28..43]][1] and pxeclient == true
298
302
  pkt << dhcpoption(OpPXEConfigFile, self.pxealtconfigfile)
299
303
  else
304
+ # We are handing out an IP and our PXE attack
305
+ if(self.reporter)
306
+ self.reporter.call(buf[28..43],self.ipstring)
307
+ end
300
308
  pkt << dhcpoption(OpPXEConfigFile, self.pxeconfigfile)
301
309
  end
302
310
  pkt << dhcpoption(OpPXEPathPrefix, self.pxepathprefix)
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.48
4
+ version: 0.0.49
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-25 00:00:00.000000000Z
13
+ date: 2011-08-26 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 13637
16
+ development. Based on SVN Revision 13642
17
17
  email:
18
18
  - hdm@metasploit.com
19
19
  - jacob.hammack@hammackj.com