Browsing the archives for the Security tag.


Using phpMyAdmin to import and export databases.

Configuring Ubuntu, F.A.Q.'s, How To's, Open Source, P.C. Linux, Ubuntu, Ubuntu Server

Exporting the database.

Step One:

Select your database from the menu on the left.

Selecting your database

Selecting your database

Step Two:

Select the export tab in the tab menu at the top.

Open the export tab

Open the export tab

Step Three:

Select the tables you want to export, if you want to do the whole database just click select all.

Select your tables

Select your tables

Step Four:

Select the “zipped” bullet option towards the bottom. This will allow you to download a copy to your computer.

Zip it up

Zip it up

Importing the database:

Step one:

Select the database you want to import into:

select import database

select import database

Step Two:

Select the import tab.

Import Tab Sir

Import Tab Sir

Step Three:

Browse for your file:

browse my thangs

browse my thangs

Step Four:

Select ok or import depending on your version!

DONE!

No Comments

Ubuntu – how to set up a secure lamp server

Configuring Ubuntu, F.A.Q.'s, How To's, LAMP, Open Source, P.C. Linux, Security, Tech Industry News, Ubuntu, Ubuntu Server

I guess I really haven’t made LAMP tutorial…..they are everywhere. But by google analytics begs me to do so as I am getting keyword traffic for this. So by combining several tutorials we will have a secure Lamp Stack.

First off I assume you are logged in as root. so if not add sudo in front of your commands.

Step One:

install Apache and PHP5 with MySQL support

Step Two:

If you are hosting multiple domains consider this: Configure apache to use virtual hosts on ubuntu server

Step Three:

Configure IPtables for firewall purposes

Step Four:

Secure Apache

Step Five:

Optimize Apache and MySQL

Setting up a secure lamp stack really wasn’t that hard now was it!

No Comments

iptables – how to permanently apply changes.

F.A.Q.'s, How To's, P.C. Linux, Security, Ubuntu, Ubuntu Server

I have been monitoring my analytics apparently people are having problem permanently applying rules into iptables.

If you read this article:

You can see how to make a file with all of your rules, apply it, and make it so it will start everytime networking does.

To add a rule just edit the file, re-apply, and let dry….lol

Any questions just leave me a comment, any problems you can e-mail me: nick|at|grochal|dot|com

@=|at| .=|dot| ; )

No Comments

Make wordpress work with mod security.

Configuring Ubuntu, F.A.Q.'s, How To's, P.C. Linux, Ubuntu, Ubuntu Server

For part of the example I have replaced <> with left carrot and right carrot.

You will need to do two things:

nano /etc/modsecurity/exclude.conf

It should look like this:

left carrot LocationMatch “/wp-admin/post.php” right carrot
SecRuleRemoveById XXXXXX
left carrot /LocationMatch right carrot

Now add this to your virtual hosts file in apache:

 nano /etc/apache2/sites-available/yourdomain.com

Add the following somewhere in the file:

SecRuleInheritance Off

Done

No Comments

Lockdown Apache with Mod Security – Bring the Hammer Down

Configuring Ubuntu, F.A.Q.'s, How To's, LAMP, P.C. Linux, Security, Ubuntu, Ubuntu Server

First off, I assume you are “running as root” if not you will need to add “sudo” in front of the commands offered below. I am using Ubuntu; you can use this as a model if you are running a different flavor of *nix.

Prerequisites – all the crap you forgot

You will need to have build essential installed, this is to compile stuff.

apt-get install build-essential

You will also need to have a proper hostname!

nano /etc/hostname

It should look like this:

yourdomain.com

one more place:

nano /etc/hosts

It should look like this:

your.ip.goes.here yourdomain.com
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Get some development files:

apt-get install apache2-prefork-dev libxml++2.6-dev liblua5.1-0 liblua5.1-0-dev

Download and Install Mod Security:

Download from http://www.modsecurity.org/download/index.html

Get over it, just register it’s free.

I suggest downloading to your home directory.

Uncompress the file:

tar -xvvzf modsecurity-apache_2.5.7.tar.gz

Get into the right position:

cd /modsecurity-apache_2.5.7/apache2

Configure some things:

./configure --with-apxs=/usr/bin/apxs2

make your install:

make install

Load mod security 2 module up by creating a load file in Apache 2:

nano /etc/apache2/mods-available/mod-security2.load

Make it look like this:

LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua5.1.so
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so

Enable the Apache Module:

ln -s /etc/apache2/mods-available/mod-security2.load /etc/apache2/mods-enabled

enable unique id module which is already packed with apache2:

ln -s /etc/apache2/mods-available/unique_id.load /etc/apache2/mods-enabled

Tell Apache where we moved crap:

nano /etc/apache2/conf.d/modsecurity2.conf

It should look like this:


Include /etc/modsecurity/*.conf

Create a mod security directory where we can place our rule files and logs:

mkdir /etc/modsecurity
mkdir /etc/modsecurity/logs
touch /etc/modsecurity/logs/modsec_audit.log
touch /etc/modsecurity/logs/modsec_debug.log

Now we are going to gather the mod security 2 rules files, which came with the package mod security 2 you downloaded early on. There should be a directory called rules.
Go into that directory then we going to copy the rule config files over to /etc/modsecurity/:

sudo cp *.conf /etc/modsecurity/

Edit the rule config file called “modsecurity_crs_10_config.conf”:

nano /etc/modsecurity/modsecurity_crs_10_config.conf

Two changes need to be made:

SecDebugLog logs/modsec_debug.log

to

SecDebugLog /etc/modsecurity/logs/modsec_debug.log

SecAuditLog logs/modsec_audit.log

to

SecAuditLog /etc/modsecurity/logs/modsec_audit.log

Time to restart apache:

/etc/init.d/apache2 restart

check to make sure you listened correctly:

cat /var/log/apache2/error.log | grep ModSecurity

If it look like the following you=win!

[Sun Nov 26 21:64:51 2008] [notice] ModSecurity for Apache/2.5.7 (http://www.modsecurity.org/) configured

DONE!

Any questions leave a comment.

No Comments
« Older Posts
Newer Posts »