Installing Yaptest on Mac

Deanx gave gave me some very useful hints on how to get yaptest working on Mac.

Install Macports

If you haven’t done so already, you’ll need to install MacPorts.

Install postgres

Next, install PostgreSQL v8.0.x:

port install postgresql80-server

It is possible to get yaptest working on Postgres 8.2+, but the solution isn’t documented here.

Install PERL Database Drivers

Install PERL’s Postgres DBI driver:

port install p5-class-dbi-pg

This will pull in postgres 8.3 as a dependency unfortunately. This isn’t what we want. We need version 8.0. Don’t use 8.3 even if it’s installed for you.

Switch to the “Ports” Version of PERL

Unhappily, all the PERL scripts in yaptest are hard-coded to use /usr/bin/perl.  However, the ports version is in /opt/local/bin/perl.  The following dirty workaround will fix the problem, but I’d like a cleaner solution:

# cd /usr/bin/
# mv perl perl-old
# ln -s /opt/local/bin/perl

Use the Mac Version of the Install Scripts

Version 0.0.9 of yaptest introduced some Mac-friendly install scripts:

# make databasemac
# make installmac

 Building bannergrab

Apparently this should fix your compile problems on mac:

gcc -lssl -L/opt/local/lib -I/opt/local/includes -lcrypto -o bannergrab bannergrab.c

 

 

Everything below here should no longer be required.  It’s left here just incase someone needs it…

 

Symlink psql8 to psql

Under Mac the database client is called “psql8”, but on Linux its “psql”.   Change to the directory containing psql8 and run:

# ln -s psql8 psql

Add the postgres user to postgres

There’s no user called “postgres” by default like on Linux.  Make one using the psql client:

su - postgresql80
psql8 template1
> CREATE USER postgres;

NB: The postgres client is called psql8, not psql like on Linux. psql8 lives in /usr/local/bin.

Fix “make database”

After you install you need to run “make database” as per the installation guide .  However, this doesn’t work as expected on Mac.  Here are some notes to work round the problems you’ll encounter:

Postgres OS-level user

The user you’ll need to su to to install the database is “postgres80”, not “postgres” like on Linux.

“dropdb” and “createdb” commands

These command reside in /opt/local/lib/postgres80/bin.  This is not in your path, so all references to these commands fail.  Add this dir to your path.

Fix “make install”

Change the PERLDIR in the Makefile:

PERLDIR=/opt/local/lib/perl5/site_perl

Some Install-files I made Earlier

Actually, they were sent to me Deanx.   This tar ball has modified yaptest-db-install.sh, yaptest-install.sh and Makefile files which are apparently more friendly for Mac-users.

 

I hope these notes help.  Let me know if I’ve missed anything (pentestmonkey aatt pentestmonkey dot net).


Leave a Reply