Skip to main content

Posts

Showing posts from September, 2014

Linux Bash Vulnerability - Test and Solution

Bash Shell Security Vulnerability There is an important vulnerability in the Linux operating system Bash Shell that has the potential of making your server easily accessible to hackers. By running the test command below, you can see if your bash is vulnerable to exploits. Please run both commands below as root on your server to see if your system is vulnerable.
===============================
1. Log into your server as root
2. Execute the following command:

env x='() ; echo vulnerable' bash -c "echo this is a test"

3. If the output is "this is a test", that means that your bash needs to be updated. Please refer to your specific OS below and update your system and bash to latest version.
================================

and

================================
1. Log into your server as root
2. Execute the following command:

export dummy='() ; echo "exploited"'

3. Enter the following command afterwards:
bash

4. If the output is "exploited&…

check memory usage on Linux Centos

free command The free command is the most simple and easy to use command to check memory usage on linux. Here is a quick example
$ free -m total used free shared buffers cached Mem: 7976 6459 1517 0 865 2248 -/+ buffers/cache: 3344 4631 Swap: 1951 0 1951 The m option displays all data in MBs. The total os 7976 MB is the total amount of RAM installed on the system, that is 8GB. The used column shows the amount of RAM that has been used by linux, in this case around 6.4 GB. The output is pretty self explanatory. The catch over here is the cached and buffers column. The second line tells that 4.6 GB is free. This is the free memory in first line added with the buffers and cached amount of memory.
Linux has the habit of caching lots of things for faster performance, so that memory can be freed and used if needed.
The last line is the swap memory, which in this case is l…

How to Rest Mysql Server Root Password in Case it was Forgotten

First you need to stop mysql service:

/etc/init.d/mysqld stop  Now Start mysql in safemode:
mysqld_safe --skip-grant-tables  Login as root: mysql --user=root mysql Now run the below: update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit; Finally kill mysql process and start it again: /etc/init.d/mysqld stop /etc/init.d/mysqld start

How to enable mod_rewrite on Apache?

The question is – how do I check if mod_rewrite is enabled? If it is disabled, how to I enable it on Apache on CentOS?
To enable mod_rewrite, you need to make sure that you have it as a module, and to make sure that Apache has loaded the module. And then you need to ensure that Apache is configured to make use of the .htaccess file for each directory.
Follow this article and you should be able to enable mod_rewrite.