talimat 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Tanım: ileri düzey exploit kullanarak geliştirme ve test etme çatı uygulaması
  2. # URL: http://www.metasploit.com
  3. # Paketçi: milisarge yakar
  4. # Gerekler: ruby libpcap postgresql ruby-bundler sqlite libxslt clang
  5. # Grup: güvenlik
  6. isim=metasploit
  7. surum=4.17.23
  8. devir=1
  9. kaynak=(https://github.com/rapid7/metasploit-framework/archive/$surum.tar.gz::$isim-$surum.tar.gz)
  10. derle() {
  11. cd "${isim}-framework-$surum"
  12. bundle config build.nokogiri --use-system-libraries
  13. sed 's|git ls-files|find -type f|' -i metasploit-framework.gemspec
  14. export CC=clang
  15. export CXX=clang++
  16. bundle install -j"$(nproc)" --no-cache --deployment
  17. find vendor/bundle/ruby -exec chmod o+r '{}' \;
  18. install -d "${PKG}/opt/${isim}" "${PKG}/usr/bin"
  19. find . -maxdepth 1 -mindepth 1 -not -path './.git*' -exec cp -r '{}' "${PKG}/opt/${isim}" \;
  20. for f in "${PKG}"/opt/${isim}/msf*; do
  21. local _msffile="${PKG}/usr/bin/`basename "${f}"`"
  22. echo -e "#!/bin/sh\nBUNDLE_GEMFILE=/opt/${isim}/Gemfile bundle exec ruby /opt/${isim}/`basename "${f}"` \"\$@\"" > "${_msffile}"
  23. chmod 755 "${_msffile}"
  24. done
  25. (cd "${PKG}/opt/${isim}"
  26. for f in tools/*/*.rb; do
  27. install -Dm 755 "${f}" ".${f}"
  28. echo -e "#!/bin/sh\nBUNDLE_GEMFILE=/opt/${isim}/Gemfile bundle exec ruby /opt/${isim}/."${f}" \"\$@\"" > "${f}"
  29. chmod 755 "${f}"
  30. done
  31. )
  32. install -Dm 644 external/zsh/_* -t "${PKG}/usr/share/zsh/site-functions"
  33. install -d "${PKG}/usr/share/doc"
  34. mv "${PKG}/opt/${isim}/documentation" "${PKG}/usr/share/doc/${isim}"
  35. rm "${PKG}/usr/bin/msfupdate"
  36. # desktop
  37. mkdir -p "$PKG/usr/share/applications/"
  38. cat > $PKG/usr/share/applications/$isim.desktop << BASLA
  39. [Desktop Entry]
  40. Name=metasploit
  41. Exec=sh -c "msfconsole;${SHELL:-bash}"
  42. Terminal=true
  43. Icon=msfconsole
  44. Type=Application
  45. Categories=Network;X-Komutan;
  46. Version=1.0
  47. BASLA
  48. }