In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
How to run Metasploit Framework on AIX and Power architecture, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.
I've done all this on my laptop using qemu-system-ppc64, which is perfect for tinkering (meaning exploration and hands-on experience) and testing on real hardware. Also, make sure you allocate at least 4 GB of memory to the qemu analog processor, or you won't be able to run metasploit (it will keep trying to load) this is my qemu loader script.
Attachment: there may be some problems with the new qemu-system-ppc64 version and AIX 7.2. The version I use works well, so here I name it qemu-system-ppc64-old
QEMU simulator version 3.0.50 (v3.0.0-614-g19b599f766-dirty)
. / qemu-system-ppc64-old-cpu POWER8-machine pseries-m 4096-serial stdio-drive file=disk.img,if=none,id=drive-virtio-disk0-device virtio-scsi-pci,id=scsi-device scsi-hd,drive=drive-virtio-disk0-cdrom aix.iso-prom-env boot-command='boot disk:'- net nic-net tap-display vnc=:1
First, we need to install some dependencies. I will include all the RPM that I have installed on the system from Aixtoolbox public repo through yum.
AIX-rpmSDLSDL-develSDL_mixerSDL_ttfSDL_ttf-develaudiofileaudiofile-develautoconfautomakebashbzip2bzip2-develca-certificatescmakecoreutilscupscups-libscurlcyrus-sasldbdbusesoundesound-develexpatexpat-develexpectflacfontconfigfontconfig-develfreetype2freetype2-develgccgcc-c++gcc-cppgcc-gogdbmgdbm-develgettextgettext-develglibglib-develglib2glib2-develgmpgmp-develgnutlsgrepgtk+infolesslibXftlibXft-devellibXrandrlibXrenderlibXrender-devellibffilibffi-devellibgcclibgcryptlibgcrypt-devellibgolibgo-devellibgpg-errorlibgpg-error-devellibiconvlibjpeglibmikmodlibmpclibogglibogg-devellibpcaplibpcap-devellibpnglibpng-devellibssh3libssh3-devellibstdc++libstdc++-devellibtasn1libtoollibvorbislibvorbis-devellibxml2libxml2-devellibxml2-pythonlibxsltlibxslt-develluam4mpfrncursesncurses-develnettlenmapopenldapp11-kitpatchpcrepcre-develperlpkg-configpostgresqlpostgresql-develpostgresql-libspthpysqlitepythonpython-cryptographypython-develpython-iniparsepython-passlibpython-pyasn1python-pycurlpython-sixpython-toolspython-urlgrabberpython3readlinereadline-develrenderprotorsyncsedsmpegsmpeg-libssqlitesqlite-develtartcltcshtightvnc-servertkunzipwgetxzxz-develxz-libsyumyum-metadata-parserzlibzlib-devel
Because ruby-2.5.1 and ruby-devel-2.5.1 RPM from https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/ruby/ don't work properly when compiling gem on which Metasploit depends, I choose to build Ruby from source code on AIX. This is not difficult (we will install it to / usr/local to separate from / opt/freeware).
In this case, I use Ruby version 2.5.1, but you can also use version 2.5.5 or 2.6.3 with the same effect.
$wget https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz$ tar-zxvf ruby-2.5.1.tar.gz$ cd ruby-2.5.1 $. / configure$ make$ su-# make install
Once we have installed Ruby (make sure / usr/local is included in your configuration file), we can continue to download Metasploit snapshots from git. I chose to take a ZIP snapshot because it would be faster under the ppc64 simulator.
$wget https://github.com/rapid7/metasploit-framework/archive/master.zip$ unzip master.zip $cd metasploit-framework-master
The next step is to run bunlde install in the metasploit directory, but we will skip this step now because we need to customize 2 gem locally and compile and build them on AIX 7.2.
Nokogiri-1.10.3.gembcrypt-3.1.13
Because nokogiri will not be built on AIX, because of the lack of the vasprintf () function, it is not a POSIX interface and is not in the C library in AIX. If you do not modify the build process, gem will build and compile, but eventually the library will not work with the following error:
Bash-5.0# / usr/local/bin/gem install nokogiri-1.10.3.gemBuilding native extensions. This could take a while...Successfully installed nokogiri-1.10.3Parsing documentation for nokogiri-1.10.3Done installing documentation for nokogiri after 49 seconds1 gem installedbash-5.0# / usr/local/bin/nokogiriTraceback (most recent call last): 8: from / usr/local/bin/nokogiri:23:in'7: from / usr/local/bin/nokogiri:23:in load' 6: from / usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/bin / nokogiri:6:in'5: from / usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' 4: from / usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' 3: from / usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri.rb:28:in'2: from / usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri.rb:32:in rescue in'1: from / usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' / usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': load failed-/ usr/local/lib/ruby / gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogir.so. Please issue below command for detailed reasons: (LoadError) / usr/sbin/execerror ruby "(ld 3 1 vasprintf / usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so"
We can check the details of the error by running the command:
Bash-5.0# / usr/sbin/execerror ruby "(ld 3 1 vasprintf / usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so" exec (): 0509-036 Cannot load program ruby because of the following errors:rtld: 0712-001 Symbol vasprintf was referenced from module/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so (), but a runtime definition of the symbol was not found.
You can see that the vasprintf symbol is missing and is called.
Let's create a working directory for Ruby gem and download nokogiri.
$mkdir GEMS$ cd GEMS$ gem fetch nokogiri Fetching: nokogiri-1.10.3.gem Downloaded nokogiri-1.10.3$ gemspec nokogiri-1.10.3.gem-- ruby > nokogiri.gemspec$ gem unpack nokogiri-1.10.3.gemUnpacked gem:'/ home/root/LOCAL-GEMS/TT/nokogiri-1.10.3'$ mv nokogiri.gemspec nokogiri-1.10.3$ cd nokogiri-1.10.3$ cd ext/nokogiri
Now we will modify the extconf.rb file to include the build process Create a working nokogiri.so shared library on AIX and navigate to nix? $CFLAGS 1.4.14, development) may be overly strict if racc is semantically versioned, use: add_development_dependency 'racc',' ~ > 1.4 racc','> = 1.4.14'WARNING: pessimistic dependency on rake-compiler (~ > 1.0.3, development) may be overly strict if rake-compiler is semantically versioned, use: add_development_dependency 'rake-compiler',' ~ > 1.0' '> = 1.0.3'WARNING: pessimistic dependency on rexical (~ > 1.0.5, development) may be overly strict if rexical is semantically versioned, use: add_development_dependency' rexical','> 1.0mm,'> = 1.0.5'WARNING: See http://guides.rubygems.org/specification-reference/ for help Successfully built RubyGem Name: nokogiri Version: 1.10.3 File: nokogiri-1.10.3.gem$ su # gem install nokogiri-1.10.3.gem
Eventually it will be built after a while (it's slow under qemu) we can check whether the final nokogiri gem is actually working by executing the gem itself.
# gem install bcrypt Fetching: bcrypt-3.1.13.gem Building native extensions. This could take a while...ERROR: Error installing bcrypt: ERROR: Failed to build gem native extension. Current directory: / usr/local/lib/ruby/gems/2.5.0/gems/bcrypt-3.1.13/ext/mri/usr/local/bin/ruby-r. / siteconf20190624-6029732-1f0poah.rb extconf.rbcreating Makefilecurrent directory: / usr/local/lib/ruby/gems/2.5.0/gems/bcrypt-3.1.13/ext/mrimake "DESTDIR=" cleancurrent directory: / usr/local/lib/ruby/gems/2.5.0/gems/bcrypt-3. 1.13/ext/mrimake "DESTDIR=" compiling bcrypt_ext.ccompiling crypt_blowfish.ccompiling crypt_gensalt.ccompiling wrapper.clinking shared-object bcrypt_ext.sogcc: error: x86.o: No such file or directorymake: 1254-004 The error code from the last command is 1.Stop.make failed Exit code 2Gem files will remain installed in / usr/local/lib/ruby/gems/2.5.0/gems/bcrypt-3.1.13 for inspection.Results logged to / usr/local/lib/ruby/gems/2.5.0/extensions/powerpc-aix-7/2.5.0-static/bcrypt-3.1.13/gem_make.out
There are also some problems with using x86.o object files on the ppc64 AIX platform. But it's also easy to fix, you just need to repeat the above to get the gem and modify the build process.
$gem fetch bcrypt Fetching: bcrypt-3.1.13.gem Downloaded bcrypt-3.1.13$ gemspec bcrypt-3.1.13.gem-- ruby > bcrypt.gemspec$ gem unpack bcrypt-3.1.13.gem$ mv bcrypt.gemspec bcrypt-3.1.13$ cd bcrypt-3.1.13$ cd ext/mri
Let's edit the extconf.rb file again and delete the x86 reference
Delete x86.o save and regenerate gem
$cd.. /.. $gem build bcrypt.gemspecWARNING: open-ended dependency on rspec (> = 3, development) is not recommended if rspec is semantically versioned, use: add_development_dependency 'rspec',' > 3'WARNING: See http://guides.rubygems.org/specification-reference/ for help Successfully built RubyGem Name: bcrypt Version: 3.1.13 File: bcrypt-3.1.13.gem$ su # gem install bcrypt-3.1.13.gemBuilding native extensions. This could take a while...Successfully installed bcrypt-3.1.13Parsing documentation for bcrypt-3.1.13Installing ri documentation for bcrypt-3.1.13Done installing documentation for bcrypt after 26 seconds1 gem installed
By now, we should have installed all the missing gem required by the Metasploit framework, so just run bundle install from the metasploit root directory
$cd metasploit-framework-master$ bundle install
Because it takes some time, you can make a cup of coffee / tea and taste it slowly. I'm going to go outside at this time.
Now, are you ready to run the Metasploit framework on AIX 7.2? I want to say yes!
We can run. / msfconsole (this may take some time under qemu)
You can even perform some real-time tests on up2date windows 10 1903 (10.0.18362.175) and bypass MS Defender; at run time)
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.