File tree Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -17,5 +17,9 @@ if [[ -z "$MSF_PATH" ]]; then
17
17
MSF_PATH=$( dirname $( dirname $path ) )
18
18
fi
19
19
20
+ if [[ -n " $MSF_BUILD " ]]; then
21
+ docker-compose -f $MSF_PATH /docker-compose.yml build
22
+ fi
23
+
20
24
cd $MSF_PATH
21
25
docker-compose run --rm --service-ports ms ./msfvenom " $@ "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ -z " $MSF_PATH " ]]; then
4
+ path=` dirname $0 `
5
+
6
+ # check for ./docker/msfconsole.rc
7
+ if [[ ! -f $path /../msfconsole.rc ]] ; then
8
+
9
+ # we are not inside the project
10
+ realpath --version > /dev/null 2>&1 || { echo >&2 " I couldn't find where metasploit is. Set \$ MSF_PATH or execute this from the project root" ; exit 1 ; }
11
+
12
+ # determine script path
13
+ pushd $( dirname $( realpath $0 ) ) > /dev/null
14
+ path=$( pwd)
15
+ popd > /dev/null
16
+ fi
17
+ MSF_PATH=$( dirname $( dirname $path ) )
18
+ fi
19
+
20
+ cd $MSF_PATH
21
+
22
+ if [[ -n " $MSF_BUILD " ]]; then
23
+ docker-compose -f $MSF_PATH /docker-compose.yml -f $MSF_PATH /docker/docker-compose.development.override.yml build
24
+ fi
25
+
26
+ docker-compose -f $MSF_PATH /docker-compose.yml -f $MSF_PATH /docker/docker-compose.development.override.yml run --rm --service-ports ms ./msfvenom " $@ "
Original file line number Diff line number Diff line change @@ -21,3 +21,4 @@ module Util
21
21
22
22
# Executable generation and encoding
23
23
require 'msf/util/exe'
24
+ require 'msf/util/helper'
Original file line number Diff line number Diff line change
1
+ # -*- coding: binary -*-
2
+
3
+ module Msf
4
+ module Util
5
+ class Helper
6
+ # Cross-platform way of finding an executable in the $PATH.
7
+ #
8
+ # which('ruby') #=> /usr/bin/ruby
9
+ def self . which ( cmd )
10
+ exts = ENV [ 'PATHEXT' ] ? ENV [ 'PATHEXT' ] . split ( ';' ) : [ '' ]
11
+ ENV [ 'PATH' ] . split ( File ::PATH_SEPARATOR ) . each do |path |
12
+ exts . each { |ext |
13
+ exe = File . join ( path , "#{ cmd } #{ ext } " )
14
+ return exe if File . executable? ( exe ) && !File . directory? ( exe )
15
+ }
16
+ end
17
+ return nil
18
+ end
19
+ end
20
+ end
21
+ end
Original file line number Diff line number Diff line change 13
13
$LOAD_PATH. unshift ( lib ) unless $LOAD_PATH. include? ( lib )
14
14
require 'metasploit/framework/version'
15
15
require 'metasploit/framework/rails_version_constraint'
16
+ require 'msf/util/helper'
16
17
17
18
Gem ::Specification . new do |spec |
18
19
spec . name = 'metasploit-framework'
@@ -24,7 +25,8 @@ Gem::Specification.new do |spec|
24
25
spec . homepage = 'https://www.metasploit.com'
25
26
spec . license = 'BSD-3-clause'
26
27
27
- if File . directory? ( File . join ( File . dirname ( __FILE__ ) , ".git" ) )
28
+ # only do a git ls-files if the .git folder exists and we have a git binary in PATH
29
+ if File . directory? ( File . join ( File . dirname ( __FILE__ ) , ".git" ) ) && Msf ::Util ::Helper . which ( "git" )
28
30
spec . files = `git ls-files` . split ( $/) . reject { |file |
29
31
file =~ /^documentation|^external/
30
32
}
You can’t perform that action at this time.
0 commit comments