Install penetration test framework under Linux Metasploit

Source: Internet
Author: User
Tags gpg wrappers

Let's start with a way to download directly from GitHub:

git clone--depth=1  git://github.com/rapid7/metasploit-framework Metasploit

And then:

CD./metasploit

The result is this:

[Email protected]:~/metasploit$ lsapp    features  msfconsole  scriptcode_of_conduct.md  gemfile  MSFD      scriptsconfig    Gemfile.local.example  msfrpc      speccontributing.md     gemfile.lock  MSFRPCD     testcopying    HACKING  msfupdate   toolsdata    lib  msfvenom    vagrantfiledb    LICENSE  pluginsdocumentation    metasploit-framework.gemspec  rakefileexternal    Modules  readme.md

Then the direct msfconsole can be run. The update is also here: msfupdate (attention to permission issues when executing)

The second method:

First, let's download this file, and save the file name as Msfinstall

Curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/ Metasploit-framework-wrappers/msfupdate.erb > Msfinstall

The result is this:

[email protected]:/home/magic/tools/metasploit# Curl https://raw.githubusercontent.com/rapid7/ Metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb#!/bin/shprint_pgp_key () {Cat <<-eof-----BEGIN PGP Public KEY BLOCK-----VERSION:GNUPG v1mqinbfday/ 0beac8i5bw5glqqhkx5jcacycxfl6azowl3qiotxo5yfbl8cepnpwyooerviujb17wehhhbwoo9wjpbaldxbrti1nvfarewot8flm7bdhye8u45mobfkyixft Nrpw3pdilthqisrb8pufhlin8obquq0rcxyv8nblvyo4gignjbfo1qgvbnmp7kbtjlauzgusczmutdpowfv8fqn52x9tcv1ahqk1hg8xg9yww0vxb5z93jklx Bb5bsrcnou4m9iv6vov2hvnrymkt7uht3z4fqflp9nkysl4dacdzgmxbf169vvldwlrclvymwabwvuyilzv4jw1w0kx8nwituk5a886882i83lxnkh1vc9jin va4/ 5htrbrwxjb7qoyh7sxa5gofgq1nwvflkrvvcmystrpu18sf1orfg1utfcz86rydxpmozvk7eeabilcqdzkof0fv3u9cxlj8gxpjpy1lu6udzun6ng1aljjspk gnbpqeqejlknag+rf+tp73trg0pw8c/ thl7fn93et3wn5tfnu86liui9wd8zlupjneyee6eypagxj4p69yb4ou5um5jwnzavameecbzvtc4hohy3nteivmdckv/ O8xxkoclpjw1rsdirklzrisjypx2yujsvmcsn5sghp5+ocsq+on4ofwxcskemvy97ftkv/fwui7mqaraqabtcjnzxrhc3bsb2l0idxtzxrhc3bsb2l0qhjhcglkny5jb20+ iqi9bbmbcganahsdbqsjcacdbrukcqglbrycaweaah4baheabqjxyxj4bqkmred3aaojem37x6ugb7lugbap/ 2h3lrympiwj7m3dkq0ftphavyarwdy1y/kf2hygmweljuzllcwyitg4pdjtr/ etadrsxvgi8jfi2qpprlsloetgipcssjwzjq2neflrpjixmb7srt8hx0oovccxj7nxfwks0oed09fabo/k8ix5ynmddv5y7jhz/ hbfkteqpxay4btczuw4a1tv8f1xw5ortnvedbjguhnezwdvj88xjgthj0yhdzmcu+mhel3mms7bfugdhjobko+ ozgnczyaz1bjjrut0cnfytvzypoeekyhmxp/ba1x6bs+x5gqnbwp+fywcl7hcrxpnwhdkzyajpml6coo8ryy45mrf/ Goberkuauqvn0dbblirmmtmpbdv/uxyk5b8jnlxnreskx4ofhoxkcccizldq2unbuatiz0fqbmlllkavnff1nq8/hm+elnf4k030wh+ne+ pipzzndid0kvbhzzdlen/ C81jw5yibsduqx5hbll2fpj029zc9qwkzkcls1gwh4lp63aufnm39gjt5vqrmflvfg9wsoglzfn1bfsfh9uot4umktkmfdqwiel2wzbcsldzat8hxxrxlnib6 sfrgjkftjdvlscwh9phabrhpqy9bj7a6diin1dc8rydmlqcikezwltjph8ndaaxi8fleucu2n9qsarwqt6qwtcp/o7c6uvpejy3uqinbfday/ 0beac5ayq56lcexqzf6ldlomjpniosn9cevi2vc/bj4rgnwtenh6eh8f05xaxhepdunwk9gtadi6row6opa0qvmgex4wndztpseuzv3dblf+ Jqymngmut40lrvhivydfrh+c5ig4cwjf19sbdopb2cpc1nls0xotlafnu70t9i6zwoj0pl1bjsr2lnbfpp43sj9qo3ak17pn134xgqgilgheoq4svf0+rtq7jaw5vmn6jxhklxrgdkj4o6s0voqwjfigzcmxli0t+sr4wjpjtdtdcbmqrd/ 4cs0dzmljvngferiobbjcwvyr+ttiq7lbbkhkz3trjf6ohlwi0iyvmj+ba7qkujjp9yvjiunp5aru/ gskpyeuvrofnywjagjaobyqxxczg10hysngqww4ot0j7jdd9zimrf8gsxpafennh+ wsva7raptwbczy5hla2cmcggeaonbjf2claw3mygmllqpbgidtok8gppe8dnvhhm49uidthf2aikmltjqwzd6hv939va77imal/ pknhyoweadmirgywhx+cejzjaqsqkd0g3psfjlbaf/0vo1nbav8q9vjgqhefantzej5hqn6ldwkuul4vb+ Aosiz5z1du32ul1ctcozujtcwjl9ebz8ybsqy7ol4slsw3uknag6tbtqqyb9liidvdqug6ojhmzbwaraqabiqilbbgbcgapahsmbqjxyxjnbqkmrediaaojem 37x6ugb7luj9yp+gifmdyjbdtd+px+ 6z9fbb8p7sf8hlepp51m1csafqudfamovrq6d4p3n0kjpqs7uz1uqjqliyaek4jteqmfkpdywcvj8zv17u41faks3bjfg3cr2+jtzf69sa/ phhr+/a6msnm/w+0yfoqhbko6miwc0an5qhzg1mbic6rb8qjzlsjowwlf06zrsmodhulb2q2jmaquvqd923wjtmilur4wavpnikdcyomlncpf/ umvutun0xup7ca0yfxjgkjznlafq8g+b8alyvodzyhjblaizkojewdn3zptqebnp7n8wtl0+rc2f3bmnak6+m0p/ f1kyxyz3obsvqxwe3ryakxarcg95wxqrn6hn0pbb5ld05ytx/pezrypyfe4cyptil+y7sseexqhrrjpwr3fkgckbpsrqkguk3miz4ihvvlykv/ Z9imynrmvzmxum2qabrgyd0x4kvdxso6yr2rn8sc89c/ oxibk1hrwvgfrofue9pmdekhsbvyeqknb8v18yp0gswrbc4cjogqdwv64ypaotp2tb9qhqjjfm9xdt/wjsxki1uzzswqbfpd/ylstb6/ V1k3dksvq6cvzqabt4g2hq78req+zyncud2z3exxrlvheqjdxzxoayqfato4iiac7wbrazz6mdr6mxxfmluqo2qxth3ricafyvaf7yuda= Hqke-----END PGP Public KEY BLOCK-----eof}install_deb () {list_file=/etc/apt/sources.list.d/ Metasploit-framework.list Pref_file=/etc/apt/preferences.d/pin-metasploit.pref IF [!-f $LIST _file];    Then Echo-n "Adding metasploit-framework to your repository list ..." echo "Deb $DOWNLOAD _uri/apt lucid main" > $LIST _file print_pgp_key | Apt-key Add-fi IF [!-f $PREF _file]; Then mkdir-p/etc/apt/preferences.d/cat > $PREF _file <<eofpackage:metasploit*pin:origin downloads.metas  ploit.compin-priority:1000eof fi echo-n "Updating Package cache:"  Apt-get Update >/dev/null echo "OK" echo "Checking for and installing update ..." Apt-get install-y--force-yes metasploit-framework}install_rpm () {echo "Checking FOr and Installing update: " Repo_file=/etc/yum.repos.d/metasploit-framework.repo Gpg_key_file=/etc/pki/rpm-gpg/rpm-gpg-key-metasploit IF [!-F $REPO _file];    Then Echo-n "Adding metasploit-framework to your repository list ..." Cat >/etc/yum.repos.d/metasploit-framework.repo <<eof[metasploit]name=metasploitbaseurl= $DOWNLOAD _uri/ rpmgpgcheck=1gpgkey=file://$GPG _key_fileenabled=1eof print_pgp_key > ${gpg_key_file} fi yum install-y metasploit- Framework}install_pkg () {(CD ~/downloads echo "Downloading package ..." Curl-o "$DOWNLOAD _uri/osx/metasploitfra Mework-latest.pkg "echo" Checking signature ... "If Pkgutil--check-signature metasploitframework-latest.pkg; Then echo "Installing package ..." installer-pkg metasploitframework-latest.pkg-target/fi echo "Cleanin G up ... "RM-FV metasploitframework-latest.pkg)}download_uri=http://downloads.metasploit.com/data/releases/ Metasploit-frameworkpkgtype=unknownid= ' id-u ' if [-f/etc/rEdhat-release]; Then Pkgtype=rpmelse if UNAME-SV | grep ' Darwin ' >/dev/null; Then pkgtype=pkg else pkgtype=deb fifiif ["$ID"-ne 0]; Then if! Hash sudo 2>/dev/null; Then echo "This script must is executed as the ' root ' user or with sudo" exit 1 else echo "Switching to root use  R to update the package "SUDO-E $ [email protected] exit 0 fificase $PKGTYPE in Deb) install_deb;;  RPM) install_rpm;; *) install_pkgesac[email protected]:/home/magic/tools/metasploit# Lsmsfinstall

That's right. This is the download script that someone else has written. You can just save it as Msfinstall, and then give the file permission to execute it.

chmod 755 Msfinstall

Then to execute:

./msfinstall

Then we can run the Metasploit:

Msfconsole

PS: Reprint please indicate the source.

Install penetration test framework under Linux Metasploit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.