本文将向咱们介绍如安在AIX和Power架构上运转Metasploit结构,这关于那些想要测验在这些架构上运转Metasploit的人可能会有所协助(至少现在我还没有在网上发现关于这方面的教程内容)。
我已在我的笔记本电脑上运用qemu-system-ppc64完成了一切这些作业(有关如安在QEMU下运转的更多细节请参阅:https://astr0paby.wordpress.com/2019/11/04/running-aix-7-2-tl3sp1-on-x86_64-via-qemu-system-ppc64/),它十分适合在真实的硬件上进行tinkering(意为探求和着手体会)和测验。别的,请保证你为qemu模仿处理器分配至少4 GB的内存,不然你将无法运转metasploit(它会一向测验加载)这是我的qemu加载器脚本。
附:关于新的qemu-system-ppc64版别和AIX 7.2可能会存在一些问题。我运用的版别能够正常顺畅的作业,因而这儿我将其命名为qemu-system-ppc64-old
QEMU模仿器版别为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
首要,咱们需求装置一些依靠项。我将经过yum从Aixtoolbox public repo中包括我已装置在体系中的一切RPM。
AIX-rpm
SDL
SDL-devel
SDL_mixer
SDL_ttf
SDL_ttf-devel
audiofile
audiofile-devel
autoconf
automake
bash
bzip2
bzip2-devel
ca-certificates
cmake
coreutils
cups
cups-libs
curl
cyrus-sasl
db
dbus
esound
esound-devel
expat
expat-devel
expect
flac
fontconfig
fontconfig-devel
freetype2
freetype2-devel
gcc
gcc-c++
gcc-cpp
gcc-go
gdbm
gdbm-devel
gettext
gettext-devel
glib
glib-devel
glib2
glib2-devel
gmp
gmp-devel
gnutls
grep
gtk+
info
less
libXft
libXft-devel
libXrandr
libXrender
libXrender-devel
libffi
libffi-devel
libgcc
libgcrypt
libgcrypt-devel
libgo
libgo-devel
libgpg-error
libgpg-error-devel
libiconv
libjpeg
libmikmod
libmpc
libogg
libogg-devel
libpcap
libpcap-devel
libpng
libpng-devel
libssh2
libssh2-devel
libstdc++
libstdc++-devel
libtasn1
libtool
libvorbis
libvorbis-devel
libxml2
libxml2-devel
libxml2-python
libxslt
libxslt-devel
lua
m4
mpfr
ncurses
ncurses-devel
nettle
nmap
openldap
p11-kit
patch
pcre
pcre-devel
perl
pkg-config
postgresql
postgresql-devel
postgresql-libs
pth
pysqlite
python
python-cryptography
python-devel
python-iniparse
python-passlib
python-pyasn1
python-pycurl
python-six
python-tools
python-urlgrabber
python3
readline
readline-devel
renderproto
rsync
sed
*** peg
*** peg-libs
sqlite
sqlite-devel
tar
tcl
tcsh
tightvnc-server
tk
unzip
wget
xz
xz-devel
xz-libs
yum
yum-metadata-parser
zlib
zlib-devel
由于来自https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/ruby/的ruby-2.5.1和ruby-devel-2.5.1 RPM在编译Metasploit所依靠的gem时无法正常作业,因而我挑选在AIX上从源码构建Ruby。这并不难(咱们将装置到 /usr/local以和/opt/freeware分隔)。
在本例中,我运用Ruby 2.5.1版别,但你也能够运用2.5.5或2.6.3版作用是相同的。
$ 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
一旦咱们装置了Ruby(保证在你的配置文件中已包括/usr/local),咱们就能够持续从git下载Metasploit快照。我之所以挑选获取ZIP快照,是由于它在ppc64模仿器下速度会更快。
$ wget https://github.com/rapid7/metasploit-framework/archive/master.zip
$ unzip master.zip
$ cd metasploit-framework-master
下一步是在metasploit目录中运转bunlde install,但咱们现在将越过此进程,由于咱们需求在本地自定义2个gem,并在AIX 7.2上编译和构建它们。
nokogiri-1.10.3.gem
bcrypt-3.1.13
由于nokogiri不会在AIX上构建,由于短少vasprintf()函数,它不是POSIX接口,而且不在AIX中的C库中,假如不修正构建进程gem将构建和编译,但终究库将不起作用,并出现以下过错:
bash-5.0# /usr/local/bin/gem install nokogiri-1.10.3.gem
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.3
Parsing documentation for nokogiri-1.10.3
Done installing documentation for nokogiri after 49 seconds
1 gem installed
bash-5.0# /usr/local/bin/nokogiri
Traceback (most recent call last):
8: from /usr/local/bin/nokogiri:23:in main>' 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 required)>' 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 required)>' 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/ *** in/execerror ruby "(ld 3 1 vasprintf /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so"[1][2][3]黑客接单网