Permalink
Browse files

Update include paths to use absolute, support fastlib, etc

  • Loading branch information...
HD Moore
HD Moore committed Feb 4, 2012
1 parent bdf8d06 commit f630d67480728e0bf32f356ddb06ea8eda1fa61c
View
@@ -8,8 +8,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/base'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/base'
View
@@ -8,8 +8,15 @@
# $Revision$
#
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
OutStatus = "[*] "
View
@@ -10,9 +10,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
def usage
View
@@ -8,6 +8,18 @@
# To use th interface option under Windows use the Index value displayed by this tool (ex: "SET INTERFACE 1")
#
#
+
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
+
+
if RUBY_PLATFORM == "i386-mingw32"
begin
require 'pcaprub'
View
@@ -8,8 +8,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'rex/proto/ntlm/crypt'
View
@@ -14,7 +14,15 @@
#
# Licence is LGPL, see LICENCE in the top-level directory
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'rex/ui'
View
@@ -7,8 +7,15 @@
# the number of modules per author
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -6,8 +6,15 @@
# This script lists each module by its disclosure date
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -4,8 +4,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/core'
@@ -14,4 +21,4 @@
framework = Msf::Simple::Framework.create
-Rex::Ui::Text::IrbShell.new(binding).run
+Rex::Ui::Text::IrbShell.new(binding).run
View
@@ -9,7 +9,15 @@
# $Revision$
#
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'rex/ui'
View
@@ -4,7 +4,15 @@
# $Revision$
#
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
View
@@ -2,7 +2,15 @@
# $Id$
# $Revision$
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
View
@@ -7,8 +7,15 @@
# NOTE: No encoding or BadChar handling is performed
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
View
@@ -7,8 +7,15 @@
# $Revision$
#
-msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
-$:.unshift(File.join(File.dirname(msfbase), '..', 'lib'))
+msfbase = __FILE__
+while File.symlink?(msfbase)
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+end
+
+$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
+require 'fastlib'
+
+$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'

0 comments on commit f630d67

Please sign in to comment.