Posted on

Beginners guide to fuzzing

Hello, aspiring ethical hackers. In this blogpost, you will learn everything about fuzzing as an ethical hacker.

What is Fuzzing?

Fuzzing or fuzz testing is a term that comes from the domain of programming . It is a software testing technique in which invalid, unexpected or random data is provided to a computer program or a system to see how it responds.

It is usually checked if the program results in any crash, memory leaks or buffer overflows. Fuzz testing is usually performed to see if the software results in any vulnerability that can be exploited by hackers.

Types of Fuzzing

Fuzzing 1024x478

There are different types of fuzz tests. They are application fuzzing, protocol fuzzing and file format fuzz testing. Let’s learn about them in detail.

1. Application fuzzing:

In this type of fuzz test, options of a command line program or UI features such as buttons and input fields in forms are tested for any vulnerability by providing random inputs.

2. Protocol fuzzing:

Just like its name says, in this type of fuzz testing, protocols are tested to see how they react when random data is sent as input to them.

3. File format fuzzing:

In file format fuzz test, a different type of file format or a corrupted file is provided as input to the programs to see how they react. For example, let’s say a web application has file upload feature that takes docx files as input from users. This is the usual practice. But how does it react when a exe file or a exe file masquerading as docx file is uploaded to that application? This type of fuzz test intends to check this.

    What is a Fuzzer?

    A Fuzzer is a tool that tests software, operating systems or networks for security vulnerabilities. A Fuzzer is a program that automatically infects random data and detects vulnerability

    Importance of fuzzing

    Fuzz testing works on the concept that it is generally assumed that users will provide proper input to the web application or program or application. But what happens if random and unexpected input is provided to the same application. How does it behave? Does it pose a security threat that hackers can exploit? etc.

    Posted on

    Hackers guide to shellcode

    Hello, aspiring ethical hackers. In our previous article, you learnt everything about a payload. In this article, you will learn what is shellcode.

    What is Shellcode?

    In hacking, Shellcode is a small piece of code that is used as a payload during exploitation of a vulnerability. Differentiating it form a payload, shellcode is commonly written in machine or assembly language. It is known as shell code because it commonly starts a command shell on the target machine.

    Let’s see what is shellcode. For this we are using Kali Linux but you can use any operating system that can run C programs and the related compilers. Kali Linux already has GCC compiler installed by default. Here, I write a simple C program for printing out “Hello world”.

    Shellcode 1

    Then I compile this C program using gcc as shown below and check its result.

    Shellcode 2
    Shellcode 3

    The program works fine. GCC compiler also allows us to view the program in assembly code format with the “-S” option.

    Shellcode 4

    Running this command creates a new file with same name but with “.s” extension (test.s in our case). Opening that file with any text editor reveals the shellcode of that particular program as shown below.

    Shellcode 5
    Shellcode 6
    Shellcode 7

    Types of Shell code

    There are different types of shell codes in hacking. They are,

    1. Remote shellcode:

    Remote shell code is used by hackers while targeting a remote machine. This is usually done by exploiting a vulnerable software on the target machine to get a shell back.

    2. Local shell code:

    This type of shell code is used on the local system on which the hacker already has access to. It is usually used when the hacker has limited privileges on the target system but can exploit a vulnerability in a software to elevate privileges.

    3. Download and execute shell code:

    This type of shell code, instead of spawning a shell, downloads another payload and executes it on the target system.

    4. Staged shell code:

    This type of shell code is used when the amount of data that can be injected into process or a software is limited. This shell code downloads additional shellcode and executes it on the target software or system.

    Posted on

    How to create a virus

    Hello, aspiring ethical hackers. In our previous blogpost of Computer virus, you have learnt what is a virus, its functions and about different types of viruses. In this article, you will learn how to create a Virus manually.

    However, note that it is only for educational and knowledge purposes and not for performing any malicious purpose. The aim of this article is to give you a basic understanding on how to create a virus. Let’s begin.

    Creation of a computer virus consists of six steps. They are,

    1. Decide the function you want your virus to perform.
    2. Select a programming language in which you want to code your virus.
    3. Code the virus.
    4. Compiling the virus.
    5. Testing.
    6. Sharing the Virus.

    Let’s learn about each step in detail.

    1. Function of a virus:

    Before you even start coding a virus, you need to decide what exactly you want your virus to do. In real-world, computer viruses perform many functions that include downloading and installing additional viruses, wiping data from the infected system and even taking complete control of the system. For example, I decide that my virus should open a Firefox browser when executed.

    2. Choose your language:

    After deciding the function of your virus, next thing you have to do is choose a programming language to code this virus. Computer viruses can be written in many programming languages like C, Deslphi, Visual Basic, C#, C++, Cobol, Ruby, Python etc. They can also be created using scripting languages like JavaScript, Batch script, Bash, PowerShell etc. Choose the programming or scripting language of your choice. For example, I want to write my virus in Batch scripting.

    3. Write code:

    Once you select the programming language or scripting language, you need to code the virus. To code a batch script, all I have to do is open a notepad, add the code shown below and save the file as Batch file (with extension .bat)

    How To Create A Virus 1
    @echo off
    start firefox.exe
    
    How To Create A Virus 2
    How To Create A Virus 3

    4. Compile (if necessary):

    Compile the virus. Compiling is a process of converting source code into machine-readable code so that a computer can execute it. Since we have written our code in Batch, it doesn’t need any compilation. But programs written in C,C++, Python need compiling. Compiled programs are usually fast.

    5. Test the virus:

    Once you have finished coding the virus and compiling it, test its working by executing the virus. I execute the Batch virus I created and it open Firefox browser as shown below.

    How To Create A Virus 4

    6. Share the virus:

    The last step is to share the virus to make your target user execute it. Normally hackers use social engineering or phishing schemes to spread the virus.

    Posted on

    Beginners guide to ARP poisoning

    Hello aspiring ethical hackers. In our previous article on Data Link layer attacks, you have learnt what is a LAN, what is a Network Hub and network Switch and their uses, what is a MAC address, what is a CAM table and various types of attacks that take place in LAN. In this article, you will learn about one of the attacks taking place on the LAN known as ARP poisoning.

    ARP Poisoning 1 1024x555

    What is ARP Poisoning?

    ARP poisoning or ARP spoofing or ARP cache poisoning is an hacking attack in which malicious ARP reply packets are sent to the default gateway. This packets are sent to change the MAC address value corresponding to a specific IP address.

    ARP Poisoning 2 1024x553

    ARP protocol translates IP addresses to MAC addresses. ARP spoofing is usually performed by sending a malicious ARP reply to the network gateway, asking it to associate its MAC address with the IP address of the machine the hacker wants to target. Once the default gateway saves this message and broadcasts it to all the machines on the network, all the traffic of the target system passes through the attacker controlled machine.

    ARP Poisoning 3 1024x584

    This allows hacker to perform packet sniffing, password sniffing and other MiTM attacks after successful ARP spoofing attack. ARP poisoning attack is performed after the hacker has finished gaining access on the target network. This attack is very difficult to detect as the common users will not find anything suspicious while the attack is going on.

    Real-world examples of ARP spoofing

    In 2008, a Chinese hacker performed ARP spoofing attack and redirected the website of none other than Metasploit to a Chinese forum where he kept on sale an exploit for a zero-day vulnerability. It is assumed he did this by targeting a router at the Internet Service Provider (ISP) level.

    Posted on

    Beginners guide to Payload generators

    Hello, aspiring ethical hackers. In our previous blogpost, you have learnt about types of Metasploit payloads, what is a payload etc. In this blogpost you will learn what is a payload generator and popular payload generators.

    What is a payload?

    A payload in cyber security is a piece of code that is executed after successfully running an exploit to take advantage of a vulnerability. When a Proof Of Concept (POC) for a vulnerability is disclosed, this allows most hackers around the world to execute their chosen payloads. This payload can be anything from malware, reverse shell, RAT, ransomware etc or their own custom payload.

    For example, ms08_067 vulnerability was exploited in real-world to deploy Conficker worm payload, but while pen testing with Metasploit, meterpreter is used as payload. Although payloads can be created manually, it would be very simple to make payloads with payload generators.

    What is a payload generator?

    Any software or application that helps us to automatically create a payload to be used in a pen test is known as a payload generator. Payloads can be a simple one liner or multiple lines of complex code. Whatever it is, it is payload generator makes our work very simple. Let’s learn about some of the popular payload generators.

    1. MSF venom:

    MSF venom is a payload generator fromMetasploitframework that can be pretty useful in generating payloads forwindows hacking,Linux hacking, web applicationhackingand even mobile hacking. MSF venom is a replacement to MSF payload earlier. Learn more about msfvenom.

    Msfvenom 1

    2. Veil-Framework:

    Veil-Framework is a tool that can generateMetasploit payloadsthat bypass common anti-virus solutions. Veil-framework is officially supported by Debian 8 and Kali Linux rolling 2018+. It may also be run on Arch Linux, Manjaro Linux, Black Arch Linux, Deepin 15+, Elementary, Fedora 22+, Linux Mint, Parrot Security, Ubuntu 15.10+ and Void Linux. Learn more about Veil Framework.

    Veil Framework 6

    3. Msfpc:

    MSFvenom Payload Creator (MSFPC) is a wrapper that can generate multiple types of payloads, based on users choice. The idea is to be assimple as possible(only requiring one input) to produce their payload.

    4. WinPayloads:

    This tool can generate undetectable Windows payloads.

    5. Arcanus Framework:

    ARCANUS is a customized payload generator/handler for penetration testing that can generate both Linux and Windows payloads. Learn more about Arcanus Framework.

    Arcanus4

    6. Hercule’s Framework:

    HERCULES is a customizable payload generator to generate Windows and Linux payloads that bypass antivirus software.

    2hercules3