Friday 2 January 2015

Set up your Pen Testing/Hacking Lab Network using a Single System

Introduction

There are lots of tutorials available on the internet related to hacking but the big problem lies in testing your theoretical skills. Unless you don't have practical exposure to hacking, you cannot really understand the strength of it. The technique I will discuss here will be advantageous for those who have only single system and want to set up a testing network using it. In case you have multiple systems then you can easily test for your skills by making one system as target and other as attacker.
 
 
But what to do when we have only a single system at our disposal. Need not to worry. Virtual machine is the ultimate solution. You can set up your own hacking network and apply your skills to gain practical exposure to hacking.
 
 
 
Installation & Configuration
 
The only thing to look for is your systems hardware configuration. You should have minimum 2 GB RAM but it is highly recommended to use 3 GB RAM for a 32 bit operating system.

We will be using Oracle VirtualBox in this tutorial. You can download virtualbox from this link [Reference 1].  Once you have installed Vbox, the next step is to download the Extensions pack. You can get it from this link [Reference 2]

Once you have followed these initial steps, you are half done. The next step is to setup a target operating system. Suppose you want to set WINDOWS XP SP2 as the target operating system. You will need a bootable Windows XP SP2 iso for that. You can easily download it from Microsoft website or torrent. You can refer to this quick video tutorial on how to setup a virtual machine using VBox and WIN XP.
 
 
 
 
Installing Applications on Virtual Machine

So now you have a virtual machine where you can test all your applications and hacks. Let us install a WAMP server and run DVWA over it. For those who are not aware of DVWA can check this link [Reference 3]

How to install applications on a virtual machine? Well the process is simple. When your Windows XP Virtual machine is running, then click on the DEVICE tab, move to USB and select your pendrive from the list.
 
 
Now you can install anything from a USB drive inside your virtual machine. There is also a facility to create shared folder with your host operating system but I would prefer that you use USB. Shared folder has some issues when your host operating system is Windows 7. You can install different servers, applications, RAT clients etc and play with it.
 
 
Advantages of Virtual Machine
 
Here are some of the major advantages of using virtual machine.
  • You can test all the viruses and RATs without any fear as your base operating system will not be affected.
  • You can test different servers and applications easily without affecting your base operating system.
  • In case the Virtual machine gets corrupt then you can re-install it.
 
Take Backup & Save Trouble in Future
 
There are also some key factors that you should remember which will help you during your pentesting:
  • Create a clone of the virtual machine
  • This step is very helpful in case your VM gets corrupt. Creating a clone of it will prevent you from re-installing it again and again.
  • You can create a clone by Right clicking on the Virtul machine instance in VBox and click on "clone.."
  • You will notice that a cloned virtual WinXP will be created for you.
 
 
 
Disable the Windows Firewall
 
The next important thing you can do is disable the windows firewall and then perform your pentesting as the firewall may block some of the suspicious activities. Using the default Windows firewall of XP virtual machine you can also test whether your activity is traceable or not. This will give you a clear understanding why RATs are not considered as a suitable hack these days because they are easily detectable. You can disable the firewall by going to control panel, clicking on Firewall and then disable it.

In this way you can set up a suitable environment for your home experiments.
 
 
 
Testing your Pen-Testing/Hack Network
 
Well a good question to ask if you have understood the above concepts. So far we discussed how to test different tools and techniques on a virtual operating system. The next step will be how to hack one virtual machine using the other. The scenario will be similar to hacking any system on internet so this technique will give you a real time exposure.

Interesting... Lets proceed then. This time we will set up another virtual machine using BackTrack [Reference 4] operating system which is one of the most widely used penetration testing operating system by security professionals.

The reason which makes Backtrack so popular is:
  • It has all the relevant tools pre-installed
  • It is linux based.
You can download the Backtrack 5 iso from its official website. Its a must have operating system for all. You can follow this simple video to install BT on virtualbox.
 
 
Once you are done with the installation part, the next step is to make the two virtual machines (BT and WinXP) connect with each other. There is a simple setting that you will have to make in both the virtual machines. Let's check it out.

Select the Backtrack virtual machine, then click on settings tab, then move to "network" settings. You will find that "Adapter 1" is set to NAT adapter. Switch to the "Adapter 2" tab.
 
 
In the Adapter2 tab, set the adapter as "Host-Only Adapter". Set the name of adapter as "VirtualBox Host Only Ethernet Adapter" . See the figure.
 
 
Make similar setting changes in your windows XP virtual machine as well. Now your two virtual machines are ready to connect with each other. You can check the IP address of Windows machine by using the ipconfig command in the command prompt and similarly you can check the IP address of the BT machine using the ifconfig command. Also you can ping the two machines to check if both are detecting each other (don't forget to disable the windows firewall else it will filter the ping data packets).

The following image shows my two virtual machines. One is WinXP and other is BT5 with there corresponding ip addresses. Both are running ovr my host operating system Win7. So in all there are 3 operating systems running simultaneously.
 
 
Now you can use various options available in Backtrack OS to perform tests on the WinXP box. Let us quickly perform an nmap scan to check the open ports on WinXP machine.
 
 
As you can see that the target is up and has some open ports as well. Similarly you can perform several attacks and use the tools available in Backtrack to penetrate the target windows XP machine without harming your own operating system.

You can use this technique to perform several tests like,
  • You can try to hack different operating systems by installing them as a virtual machine.
  • This will have a real time simulation of original scenario.
  • You can increase the level of difficulty of your hacks by installing firewalls, IDS/IPS etc.
  • This is a self customization scenario where you can do what ever you want
 
 
Conclusion

This is just a quick example for you all to get started with using VM's for pentesting and hacking. You can further take this tutorial to next level by experimenting with various flavors of operating systems and try your hands on them.

This can be like a practice battlefield for you before you dive deep into the real fight.
References

HOW TO CREATE A VIRTUAL HACKING LAB

Many of you here are new to hacking. If so, I strongly recommend that each of you set up a "laboratory" to practice your hacks. Just like any discipline, you need to practice, practice, and practice some more before you take it out to the real world.
In many disciplines, if you don't practice, you fall victim to failure. In our discipline, if you don't practice and fail, you may be serving years behind bars. This makes practice and a dedicated practice lab an even more compelling argument than with other disciplines.
Many of you have been having difficulty setting up your hacking environment to practice your hacks. In this tutorial, I will show you the simplest and fastest way to set up a lab to practice your hacks before taking them out into the real world where any slip-ups could be devastating!

Step 1: Download VMware Workstation or Player

The best way to practice hacking is within a virtual environment. Essentially, you set up a hacking system, such as Kali Linux, and some victims to exploit. Ideally, you would want multiple operating systems (Windows XP, Vista, 7, and 8, as well as a Linux flavor) and applications so that you can try out a variety of hacks.
Virtual machines and a virtual network are the best and safest way to set up a hacking lab. There are several virtualization systems out there, including Citrix, Oracle's VirtualBox, KVM, Microsoft's Virtual PC and Hyper-V, and VMware's Workstation, VMware Player and ESXi. For a laboratory environment, I strongly recommend VMware's Workstation or Player. Workstation is commercial product that costs under $200, while Player is free. You can also get a free 30-day trial of Workstation.
Player is limited to just playing VMs , while Workstation can both create and play VMs. Let's download VMware's Workstation or Player here.

Step 2: Download Kali VMware Images

Once you have downloaded and installed your virtualization system, our next step is to download the VMware images of Kali provided by Offensive Security. With these images, you won't have to create the virtual machine, but simply run it from Workstation or Player—Offensive Security has already created this image for you. This means that once you have downloaded the VM of Kali, you can then use it in either Workstation or Player.

Step 3: Unzip Images

Once you have completed the download, you will need to unzip the files. There are numerous zip utilities available for free including 7-Zip, WinZip, WinArchiver, etc. Download and install one and unzip the files. In the screenshot below, I have downloaded the free trial of WinZip and have used it to unzip the Kali files.

Step 4: Open VMware Image

Once all the files have been unzipped, our next step is to open this new virtual machine. Make note of the location where you have unzipped the virtual machine image. Then, go to either VMware Workstation or Player and go to File -> Open like in the screenshot below.
This will open a window like that in the screenshot below. You can see that my Kali image was stored under documents, so I browse there and double-click on the folder.
When I do so, it reveals the VMware virtual machine file that I will load into VMware. Note that I am using the "amd64" version, which is simply the 64-bit version, but the 32-bit version will work, as well, albeit a bit slower.
When you do so, VMware will start your virtual machine and greet you with a screen like below.
Click on the green button in the upper left below "Kali-Linux-1.0.9-vm-amd64" that says "Power on this virtual machine." You should be greeted by the now familiar Kali screen like below.
Simply use the user "root" and password "toor" to get started hacking!

Step 5: Download & Install Targets

For the next step, you need to download and install a target system. Of course, you could use your own host Windows 7 or 8 system, but since this is practice, you might want to use an older, easier to hack system. In addition, hacking your own system can leave it unstable and damaged.
I recommend installing a Windows XP, Vista, Server 2003, or an older version of Linux. These systems have many known security flaws that you can practice on and, then when you become more proficient at hacking, you can then upgrade to Windows 7 and 8 and newer versions of Linux.
If you or your friends don't have a copy of these older operating systems, you can purchase them very inexpensively many places on the Internet. For instance, at last check there are numerous copies available on eBay for as low as $9.95.
Of course, you can also obtain these operating systems for free on many of the torrent sites, but BEWARE... you will likely be downloading more than just the operating systems. VERY often, these free downloads include rootkits that will embed in your system when you open the file.
In addition, older versions of Linux are available from the distributor or via torrent sites, as well.

Step 6: Download Old Applications

Once you have your operating system in place, very often you will need applications to run on these older versions of the Windows and Linux operating systems. You will likely need a browser, Office, Adobe products, etc. These older products have well-known security flaws that you can hone your skills on.
I like the site Old Apps to download many of these. Of course, once again, you can obtain these from many of the torrent sites with the same caveat as above of you might get more than you bargained for.
I'm hoping that this brief tutorial is helpful to some of you who have had difficulty setting up Kali and a lab, and now we can get back to our work of hacking, my TREAMENDOUS hackers!

WAYS OF BECOMING A BETTER HACKER

There is a community and shared culture of expert programmers and networking wizards that traces its history back through decades to the first time-sharing minicomputers and the earliest ARPAnet experiments. The members of this culture were the first "hackers." Breaking into computers and phreaking phone systems have come to symbolize hacking in popular culture, but hacking culture is much more complex and moralistic than most people know. Learn basic hacking techniques, how to think like a hacker, and how to gain respect in order to crack your way into the complex world of hacking.

http://www.googleadservices.com/pagead/aclk?sa=L&ai=CL2Nb5YOmVMCyCIeVZKOdgrAJqt23rwaCmvynnQHAjbcBEAEgmL-PBWC3vIOF9DCgAfvjof8DyAEBqAMByAPDBKoEfk_Q3WicDRwpvKGnlkoPlBw5nnaCYKEKn8c7HwGPb30I24bAYHwRuCGbN54buJLpD4yPK1LyGmvL0xcUXTnQxo5mzNWbUrfcwaotLbOqtjOdr417Tmxjp10wl4olM48m4UgoHRemZvF-ulQMqiwFwY1s3M0gXekJvj0PM-lQeogGAYAH7Zte&num=1&cid=5GjHTh6MPhZNPd4XmEywX5FY&sig=AOD64_2NJn5hRnIaj3yoMesVaXirItA14g&client=ca-pub-9543332082073187&adurl=http://www.aiu.edu/university/lp3/index3.html&nm=57&mb=2&bg=!A0TgqHz1G4oeCAIAAAEJUgAAADkqAP0r84JYlizyax2xNJ_f75KLxBjuTNHMpUBZcLyG3Qm3KCRli5KeaLLkZYhbyKyjGErDL3n4HZAFrZoyAmeCa_x_5bIMm8EGrfCElp-xhEOqy_JRLsNARDzeJmeM4DsQk6KqdthLR62F8b-J34ljQnxDBigP8IxmCCjL8JjIXejWv3eyr7Y9HhgbPi0cpiXKg8nnUvqIJinGQKyase02x7gRGcHLvHsepFAMCIoINAi73TRZSOc7QztzHcenxYo8n5M15q0mvH-FiYph18sdHjbLgdoJsmDiv9oJA-wmROoQnOHYpOcpty55OF2DLIWnRl98ef5MJGCeCBatjh0m

  1. Learning Basic Hacking Skills
        1. Become a Hacker Step 4.jpg
          1
          Run Unix. Unix is the operating system of the Internet. While you can learn to use the Internet without knowing Unix, you can't be an Internet hacker without understanding Unix. For this reason, the hacker culture today is pretty strongly Unix-centered. A Unix like Linux can run along side Microsoft Windows on the same machine. Download Linux online or find a local Linux user group to help you with installation.[1]
          • A good way to dip your toes in the water is to boot up what Linux fans call a live CD, a distribution that runs entirely off a CD without having to modify your hard disk. This is a way to get a look at the possibilities without having to do anything drastic.
          • There are other operating systems besides Unix, but they're distributed in binary — you can't read the code, and you can't modify it. Trying to learn to hack on a Microsoft Windows machine or under any other closed-source system is like trying to learn to dance while wearing a body cast.
          • Under Mac OS X it's possible to run Linux, but only part of the system is open source — you're likely to hit a lot of walls, and you have to be careful not to develop the bad habit of depending on Apple's proprietary code.
          Ad
        2. Become a Hacker Step 5.jpg
          2
          Write HTML. If you don't know how to program, learning basic HyperText Mark-Up Language (HTML) and gradually building proficiency is essential. What you see when you look at a website of pictures, images, and design components is all coded using HTML. For a project, set out to learn how to make a basic home page and work your way up from there.
          • In your browser, open the page source information to examine the HTML to see an example. Go to Web Developer > Page Source in Firefox and spend time looking at the code.
          • You can write HTML in a basic word processing program like Notepad or Simple text and save your files as "text only," so you can upload them to a browser and see your work translated.[2]
          • You'll need to learn to format tags and learn to think visually using them.[3] "<" is used to open a tag and "/> is used to close it. " " is the opening for a line of paragraph code. You'll use tags to signal anything visual: italics, formatting, color, etc. Learning HTML will help you to understand better how the Internet works.
        3. Become a Hacker Step 3.jpg
          Learn the language of programing. Before you start writing poems you have to learn basic grammar. Before you break the rules you have to learn the rules. But if your ultimate goal is to become a hacker, you're going to need more than basic English to write your masterpiece.[4]
        4. Python is a good "language" to start off with because it's cleanly designed, well documented, and relatively kind to beginners. Despite being a good first language, it is not just a toy; it is very powerful, flexible, and well-suited for large projects. Java is an alternative, but its value as a first programming language has been questioned.[5]
        5. If you get into serious programming, you will have to learn C, the core language of Unix. C++ is very closely related to C; if you know one, learning the other will not be difficult. C is very efficient with your machine's resources, but will soak up huge amounts of your time on debugging and is often avoided for that reason, unless the efficiency of your computer is especially important.
        6. It is probably a good idea to use a good starting platform such as Backtrack 5 R3, Kali or Ubuntu 12.04LTS.

        Part 2 of 3: Thinking Like a Hacker

        1. Become a Hacker Step 1.jpg
          1
          Think creatively. Now that you've got the basic skills in place, you can start thinking artistically. Hackers are like artists, philosophers, and engineers all rolled up into one. They believe in freedom and mutual responsibility. The world is full of fascinating problems waiting to be solved. Hackers take a special delight in solving problems, sharpening their skills, and exercising their intelligence.
          • Hackers have a diversity of interests culturally and intellectually, outside of hacking. Work as intensely as you play, and play as intensely as you work. For true hackers, the boundaries between "play," "work," "science," and "art" all tend to disappear, or to merge into a high-level creative playfulness.
          • Read science fiction. Go to science fiction conventions, which is a great way to meet hackers and proto-hackers. Consider training in a martial art. The kind of mental discipline required for martial arts seems to be similar in important ways to what hackers do. The most hacker-ly martial arts are those which emphasize mental discipline, relaxed awareness, and control, rather than raw strength, athleticism, or physical toughness. Tai Chi is a good martial art for hackers.
        2. 441133 5.jpg
          2
          Love solving problems. No problem should ever have to be solved twice. Think of it as a community in which the time of everyone is hackers is precious. Hackers believe sharing information is a moral responsibility. When you solve problems, make the information public to help everyone solve the same issue.
          • You don't have to believe that you're obligated to give all your creative product away, though the hackers that do are the ones that get most respect from other hackers. It's consistent with hacker values to sell enough of it to keep you in food and rent and computers.
          • Read older pieces, such as the "Jargon File" or "Hacker Manifesto" by The Mentor. They may be out of date in terms of technical issues, but the attitude and spirit are just as timely.[6]
        3. 441133 6.jpg
          3
          Learn to recognize and fight authority. The enemy of the hacker is boredom, drudgery, and authoritarian figures who use censorship and secrecy to strangle the freedom of information. Monotonous work keeps the hacker from hacking.
          • Embracing hacking as a way of life is to reject so-called "normal" concepts of work and property, choosing instead to fight for equality and common knowledge.
        4. 441133 7.jpg
          4
          Be competent. Anyone who spends time on Reddit can write up a ridiculous cyberpunk user name and pose as a hacker. But the Internet is a great equalizer, and values competence over ego and posture. Spend time working on your craft and not your image and you'll more quickly gain respect than modeling yourself on the superficial things we think of "hacking" in popular culture.

        Part 3 of 3: Earning Respect

        1. 441133 8.jpg
          Write open-source software. Write programs that other hackers think are fun or useful, and give the program sources away to the whole hacker culture to use. Hackerdom's most revered demigods are people who have written large, capable programs that met a widespread need and given them away, so that now everyone uses them.
        2. 441133 9.jpg
          Help test and debug open-source software. Any open-source author who's thinking will tell you that good beta-testers (who know how to describe symptoms clearly, localize problems well, can tolerate bugs in a quickie release, and are willing to apply a few simple diagnostic routines) are worth their weight in rubies.
          • Try to find a program under development that you're interested in and be a good beta-tester. There's a natural progression from helping test programs to helping debug them to helping modify them. You'll learn a lot this way, and generate goodwill with people who will help you later on.
        3. 441133 10.jpg
          Publish useful information. Another good thing is to collect and filter useful and interesting information into web pages or documents like Frequently Asked Questions (FAQ) lists, and make those generally available. Maintainers of major technical FAQs get almost as much respect as open-source authors.
        4. 441133 11.jpg
          Help keep the infrastructure working. The hacker culture (and the engineering development of the Internet, for that matter) is run by volunteers. There's a lot of necessary but unglamorous work that needs done to keep it going — administering mailing lists, moderating newsgroups, maintaining large software archive sites, developing RFCs and other technical standards. People who do this sort of thing well get a lot of respect, because everybody knows these jobs are huge time sinks and not as much fun as playing with code. Doing them shows dedication.
        5. 441133 12.jpg
          Serve the hacker culture itself. This is not something you'll be positioned to do until you've been around for a while and become well-known for one of the four previous items. The hacker culture doesn't have leaders, exactly, but it does have culture heroes and tribal elders and historians and spokespeople. When you've been in the trenches long enough, you may grow into one of these.
          • Hackers distrust blatant ego in their tribal elders, so visibly reaching for this kind of fame is dangerous. Rather than striving for it, you have to sort of position yourself so it drops in your lap, and then be modest and gracious about your status.

INTRODUCTION TO HACKING

Hi viewers... i just want to highlight u on what hacking is all about..............
Hacking is the art of exploiting computers to get access to otherwise unauthorised information. Now that the world is using IT systems to gather, store and manipulate important information there is also a need to make sure that data is secure. However, no system is without its problems. Holes are often present within security systems which, if exploited, allow hackers to gain access to this otherwise restricted information. This WikiBook aims to give you the information required to think like hackers, so as to be able to secure your systems and keep your information safe.
Hacking and security is a constantly updated and fast moving sector of the computing industry and, as such, it is vital that you are up to date with all the details (including the latest exploits, patches and more).
It is important that hackers also follow the hackers Ethics
t is important that hackers follow The Hacker Ethic in the same way that it is important that police follow their code of conduct. An abuse of skill within the hacking world causing harm to others. Remember: It is almost impossible to gain respect at the expense of others.
Image result for Pictures of Hacking

The Original Ethic

Back when computers just started to reach universities and students had access to open systems, curious users began to show a certain disregard for the rules. These users would enter areas of the system without authorization, gaining access to privileged resources. With no Internet and no copies of Hacking Exposed or Security Warrior to assist them, they had to figure out how to enter the systems on their own.
Although these young students represented the first hackers, they had no malicious intent; they simply wanted knowledge, information, a deeper understanding of the systems which they had access to. To justify and eventually distinguish their efforts, the hacking community developed The Hacker Ethic as a core part of their subculture. The Hacker Ethic states two basic principles:
  • Do no damage.
  • Make no one pay for your actions.
These two principles fall hand in hand. The original hackers had an intention to learn about the systems they invaded, not to destroy them or steal valuable confidential information. They wanted to know how they worked, their flaws, their strengths, interesting functions of their design. They had no authorization; at the time, they made up for this by making a point of neither interfering with anyone's work nor costing anyone any money in the process of exploring the system.
Unfortunately this mantra does not provide a fully effective cover for your actions. Even disregarding the legal ramifications, such as the Computer Fraud and Abuse Act of 1986, your actions will have devastating unintentional consequences if not carefully controlled. Robert Morris created the Morris Worm to gauge the size of the Internet harmlessly; unfortunately, it loaded down the systems it infected due to exponential re-infection, causing tens of millions of dollars of financial damage. You must always remember to carefully consider the short and long term impact of your actions on any system.

Today's Ethic

Today we need to add one more rule to The Hacker Ethic, a rule that we should have added long ago. The Morris Worm illustrates why this rule exists, even beyond legality.
  • Always get permission ahead of time.
Please remember to always get permission before acting. Your actions cause a major disruption to the targets you attack. Networks become slow, servers crash or hang, and you create spurious log entries. Any institution with a useful IA sector will notice your attack and panic, believing you to have malicious intent; they will invariably expend resources searching for back doors and trying to determine what confidential information you stole. All of this, even if you don't get caught, demands that you acquire permission ahead of time.
You always have authorization to hack into servers you own; likewise, if you participate in a Capture the Flag game or as Red Cell in a Red vs Blue competition, you implicitly have the right to hack into whatever you can get your hands on. In all other cases, you need to ask the owners of the machines for authorization; you can even ask them to pay for it, selling your services as penetration tests and giving them a comprehensive outline of their network's vulnerabilities and proper mitigation steps to improve their security. As long as you have permission ahead of time, and you remember the first two rules of The Hacker Ethic, you can do as you please with the network and the affected machines.