Netglub

Really Open Source Information Gathering

How to compile the master

6 Comments »

Only available on GNU Linux distributions.

step 1 : Prerequisites

The sources are not available yet

Mandatory Dependencies and package needed

Some package are mandatory to compile and run the master :

  • build-essential
  • mysql-server ( see step 2 )
  • libmysqlclient16-dev
sudo aptitude install build-essential mysql-server libmysqlclient16-dev

Step 2 : Install Database.

Netglub master use a mysql database. a file containing all the tables is available in the package.
Location :

@Netglub_location)/trunk/master/tools/sql/netglub.sql 

The user that will be used must have all right in this database.

In the following hint, we create a database named netglub with user netglub (password : netglub)

bash~$ mysql -u (@MYSQL_USER_NAME (root)) -p(@MYSQL_PASSWORD)
mysql> create database netglub;
mysql> use netglub;
mysql> create user "netglub"@"localhost";
mysql> set password for "netglub"@"localhost" = password("netglub");
mysql> GRANT ALL ON netglub.* TO "netglub"@"localhost";
mysql> quit
bash~$ mysql -u (@MYSQL_USER_NAME (root)) -p(@MYSQL_PASSWORD) netglub < (@Netglub_location)/trunk/master/tools/sql/netglub.sql
Now the database is available.

Step 3 : Qt framework install

The master depend on Qt framework (version 4.6 at least).

Actually, the latest release of Qt framework is the 4.6.3. The packages available on Ubuntu official repository being too old, two solutions may be used :

First Solution: Install Qt SDK.

You can download the 64bit version of Qt SDK at http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp or download it from our local mirror (private link). netglub master can be used on a 32bit processor too, if you made this choose, you should dowload the Qt SDK 32bit version http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86-opensource-2010.03.bin or dirrectly here (private link)

The SDK take up more disk space than compiling Qt sources, but it contains a inary version of Qt libraries which avoid a complete compile. Furthermore, the compilation is trivial via graphical wizard.

wget http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86_64-opensource-2010.03.bin
chmod +x qt-sdk-linux-x86_64-opensource-2010.03.bin 
./qt-sdk-linux-x86_64-opensource-2010.03.bin 

Second solution : Compiling Qt Sources

the first solution is recomended

This solution, more laborious, is to download the Qt source (http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src -4.6.3.tar.gz) and to make yourself compile it

sudo aptitude install libxq11-dev libxext-dev 
tar xf qt-everywhere-opensource-src-4.6.3.tar.gz 
cd qt-everywhere-opensource-src-4.6.3 cd qt-everywhere-opensource-src-4.6.3
./configure -opensource -fast -nomake examples -nomake demos -qt-sql-mysql -plugin-sql-mysql
make 
sudo make install 
To compile Qt in debug mode :

 ./configure -opensource -fast -nomake examples -nomake demos -debug -no-separate-debug-info 

Getting mysql to work :

The mysql plugins are not included in the sdk you may need some help to instal it :

if you have compiled the sources, you may not need the following (if you installed the mysql plugins.)
cd (@Qt)/qt/src/plugins/sqldrivers/mysql
qmake (qmake is locate in the bin directory of qt)
make
You may have some problems to detects mysql headers, if it's the case, you can force a path to this headers :
qmake INCLUDEPATH+=(@mysql_headers_path) ex: qmake INCLUDEPATH+=/usr/include/mysql/
then retry make.
cp libqsqlmysql.so ../../../../plugins/sqldrivers/ 
  or cp libqsqlmysql.so (@Qt)/qt/plugins/sqldrivers/ 
Now, Qt is installed, you can begin the master install.

step 4 : install the master :

you can now compile the master :

cd (@netglub_location)/master
qmake
make 

to finish the instalation :

cd tools
sudo ./install.sh

to launch the master :

./(@netglub_location)/master/tools/netglub_master start
the master will automaticaly start at each boot.
You can tip :
sudo ./master -h
for help
If you want to change some configuration, you can change the file
(@netglub_location)/master/tools/master.conf
and launch install.sh again.

6 Responses

Is it possible that you forgot the qt directory in your source package? I already installed the Qt SDK, and I already compiled netglub, so I proceed directly to step 4 and I get this error:
main.cpp: In function ‘int main(int, char**)’:
main.cpp:276:32: error: ‘getpid’ was not declared in this scope
make[1]: *** [../build/main.o] Error 1
make[1]: Leaving directory `/tmp/netglub-1.0/master/src’
make: *** [sub-src-master-pro-make_default-ordered] Error 2

Thanks!!

  • Hello,

    On Kubuntu 13.04, I had a problem trying to compile the master :

    main.cpp:277:32: error: ‘getpid’ was not declared in this scope

    I had to add this line for it to work :
    #include

    I don’t know whether it comes from me or if it’s a kind of regression, due to the evolution of Ubuntu.

  • To get master to compile on:

    Linux Kali 3.12-kali1-amd64 #1 SMP Debian 3.12.6-2kali1 (2014-01-06) x86_64 GNU/Linux

    I needed to edit the ~/master/src/main.cpp

    at line 22 I added

    #include <unistd.h>

    No changes were needed anywhere else.

    philip

  • include

    to resolve
    main.cpp:277:32: error: ‘getpid’ was not declared in this scope

  • include unistd.h

  • Hi folks,
    Trying to install Netglub on BTrR3 and KALI for some time but without success.
    Used few scripts/ways (like on pentest-standard.org).
    Is there any way for someone to check right procedure?
    Thanx

  • Leave a Reply

    You must be logged in to post a comment.