Gentoo Archives: gentoo-commits

From: Richard Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/metasploit/
Date: Fri, 29 Jul 2016 20:40:04
Message-Id: 1469824778.1339751c5e04a835e9ca4931610d3bcd6d91024e.zerochaos@gentoo
1 commit: 1339751c5e04a835e9ca4931610d3bcd6d91024e
2 Author: Zero_Chaos <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 29 20:39:05 2016 +0000
4 Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 29 20:39:38 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1339751c
7
8 net-analyzer/metasploit: about halfway through updates to support live, already sorry that I'm alive
9
10 Package-Manager: portage-2.3.0
11
12 net-analyzer/metasploit/Manifest | 2 -
13 .../metasploit-4.11.5_p2015110401-r1.ebuild | 299 ---------------------
14 net-analyzer/metasploit/metasploit-4.11.7.ebuild | 297 --------------------
15 net-analyzer/metasploit/metasploit-4.12.7.ebuild | 2 +-
16 net-analyzer/metasploit/metasploit-9999.ebuild | 15 +-
17 5 files changed, 14 insertions(+), 601 deletions(-)
18
19 diff --git a/net-analyzer/metasploit/Manifest b/net-analyzer/metasploit/Manifest
20 index 0b7f81b..ee44860 100644
21 --- a/net-analyzer/metasploit/Manifest
22 +++ b/net-analyzer/metasploit/Manifest
23 @@ -1,3 +1 @@
24 -DIST metasploit-4.11.5_p2015110401.tar.gz 35426390 SHA256 fd8ef85a1d935245892c618001d1f992d6be16baa449a61c358b64a306ec249c SHA512 57e6d09546b219023a2f0c5920f143cbda1736c274004e16533693bc25d4f3fc35458c0ddecc1d552e0db575a41a7c7dab5db0dd1fa14d48e8fd66dbf6c9a94c WHIRLPOOL 1c3e2683598f25ce89904c5d0e9e3cf85820a6f09a06ef6e62207cdd30fe48e793012391b44c82131bacf05fce62f0093704d193769ab86ea40b9577543980f1
25 -DIST metasploit-4.11.7.tar.gz 23163701 SHA256 1dbfc027dbcbb746858d36dda5ba9321cdc7d5dbc7538ceb20730a9de56d026b SHA512 cd84a4ba253e8ae38f93ba20316f0cb0aa5aeabfb345f07cb96791c5b7589572920b1723df624e26b4e07968fe8be55b04e1abc3c8828b5588bec62aca100d55 WHIRLPOOL c054e19f1c994c43230777a5f72d74b468f9de97b0f64edd17f4e9ef68fff3546d1311d9f80036d5aeccb6381c3c7f0200d5e3e33ce567e36f6ce58a9b97d4b3
26 DIST metasploit-4.12.7.tar.gz 23335841 SHA256 30d3fe6f0e3626e86d1497beb21f4ed304fb2f5f375823a5b91f5cbc9d762bae SHA512 6927876b577e1d2421eeabdd1abab90ac99aef02703c0b431eb664c855008639081af64dd82426b87114c8460ecd31ecb46cc89af1edf4f65a2e79b30d99675a WHIRLPOOL add23aad4f5f916510c1e879d25b182651c2bd22e10311ebf43347c8a5fc5056a1f9ee13906791754585bfea4ab742a005564347de7dabaa62f987301b4c0332
27
28 diff --git a/net-analyzer/metasploit/metasploit-4.11.5_p2015110401-r1.ebuild b/net-analyzer/metasploit/metasploit-4.11.5_p2015110401-r1.ebuild
29 deleted file mode 100644
30 index 5bf6ef1..0000000
31 --- a/net-analyzer/metasploit/metasploit-4.11.5_p2015110401-r1.ebuild
32 +++ /dev/null
33 @@ -1,299 +0,0 @@
34 -# Copyright 1999-2015 Gentoo Foundation
35 -# Distributed under the terms of the GNU General Public License v2
36 -# $Id$
37 -
38 -EAPI="5"
39 -
40 -#never ever ever have more than one ruby in here
41 -USE_RUBY="ruby21"
42 -inherit eutils ruby-ng
43 -
44 -if [[ ${PV} == "9999" ]] ; then
45 - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
46 - EGIT_CHECKOUT_DIR="${WORKDIR}"/all
47 - inherit git-r3
48 - KEYWORDS=""
49 - SLOT="9999"
50 -else
51 - ##Tags https://github.com/rapid7/metasploit-framework/releases
52 - ##Releases https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version
53 - #SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${PV}.tar.gz -> ${P}.tar.gz"
54 - ##Snapshots
55 - MY_PV=${PV/_p/-}
56 - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
57 - KEYWORDS="~amd64 ~arm ~x86"
58 - RUBY_S="${PN}-framework-${MY_PV}"
59 - inherit versionator
60 - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)"
61 -fi
62 -
63 -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code"
64 -HOMEPAGE="http://www.metasploit.org/"
65 -LICENSE="BSD"
66 -IUSE="development +java oracle +pcap test"
67 -
68 -#multiple known bugs with tests reported upstream and ignored
69 -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible)
70 -RESTRICT="test"
71 -
72 -RUBY_COMMON_DEPEND="virtual/ruby-ssl
73 - >=dev-ruby/activesupport-4.0.9:4.0
74 - >=dev-ruby/actionpack-4.0.9:4.0
75 - >=dev-ruby/activerecord-4.0.9:4.0
76 - dev-ruby/bcrypt-ruby
77 - dev-ruby/builder:3
78 - dev-ruby/bundler
79 - dev-ruby/filesize
80 - dev-ruby/jsobfu:0.2.1
81 - dev-ruby/json
82 - dev-ruby/kissfft
83 - dev-ruby/metasm:1.0.2
84 - dev-ruby/metasploit_data_models:1.2.9
85 - dev-ruby/meterpreter_bins:0.0.22
86 - dev-ruby/metasploit-payloads:1.0.15
87 - dev-ruby/metasploit-credential:1.0.1
88 - >=dev-ruby/metasploit-concern-1.0.0:1.0
89 - >=dev-ruby/metasploit-model-1.0.0:1.0
90 - dev-ruby/msgpack
91 - dev-ruby/nokogiri
92 - dev-ruby/recog:2.0.14
93 - =dev-ruby/rkelly-remix-0.0.6
94 - dev-ruby/sqlite3
95 - >=dev-ruby/pg-0.11
96 - dev-ruby/packetfu:1.1.11
97 - >=dev-ruby/rubyzip-1.1
98 - dev-ruby/rb-readline-r7
99 - dev-ruby/robots
100 - java? ( dev-ruby/rjb )
101 - oracle? ( dev-ruby/ruby-oci8 )
102 - pcap? ( dev-ruby/pcaprub:*
103 - dev-ruby/network_interface )
104 - development? ( dev-ruby/fivemat
105 - dev-ruby/pry
106 - dev-ruby/redcarpet
107 - dev-ruby/yard
108 - >=dev-ruby/rake-10.0.0
109 - >=dev-ruby/factory_girl-4.1.0 )"
110 - #lorcon doesn't support ruby21
111 - #lorcon? ( net-wireless/lorcon[ruby] )
112 -ruby_add_bdepend "${RUBY_COMMON_DEPEND}
113 - test? ( >=dev-ruby/factory_girl-4.1.0
114 - dev-ruby/fivemat
115 - dev-ruby/database_cleaner
116 - >=dev-ruby/rspec-2.12
117 - dev-ruby/shoulda-matchers
118 - dev-ruby/timecop
119 - >=dev-ruby/rake-10.0.0 )"
120 -ruby_add_rdepend "${RUBY_COMMON_DEPEND}"
121 -
122 -COMMON_DEPEND="dev-db/postgresql[server]
123 - >=app-crypt/johntheripper-1.7.9-r1[-minimal]
124 - net-analyzer/nmap"
125 -RDEPEND+=" ${COMMON_DEPEND}
126 - >=app-eselect/eselect-metasploit-0.16"
127 -
128 -RESTRICT="strip"
129 -
130 -QA_PREBUILT="
131 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin
132 - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin
133 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin
134 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin
135 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin
136 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin
137 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin
138 - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin
139 - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin
140 - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin
141 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
142 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
143 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
144 - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin
145 - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf
146 - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so
147 - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so
148 - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so
149 - "
150 -
151 -pkg_setup() {
152 - if use test; then
153 - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail
154 - su postgres -c "createuser msf_test_user -d -S -R"
155 - if [ $? -ne 0 ]; then
156 - su postgres -c "dropuser msf_test_user" || die
157 - su postgres -c "createuser msf_test_user -d -S -R" || die
158 - fi
159 - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die
160 - fi
161 - ruby-ng_pkg_setup
162 -}
163 -
164 -all_ruby_unpack() {
165 - if [[ ${PV} == "9999" ]] ; then
166 - git-r3_src_unpack
167 - else
168 - default_src_unpack
169 -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all
170 -# rm -r msf3
171 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb)
172 - #msf_version=${msf_version#*=}
173 - fi
174 -}
175 -
176 -all_ruby_prepare() {
177 - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs
178 - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch"
179 - epatch_user
180 -
181 - #unbundle johntheripper, at least it now defaults to running the system version
182 - rm -r data/john/run.*
183 - rm -r data/john/src.tar.bz2
184 - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run
185 - rm -r data/cpuinfo
186 -
187 - #remove random oudated collected garbage
188 - rm -r external
189 -
190 - #remove unneeded ruby bundler versioning files
191 - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements
192 - #we regen this file in each_ruby_prepare
193 - rm Gemfile.lock
194 - #The Gemfile contains real known deps
195 - #add our dep on upstream rb-readline instead of bundled one
196 - #and then they broke it...
197 - #sed -i "/gem 'packetfu'/a #use upstream readline instead of bundled\ngem 'rb-readline'" Gemfile || die
198 - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die
199 - #remove the bundled readline
200 - #https://github.com/rapid7/metasploit-framework/pull/3105
201 - #this PR was closed due to numerous changes to their local fork, almost entirely for non-linux
202 - #but now we have to go back to bundled readline because otherwise it's broken
203 - #rm lib/rbreadline.rb
204 - #now we edit the Gemfile based on use flags
205 - #even if we pass --without=blah bundler still calculates the deps and messes us up
206 - if ! use pcap; then
207 - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die
208 - fi
209 - if ! use development; then
210 - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die
211 - fi
212 - if ! use test; then
213 - sed -i -e "/^group :test/,/^end$/d" Gemfile || die
214 - fi
215 - if ! use test && ! use development; then
216 - sed -i -e "/^group :development/,/^end$/d" Gemfile || die
217 - fi
218 - #We don't need simplecov
219 - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die
220 - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die
221 -
222 - #we need to edit the gemspec too, since it tries to call git instead of anything sane
223 - #probably a better way to fix this... if I care at some point
224 - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die
225 -
226 - #let's bogart msfupdate
227 - rm msfupdate
228 - echo "#!/bin/sh" > msfupdate
229 - echo "echo \"[*]\"" >> msfupdate
230 - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate
231 - echo "echo \"[*]\"" >> msfupdate
232 - echo "echo \"\"" >> msfupdate
233 - if [[ ${PV} == "9999" ]] ; then
234 - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate
235 - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate
236 - echo "else" >> msfupdate
237 - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate
238 - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate
239 - echo "fi" >> msfupdate
240 - else
241 - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate
242 - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate
243 - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate
244 - fi
245 - #this is set executable in src_install
246 -
247 - #install our database.yml file before tests are run
248 - cp "${FILESDIR}"/database.yml config/
249 -
250 -}
251 -
252 -each_ruby_prepare() {
253 - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die
254 - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die
255 -
256 - #force all metasploit executables to use desired ruby version
257 - #https://dev.metasploit.com/redmine/issues/8357
258 - for file in $(ls -1 msf*)
259 - do
260 - #poorly adapted from python.eclass
261 - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed"
262 - done
263 -}
264 -
265 -each_ruby_test() {
266 - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox
267 -
268 - #we bogart msfupdate so no point in trying to test it
269 - rm spec/msfupdate_spec.rb || die
270 - #we don't really want to be uploading to virustotal during the tests
271 - rm spec/tools/virustotal_spec.rb || die
272 -
273 - # https://dev.metasploit.com/redmine/issues/8425
274 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die
275 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die
276 -
277 - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die
278 - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user"
279 -}
280 -
281 -each_ruby_install() {
282 - #Tests have already been run, we don't need this stuff
283 - rm -r spec || die
284 - rm -r test || die
285 - rm Gemfile.lock || die
286 -
287 - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple.
288 - # should be as simple as copying everything into the target...
289 - dodir /usr/$(get_libdir)/${PN}${SLOT}
290 - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed"
291 - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md
292 - fowners -R root:0 /
293 -
294 -}
295 -
296 -all_ruby_install() {
297 - # do not remove LICENSE, bug #238137
298 - dodir /usr/share/doc/${PF}
299 - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die
300 - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
301 -
302 - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate
303 -
304 - #tell revdep-rebuild to ignore binaries meant for the target
305 - dodir /etc/revdep-rebuild
306 - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT}
307 - #These dirs contain prebuilt binaries for running on the TARGET not the HOST
308 - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter"
309 - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits"
310 - EOF
311 -}
312 -
313 -pkg_postinst() {
314 - elog "Before use you should run 'env-update' and '. /etc/profile'"
315 - elog "otherwise you may be missing important environmental variables."
316 -
317 - elog "You need to prepare the database by running:"
318 - elog "emerge --config postgresql"
319 - elog "/etc/init.d/postgresql-<version> start"
320 - elog "emerge --config =metasploit-${PV}"
321 -
322 - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
323 -
324 - einfo
325 - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary"
326 -}
327 -
328 -pkg_config() {
329 - einfo "If the following fails, it is likely because you forgot to start/config postgresql first"
330 - su postgres -c "createuser msf_user -D -S -R"
331 - su postgres -c "createdb --owner=msf_user msf_database"
332 -}
333
334 diff --git a/net-analyzer/metasploit/metasploit-4.11.7.ebuild b/net-analyzer/metasploit/metasploit-4.11.7.ebuild
335 deleted file mode 100644
336 index 2fb25d3..0000000
337 --- a/net-analyzer/metasploit/metasploit-4.11.7.ebuild
338 +++ /dev/null
339 @@ -1,297 +0,0 @@
340 -# Copyright 1999-2016 Gentoo Foundation
341 -# Distributed under the terms of the GNU General Public License v2
342 -# $Id$
343 -
344 -EAPI="5"
345 -
346 -#never ever ever have more than one ruby in here
347 -USE_RUBY="ruby21"
348 -inherit eutils ruby-ng
349 -
350 -if [[ ${PV} == "9999" ]] ; then
351 - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
352 - EGIT_CHECKOUT_DIR="${WORKDIR}"/all
353 - inherit git-r3
354 - KEYWORDS=""
355 - SLOT="9999"
356 -else
357 - ##Tags https://github.com/rapid7/metasploit-framework/releases
358 - ##Releases https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version
359 - #SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${PV}.tar.gz -> ${P}.tar.gz"
360 - ##Snapshots
361 - MY_PV=${PV/_p/-}
362 - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
363 - KEYWORDS="~amd64 ~arm ~x86"
364 - RUBY_S="${PN}-framework-${MY_PV}"
365 - inherit versionator
366 - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)"
367 -fi
368 -
369 -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code"
370 -HOMEPAGE="http://www.metasploit.org/"
371 -LICENSE="BSD"
372 -IUSE="development +java oracle +pcap test"
373 -
374 -#multiple known bugs with tests reported upstream and ignored
375 -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible)
376 -RESTRICT="test"
377 -
378 -RUBY_COMMON_DEPEND="virtual/ruby-ssl
379 - >=dev-ruby/activesupport-4.0.9:4.0
380 - >=dev-ruby/actionpack-4.0.9:4.0
381 - >=dev-ruby/activerecord-4.0.9:4.0
382 - dev-ruby/bcrypt-ruby
383 - dev-ruby/builder:3
384 - dev-ruby/bundler
385 - dev-ruby/filesize
386 - dev-ruby/jsobfu:0.3.0
387 - dev-ruby/json
388 - dev-ruby/kissfft
389 - dev-ruby/metasm:1.0.2
390 - dev-ruby/metasploit_data_models:1.2.10
391 - dev-ruby/meterpreter_bins:0.0.22
392 - dev-ruby/metasploit-payloads:1.0.21
393 - dev-ruby/metasploit-credential:1.0.1
394 - >=dev-ruby/metasploit-concern-1.0.0:1.0
395 - >=dev-ruby/metasploit-model-1.0.0:1.0
396 - dev-ruby/msgpack
397 - dev-ruby/nokogiri
398 - dev-ruby/openssl-ccm:1.2.1
399 - dev-ruby/recog:2.0.14
400 - =dev-ruby/rkelly-remix-0.0.6
401 - dev-ruby/sqlite3
402 - >=dev-ruby/pg-0.11
403 - dev-ruby/packetfu:1.1.11
404 - >=dev-ruby/rubyzip-1.1
405 - dev-ruby/rb-readline-r7
406 - dev-ruby/robots
407 - java? ( dev-ruby/rjb )
408 - oracle? ( dev-ruby/ruby-oci8 )
409 - pcap? ( dev-ruby/pcaprub:*
410 - dev-ruby/network_interface )
411 - development? ( dev-ruby/fivemat
412 - dev-ruby/pry
413 - dev-ruby/redcarpet
414 - dev-ruby/yard
415 - >=dev-ruby/rake-10.0.0
416 - >=dev-ruby/factory_girl-4.1.0 )"
417 - #lorcon doesn't support ruby21
418 - #lorcon? ( net-wireless/lorcon[ruby] )
419 -ruby_add_bdepend "${RUBY_COMMON_DEPEND}
420 - test? ( >=dev-ruby/factory_girl-4.1.0
421 - dev-ruby/fivemat
422 - dev-ruby/database_cleaner
423 - >=dev-ruby/rspec-2.12
424 - dev-ruby/shoulda-matchers
425 - dev-ruby/timecop
426 - >=dev-ruby/rake-10.0.0 )"
427 -ruby_add_rdepend "${RUBY_COMMON_DEPEND}"
428 -
429 -COMMON_DEPEND="dev-db/postgresql[server]
430 - >=app-crypt/johntheripper-1.7.9-r1[-minimal]
431 - net-analyzer/nmap"
432 -RDEPEND+=" ${COMMON_DEPEND}
433 - >=app-eselect/eselect-metasploit-0.16"
434 -
435 -RESTRICT="strip"
436 -
437 -QA_PREBUILT="
438 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin
439 - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin
440 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin
441 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin
442 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin
443 - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin
444 - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin
445 - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin
446 - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin
447 - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin
448 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
449 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
450 - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
451 - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin
452 - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf
453 - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so
454 - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so
455 - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so
456 - "
457 -
458 -pkg_setup() {
459 - if use test; then
460 - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail
461 - su postgres -c "createuser msf_test_user -d -S -R"
462 - if [ $? -ne 0 ]; then
463 - su postgres -c "dropuser msf_test_user" || die
464 - su postgres -c "createuser msf_test_user -d -S -R" || die
465 - fi
466 - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die
467 - fi
468 - ruby-ng_pkg_setup
469 -}
470 -
471 -all_ruby_unpack() {
472 - if [[ ${PV} == "9999" ]] ; then
473 - git-r3_src_unpack
474 - else
475 - default_src_unpack
476 -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all
477 -# rm -r msf3
478 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb)
479 - #msf_version=${msf_version#*=}
480 - fi
481 -}
482 -
483 -all_ruby_prepare() {
484 - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs
485 - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch"
486 - epatch_user
487 -
488 - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run
489 - rm -r data/cpuinfo
490 -
491 - #remove random oudated collected garbage
492 - rm -r external
493 -
494 - #remove unneeded ruby bundler versioning files
495 - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements
496 - #we regen this file in each_ruby_prepare
497 - rm Gemfile.lock
498 - #The Gemfile contains real known deps
499 - #add our dep on upstream rb-readline instead of bundled one
500 - #and then they broke it...
501 - #sed -i "/gem 'packetfu'/a #use upstream readline instead of bundled\ngem 'rb-readline'" Gemfile || die
502 - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die
503 - #remove the bundled readline
504 - #https://github.com/rapid7/metasploit-framework/pull/3105
505 - #this PR was closed due to numerous changes to their local fork, almost entirely for non-linux
506 - #but now we have to go back to bundled readline because otherwise it's broken
507 - #rm lib/rbreadline.rb
508 - #now we edit the Gemfile based on use flags
509 - #even if we pass --without=blah bundler still calculates the deps and messes us up
510 - if ! use pcap; then
511 - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die
512 - fi
513 - if ! use development; then
514 - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die
515 - fi
516 - if ! use test; then
517 - sed -i -e "/^group :test/,/^end$/d" Gemfile || die
518 - fi
519 - if ! use test && ! use development; then
520 - sed -i -e "/^group :development/,/^end$/d" Gemfile || die
521 - fi
522 - #We don't need simplecov
523 - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die
524 - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die
525 -
526 - #we need to edit the gemspec too, since it tries to call git instead of anything sane
527 - #probably a better way to fix this... if I care at some point
528 - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die
529 -
530 - #let's bogart msfupdate
531 - rm msfupdate
532 - echo "#!/bin/sh" > msfupdate
533 - echo "echo \"[*]\"" >> msfupdate
534 - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate
535 - echo "echo \"[*]\"" >> msfupdate
536 - echo "echo \"\"" >> msfupdate
537 - if [[ ${PV} == "9999" ]] ; then
538 - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate
539 - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate
540 - echo "else" >> msfupdate
541 - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate
542 - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate
543 - echo "fi" >> msfupdate
544 - else
545 - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate
546 - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate
547 - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate
548 - fi
549 - #this is set executable in src_install
550 -
551 - #install our database.yml file before tests are run
552 - cp "${FILESDIR}"/database.yml config/
553 -
554 -}
555 -
556 -each_ruby_prepare() {
557 - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die
558 - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die
559 -
560 - #force all metasploit executables to use desired ruby version
561 - #https://dev.metasploit.com/redmine/issues/8357
562 - for file in $(ls -1 msf*)
563 - do
564 - #poorly adapted from python.eclass
565 - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed"
566 - done
567 -}
568 -
569 -each_ruby_test() {
570 - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox
571 -
572 - #we bogart msfupdate so no point in trying to test it
573 - rm spec/msfupdate_spec.rb || die
574 - #we don't really want to be uploading to virustotal during the tests
575 - rm spec/tools/virustotal_spec.rb || die
576 -
577 - # https://dev.metasploit.com/redmine/issues/8425
578 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die
579 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die
580 -
581 - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die
582 - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user"
583 -}
584 -
585 -each_ruby_install() {
586 - #Tests have already been run, we don't need this stuff
587 - rm -r spec || die
588 - rm -r test || die
589 - rm Gemfile.lock || die
590 -
591 - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple.
592 - # should be as simple as copying everything into the target...
593 - dodir /usr/$(get_libdir)/${PN}${SLOT}
594 - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed"
595 - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md
596 - fowners -R root:0 /
597 -
598 -}
599 -
600 -all_ruby_install() {
601 - # do not remove LICENSE, bug #238137
602 - dodir /usr/share/doc/${PF}
603 - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die
604 - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
605 -
606 - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate
607 -
608 - #tell revdep-rebuild to ignore binaries meant for the target
609 - dodir /etc/revdep-rebuild
610 - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT}
611 - #These dirs contain prebuilt binaries for running on the TARGET not the HOST
612 - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter"
613 - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits"
614 - EOF
615 -}
616 -
617 -pkg_postinst() {
618 - elog "Before use you should run 'env-update' and '. /etc/profile'"
619 - elog "otherwise you may be missing important environmental variables."
620 -
621 - elog "You need to prepare the database by running:"
622 - elog "emerge --config postgresql"
623 - elog "/etc/init.d/postgresql-<version> start"
624 - elog "emerge --config =metasploit-${PV}"
625 -
626 - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
627 -
628 - einfo
629 - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary"
630 -}
631 -
632 -pkg_config() {
633 - einfo "If the following fails, it is likely because you forgot to start/config postgresql first"
634 - su postgres -c "createuser msf_user -D -S -R"
635 - su postgres -c "createdb --owner=msf_user msf_database"
636 -}
637
638 diff --git a/net-analyzer/metasploit/metasploit-4.12.7.ebuild b/net-analyzer/metasploit/metasploit-4.12.7.ebuild
639 index b5c66e5..cdda09e 100644
640 --- a/net-analyzer/metasploit/metasploit-4.12.7.ebuild
641 +++ b/net-analyzer/metasploit/metasploit-4.12.7.ebuild
642 @@ -45,7 +45,7 @@ RUBY_COMMON_DEPEND="virtual/ruby-ssl
643 dev-ruby/bundler
644 dev-ruby/filesize
645 dev-ruby/jsobfu:0.3.0
646 - dev-ruby/json
647 + dev-ruby/json:*
648 dev-ruby/kissfft
649 dev-ruby/metasm:1.0.2
650 >=dev-ruby/metasploit_data_models-2.0.0
651
652 diff --git a/net-analyzer/metasploit/metasploit-9999.ebuild b/net-analyzer/metasploit/metasploit-9999.ebuild
653 index 630ddac..383376b 100644
654 --- a/net-analyzer/metasploit/metasploit-9999.ebuild
655 +++ b/net-analyzer/metasploit/metasploit-9999.ebuild
656 @@ -41,20 +41,22 @@ RUBY_COMMON_DEPEND="virtual/ruby-ssl
657 >=dev-ruby/actionpack-4.2.6:4.2
658 >=dev-ruby/activerecord-4.2.6:4.2
659 dev-ruby/bcrypt-ruby
660 + dev-ruby/bit-struct
661 dev-ruby/builder:3
662 dev-ruby/bundler
663 dev-ruby/filesize
664 dev-ruby/jsobfu:0.3.0
665 - dev-ruby/json
666 + dev-ruby/json:*
667 dev-ruby/kissfft
668 dev-ruby/metasm:1.0.2
669 >=dev-ruby/metasploit_data_models-2.0.0
670 dev-ruby/meterpreter_bins:0.0.22
671 - dev-ruby/metasploit-payloads:1.1.11
672 + dev-ruby/metasploit-payloads:1.1.13
673 >=dev-ruby/metasploit-credential-2.0.0
674 >=dev-ruby/metasploit-concern-2.0.0
675 >=dev-ruby/metasploit-model-2.0.0
676 dev-ruby/msgpack
677 + dev-ruby/net-ssh:*
678 dev-ruby/nokogiri
679 dev-ruby/octokit
680 dev-ruby/openssl-ccm:1.2.1
681 @@ -62,12 +64,18 @@ RUBY_COMMON_DEPEND="virtual/ruby-ssl
682 dev-ruby/recog:2.0.14
683 dev-ruby/redcarpet
684 =dev-ruby/rkelly-remix-0.0.6
685 + dev-ruby/rex-powershell
686 + dev-ruby/rex-random_identifier
687 + dev-ruby/rex-registry
688 + dev-ruby/rex-text
689 + dev-ruby/rex-zip
690 dev-ruby/sqlite3
691 >=dev-ruby/pg-0.11
692 dev-ruby/packetfu:1.1.11
693 >=dev-ruby/rubyzip-1.1
694 dev-ruby/rb-readline-r7
695 dev-ruby/robots
696 + dev-ruby/sshkey
697 dev-ruby/tzinfo:*
698 java? ( dev-ruby/rjb )
699 oracle? ( dev-ruby/ruby-oci8 )
700 @@ -195,6 +203,9 @@ all_ruby_prepare() {
701 #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo
702 sed -i '/tzinfo-data/d' metasploit-framework.gemspec
703
704 + #mettle has no tags, and no releases on rubygems.
705 + sed -i '/metasploit_payloads-mettle/d' metasploit-framework.gemspec
706 +
707 #let's bogart msfupdate
708 rm msfupdate
709 echo "#!/bin/sh" > msfupdate