Tuesday 15 December 2015

Error! E: Encountered a section with no Package: header


apt-get update
Error : Reading package lists... Error! E: Encountered a section with no Package: header

rm -vf /var/lib/apt/lists/*

apt-get update

Ref: http://askubuntu.com/questions/30072/how-do-i-fix-a-problem-with-mergelist-or-status-file-could-not-be-parsed-err

Tuesday 8 December 2015

Install OpenVAS 7 on Ubuntu 14.04


OpenVAS Source Installation Steps

mkdir openvas-src
cd openvas-src/
wget http://wald.intevation.org/frs/download.php/1638/openvas-libraries-7.0.1.tar.gz
wget http://wald.intevation.org/frs/download.php/1640/openvas-scanner-4.0.1.tar.gz
wget http://wald.intevation.org/frs/download.php/1637/openvas-manager-5.0.0.tar.gz
wget http://wald.intevation.org/frs/download.php/1639/greenbone-security-assistant-5.0.0.tar.gz
wget http://wald.intevation.org/frs/download.php/1633/openvas-cli-1.3.0.tar.gz
tar zxvf openvas-{component}.tar.gz

install the Ubuntu 14.04 packages

apt-get install build-essential bison flex cmake pkg-config libglib libglib2.0-dev libgnutls libgnutls-dev libpcap libpcap0.8-dev libgpgme11 libgpgme11-dev doxygen libuuid1 uuid-dev sqlfairy xmltoman sqlite3 libxml2-dev libxslt1.1 libxslt1-dev xsltproc libmicrohttpd-dev

Enter each of the components directories and perform the following steps,

cd {component}
mkdir source
cd source
cmake ..
make
make install

openvas-mkcert
ldconfig
openvassd

Check that openvassd has started correctly and is running.

ps -ef | grep openvas

Lets sync NVT plugins and the vulnerability data.

openvas-nvt-sync
openvas-scapdata-sync
openvas-certdata-sync

Create a user account and client certificate.

openvasmd --create-user=admin --role=Admin
openvas-mkcert-client -n -i

Then check you have openvassd / openvasmd / gsad running.

openvasmd --rebuild --progress
openvasmd
gsad

ps -ef | grep openvas

And confirm each component is listening on its port.

netstat -anp | grep LISTEN

we have OpenVAS up and running its time to look at the web console,
https://192.168.1.127/omp

Ref :- https://hackertarget.com/install-openvas-7-ubuntu/

Enable logs from MySQL configuration


All log files are NOT enabled by default MySQL setup.

The Error Log

Error Log goes to syslog due to,

cat /etc/mysql/conf.d/mysqld_safe_syslog.cnf
[mysqld_safe]
syslog

vi /etc/mysql/my.cnf
[mysqld_safe]
log_error=/var/log/mysql/error.log

[mysqld]
log_error=/var/log/mysql/error.log

The General Query Log

To enable General Query Log,

vi /etc/mysql/my.cnf
general_log_file        = /var/log/mysql/mysql.log
general_log             = 1

The Slow Query Log

To enable Slow Query Log,

vi /etc/mysql/my.cnf
log_slow_queries       = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

Error Log file = /var/log/mysql/error.log
General Query Log file = /var/log/mysql/mysql.log
Slow Query Log file = /var/log/mysql/mysql-slow.log


Ref :- https://dev.mysql.com/doc/refman/5.6/en/server-logs.html
          http://www.pontikis.net/blog/how-and-when-to-enable-mysql-logs