Archive for the 'MySQL' Category

Page 2 of 2

Nikto – vulnerabilities scanner


Nikto is an Open Source (GPL) web server scanner which scans your webserver against more than 3500 dangerous files/CGIs, outdated version checking, It has a very good plugin support
Official site

To install in ubuntu / debian

1
$ aptitude install nikto

For simple test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
firewall ~ # nikto -h debianuser.org
---------------------------------------------------------------------------
- Nikto 2.02/2.03     -     cirt.net
+ Target IP:       188.40.116.206
+ Target Hostname: debianuser.org
+ Target Port:     80
+ Start Time:      2010-12-07 10:45:55
---------------------------------------------------------------------------
+ Server: Apache
+ OSVDB-3092: GET /img/ : This may be interesting...
+ OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons
+ 4347 items checked: 2 item(s) reported on remote host
+ End Time:        2010-12-07 10:49:45 (230 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

MySQL: Show processlist every second

MySQL-Logo

1
mysqladmin -u root -p -i 1 processlist

-u username
-p you will be promted for a password
-i 1 interval one second

Output will see like this one:

1
2
3
4
5
6
7
8
9
+--------+------+-------------------+-----+---------+------+-------+------------------+
| Id     | User | Host              | db  | Command | Time | State | Info             |
+--------+------+-------------------+-----+---------+------+-------+------------------+
| 424111 | db4  | 192.168.2.1:58431 | db4 | Sleep   | 15   |       |                  |
| 424195 | db4  | 192.168.2.1:50531 | db4 | Sleep   | 1    |       |                  |
| 424483 | db3  | 192.168.2.1:41503 | db3 | Sleep   | 464  |       |                  |
| 424490 | db3  | 192.168.2.1:41513 | db3 | Sleep   | 443  |       |                  |
| 424551 | root | localhost         |     | Query   | 0    |       | show processlist |
+--------+------+-------------------+-----+---------+------+-------+------------------+

MySQL – Database size

As I know, there are two ways to calculate the MySQL database size:

First one:

1
du -shc /var/lib/mysql/*

Second one:

1
SELECT table_schema ,SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;