actions.py 1.3 KB

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import shelltools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import get
  9. def install():
  10. shelltools.makedirs(get.installDIR() + "/usr/bin")
  11. for i in ["msfbinscan", "msfconsole", "msfd", "msfelfscan", "msfmachscan", "msfpescan", "msfrop", "msfrpc", "msfrpcd", "msfupdate", "msfvenom"]:
  12. msfBashFile = open(get.installDIR() + "/usr/bin/%s" % i, "w")
  13. msfBashFile.write("#!/bin/sh\nexec ruby /usr/share/metasploit/%s \"$@\"\n" % i)
  14. msfBashFile.close()
  15. shelltools.system("chmod +x '%s/usr/bin/%s'" % (get.installDIR(), i))
  16. shelltools.copytree(get.workDIR() + "/metasploit-framework-%s/" % get.srcVERSION(), "%s/usr/share/metasploit/" % get.installDIR())
  17. shelltools.cd("%s/usr/share/metasploit/" % get.installDIR())
  18. shelltools.system("bundle install --jobs=1 --no-cache --deployment")
  19. shelltools.system("find vendor/bundle/ruby/*/gems/robots-* -exec chmod o+r '{}' \;")
  20. shelltools.cd("%s/metasploit-framework-%s" % (get.workDIR(), get.srcVERSION()))
  21. pisitools.insinto("/%s/metasploit" % get.docDIR(), "documentation/*")
  22. pisitools.dodoc("COPYING", "HACKING", "LICENSE", "README*")