BREAKING NEWS
Showing posts with label INTERNET SECURITY. Show all posts
Showing posts with label INTERNET SECURITY. Show all posts

Thursday, July 16, 2015

Backtrack Penetration Testing Tutorial

Penetration testing is a legal and authorized attempt to exploit computer systems for the purpose of making the computer systems more secure. This Backtrack Penetration Testing Tutorial is a penetration testing tutorial using Backtrack Linux. Backtrack is the best penetration testing distribution. Offers some penetration testing programs and these programs will used in this Backtrack Penetration Testing Tutorial. The results of penetration testing are addressing the vulnerabilities in the computer system and also particular recommendations for fixing the vulnerabilities. Penetration testing is used to protect the computer systems and networks from attackers (Black Hat Hacker).

Requirement
You need a place to practice this Backtrack Penetration Testing Tutorial. Virtual Lab is the solutions. You can make a network in your own computer without “real computer”. With virtual lab you can practice without harming other computer systems. Virtual Machine is the solution. With Virtual Machine you can install OS under your OS, in other words you can use multiple OS in the same time and in the same machine.

There are some Virtualization software, for example VirtualBox and VMware. But I recommended VirtualBox for this Backtrack Penetration Testing Tutorial. You can install VirtualBox on your Backtrack for free because VirtualBox is an Open Source software.

Backtrack Penetration Testing Tutorial

Step 1 : Information Gathering
The first step of Backtrack Penetration Testing Tutorial is Information Gathering. Gathering all of the information from the web about victim. If your victim has a website you can gather all of the victim’s personal information in his domain name of the website. You can read information gathering using domain name.

Not only that, you also can grab the website and make it offline website in your computer so you can access locally and identify the website. HTTrack is tool that can copy a website page-by-page and we will use it in this Backtrack Penetration Testing Tutorial. With HTTrack you can make off-line copy of the victim’s website.

Installing HTTrack is easy. Open your terminal and install it by type :
apt-get install httrack



Open your HTTrack using terminal and enter your project name, base part (a path where you want to save the offline copy of the website), and URL (site that you want to copy). Wait for a moment and you will get offline copy of the site.

Now lets collect another information using The Harvester. The Harvester is a Python script that allows to collect email addresses or subdomains that related to the victim’s website and we will use it in this Backtrack Penetration Testing Tutorial. This Christian Martorella’s script will use Google and Bing when looking for emails, hosts, or subdomain of the victim’s website.

cd /pentest/enumeration/theharvester

./theHarvester.py -d victimwebsite.com -l 10 -b google.com



Step 2 : Scanning
Scanning the port of systems and the vulnerabilities is the next step of Backtrack Penetration Testing Tutorial. Scanning port is important because port is a location where software and hardware communicate in the networks. Port allows a computer to exchange information with other computers, softwares, or also devices.

Common Ports and Services
Port     Service
20        FTP data transfer
21        FTP control
22        SSH
23        Telnet
25        SMTP (e-mail)
53        DNS
80        HTTP
443      HTTPS

Ping
Ping is a network tool used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent to a destination computer. (Wikipedia)


Port Scanning
Ports can be either TCP or UDP and there are 65.536 (0–65.535) ports on every computer. The purpose of scanning ports is to know the “open” port. So we can know what services used in the server.

Nmap is the most popular port scanning tool and we will use it in this Backtrack Penetration Testing Tutorial. It is open source and build by default in the Backtrack. You can read my post about Basic usage of Nmap. Nmap is very important tool in the network security. The simple way using nmap is :
nmap -p- IP


Vulnerabilities Scanning
The purpose of vulnerabilities scanning is looking for vulnerabilities of the system so we can attack it with the suitable exploit. We need tool to scan systems for vulnerabilities, the vulnerability scanner called Nessus. We will use Nessus in this Backtrack Penetration Testing Tutorial. You can install Nessus on Backtrack and lets scan the vulnerabilities.


Step 3 : Exploitation
This is the final step of Backtrack Penetration Testing Tutorial. Exploitation can be launch with Exploitation Tools. You can use Metasploit or Medusa. Read my post about Exploiting with Metasploit if you want to use Metasploit. But no we will use Medusa.

Medusa is brute force tool that attempts to gain access to remote services (FTP, HTTP, MySQL, Telnet, VNC, Web Form, and more). Before using Medusa we need some required things. We need IP target, username list, and password dictionary.

Backtrack includes a word lists that you can use for brute forcing. We can find it at /pentest/passwords/wordlists/

In order to using Medusa for brute-force attack, you can open terminal and type the following command:
medusa –h target_ip –u username –P path_to_password_dictionary –M service_to_attack



I think this is a simple Backtrack Penetration Testing Tutorial. If you have any ideas you can write the comment below. Hope this Backtrack Penetration Testing Tutorial help you.

What is Secure Sockets Layer (SSL) and How it Works

Secure Sockets Layer (SSL) is the most widely used technology for providing a secure communication between the web client and the web server. Most of us are familiar with many sites such as Gmail, Yahoo etc. using https protocol in their login pages. When we see this, we may wonder what’s the difference between http andhttps.
In simple words, a HTTP protocol is used for standard communication between the Web server and the client. HTTPS is used for a “Secure communication”.

How Secure Sockets Layer Works?

Before we understand the concept of SSL, let us first learn what a “Secure Communication” means. Suppose there exists two communicating parties: Say A (client) and B (server).

Working of HTTP:

When A sends a message to B, the message is sent as a plain text in an unencrypted manner. This is acceptable in normal situations where the messages exchanged are not confidential. But, imagine a situation where A sends a PASSWORD to B. In this case, the password is also sent as a plain text. This has a serious security problem because, if an intruder (hacker) can gain unauthorized access to the ongoing communication between A and B , he can easily obtain the PASSWORDS, since they remain unencrypted. This scenario is illustrated using the following diagram:
Working of HTTP

Now let us see the working of HTTPS:

When A sends a PASSWORD (say “mypass“) to B, the message is sent in an encrypted format. The encrypted message is decrypted on B‘s side. So, even if the Hacker manages to gain an unauthorised access to the ongoing communication between A and B he gets only the encrypted password (“xz54p6kd“) and not the original password. This is shown below:
Working of Secure Sockets Layer

How is HTTPS implemented?

HTTPS is implemented using Secure Sockets Layer (SSL). A website can implement HTTPS by purchasing an SSL Certificate. Secure Sockets Layer (SSL) technology protects a Web site and makes it easy for the site visitors to trust it. It has the following uses:
  1. An SSL Certificate enables encryption of sensitive information during online transactions.
  2. Each SSL Certificate contains unique and authenticated information about the certificate owner.
  3. A Certificate Authority verifies the identity of the certificate owner when it is issued.

How Encryption Works?

The whole concept of Secure Sockets Layer is implemented on the basis of RSA algorithm where each SSL Certificate consists of a Public key and a Private key. The public key is used to encrypt the information and the private key is used to decrypt it. When your browser connects to a secure domain, the server sends a Public key to the browser to perform the encryption. The public key is made available to everyone but the private key(used for decryption) is kept secret. So, during a secure communication, the browser encrypts the message using the public key and sends it to the server. This message is decrypted on the server side using the Private key(Secret key).

How to Identify a Secure Connection?

In the Internet Explorer and most other browser programs like Firefox or Google Chrome, you will see a lock icon Picture of the Lock icon in the Security Status bar. The Security Status bar is located on the right side of the Address bar. You can click the lock to view the identity of the website.
In high-security browsers, the authenticated organization name is prominently displayed and the address bar turns GREEN when an Extended Validation SSL Certificate is detected. If the information does not match or the certificate has expired, the browser displays an error message or warning and the status bar may turn RED.
So, the bottom line is, whenever you perform an online transaction such as Credit card payment, Bank login or Email login always ensure that you have a secure communication. A secure communication is a must in these situations. Otherwise there are chances of a Phishing attack using a fake login page.
I Hope you like the information presented in this article. Please pass your comments.

Block or Redirect Unwanted Websites Using HOSTS File

The hosts file is one of the interesting and useful feature of both Windows and Linux operating systems that provides many handy options in addressing network nodes. For instance, you can use the hosts file to blockannoying ads, pop-ups, banners, porn sites, or even redirect one website to another.
In this post I will show you how to play around with the hosts file to accomplish some of the above mentioned jobs.

What is a hosts File?

The hosts file is just like any other computer file that is used by the operating system to map hostnames and domain names on to their corresponding IP addresses.
In other words, when you type “google.com” on your browser’s address bar, your computer will look for thehosts file to see if it contains the corresponding IP address for the domain name you typed (google.com). In case if no entry is present in the hosts file, the request is then passed on to the DNS (Domain Name System) server to obtain the IP address.

hosts File vs. DNS

When it comes to resolving the hostnames, the hosts file is given the first priority over the Domain Name System. In most cases, the hosts file remains unconfigured on the operating system and hence the DNS is used by the computer to resolve the domain names to their corresponding IP addresses.
However, if the hosts file is found to contain a valid entry for a given hostname or domain name, then this is picked up and used by the operating system.

Where is the hosts File Located?

Windows: In case of the Windows operating system, the hosts file is located at:
%systemroot%\system32\drivers\etc\hosts
NOTE: In most cases this should be: C:\Windows\System32\drivers\etc\hosts
Unix/Linux: In case of Linux it is located at:
/etc/hosts

How to Block a Website?

To block a specific website, all you have to do is just add a new entry for that site in the hosts file. I would prefer to backup the original file and create a new one instead of modifying it. So, if something goes wrong, you can just delete it and restore the original one! Well, here is a step-by-step procedure on how to create a new hosts file on Windows:
  1. Go to “My Computer” and you should see the “Menu bar” on top. In case of Vista and Win 7, just click “Alt” to unhide the “Menu bar”.
  2. Now in the menu bar, click on “Tools -> Folder Options”. In the “View” tab uncheck the option that says: “Hide extensions for known file types” and click on “OK”.
Windows Folder Options
  1. Open a new text pad (New Text Document.txt) and rename it to: hosts. You will get a pop-up message with a warning. Just click on “Yes”.
    Please note that the renamed file hosts should not have any extension such as hosts.txt.
  2. Open the hosts file using the notepad. Now let us assume that you want to block the sites Facebookand Youtube on your computer. For this all you have to do is add the following lines to your hosts file:
    127.0.0.1       facebook.com
    127.0.0.1       www.facebook.com
    127.0.0.1       youtube.com
    127.0.0.1       www.youtube.com
    Each entry should be placed on an individual line. The IP address and the hostname should be separated by a space or a tab. In this way, you can block any given website by just pointing it to the IP address 127.0.0.1.
  3. Navigate to %systemroot%\system32\drivers\etc. Here you should see the original hosts file, rename it to hosts_bak. Just copy and paste the new hosts file that you have created. That’s it. You’ve now successfully blocked those websites from loading on your computer.
    If you are using Vista/Win 7 you may have to take ownership of the original hosts file before renaming it.

How to Redirect a Website?

Suppose you want to redirect Friendster.com to Google.com, all you have to do is just add the following lines to your hosts file:
74.125.236.72       friendster.com
74.125.236.72       www.friendster.com
Here 74.125.236.72 is the IP address of Google.com. To find out the IP address of any given website, just go to command prompt and ping it. For example: ping google.com. You should get a ping response that displays the IP address as shown below:
Ping Test
From now on, whenever you type “friendster.com” on your browser, you will be redirected to “google.com”.

How does a hosts File work?

Whenever you block a website using the hosts file, you point it to the IP address 127.0.0.1 which in fact is the IP address of your own computer. In other words, the IP 127.0.0.1 points to your own computer and doesn’t exist outside.
So, whenever you type the URL of a website for which an entry is present in the hosts file, your computer will load the IP as 127.0.0.1 instead of the actual one and tries to establish a connection with this IP address (127.0.0.1) but fails. As a result the website doesn’t load at all.
The redirection of the website works by pointing the domain name of one website to the IP address of another website (as configured by the hosts file) instead of its original IP address. So, whenever you type friendster.com, it is pointed to Google.com’s IP address and thus, the Google page loads up instead of the actual page from friendster.com.

How to Block the Annoying Ads?

I have found a great solution to keep all the annoying ads, banners, pop-ups and other parasites at bay by using a pre-configured hosts called MVPS hosts file. This hosts file contains a long list of entries to block all those annoying ads and pop-ups that usually load while you are surfing the Internet. You can also receive regular updates on this to stay up-to-date. You can download MVPS hosts file from the link below:


If you are playing around with the hosts file and something goes wrong, just delete the hosts file itself and rename the original file from hosts_bak to hosts. This should bring back everything to normal. I hope this post on hosts file will help you block unwanted websites on your computer. Waiting for your comments. :)

Monday, July 13, 2015

Source Code Analyzer for PHP Vulnerabilities - RIPS

The World Wide Web grew rapidly during the last decades and is used by millions of people every day for online shopping, banking, networking, and other activities. Many of these websites are developed with PHP, the most popular scripting language on the Web. However, PHP code is prone to different types of critical security vulnerabilities that can lead to data leakage, server compromise, or attacks against an application’s users. This problem can be addressed by analyzing the source code of the application for security vulnerabilities before the application is deployed on a web server. Novel approach is presented for the precise static analysis of PHP code to detect security vulnerabilities in web applications. As dismissed by previous work in this area, a comprehensive configuration and simulation of over 900 PHP built-in features allows us to precisely model the highly dynamic PHP language. By performing an intra- and inter-procedural data flow analysis and by creating block and function summaries, we are able to efficiently perform a backward-directed taint analysis for 20 different types of vulnerabilities. Furthermore, string analysis enables us to validate sanitization in a context-sensitive manner. Our method is the first to perform fine-grained analysis of the interaction between different types of sanitization, encoding, sources, sinks, markup contexts, and PHP settings. We implemented a prototype of our approach in a tool called RIPS. Our evaluation shows that RIPS is capable of finding severe vulnerabilities in popular real world applications: we reported 73 previously unknown vulnerabilities in five well-known PHP applications such as phpBB, osCommerce, and the conference management software HotCRP.


What is RIPS

RIPS is a tool written in PHP to find vulnerabilities in PHP applications using static code analysis. By tokenizing and parsing all source code files RIPS is able to transform PHP source code into a program model and to detect sensitive sinks (potentially vulnerable functions) that can be tainted by userinput (influenced by a malicious user) during the program flow. Besides the structured output of found vulnerabilities RIPS also offers an integrated code audit framework for further manual analysis. 


Features

  • scan and vulnerability statistics
  • grouped vulnerable code lines (bottom up or top down)
  • vulnerability description with example code, PoC, patch
  • exploit creator
  • file list and graph (connected by includes)
  • function list and graph (connected by calls)
  • userinput list (application parameters)
  • source code viewer with highlighting
  • active jumping between function calls
  • search through code by regular expression
  • 8 syntax highlighting designs
  • Code Execution
  • Command Execution
  • Cross-Site Scripting
  • Header Injection
  • File Disclosure
  • File Inclusion
  • File Manipulation
  • LDAP Injection
  • SQL Injection
Download & read more here:
 
Back To Top
Copyright © 2015 Serious Coders.