<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ritesh Sahu on Medium]]></title>
        <description><![CDATA[Stories by Ritesh Sahu on Medium]]></description>
        <link>https://medium.com/@riteshs4hu?source=rss-ffa740d80d65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vAaCijL0tqp5S3Ne</url>
            <title>Stories by Ritesh Sahu on Medium</title>
            <link>https://medium.com/@riteshs4hu?source=rss-ffa740d80d65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:55:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riteshs4hu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Journey into Android]]></title>
            <link>https://medium.com/@riteshs4hu/a-journey-into-android-fbaa891c1b27?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbaa891c1b27</guid>
            <category><![CDATA[android-architecture]]></category>
            <category><![CDATA[apk]]></category>
            <category><![CDATA[android-components]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 17:02:27 GMT</pubDate>
            <atom:updated>2024-04-01T17:02:27.372Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Its Architecture, File System, and Permissions</h4><p>In this blog post, I introduced Android and its architecture, detailing various layers. I also discussed the Android file system structure, common folders in Android internal storage, APK files and their key components, app sandboxing and the permission model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*17DpGFS55XPqjLrO8-B3Bw.jpeg" /></figure><p><strong>Introduction to Android</strong></p><p><strong>Android</strong> is an <strong><em>open-source operating </em></strong>system designed primarily for <strong><em>touchscreen mobile</em></strong> devices such as <strong>smartphones </strong>and <strong>tablets</strong>. It offers a customizable user interface, multitasking capabilities and rich notification features.</p><h3>Android’s Architecture</h3><p>Android’s architecture is based on a modified version of the Linux kernel and is designed to be open and flexible. It consists of several key components that work together to provide a rich user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*Awr49Y8mvoPgzkvNvhuqDg.jpeg" /></figure><p><strong><em>Here are the main components of Android’s architecture:</em></strong></p><p><strong>Applications:</strong> At the top of the Android architecture are the applications themselves. These are the software programs that users interact with, such as messaging apps, web browsers, games, and productivity tools. Android applications are written in Java or Kotlin and are compiled into bytecode that runs on the Android Runtime (ART).</p><p><strong>Android Framework:</strong> The Android framework provides a set of Java libraries and APIs that developers use to build applications. It includes various components such as Activity Manager, Content Providers, View System, and Notification Manager. These components provide the building blocks for creating applications and interacting with the system services.</p><p><strong>Native Libraries and Android Runtime (ART, Dalvik VM):</strong> Android includes a set of native libraries written in C/C++ that provide core functionalities such as <em>graphics rendering (OpenGL),</em> <em>database access (SQLite),</em> and <em>web rendering (WebKit).</em> These native libraries are used by the Android framework and applications to access low-level system functionalities.</p><p><strong><em>Android Runtime (ART)</em></strong> is the runtime environment used to run Android applications. It uses <strong>ahead-of-time (AOT)</strong> compilation to convert application bytecode into native machine code, which improves performance and efficiency compared to the earlier Dalvik virtual machine. Dalvik VM was the original runtime used in Android before being replaced by ART.</p><p><strong>Hardware Abstraction Layer (HAL):</strong> Provides a standardized interface for Android to communicate with hardware components, allowing device manufacturers to write drivers for their specific hardware.</p><p><strong>Linux Kernel:</strong> The Linux kernel serves as the foundation of the Android operating system. It provides core functionalities such as device drivers, memory management, process management, and networking. The Linux kernel is responsible for interacting with the device’s hardware and managing system resources.</p><h3><strong>Android file system </strong>structure</h3><p>The Android file system structure can vary slightly depending on the device manufacturer and Android version, but it generally follows a similar layout.</p><p><strong><em>Here’s a basic overview:</em></strong></p><ul><li><strong>Root Directory (/):</strong> The top-level directory that contains all other directories and files.</li><li><strong>/boot:</strong> Contains files related to the boot process of the Android device, including the bootloader and kernel image. The bootloader initializes the device’s hardware and loads the kernel into memory to start the operating system.</li><li><strong>/system:</strong> Contains the Android operating system files, including the kernel, system libraries, and system apps. This directory is read-only on most devices to prevent modification of system-critical files.</li><li><strong>/recovery:</strong> Stores files used during the recovery process of the Android device. It includes the recovery image and related utilities used to troubleshoot or repair the device, such as installing system updates or performing factory resets.</li><li><strong>/data:</strong> Contains user data, app data, and installed apps. Each app typically has its own directory under <strong>/data/data</strong>, where it stores its private data. User-generated content like photos, videos, and documents are also stored here.</li><li><strong>/cache:</strong> Holds temporary files and cached data used by the system and apps. These files can be safely deleted to free up storage space, but doing so may affect the performance of certain apps until the cache is regenerated.</li><li><strong>/misc: </strong>This partition contains system settings like carrier or region IDs, USB configurations, and hardware settings. It’s crucial for device features and can cause malfunctions if corrupted or missing. It’s also used by recovery to communicate with the bootloader, store information during updates, and manage the boot process.</li><li><strong>/sdcard: </strong>The <em>/sdcard</em> partition, also known as the external storage or primary storage, is where user-generated content and downloaded files are typically stored on an Android device. This includes items such as photos, videos, music, documents, and app data that users create or save.</li></ul><h4>Common Folders in Android Internal Storage</h4><p>The internal storage of an Android device contains several common folders used for storing various types of data. These folders are part of the user data partition and are not specific to third-party apps.</p><p><strong><em>Here is a brief description of some of the most common folders:</em></strong></p><ul><li><strong>Android:</strong> The Android folder contains system files and data related to the Android operating system, including system settings and cached data.</li><li><strong>DCIM (Digital Camera Images):</strong> The DCIM folder is where photos and videos captured by the device’s camera are typically stored. It stands for “Digital Camera Images.”</li><li><strong>Downloads:</strong> The Downloads folder is used for storing files that have been downloaded from the internet or received through apps like email or messaging.</li><li><strong>Movies: </strong>Some devices have a folder specifically for storing movie or video files.</li><li><strong>Music:</strong> Similar to the Movies folder, the Music folder is used for storing music files.</li><li><strong>Pictures:</strong> In addition to the DCIM folder, some devices have a separate Pictures folder for storing images.</li></ul><h4><strong>What is an APK file</strong></h4><p>An Android Application Package (APK) is the file format used to distribute and install applications on Android devices. It contains all the necessary components for an app to be installed and run on an Android device, including code (in the form of dex files), resources, assets, manifest file, and certificates.</p><p><strong><em>Here’s a breakdown of the key components within an APK:</em></strong></p><p><strong>Code (classes.dex):</strong> This section includes the compiled Java or Kotlin code of the application in the form of .dex files. These files are optimized for the Android runtime (ART or Dalvik) and contain the executable code necessary to run the app.</p><p><strong>Manifest File (AndroidManifest.xml):</strong> The AndroidManifest.xml file describes essential information about the application to the Android system. It includes the app’s package name, version, permissions required, entry points (activities, services, receivers), and more.</p><p><strong>Resources (res):</strong> This section contains non-code resources used by the application, such as images, XML layouts, strings, and other assets. These resources are compiled into a binary format and can be accessed by the app at runtime.</p><p><strong>Libraries:</strong> If the application uses any third-party libraries or dependencies, they are bundled within the APK. This ensures that the app has access to all necessary code when installed on a device, even if the device doesn’t have those libraries installed separately.</p><p><strong>Assets (assets):</strong> These are raw files that the app can access using a file manager. They are stored in the assets/ directory within the APK and can include fonts, sounds, videos, and other files.</p><p><strong>Pre-compiled Resources (resources.arsc):</strong> This file contains pre-compiled resources that the Android system can quickly load at runtime. It helps improve the performance of resource loading in the app.</p><p><strong>Certificates (CERT.RSA and CERT.SF):</strong> Before an APK can be installed on a device, it must be signed with a cryptographic signature. The CERT.RSA and CERT.SF files contain the certificates used to sign the APK, ensuring its integrity and authenticity.</p><h4>Android app components</h4><p>Android app components are the fundamental building blocks of an Android application. They serve as the entry points for the system to interact with the app. While not all components are directly accessible to the user, they work together and depend on each other to define the app’s behaviour. Each component is distinct and plays a specific role, contributing to the overall functionality and structure of the app.</p><p><strong><em>There are four types of app components:</em></strong></p><p><strong>Activities:</strong> Activities represent the UI of an application. They are responsible for presenting the user interface and handling user interactions. An app usually consists of multiple activities that work together to form a complete user experience.</p><p><strong>Services:</strong> Services are background processes that run without a UI. They are used for tasks that need to continue running even when the app is not in the foreground, such as playing music, fetching data from the internet, or performing other long-running operations.</p><p><strong>Broadcast Receivers: </strong>Broadcast Receivers can be used to handle system-wide broadcast messages, which can include notifications. However, they are not limited to handling notifications. Broadcast Receivers can also respond to other types of system events, such as changes in network connectivity, the device’s battery level, or the device’s screen turning on or off.</p><p><strong>Content Providers:</strong> Content Providers in Android are used to manage access to structured data, allowing different applications to securely share data. They typically store data in a SQLite database, but they can also provide access to other types of data, such as files or web resources. They are commonly used in Contacts, Messaging, and Media Player apps.</p><h4>App Sandboxing and the Permission Model</h4><p><strong>Sandboxing</strong> is a <strong>security technique</strong> in which each app is run in an <strong>isolated environment,</strong> keeping it separate from other apps and system resources. This helps <strong><em>protect an app’s data and processes from other apps</em></strong>. In the Android operating system, each app runs in its process, known as an “app sandbox.” This process has a <strong>unique user ID </strong>assigned to it <strong><em>during installation</em></strong>. This user ID also provides the app with a separate storage area that it uses for its data. When an Android app is launched, it utilizes sandboxing to prevent it from accessing data or processes of other apps. Sandboxing also helps protect against malware and malicious apps because if an app becomes infected, its access to other apps is restricted.</p><p><strong>Permission Model</strong> in Android is closely related to app sandboxing. Android apps <strong><em>require permission</em></strong> to <strong>access certain resources or perform certain actions on the device.</strong> These <em>permissions are declared </em>in the app’s <strong>manifest file</strong> and are granted to the app by the user at the time of installation or runtime. The permission model helps ensure that apps only have access to the resources they need to function properly and that they cannot access sensitive information or perform malicious actions without the user’s consent. By combining app sandboxing with a robust permission model, Android provides a secure environment for running apps while protecting user data and privacy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbaa891c1b27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API — OWAS Top 10 (Part 2) | Broken Authentication]]></title>
            <link>https://medium.com/@riteshs4hu/api-owas-top-10-part-2-broken-authentication-ffd8dcce4707?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffd8dcce4707</guid>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[broken-authentication]]></category>
            <category><![CDATA[owasp]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 16:28:32 GMT</pubDate>
            <atom:updated>2023-11-27T16:28:32.534Z</atom:updated>
            <content:encoded><![CDATA[<h3>API — OWAS Top 10 (Part 2) | Broken Authentication</h3><h4>Broken Authentication…</h4><p>Hello everyone,</p><p>In this blog, I will be discussing the top 10 vulnerabilities of APIs as outlined by OWASP.</p><p>Let us begin with the second vulnerability on the list, which is known as <strong>Broken Authentication.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtEpzKlgiKHhaVMqh6U1Kw.jpeg" /><figcaption>API:2023 OWASP TOP 10 | Broken Authentication</figcaption></figure><h4><strong>What is Broken Authentication?</strong></h4><ol><li><strong>Broken: </strong><em>In this context, “broken” means that something is not working as it should. It’s like when a toy isn’t functioning properly or a machine stops working correctly.</em></li><li><strong>Authentication:</strong> <em>Authentication is the process of proving who you are. It’s like showing your ID to the bouncer at a club to prove you’re old enough to get in. In the digital world, authentication involves proving your identity to access something, usually with a username and password.</em></li><li><strong>Broken Authentication:</strong> Broken authentication is a security vulnerability that occurs when the authentication mechanisms of an application or system are not properly implemented, allowing attackers to bypass or manipulate the authentication process. This could lead to unauthorized access to sensitive information or functionality, as the system fails to accurately verify the identity of users. Broken authentication vulnerabilities can arise from issues like weak password policies, improper session management, inadequate protection against credential stuffing, and more.</li></ol><h4><strong>Here are some of the key impacts:</strong></h4><ol><li><strong>Unauthorized Access:</strong> <em>The most immediate impact of broken authentication is that unauthorized users can gain access to sensitive areas or functionalities of an application. This can lead to data breaches, unauthorized changes, or misuse of resources.</em></li><li><strong>Data Exposure:</strong> <em>If attackers exploit broken authentication, they might gain access to sensitive user data, such as personal information, financial details, or private communications. This can result in identity theft, fraud, or privacy violations.</em></li><li><strong>Account Compromise:</strong> <em>Broken authentication can lead to the compromise of user accounts. Attackers could steal or manipulate login credentials, gaining control of legitimate user accounts. This can result in unauthorized actions being taken on behalf of the compromised users.</em></li></ol><h4><strong>Mitigation:</strong></h4><p><em>Here are several mitigation strategies to address these vulnerabilities:</em></p><p><strong>Secure Authentication Mechanisms:</strong></p><ul><li>Implement multi-factor authentication (MFA) to require users to provide multiple forms of verification before gaining access.</li><li>Use strong and complex passwords, and encourage users to use password managers.</li></ul><p><strong>Session Management:</strong></p><ul><li>Implement session timeouts to automatically log users out after a period of inactivity.</li><li>Use secure session tokens or cookies with short expiration times.</li><li>Ensure that session identifiers are not exposed in URLs, as they can be easily exploited.</li></ul><p><strong>Rate Limiting:</strong></p><ul><li>Implement rate-limiting mechanisms to prevent attackers from conducting rapid and automated brute-force attacks.</li></ul><p><strong>Security Headers:</strong></p><ul><li>Use security headers, such as HTTP Strict Transport Security (HSTS) and Content Security Policy (CSP), to enhance the overall security of the application.</li></ul><p><strong>Error Messages and Logging:</strong></p><ul><li>Avoid providing detailed error messages during authentication failures, as these can provide valuable information to attackers.</li><li>Implement comprehensive logging to track and analyze authentication and access events for suspicious activities.</li></ul><h4>Some Examples of Broken Authentication.</h4><p><strong>1. Rate Limiting / Brute Force Attack:</strong></p><ul><li>Client: The client is the legitimate user attempting to log in. They provide their username and password.</li><li>Server: The server is responsible for handling the login process. If the server does not have proper rate-limiting mechanisms in place, an attacker can repeatedly send login requests with various password combinations.</li><li>Attacker: The attacker aims to gain unauthorized access to an account. They use automated tools to repeatedly send login requests with different passwords. Since the server doesn’t limit the number of attempts, the attacker can keep trying different passwords until they find the correct one.</li></ul><p>Attack Process:</p><ol><li>The attacker sends multiple login requests to the server using different password guesses.</li><li>The server, lacking proper rate limiting, allows each attempt without restriction.</li><li>The attacker’s tool eventually finds the correct password, granting unauthorized access.</li></ol><p><strong>2. Insecure Session Management:</strong></p><ul><li>Client: The client is the user interacting with the application.</li><li>Server: The server maintains session information for authenticated users. This includes session tokens or cookies.</li><li>Attacker: The attacker seeks to exploit insecure session management to gain unauthorized access to a user’s account.</li></ul><p>Attack Process:</p><ol><li>The user logs in and receives a session token from the server.</li><li>The attacker intercepts or steals the user’s session token through techniques like session fixation or session hijacking.</li><li>The attacker presents the stolen token to the server, tricking it into believing they are the authenticated user.</li><li>The server grants access to the attacker, considering them the legitimate user.</li></ol><p><strong>3. Password Reset Vulnerabilities:</strong></p><ul><li>Client: The client is the legitimate user who needs to reset their password.</li><li>Server: The server handles password reset requests and generates temporary tokens or links to facilitate the process.</li><li>Attacker: The attacker aims to take control of a user’s account by exploiting weaknesses in the password reset process.</li></ul><p>Attack Process:</p><ol><li>The attacker identifies a password reset vulnerability, such as predictable reset tokens or insufficient validation.</li><li>The attacker initiates a password reset request for a victim’s account.</li><li>The server generates a predictable or weak token and sends it to the attacker.</li><li>The attacker uses the token to reset the victim’s password and gains unauthorized access to the account.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffd8dcce4707" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API - OWAS Top 10 (Part 1) | Broken Object Level Authorization]]></title>
            <link>https://medium.com/@riteshs4hu/api-owas-top-10-part-1-broken-object-level-authorization-668e9a99746d?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/668e9a99746d</guid>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[bola]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 16:27:37 GMT</pubDate>
            <atom:updated>2023-11-27T16:27:37.138Z</atom:updated>
            <content:encoded><![CDATA[<h4>Broken Object Level Authorization (BOLA)</h4><p>Hello everyone,</p><p>In this blog, I will be discussing the top 10 vulnerabilities of APIs as outlined by OWASP.</p><p>Let us begin with the first vulnerability on the list, which is known as “Broken Object Level Authorization” or BOLA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtEpzKlgiKHhaVMqh6U1Kw.jpeg" /><figcaption>API:2023 OWASP TOP 10 | BOLA</figcaption></figure><p><strong>What is Broken Object Level Authorization (BOLA)?</strong></p><p>Broken Object Level Authorization (BOLA) refers to a significant security vulnerability where an application fails to properly enforce authorization controls for specific objects or resources. This vulnerability allows attackers to gain unauthorized access to objects they shouldn’t be able to access.</p><p><strong>How its Work?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hpEGivTiqpSJPRaA0PjeFw.png" /><figcaption>Broken Object Level Authorization</figcaption></figure><p><strong>Scenario: </strong>Suppose we have a simple online banking application where users can view their account details after logging in. The application uses user IDs as object identifiers.</p><ol><li><strong>Attacker:</strong> <em>An individual with malicious intent who wants to gain unauthorized access to other users’ account information.</em></li><li><strong>Client:</strong> <em>A legitimate user who wants to access their account information through the banking application.</em></li><li><strong>Server:</strong> <em>The online banking application that handles requests from clients and provides account information.</em></li></ol><p><strong>Flow of Events:</strong></p><ol><li>Normal User Access (Client):</li></ol><ul><li>The legitimate user (client) logs into the banking application using their username and password.</li><li>Once authenticated, the user is directed to their account page where they can see their account balance and recent transactions.</li><li>The server properly checks the user’s authorization and provides access to the appropriate account data based on the user’s credentials.</li></ul><p>2. Unauthorized Access Attempt (Attacker):</p><ul><li>The attacker observes that the application uses sequential user IDs in the URL to access different user accounts (e.g., <a href="https://bankapp.com/account?id=123).">https://bankapp.com/account?id=123).</a></li><li>The attacker decides to test for BOLA vulnerabilities by manipulating the user ID parameter in the URL.</li></ul><p>3. Exploiting the Vulnerability (Attacker):</p><ul><li>The attacker changes the user ID parameter in the URL to a different value, representing a different user’s account (e.g., <a href="https://bankapp.com/account?id=456).">https://bankapp.com/account?id=456).</a></li><li>They access the URL, expecting to see the account details of user ID 456, even though they are not authenticated as that user.</li></ul><p>4. Server Response (Server):</p><ul><li>The server receives the manipulated request and processes it without adequately verifying the attacker’s authorization.</li><li>The server mistakenly provides the account details of user ID 456, allowing the attacker to view account balances and transactions that don’t belong to them.</li></ul><p>5. Unauthorized Data Access (Attacker):</p><ul><li>The attacker successfully gains access to the sensitive account information of another user.</li><li>They can potentially perform further actions, such as attempting to withdraw funds or perform unauthorized transactions.</li></ul><p><strong>Mitigation:</strong></p><p><em>To prevent Broken Object Level Authorization vulnerabilities like this:</em></p><ul><li>Implement strong authorization controls that check if the authenticated user has the proper permissions to access the requested object.</li><li>Avoid using easily guessable identifiers for objects.</li><li>Implement contextual authorization checks to ensure that users can only access objects they are authorized to, even if parameters are manipulated.</li></ul><blockquote><strong>Stay tuned for the next part, where we’ll dive into another intriguing aspect of API security. Make sure to follow and share this valuable information with those interested in learning about “OWASP Top 10 API Vulnerabilities.”🕵️‍♂️💻</strong></blockquote><p><em>Thank you for being a part of this blog journey.</em></p><p><strong>Goodbye! 😊👋</strong></p><p>📚📚 Keep discovering and growing! 📚📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=668e9a99746d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OWASP crAPI Walkthrough]]></title>
            <link>https://medium.com/@riteshs4hu/owasp-crapi-walkthrough-baec54214f85?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/baec54214f85</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[crapi]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 07:28:37 GMT</pubDate>
            <atom:updated>2023-09-21T07:28:37.949Z</atom:updated>
            <content:encoded><![CDATA[<h4>Exploring the Top Ten Vulnerabilities…</h4><p><strong>Hello friends! 🌟</strong></p><p>Welcome to our comprehensive walkthrough of OWASP crAPI, a purposely vulnerable API created to shed light on the top ten API security risks outlined by the Open Web Application Security Project (OWASP). In this blog post, we will take you on a journey through the intricacies of crAPI, exposing its vulnerabilities and providing you with real-world examples of API security challenges.</p><p><strong><em>🚀 Let’s Get Started….!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QfSRXeaDIOYSpyChNxKrOQ.jpeg" /><figcaption>API</figcaption></figure><h4>Installation and Deployment with Docker and docker-compose.</h4><p>To get <a href="https://github.com/OWASP/crAPI">OWASP crAPI</a> up and running on your local environment, you can utilize Docker and docker-compose for easy and isolated deployment.</p><p><strong>Prerequisites:</strong></p><ul><li>Docker Compose version 1.27.0 or above</li></ul><p><strong>Installation of Docker Compose (Version 1.27.0):</strong></p><p>First, ensure you have the curl installed. If not, you can install them with the following commands:</p><p>apt update<br>apt install -y curl</p><p><strong>Now, download and install Docker Compose:</strong></p><pre>curl -L &quot;https://github.com/docker/compose/releases/download/1.27.0/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose<br>chmod +x /usr/local/bin/docker-compose<br>docker-compose --version</pre><h4><strong>Configuring OWASP crAPI:</strong></h4><p>To configure and deploy OWASP crAPI, follow these steps:</p><p>1. Download the docker-compose.yml file:</p><pre>curl -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.yml</pre><p>2. Pull the necessary Docker images:</p><pre>docker-compose pull</pre><p>3. Start the OWASP crAPI application using docker-compose:</p><pre>docker-compose -f docker-compose.yml --compatibility up -d</pre><p><strong>Note: </strong><em>If you wish to make the application accessible from any IP address, including your local network address (0.0.0.0), you can customize the docker-compose.yml file as described below:</em></p><ul><li>Open docker-compose.yml and find the ‘crapi-web’ section.</li><li>Change the IP address from 127.0.0.1 to 0.0.0.0 for the specified ports:</li></ul><pre>ports:<br>  - &quot;${LISTEN_IP:-0.0.0.0}:8888:80&quot;<br>  - &quot;${LISTEN_IP:-0.0.0.0}:8443:443&quot;</pre><ul><li>Next, find the ‘mailhog’ section in the same file and change the IP address from 127.0.0.1 to 0.0.0.0 for the specified port:</li></ul><pre>ports:<br>  - &quot;${LISTEN_IP:-0.0.0.0}:8025:8025&quot; # Mail ui</pre><p><strong>Running OWASP crAPI:</strong></p><p><em>After making the necessary changes, run the OWASP crAPI application with the updated configuration:</em></p><pre>docker-compose -f docker-compose.yml --compatibility up -d</pre><p><em>You can access the OWASP crAPI dashboard in your web browser using the following URL:</em></p><p>http://&lt;your-ip-addr&gt;:&lt;your-defined-port&gt;/dashboard</p><blockquote><strong><em>For more detailed information and updates, refer to the OWASP crAPI GitHub repository: </em></strong><a href="https://github.com/OWASP/crAPI"><em>https://github.com/OWASP/crAPI</em></a></blockquote><h3>Exploring the Top Ten Vulnerabilities and Overcoming Challenges in crAPI</h3><p><strong>Let’s take a closer look at the vulnerabilities crAPI exposes:</strong></p><blockquote>BOLA Vulnerabilities (Broken Object-Level Authorization)</blockquote><p><strong><em>BOLA, or Broken Object-Level Authorization</em></strong><em>, is a type of security vulnerability that occurs when an application fails to properly enforce access controls at the object or data level. This can lead to unauthorized users gaining access to sensitive data or performing actions they should not be allowed to perform within the application.</em></p><p><strong>Challenge 1 — Access details of another user’s vehicle.</strong></p><p>Upon signing up and logging into the account, I noticed an “Add Vehicle” option in the dashboard. After successfully adding a vehicle, the dashboard displayed detailed information about the vehicle along with its location on a Google map. Curiously, I discovered a “Refresh Location” option at the bottom of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*zSpB_YvdpTbLbH4Lpg9JWg.png" /></figure><p>Clicking on this option, I intercepted the request using Burp Suite, revealing an API endpoint that requires a vehicle ID, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SRgsdm5Y3U84Rwdii9Ujlg.png" /></figure><p>The next step was to identify the vehicle IDs of other users. I navigated to the “Community” page and found messages posted by various users. By inspecting the responses in Burp Suite, I uncovered additional information, particularly the “vehicle id” attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*VNeRUtm5AdjtB0QKGr-ndg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47NdyTem0ftcODvpiWPeGg.png" /></figure><p>With the vehicle ID in hand, I forwarded the request to the API endpoint responsible for retrieving vehicle locations to Burp Suite’s repeater. Using the vehicle ID associated with another user, I successfully gained access to the location details of their vehicle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uL0hS9-x6uRqOgyPsTOEA.png" /><figcaption>Challenge-1 Complete.</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 1 Complete — — — — — — — — — — — —</p><p><strong>Challenge 2 — Access mechanic reports of other users</strong></p><p>While exploring the dashboard, I stumbled upon the “Contact Mechanic” page, which presented me with a form to fill out. After completing the form, I couldn’t help but wonder what lay beneath the surface.</p><p>Upon inspecting the response using Burp Suite, I discovered a link that provided access to a mechanic report. This link included a “report_id” parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvqbM0HUxe2zdXzSJwAsYQ.png" /></figure><p>Taking advantage of this discovery, I intercepted the request containing the “report_id.” I decided to test it out by attempting to access the report associated with “id=2.” To my surprise, I successfully gained access to another user’s mechanic report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qgGK1RZD3iohf5LSLpuwA.png" /><figcaption>Challenge 2 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 2 Complete — — — — — — — — — — —</p><blockquote>Broken User Authentication</blockquote><p><em>Broken user authentication is a critical security issue when an application fails to properly authenticate or authorize users, potentially allowing unauthorized individuals to access restricted resources or perform actions they shouldn’t have access to.</em></p><p><strong>Challenge 3 — Reset the password of a different user.</strong></p><p>I noticed a “Forgot Password” option on the login page. After providing my email on the “Forgot Password” page, an OTP was promptly dispatched to my email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*GsGeYotfeSdhePANomZSGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*SJEzuSTFKuFzdA-vWVa7RQ.png" /></figure><p>I accessed my email via &lt;your-define-ip&gt; on port 8025 to retrieve the OTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*h--maEBkJYqA5p8M490Oaw.png" /></figure><p>I intentionally provided after providing multiple wrong OTPs, I received a response indicating that my attempts had exceeded the limit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WkJd0sqJGspSgFTbPjw_6Q.png" /></figure><p>I observed that this endpoint utilized version v3, prompting me to investigate version v2, hoping it lacked the exact protection mechanism. To my surprise, v2 did indeed lack limitations on the number of attempts.</p><p>I obtained the email addresses of other users from the community page. I proceeded to generate OTPs for another user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLts87D3NMzOBvyMYYZN7w.png" /></figure><p>To carry out this task, I employed Burp Suite’s Intruder function, employing a sniper attack.</p><p>Once I had the Intruder setup in motion and initiated the attack, the response I received carried the message “OTP verified.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*RkGqbLJPPyz-VgSJVo_WBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*_8RoLm2vUsc59cFeICpzIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*xrUWOcWOLuEW8r9wfB1lHQ.png" /><figcaption>Challenge 3 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 3 Complete — — — — — — — — — — —</p><blockquote>Excessive data exposure</blockquote><p><em>Excessive data exposure is a critical security issue that occurs when sensitive information is unintentionally or improperly disclosed to unauthorized individuals or systems. It can have serious consequences for individuals and organizations, including data breaches, privacy violations, and legal ramifications.</em></p><p><strong>Challenge 4 — Find an API endpoint that leaks sensitive information of other users</strong></p><p>While exploring the “Community” page, I made a striking discovery. Upon inspecting the response, I found that it contained detailed information about another user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nk_BP1bs0ofBKB_AmEL22Q.png" /><figcaption>Challenge 4 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 4 Complete — — — — — — — — — — —</p><p><strong>Challenge 5 — Find an API endpoint that leaks an internal property of a video</strong></p><p>In the process of uploading a video, I made an intriguing discovery. Upon receiving the response, I noticed that it disclosed an internal property of the video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8XcsdsZnog7uvWXbhzZKA.png" /><figcaption>Challenge 5 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 5 Complete — — — — — — — — — — —</p><blockquote>Rate Limiting</blockquote><p><em>Rate limiting is a technique used in computer systems to control the rate at which requests or actions are allowed. It’s often implemented to prevent abuse, protect resources, and maintain system stability. Rate limiting can be applied in various contexts, such as API rate limiting, login attempts, or even in protecting against DDoS attacks.</em></p><blockquote><strong><em>Challenge 6 — Perform a layer 7 DoS using ‘contact mechanic’ feature</em></strong></blockquote><p><strong><em>A Layer 7 Denial of Service (DoS) attack, often referred to as an application layer DoS attack, is a type of cyberattack that specifically targets the application layer of the OSI model. In this type of attack, the attacker aims to overwhelm a web server or application by sending a large volume of malicious requests that are designed to consume server resources, exhaust server capacity, or exploit vulnerabilities in the application.</em></strong></p><p>While exploring the application, I encountered the ‘Contact Mechanic’ feature, which allowed users to fill out a form for assistance. Intrigued, I decided to investigate further.</p><p>Upon examining the request, I noticed the parameter “repeat_request_if_failed” was set to “false,” with “number_of_repeats” at a value of 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wwJRt6EsjeFC-Dr995O7A.png" /></figure><p>However, what piqued my curiosity was the potential impact of changing these values. By modifying “repeat_request_if_failed” to “true” and setting “number_of_repeats” to a whopping 10,000, I initiated a request that overwhelmed the system.</p><p>The response I received clearly indicated a Layer 7 Denial-of-Service (DoS) condition with the message: “Service unavailable. Seems like you caused a Layer 7 DoS :)”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6lywQ_iTL-nPLXLV3Kmtdw.png" /><figcaption>Challenge 6Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 6 Complete — — — — — — — — — — —</p><blockquote>BROKEN FUNCTION LEVEL AUTHORIZATION (BFLA)</blockquote><p><strong>Broken Function Level Authorization (BFLA) </strong><em>is a security vulnerability that occurs when an application or system does not properly enforce access controls at the function or feature level. In other words, it allows users to perform actions or access features that they should not have</em> <em>permission to use.</em></p><p><strong>Challenge 7 — Delete a video of another user</strong></p><p><strong>Step 1: Change Video Name</strong></p><p>I began by using the “Change Video Name” option, allowing me to modify the name of the video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Q4R4B4xOWjWC8WOU0rZ4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T31EhsyhFqeo0dhKHoqnMQ.png" /></figure><p>Upon renaming the video, I noticed that the method used was PUT. This piqued my interest, prompting me to explore which methods were allowed for this endpoint. To my surprise, I discovered that the DELETE method was permitted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjMJp_VV7eD4vGWeaCxZnA.png" /></figure><p>Taking advantage of the DELETE method, I initiated a request with an empty request body. The server responded with a message stating, “This is an admin function. Try to access the admin API.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hMEIGM4Tdsi3hFlNqFT5Cg.png" /></figure><p>Recognizing the need for admin privileges, I decided to manipulate the request further. By changing the user to “admin” and sending the request, I successfully deleted the video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pu2VA9Br-TenDVKkS-vx4g.png" /></figure><p>However, the real challenge was to delete another user’s video. Upon examining the endpoint, I noticed that it utilized a numerical value at the end. Suspecting this value to be a unique identifier, I modified it to represent the target user and sent the request. The result? A successful deletion of another user’s video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsLuHrgfkgC5yl40ehv9JQ.png" /><figcaption>Challenge 7 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 7 Complete — — — — — — — — — — —</p><blockquote>Mass Assignment</blockquote><p><em>Mass assignment is a security vulnerability that occurs when an attacker can manipulate input data to modify an object’s properties, often leading to unauthorized changes in a system. This can happen when developers don’t properly validate and sanitize user inputs or fail to restrict which properties can be modified in an object.</em></p><p><strong>Challenge 8 — Get an item for free</strong></p><p>We initiated the challenge by exploring the ‘shop’ page, where we noticed an available balance of $100 and two items: ‘Seat’ and ‘Wheel’. We placed an order and closely examined the request and response from the workshop API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kA2fo7ogkgWCF1Ipz-H43g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y9080Yx6TAiM2OfJa9_plg.png" /></figure><p>Past-orders page displayed a list of all orders for the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gt0JkIGbb4ZTlo63Qii89A.png" /></figure><p>Now intercepted the order detail request, revealing the allowed methods and the order’s status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*LRcwNaFxEJ_6khsheJetng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zzxl6Db8sfS-vVDdZ_Rx8Q.png" /></figure><p>We dared to change the request method from GET to PUT, leading to a valuable message in the response. It appeared that the ‘status’ could have only three distinct values ‘delivered’, ‘return pending’ or ‘returned’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IULreFJZiC18rIi7SLQJw.png" /></figure><p>We modified the ‘status’ to ‘returned’. The result? The item was successfully returned, and a refund was added to the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHV_Y7TUcux8SvqxBF1_VA.png" /><figcaption>Challenge 8 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 8 Complete — — — — — — — — — — —</p><p><strong>Challenge 9 — Increase your balance by $1,000 or more</strong></p><p>To increase our balance by $1,000 or more, we placed a new order. We adjusted the ‘quantity’ to 100 and changed the status to ‘returned’ using the previous endpoint. the application deducted $10 for one seat, reducing the balance from $90 to $80. By manipulating the ‘quantity’ to ‘100’ and the ‘status’ to ‘returned’, we triggered a refund of $1,000, effectively adding it to our account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4uNMZ5XRirNGih24xwMgw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*vyGHxGbXMd6Fl7-AtBghTw.png" /><figcaption>Challenge 9 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 9 Complete — — — — — — — — — — —</p><p><strong>Challenge 10 — Update internal video properties</strong></p><p>We initiated the challenge by using the “Change Video Name” option, which allowed us to modify the video’s name. While performing this action, we noticed that the method being used was PUT.</p><p>Upon renaming the video, the response provided valuable information, specifically the “conversion_params,” which exposed internal video properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Q4R4B4xOWjWC8WOU0rZ4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0iLUr3IxrkWLoFS2obuM1g.png" /></figure><p>We used “conversion_params” to alter the video properties and received confirmation of success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK_lc8N49SA00GtdBkJZ-Q.png" /><figcaption>Challenge 10 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 10 Complete — — — — — — — — — — —</p><blockquote>Server-Side Request Forgery (SSRF)</blockquote><p><em>SSRF is a type of security vulnerability that occurs when an attacker can manipulate the requests made by a web application to access resources on the server or other internal systems that they should not have access to.</em></p><p><strong>Challenge 11 — Make crAPI send an HTTP call to “www.google.com&quot; and return the HTTP response.</strong></p><p>We started by intercepting the request from the contact mechanic form in Burp Suite. Within the response, we discovered a URL that our request was using.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qSPWCeNLrwLyPUzC9Nm1w.png" /></figure><p>We decided to modify the request URL. By substituting the URL, we successfully prompted the server to make an HTTP call to “www.google.com.&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V66_QkGhvDJ0BbnujUrNVw.png" /><figcaption>Challenge 11 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 11 Complete — — — — — — — — — — —</p><blockquote>NoSQL Injection</blockquote><p><em>NoSQL Injection is a type of security vulnerability that occurs in applications that use NoSQL databases, such as MongoDB, Cassandra, or Redis when user-supplied data is not properly sanitized or validated before being used in database queries.</em></p><p><strong>Challenge 12 — Find a way to get free coupons without knowing the coupon code.</strong></p><p><strong>Step 1: </strong>Intercepting the Validate-Coupon Request</p><p>We initiated the challenge by intercepting the validate-coupon request in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Yp9s0aedQa28Pt6oRzC5A.png" /></figure><p><strong>Step 2: </strong>Employing a NoSQL Payload</p><p>We took inspiration from a collection of NoSQL injection payloads available on GitHub at <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection">https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection</a> Specifically, we used the payload { &quot;$ne&quot;: 1 }, which proved effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5v4S1tvbl8qcoWxd1syOsQ.png" /><figcaption>Challenge 12 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 12 Complete — — — — — — — — — — —</p><blockquote>SQL Injection</blockquote><p><em>SQL Injection (SQLi) is a type of security vulnerability that occurs in web applications when user-supplied data is not properly validated or sanitized before being included in SQL queries. This allows malicious users to manipulate these queries to gain unauthorized access to a database or perform unintended actions on the database.</em></p><p><strong>Challenge 13 — Find a way to redeem a coupon that you have already claimed by modifying the database</strong></p><p>After completing Challenge 12 and obtaining a free coupon, we proceeded to use the coupon code. We intercepted the request associated with coupon redemption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*Fba_jPui9BxkoOfg6Xhz2Q.png" /></figure><p>To manipulate the database and redeem the coupon, we turned to a repository of offensive payloads available at [<a href="https://github.com/InfoSecWarrior/Offensive-Payloads/">https://github.com/InfoSecWarrior/Offensive-Payloads/</a>]. We used a basic SQL injection payload: 0&#39; or &#39;0&#39; = &#39;0.</p><p>The response we received was a success message indicating that the coupon code had already been claimed by us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVNjonFFBdyaCY-S7WPohw.png" /></figure><p>We attempted to identify the SQL version by using the payload 0&#39;; select version() --+, which revealed the SQL version in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbRZZaXnPnpz3NZ4lN9IcA.png" /><figcaption>Challenge 13 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 13 Complete — — — — — — — — — — —</p><blockquote>Unauthenticated access</blockquote><p><em>Unauthenticated access refers to allowing users or clients to interact with a system or application without requiring them to provide any form of authentication or identification. This means that users can access certain resources or perform certain actions without needing to log in or provide credentials.</em></p><p><strong>Challenge 14 — Find an endpoint that does not perform authentication checks for a user.</strong></p><ol><li>Intercepting the Order Details Request</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*ShjdGJUCJrJPu6ZK8w4BTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8EbmF1wsR6-I7j75GwypQ.png" /></figure><p>we decided to send a request to this endpoint without including a valid authentication token. the response came back successful, providing us with the order details without requiring any form of authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XhuxtQtulfwAI8FzUQH1w.png" /><figcaption>Challenge 14 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 14 Complete — — — — — — — — — — —</p><blockquote>JWT Token</blockquote><p><em>A JWT (JSON Web Token) is a compact, URL-safe means of representing claims to be transferred between two parties. It’s commonly used for authentication and authorization purposes in web applications. JWTs consist of three parts: the header, the payload, and the signature. The header and payload are Base64Url encoded JSON objects, and the signature is used to verify the integrity of the token.</em></p><p><strong>Challenge 15 — Forging Valid JWT Tokens for Full Access</strong></p><p><strong>Step 1:</strong> Intercepting User Dashboard Request My journey began by intercepting the user dashboard request, a critical step in understanding and manipulating the JWT authentication mechanism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5VjSRKbuuisuDEsosG_F5w.png" /></figure><p><strong>Step 2:</strong> Leveraging Burp JWT Editor To forge a valid JWT token, I turned to the Burp JWT Editor. Here’s what I did:</p><ul><li>Within the Request, I navigated to the JSON Web Token section.</li><li>I changed the algorithm (alg) from RS256 to “none,” effectively disabling the signature.</li><li>With the signature removed, I sent the request, eagerly awaiting the result.</li><li>The request came back successful, granting me access to my user details without a valid signature.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ictSWYAf225qq9gk4C0lJA.png" /></figure><p><strong>Step 3:</strong> Accessing Another User’s Information</p><p>I changed my email to that of another user and sent the request once more. the response revealed another user’s details, effectively proving that I had successfully forged a valid JWT token, circumventing the intended authentication mechanism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_o3UYgDHk6eduG_cAQXPAw.png" /><figcaption>Challenge 15 Complete</figcaption></figure><p>— — — — — — — — — — — — — — — Challenge 15 Complete — — — — — — — — — — —</p><p><strong>Conclusion</strong><br>OWASP crAPI offers a unique opportunity to gain hands-on experience with the most critical API security risks. By exploring these vulnerabilities and challenges, you’ll develop a deeper understanding of API security best practices and how to protect your APIs from potential threats.</p><p><em>Thank you for taking the time to explore this blog with us. We hope it provided valuable insights and knowledge. Your support and engagement mean the world to us.</em></p><p>Stay curious, stay secure, and keep learning! Until next time, take care and happy exploring. 🚀✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baec54214f85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring APIs: An Introduction and Overview of Different Types]]></title>
            <link>https://medium.com/@riteshs4hu/exploring-apis-an-introduction-and-overview-of-different-types-11c81379491a?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/11c81379491a</guid>
            <category><![CDATA[soap-api]]></category>
            <category><![CDATA[http-request-method]]></category>
            <category><![CDATA[graphql-api]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Fri, 25 Aug 2023 16:28:14 GMT</pubDate>
            <atom:updated>2023-08-25T16:28:14.179Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction to API…</h4><p><strong>Hello folks! 🌟</strong></p><p>Welcome to my blog where we’ll journey through the intricate realm of Application Programming Interfaces(API).</p><p><strong><em>🚀 Let’s Get Started….!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkTx2dAuuh3ndlDwKxcisw.jpeg" /><figcaption>API</figcaption></figure><h4>Introduction to APIs:</h4><p><strong>API</strong> stands for <em>Application Programming Interface</em>. It is a set of rules and protocols that govern how different software components should interact with each other. APIs provide a standardized way for developers to access the functionalities and data of another software application or service. They define the methods, data structures, and protocols that should be used for communication.</p><h4><strong>How Do APIs Work?</strong>🤔🤔</h4><p>To understand how APIs work, consider a scenario where you use a weather app on your smartphone. When you open the app and request the weather forecast for your location, the app doesn’t generate this information itself. Instead, it sends a request to a weather service’s API, which then processes the request, retrieves the data, and sends it back to your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dH2Txy9KkuLD7_WcsZrnFg.png" /><figcaption>How API Works: Clent And Server</figcaption></figure><blockquote><strong>The basic working of an API involves communication between a client and a server.</strong></blockquote><p><strong>1. Client Sends Request:</strong></p><ul><li>The client, which could be a web browser, mobile app, or any other software, initiates communication by sending a request to the server.</li><li>The request specifies what action the client wants to perform. This could be retrieving data, sending data, updating information, or deleting data.</li></ul><p><strong>2. Endpoint and URL:</strong></p><ul><li>The client sends the request to a specific URL known as an endpoint. An endpoint corresponds to a particular operation provided by the API.</li><li>The endpoint is usually a part of the URL, like <a href="https://api.example.com/endpoint.">https://api.example.com/endpoint.</a></li></ul><p><strong>3. HTTP Methods:</strong></p><ul><li>The client uses standard HTTP methods to define the type of action it wants to perform.</li><li>Standard techniques include: (GET, POST, PUT, DELETE)</li></ul><p><strong>4. Parameters:</strong></p><ul><li>The client can include parameters in the URL (query parameters) or the request body (for POST and PUT requests).</li><li>These parameters provide additional information required by the server to fulfil the request.</li></ul><p><strong>5. Headers:</strong></p><ul><li>The client can include headers in the request to provide additional information, such as authentication tokens, content types, or any other metadata.</li></ul><p><strong>6. Server Processing and Validation:</strong></p><ul><li>The server receives the request and processes it based on the provided endpoint, method, parameters, and payload.</li><li>The server may validate the request, check for authorization, interact with databases, perform calculations, or execute other tasks.</li></ul><p><strong>7. Response:</strong></p><ul><li>Once the server has processed the request, it sends back a response to the client.</li><li>The response includes a status code indicating the result of the request (e.g., 200 for success, 404 for not found).</li><li>It also contains the requested data or information, if applicable.</li></ul><p><strong>8. Data Format:</strong></p><ul><li>API responses are often formatted using standardized data interchange formats like JSON or XML.</li><li>JSON (JavaScript Object Notation) is a common choice due to its simplicity and compatibility with various programming languages.</li></ul><p><strong>9. Error Handling:</strong></p><ul><li>If the server encounters an issue processing the request, it sends back an error response.</li><li>The error response includes an appropriate error code and a message explaining the issue.</li><li>This helps developers identify and resolve problems in their requests.</li></ul><p><strong>10. Display or Usage:</strong></p><ul><li>The client application receives the response from the server and can process and display the data to the user in a user-friendly format</li></ul><h4>Why Do We Need APIs?</h4><ol><li><strong>Integration:</strong> APIs enable different software systems to work together. They allow businesses to integrate various services and create comprehensive solutions.</li><li><strong>Efficiency:</strong> APIs save time and resources. Instead of building everything from scratch, developers can use APIs to access pre-built functionality, such as payment processing or location services.</li><li><strong>Security and Control:</strong> APIs can provide controlled access to functionalities and data, allowing developers to define access rights and permissions. This enhances security by preventing unauthorized access to sensitive information.</li><li><strong>Data Access and Sharing:</strong> APIs enable controlled access to data stored within an application or service. This is especially important when integrating with external services or allowing partners to interact with your data in a controlled manner.</li></ol><h4>The common HTTP request methods</h4><p><strong>1. GET:</strong></p><blockquote><strong><em>Purpose:</em></strong><em> Retrieve data from the server.</em></blockquote><blockquote><strong><em>Description:</em></strong><em> The GET request method is used when you want to retrieve information from the server without making any changes to the server’s state. It’s commonly used for reading data from resources like fetching articles, images, or user profiles. It’s idempotent, meaning that making the same request multiple times won’t result in different outcomes, and it’s considered safe as it shouldn’t modify any data on the server.</em></blockquote><p><strong>2. POST:</strong></p><blockquote><strong><em>Purpose:</em></strong><em> Send data to the server to create a new resource or perform an action.</em></blockquote><blockquote><strong><em>Description: </em></strong><em>The POST request method is used when you want to submit data to the server to create a new resource or trigger a specific action. It’s commonly used when submitting forms, adding comments, or performing transactions. Unlike GET, it’s not idempotent, which means making the same request multiple times might lead to different results. It’s also not considered safe as it can potentially modify the server’s state.</em></blockquote><p><strong>3. PUT:</strong></p><blockquote><strong><em>Purpose: </em></strong><em>Update or replace an existing resource or create one if it doesn’t exist.</em></blockquote><blockquote><strong><em>Description:</em></strong><em> The PUT request method is used to update an existing resource’s data or replace it entirely. If the resource doesn’t exist, it can also be used to create a new resource. PUT is idempotent, so making the same request multiple times will have the same effect as making it once. It’s typically used for updating user profiles, uploading files, or editing content.</em></blockquote><p><strong>4. PATCH:</strong></p><blockquote><strong><em>Purpose: </em></strong><em>Apply partial modifications to a resource.</em></blockquote><blockquote><strong><em>Description:</em></strong><em> The PATCH request method is similar to PUT, but it’s used to apply partial modifications to a resource instead of replacing the entire resource. It’s useful when you only want to update specific fields of a resource without affecting the rest. Like PUT, PATCH is also idempotent.</em></blockquote><p><strong>5. DELETE:</strong></p><blockquote><strong><em>Purpose:</em></strong><em> Remove a resource from the server.</em></blockquote><blockquote><strong><em>Description: </em></strong><em>The DELETE request method is used to request the removal of a resource from the server. It’s employed when you want to delete user accounts, posts, or any other data. Similar to GET and PUT, DELETE is idempotent, so multiple identical requests will yield the same result as a single request.</em></blockquote><p><strong>6. HEAD:</strong></p><blockquote><strong><em>Purpose: </em></strong><em>Retrieve headers of a resource without the actual data.</em></blockquote><blockquote><strong><em>Description:</em></strong><em> The HEAD request method is akin to GET, but it only retrieves the headers of the response, not the full content. It’s used to check resource status, and metadata, or to determine if a resource has been modified since a certain date.</em></blockquote><p><strong>7. OPTIONS:</strong></p><blockquote><strong><em>Purpose:</em></strong><em> Retrieve information about the communication options for the target resource.</em></blockquote><blockquote><strong><em>Description: </em></strong><em>The OPTIONS request method is used to retrieve information about the communication options available for a particular resource. It helps clients understand what methods, headers, and other capabilities are supported by the server.</em></blockquote><p><strong>8. CONNECT:</strong></p><blockquote><strong><em>Purpose:</em></strong> Used for establishing a network connection to a resource, typically for use with proxy servers.</blockquote><blockquote><strong><em>Description:</em></strong> The CONNECT request method is used to establish a network connection to a resource, usually through a proxy server. It’s often used in scenarios involving secure connections.</blockquote><p><strong>9. TRACE:</strong></p><blockquote><strong><em>Purpose: </em></strong><em>Echoes back the received request for diagnostic purposes.</em></blockquote><blockquote><strong><em>Description:</em></strong><em> The TRACE request method is used for diagnostic purposes, where the server echoes back the received request. It’s rarely used in practice due to potential security risks, as it can expose sensitive information.</em></blockquote><h4>Types of APIs?</h4><p><em>Now, let’s explore three major types of APIs:</em></p><p><strong>1. REST APIs (Representational State Transfer):</strong><br>REST is an architectural style that provides a set of guidelines for designing networked applications. It leverages the HTTP protocol’s methods, such as GET, POST, PUT, and DELETE, to perform operations on resources. REST APIs are designed to be stateless, meaning each request from a client to the server must contain all the necessary information for the server to understand and process it. They use URLs (Uniform Resource Locators) to identify resources, and responses are usually in formats like JSON or XML.</p><p><strong>2. SOAP APIs (Simple Object Access Protocol):</strong><br>SOAP is a protocol that defines a standardized format for exchanging structured information between software components over various protocols, including HTTP, SMTP, and more. It relies on XML for message formatting and can be quite rigid in terms of its structure. SOAP APIs provide built-in security and error-handling mechanisms, making them suitable for applications where reliability is crucial.</p><p>SOAP APIs are commonly used in scenarios where data integrity, security, and complex data structures are important. They are often used in enterprise-level applications, web services, and other situations where a standardized and reliable communication protocol is needed. However, it’s worth noting that while SOAP provides robust features, it can be more complex and heavy compared to other API styles like REST.</p><p><strong>3. GraphQL APIs.</strong></p><p>GraphQL API is a powerful approach to building application interfaces that enable clients to request exactly the data they need, eliminating over-fetching and under-fetching. It utilizes a flexible query language where clients define their data requirements, allowing multiple data sources to be aggregated in one request.GraphQL has become a powerful alternative to traditional REST APIs, enhancing efficiency and customization in data retrieval and communication.</p><p><strong><em>Thank you for taking the time to read this blog post. I hope you found it informative and engaging.</em></strong></p><h4>📚📚Happy exploring and learning…!!!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11c81379491a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Extensive Overview of Web Applications for Beginners]]></title>
            <link>https://medium.com/@riteshs4hu/an-extensive-overview-of-web-applications-for-beginners-1d260dbc3675?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d260dbc3675</guid>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[sessions]]></category>
            <category><![CDATA[web-applications]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[http-response]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Fri, 26 May 2023 04:53:59 GMT</pubDate>
            <atom:updated>2023-05-26T04:53:59.904Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Structure, Functionality, and Communication</h4><p>Hello, everyone…!!!</p><p>This blog post will provide you with a comprehensive introduction to web applications, specifically tailored for beginners. Throughout this journey, we will delve into various topics related to web applications, starting with the fundamental communication between clients and servers. We will explore intricate details such as <strong>HTTP request</strong> and <strong>response headers,</strong> <strong>HTTP request</strong> and <strong>response body</strong>, commonly used<strong> HTTP request methods,</strong> essential<em> HTTP status codes,</em> the significance of <em>HTTP security headers,</em> and the fundamental concepts of <strong><em>cookies </em></strong><em>and</em><strong><em> sessions</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0gjLpN1aaHuRowTKgr6yQ.jpeg" /></figure><p><strong>Introduction web application.</strong></p><p>A web application, also known as a web app, is a software application that runs on a web server and is accessed by users through a web browser. It is designed to provide specific functionality or services to users, similar to traditional desktop applications, but with the advantage of being accessible through a web browser on various devices.</p><p><em>The basic working principle of a web application involves client-server architecture and the use of standard web technologies.</em></p><blockquote>The basic components of a web application typically include:</blockquote><blockquote><strong><em>1. Front-end: </em></strong><em>This is the part of the web application that the </em>user interacts<em> with, </em><strong><em>such as the user interface (UI) and user experience (UX) design. </em></strong><em>It usually consists of </em><strong>HTML, CSS,</strong><em> and </em><strong>JavaScript,</strong><em> which are used to create the visual elements and enable user interaction.</em></blockquote><blockquote><strong><em>2. Back-end: </em></strong><em>This is the part of the web application that </em>runs on the server<em> and is </em><strong><em>responsible for processing data and generating responses to client requests.</em></strong><em> It includes server-side scripting languages such as </em><strong>PHP, Python,</strong><em> or </em><strong>Ruby,</strong><em> and databases such as </em><strong>MySQL</strong><em> or </em><strong>PostgreSQL.</strong></blockquote><blockquote><strong><em>3. Web server:</em></strong><em> The web server is responsible for </em>receiving and responding to HTTP requests from clients.<em> Popular web servers include</em><strong> Apache, Nginx,</strong><em> and </em><strong>IIS.</strong></blockquote><blockquote><strong><em>4. APIs:</em></strong><em> Application Programming Interfaces (APIs) allow different software components to communicate with each other. Web applications may use APIs to integrate with other services or to enable third-party developers to build applications that interact with their data.</em></blockquote><blockquote><strong><em>5. Security:</em></strong><em> Security is a critical component of any web application, as it </em>helps protect user data and prevent unauthorized access. <em>This includes measures such as </em><strong>SSL/TLS encryption, secure authentication,</strong><em> and </em><strong>access control.</strong></blockquote><blockquote>How web application work…</blockquote><ol><li>The user enters the URL for the web application or clicks a link to access it in a web browser.</li><li>The web browser sends a request to the web server. The request contains information such as the HTTP method (e.g., GET, POST), the requested URL, and any additional data.</li><li>The web server receives the request and determines the appropriate handler or controller based on the requested URL. This routing process is often managed by a web framework or server-side scripting language.</li><li>Once the web server identifies the appropriate handler, it processes the request. This may involve fetching data from a database, performing computations, or executing various tasks based on the nature of the request.</li><li>The web application’s business logic handles the processing of the request. It includes tasks such as handling user input, performing calculations, and interacting with databases or external systems.</li><li>If the web application needs to retrieve or store data, it interacts with a database. User information, application data, and other relevant data are stored and managed in the database. A database management system (DBMS) like MySQL, PostgreSQL, or MongoDB may be used for data operations.</li><li>Once the server has processed the request and obtained the necessary data, it generates a response. The response typically includes HTML, CSS, JavaScript, and other resources required to render the web page.</li><li>The web server sends the response back to the user’s web browser.</li><li>The user’s web browser receives the response and renders the web page based on the received HTML, CSS, and JavaScript.</li><li>The user can now interact with the web application by clicking buttons, filling out forms, or performing other actions.</li><li>User interactions trigger additional requests to the server, initiating a new cycle of processing. These requests follow the same client-server architecture and request-response cycle.</li><li>Web applications often need to maintain user-specific data or state across multiple requests. Techniques like cookies, sessions, or local storage are used to manage and maintain this state.</li><li>Web applications can utilize technologies like AJAX or WebSocket to provide real-time updates or enable bidirectional communication between the client and server. AJAX allows for dynamic content updates without requiring a full page reload, while WebSocket facilitates continuous communication for real-time notifications or live data streaming.</li></ol><blockquote>Basic communication for client and server.</blockquote><ol><li>The client, which could be a web browser or a mobile application, <em>sends a request to the server</em>. This request is typically sent using the <strong>HTTP (Hypertext Transfer Protocol) protocol</strong>.</li><li>The request contains information such as the <strong>URL of the requested resource, any parameters needed for the request,</strong> and other metadata such as <strong><em>cookies or authentication tokens</em></strong>.</li><li>The <em>server receives the request</em> <em>and processes it</em>. This could involve <strong><em>retrieving data from a database, executing some business logic,</em></strong> <strong><em>or generating a response dynamically based on the request.</em></strong></li><li>The server then <em>generates a response to the request.</em> This response contains the requested data or confirmation that the requested action was completed, along with additional metadata such as <strong>status codes, headers, </strong>and <strong>cookies.</strong></li><li>The server sends the response back to the client, again <strong><em>using the HTTP protocol.</em></strong></li><li>The client receives the response and processes it. This could involve rendering the data on a web page or performing some other action based on the response.</li><li>If necessary, the client may send additional requests to the server to retrieve more data or perform further actions, starting the process over again.</li></ol><h4>There are two ways for a server to get input from a user in a web application.</h4><p><strong>1. Header/URL Parameters:</strong> In this method, input is passed to the server through the URL of the requested web page. This is typically done by appending parameters to the end of the URL, separated by question marks and ampersands. <strong><em>For example,</em></strong><em> a URL with parameters might look like this:</em> http://example.com/page?param1=value1&amp;param2=value2. The server can then extract these parameters from the URL and use them to generate the appropriate response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*oAWs5d4aGbh8uTrCLA1vlQ.png" /><figcaption>Understanding URLs</figcaption></figure><p><strong>2. Body: </strong>The HTTP body, also known as the message body, is part of an HTTP request or response that carries the actual data being sent or received. It is located after the headers in an HTTP message and is separated from the headers by a blank line.</p><blockquote>HTTP Request and Response Header…</blockquote><p><strong>1. HTTP Request Headers:</strong> HTTP request headers are <em>sent by the client</em> <em>(typically a web browser or an application) </em><strong>to the server to provide additional information about the request.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*tiIwSe9kZpjm6rUQxFwUKw.png" /><figcaption>HTTP Request Header</figcaption></figure><p><em>Some commonly used request headers include:</em></p><blockquote><strong><em>Host: </em></strong>Specifies the hostname of the server the client wants to communicate with.</blockquote><blockquote><strong><em>User-Agent:</em></strong><em> </em>Identifies the client application or browser making the request.</blockquote><blockquote><strong><em>Accept: </em></strong>Indicates the media types or content formats that the client can handle or prefers in the response.</blockquote><blockquote><strong><em>Content-Type: </em></strong>Specifies the media type of the content in the request body (if any).</blockquote><blockquote><strong><em>Authorization:</em></strong><em> </em>Provides credentials or authentication tokens for accessing protected resources.</blockquote><blockquote><strong><em>Cookie: </em></strong>Contains cookies previously stored by the client for the server to identify the user or maintain session state.</blockquote><p><strong>2. HTTP Response Headers:</strong> HTTP response headers are <strong><em>sent by the server back to the client as part of the HTTP response</em></strong>. They provide information about the response and additional instructions to the client.</p><p><em>Some commonly used response headers include:</em></p><blockquote><strong><em>Content-Type: </em></strong>Specifies the media type or format of the content in the response body.</blockquote><blockquote><strong><em>Content-Length: </em></strong>Indicates the size of the response body in bytes.</blockquote><blockquote><strong><em>Cache-Control: </em></strong>Provides instructions for caching the response at the client or intermediary servers.</blockquote><blockquote><strong><em>Set-Cookie: </em></strong>Sets cookies on the client to be stored for subsequent requests.</blockquote><blockquote><strong><em>Location: </em></strong>Redirects the client to a new URL if the response is a redirection.</blockquote><blockquote><strong><em>Server: </em></strong>Specifies the software or server name that generated the response.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*9jUxdlDwAlhtcSIoqC0c5Q.png" /><figcaption>HTTP Response Headers.</figcaption></figure><blockquote>HTTP Request and Response Body…</blockquote><ol><li><strong>HTTP Request Body: </strong>The HTTP request body is part of an HTTP request where you can <strong><em>include additional data or information to be sent to the server.</em></strong> It is used in <strong>HTTP methods</strong> such as <strong>POST, PUT,</strong> and <strong>PATCH</strong> to send data to the server for processing or storage. The request body is typically used to send data in structured formats such as <em>JSON (JavaScript Object Notation) or XML (eXtensible Markup Language).</em></li><li><strong>HTTP Response Header:</strong> The HTTP response body is the part of an HTTP response <strong><em>that contains the data or information sent by the server back to the client in response to an HTTP request.</em></strong> It is used to convey the requested resource, such as HTML content, JSON data, images, or any other type of data.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*gL3rDLeWO_ctEBmPLYWcrw.png" /><figcaption>HTTP Request Message Example</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*tTTTzcWoeF4SyzMQBBJCuQ.png" /><figcaption>HTTP Response Message Example</figcaption></figure><blockquote>HTTP Request Methods…</blockquote><blockquote><strong><em>1. GET: </em></strong>The GET method requests a representation of the specified resource. It retrieves data from the server without causing any modifications. GET is used for retrieving web pages, images, documents, or any other data from a server. It is safe, meaning it should not have any side effects on the server or the resource being retrieved.</blockquote><blockquote><strong><em>2. POST:</em></strong><em> </em>The POST method is used to submit data to the specified resource, often causing a change in state or side effects on the server. It sends data in the request body and typically creates a new resource on the server. POST requests are commonly used when submitting forms, creating new records, or uploading files.</blockquote><blockquote><strong><em>3. HEAD:</em></strong><em> </em>The HEAD method is similar to GET, but it requests only the headers of the response, without the response body. It is often used to retrieve metadata about a resource, such as content type, last-modified timestamp, or content length, without transferring the entire content. HEAD requests are useful when you need to check the status or headers of a resource before downloading the full response.</blockquote><blockquote><strong><em>4. PUT:</em></strong><em> </em>The PUT method replaces all current representations of the target resource with the request payload sent in the request body. It is used to update or create a resource with a specific URI. The entire representation of the resource should be included in the request, even if only a small change is intended. PUT requests are idempotent, meaning that making the same request multiple times should have the same effect as a single request.</blockquote><blockquote><strong><em>5. CONNECT:</em></strong><em> </em>The CONNECT method is primarily used to establish a network connection between the client and a server identified by the target resource. It is typically used in HTTP tunneling scenarios, such as establishing an HTTPS connection through a proxy server.</blockquote><blockquote><strong><em>6. OPTIONS:</em></strong><em> </em>The OPTIONS method is used to request information about the communication options available for a particular resource or server. It allows the client to inquire about the allowed methods, headers, and other capabilities supported by the server.</blockquote><blockquote><strong><em>7. DELETE:</em></strong><em> </em>The DELETE method is used to delete the specified resource. It requests the server to remove the resource identified by the given URI. DELETE requests are used to delete records, files, or any other server-side resources. Like PUT, DELETE requests are also idempotent.</blockquote><blockquote>HTTP Status code…</blockquote><p><strong>HTTP status codes </strong>are <em>three-digit numbers returned by a server in response</em> to an HTTP request. They provide <strong><em>information about the status of the request and the corresponding response.</em></strong> These status codes are grouped into different categories, each indicating a particular type of response. Here are some commonly encountered HTTP status code categories and their meanings:</p><p><strong>Informational (100 - 199):</strong></p><ul><li><strong><em>100 Continue: </em></strong><em>The server acknowledges the initial part of the request and asks the client to proceed with the rest of the request.</em></li></ul><p><strong>Success (200 – 299):</strong></p><ul><li><strong><em>200 OK: </em></strong><em>The request has succeeded, and the server sends the requested content as the response.</em></li><li><strong><em>201 Created:</em></strong><em> The request has been fulfilled, resulting in the creation of a new resource.</em></li><li><strong><em>204 No Content:</em></strong><em> The server successfully processed the request but does not return any content in the response body.</em></li></ul><p><strong>Redirection (300 – 399):</strong></p><ul><li><strong><em>301 Moved Permanently: </em></strong><em>The requested resource has been permanently moved to a new location. Clients should update their bookmarks or links.</em></li><li><strong><em>302 Found:</em></strong><em> The requested resource has been temporarily moved to a different location. Clients should continue to use the original URL for future requests.</em></li><li><strong><em>304 Not Modified:</em></strong><em> The client’s cached version of the requested resource is still valid, and the server has not modified it.</em></li></ul><p><strong>Client Errors (400 – 499):</strong></p><ul><li><strong><em>400 Bad Request: </em></strong><em>The server cannot process the request due to invalid syntax, malformed request, or other client-side errors.</em></li><li><strong><em>401 Unauthorized:</em></strong><em> The request requires authentication. The client must provide valid credentials to access the requested resource.</em></li><li><strong><em>404 Not Found: </em></strong><em>The server cannot find the requested resource or URL.</em></li></ul><p><strong>Server Errors (500 – 599):</strong></p><ul><li><strong><em>500 Internal Server Error:</em></strong><em> An unexpected error occurred on the server while processing the request.</em></li><li><strong><em>503 Service Unavailable: </em></strong><em>The server is temporarily unable to handle the request due to maintenance or overload. It asks the client to try again later.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sq1OwGp_FBwuxc9x36kyw.png" /><figcaption>Common HTTP Status Codes</figcaption></figure><blockquote>HTTP Security Headers…</blockquote><p>Security headers are HTTP response headers that provide instructions to a web browser on how to handle and protect the website’s content. These headers enhance the security of web applications by mitigating common security vulnerabilities and protecting against various types of attacks.</p><p>Here are some commonly used security headers:</p><p>1. <strong>Strict-Transport-Security (HSTS):</strong> The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) informs browsers that the site should only be accessed using HTTPS and that any future attempts to access it using HTTP should automatically be converted to HTTPS.</p><p>3. <strong>Content-Security-Policy (CSP):</strong> CSP defines a policy that specifies which content the browser should trust and load on a web page. It helps prevent cross-site scripting (XSS) and data injection attacks by allowing the website owner to whitelist trusted sources for scripts, stylesheets, and other resources.</p><p>3. <strong>X-Frame-Options:</strong> This header mitigates clickjacking attacks by specifying whether a web page can be embedded within an iframe on another domain. It helps prevent unauthorized framing of a website and protects against UI redressing attacks.</p><p>4. <strong>X-XSS-Protection:</strong> This header enables or configures the built-in cross-site scripting (XSS) protection mechanism in modern browsers. It helps detect and prevent XSS attacks by sanitizing user input and blocking malicious scripts from executing.</p><p>5. <strong>X-Content-Type-Options:</strong> This header prevents MIME-type sniffing, which is the browser’s tendency to override the declared content type of a resource. It helps protect against certain types of attacks, such as content spoofing and drive-by downloads.</p><p>6. <strong>Referrer-Policy:</strong> This header controls the information sent in the HTTP Referer header when a user navigates from one website to another. It helps protect user privacy by limiting the amount of referrer information shared with external websites.</p><blockquote>What is Cookies…</blockquote><p>A cookie is a small piece of data that is sent from a website to a user’s web browser (client) and stored on their device. When the user visits the website again in the future, the browser sends the cookie back to the website, allowing the website to recognize and remember the user.</p><ol><li>When a user visits a website, the website includes a “Set-Cookie” header in its response to the user’s browser.</li><li>The cookie typically contains key-value pairs that hold specific data. For example, it might include information like a user ID, preferences, or a unique identifier.</li><li>The browser receives the cookie and stores it on the user’s device. The cookie is associated with the specific website domain that sent it.</li><li>For subsequent requests to the same website, the browser automatically includes the cookie in the request headers.</li><li>The website can access the cookie data when the user interacts with it, allowing it to retrieve and utilize the stored information.</li><li>The website can also modify or update the cookie by sending a new cookie with updated values or by instructing the browser to delete or overwrite the existing cookie.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*vTccq0ZNrN4Zji9Jpe4VPA.png" /></figure><p><em>Several types of cookie attributes can be used to specify various properties and behaviors of cookies. Here are the commonly used cookie attributes:</em></p><ul><li><strong>Name and Value: </strong>Think of cookies as small pieces of information with a name (like a label) and a corresponding value (like the information itself). For example, a cookie named “username” could have the value “JohnDoe” to remember the username of a user.</li><li><strong>Domain: </strong>The domain attribute tells the browser which websites can access the cookie. It’s like specifying a group of websites that are allowed to see and use the cookie. For example, if a cookie has the domain attribute set to “.example.com”, it can be accessed by all subdomains of “example.com”, such as “blog.example.com” or “shop.example.com”.</li><li><strong>Path: </strong>The path attribute determines the specific pages or directories on a website where the cookie is valid. It’s like giving the cookie a specific address to work within. For instance, if a cookie has a path attribute set to “/products”, it will only be sent to requests made to URLs that start with “/products”, such as “example.com/products” or “example.com/products/shoes”.</li><li><strong>Expiration: </strong>Cookies can have an expiration attribute that sets an expiration date for the cookie. It’s like setting a time limit for how long the cookie should be stored and used. Once the expiration date is reached, the cookie will be automatically deleted by the browser.</li><li><strong>Secure: </strong>The secure attribute ensures that the cookie is only transmitted over secure connections, typically HTTPS. It’s like ensuring that the cookie is only sent over encrypted channels to protect sensitive information. If a cookie has the secure attribute and the website is accessed over a regular HTTP connection, the cookie won’t be sent.</li><li><strong>HttpOnly:</strong> The HttpOnly attribute is a security measure that prevents client-side scripts (like JavaScript) from accessing the cookie. It’s like putting a lock on the cookie to keep it safe from certain types of attacks. Cookies with the HttpOnly attribute can only be accessed by the server.</li></ul><blockquote>What is Sessions…</blockquote><p>A session is a mechanism that allows for stateful communication between a client (such as a web browser) and a server. It enables the server to maintain information about a user’s interactions across multiple requests, facilitating personalized and interactive communication.</p><p>Here’s an explanation of how sessions work for client-server session-based communication:</p><p><strong>1. Session Initialization:</strong></p><ul><li>When a client initiates a connection with a server (e.g., by accessing a website), the server creates a new session for that client.</li><li>The server generates a unique session identifier, often referred to as a session ID or token, associated with that session.</li><li>The session ID is typically sent to the client through a response, such as setting it as a cookie or including it in the response body or URL.</li></ul><p><strong>2. Client Request:</strong></p><ul><li>When the client sends subsequent requests to the server (e.g., navigating to different pages or interacting with forms), it includes the session ID as part of the request.</li><li>The session ID can be transmitted through various means, such as cookies, URL parameters, or custom headers. Cookies are the most common method, where the session ID is automatically included by the client’s browser with each request to the same domain.</li></ul><p><strong>3. Server Session Management:</strong></p><ul><li>On the server side, the session ID received with each request is used to identify the corresponding session.</li><li>The server retrieves the session data associated with the session ID. This data may include user-specific information, session variables, or any other relevant data that needs to be maintained throughout the session.</li><li>The server can update the session data based on the client’s request, performing operations like storing form input, updating user preferences, or tracking user progress.</li></ul><p><strong>4. Server Response:</strong></p><ul><li>After processing the client’s request and updating the session data, the server generates a response.</li><li>The response may contain updated session data or other relevant information.</li><li>The session ID is typically included in the response to ensure that the client can maintain the session during subsequent interactions.</li></ul><p><strong>5. Session Termination:</strong></p><ul><li>Sessions can be terminated in various ways, such as when the user explicitly logs out, the session times out due to inactivity, or the server-side session is invalidated.</li><li>Upon termination, the server removes the associated session data, and the client’s subsequent requests will require a new session to be established.</li></ul><p><em>The session mechanism allows for maintaining user-specific data and session state on the server, which enables personalized experiences, persistent logins, and continuity in the user’s interactions with the web application.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*wMA2aHx4EzHwSt_zdqyVNA.png" /></figure><p><strong><em>Thank you for taking the time to read this blog post. I hope you found it informative and engaging.</em></strong></p><h4><strong>Happy exploring and learning…!!!</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d260dbc3675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Guide To Nmap Scanning For Beginners.]]></title>
            <link>https://medium.com/@riteshs4hu/a-step-by-step-guide-to-nmap-scanning-for-beginners-45d00dd759f9?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/45d00dd759f9</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[nmap-scan]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[network]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Sun, 09 Apr 2023 11:44:08 GMT</pubDate>
            <atom:updated>2023-04-09T11:45:32.520Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Nmap…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4dUEgSn_17sxgy5wTNayw.jpeg" /><figcaption>NMAP</figcaption></figure><p><strong>Introduction</strong></p><p>Nmap, also known as <strong>Network Mapper,</strong> is<em> a free and open-source tool</em> that helps with network exploration, management, and security auditing. It is a versatile network scanner that can identify hosts and services on a computer network, and it can also be used to identify security vulnerabilities on a network. <strong>In this article, </strong>we will discuss the different steps involved in <strong>Nmap scanning, target specification, host discovery, port specification and scan order, service version detection, script scan, OS detection and output. </strong><em>We will also provide command examples for each step.</em></p><h4><strong>Some common options used with Nmap:-</strong></h4><ol><li><strong>-v (verbose) / </strong><strong>-vv (double verbose): </strong>Provides more detailed output during the scan, such as the target being scanned, the status of each port, and any errors that occur.</li><li><strong>-p (port specification): </strong>This option allows you to specify which ports to scan, using a comma-separated list or a range of ports.</li><li><strong>-sS (TCP SYN scan): </strong>This is the default scan type in Nmap, and it sends SYN packets to the target&#39;s ports to determine if they are open or not.</li><li><strong>-sT (TCP connect scan):</strong> This scan type uses a full TCP connection to determine if the target&#39;s ports are open or not.</li><li><strong>-sU (UDP scan):</strong> This scan type sends UDP packets to the target&#39;s ports to determine if they are open or not.</li><li><strong>-A (OS detection and version detection):</strong> This option enables version detection, OS detection, script scanning, and traceroute all in one command.</li><li><strong>-O (OS detection):</strong> This option enables operating system detection of the target.</li><li><strong>--script (script scanning): </strong>This option allows you to run scripts against the target, such as vulnerability scanners or brute force attacks.</li><li><strong>-iL (input file):</strong> This option allows you to specify a file containing a list of targets to scan.</li><li><strong>-oA (output file):</strong> This option allows you to specify an output file for the scan results, which can be in several formats, including XML, grepable, and normal.</li></ol><h3><strong>Target Specification…</strong></h3><p>Target specification is a crucial step in using Nmap. It specifies the target hosts, networks, or IP addresses that you want to scan. This can be done in a variety of ways, including specifying individual IP addresses, CIDR notation for IP address ranges, or hostnames. Nmap also supports various target list formats, such as a file containing a list of hosts, or input from standard input.</p><p><strong><em>Here are some common options for target specification:</em></strong></p><p><strong>1. Hostnames or IP Addresses.</strong><br><em>One of the simplest ways to specify the target is by providing the hostname or IP address of the host. </em><strong><em>For example:-</em></strong></p><p>nmap -v scanme.nmap.org</p><p>nmap -v 192.168.1.1</p><p><strong>2. CIDR Notation.</strong><br>CIDR (Classless Inter-Domain Routing) notation allows specifying a range of IP addresses using a prefix length.<strong> <em>For example:-</em></strong></p><p>nmap -v -p 80,443 example.com/24</p><p>nmap -v 192.168.1.1/24</p><p>nmap 192.168.1.1/24</p><p><strong>3. IP Range.</strong><br>We can also specify a range of IP addresses using hyphen notation. For example, to scan all IP addresses between 192.168.0.1 to 192.168.0.254, we can use the following command:</p><p>nmap 192.168.0.1–254</p><p>nmap 10.0.0–255.1–254</p><p><strong>4. Input from List of Hosts/Networks.</strong><br>The <strong>“-iL”</strong> option allows the user to read a list of hosts and networks from a file.<em> For example, let’s say we have a file named “targets.txt,” which contains a list of hosts and networks. We can use the following command to scan those targets:</em></p><p>nmap -v -iL targets.txt</p><p>nmap -iL targets.txt</p><p><strong>5. Choose Random Targets.</strong><br>The <strong>“-iR” </strong>option allows the user to choose random targets. <em>For example:</em></p><p>nmap -iR 3</p><p>nmap -v -p 80,443,22,21,445 -iR 3</p><p><strong>6. Exclude Hosts/Networks.</strong><br>The <strong>“ — exclude”</strong> option allows the user to exclude specific hosts and networks from the scan. For example, to exclude hosts “192.168.0.1” and “192.168.0.2” from the scan, we can use the following command:</p><p>nmap 192.168.0.0/24 --exclude 192.168.0.1,192.168.0.2</p><p><strong>7. Exclude List from File.</strong><br>The <strong>“ — excludefile”</strong> option allows the user to exclude a list of hosts and networks from a file. For example, let’s say we have a file named “exclude.txt,” which contains a list of hosts and networks to exclude. We can use the following command to exclude those targets from the scan:</p><p>nmap 192.168.0.0/24 --excludefile exclude.txt</p><h3>Host Discovery…</h3><p><strong>Host discovery</strong> is essential in conducting a network scan, whether for internal or external penetration testing. This process involves identifying which hosts are active and running on a network, as well as determining their IP addresses and other critical information. Several methods and Nmap commands can be used for host discovery, depending on the type of test being conducted.</p><p><strong><em>For internal penetration testing, the following Nmap TECHNIQUES can be used for host discovery:</em></strong></p><ul><li>ARP Scan</li><li>ICMP Scan</li><li>TCP (SYN/ACK) Scan</li><li>UDP Scan</li></ul><p><em>An ARP scan sends ARP packets to determine which hosts are active on the network. An ICMP scan sends ICMP packets to determine which hosts are up and running, while a TCP SYN/ACK scan sends TCP SYN/ACK packets to identify hosts that are listening on specific ports. A UDP scan sends UDP packets to determine which hosts are accepting UDP traffic.</em></p><p><strong><em>For external penetration testing, the following Nmap TECHNIQUES can be used for host discovery:</em></strong></p><ul><li>ICMP Scan</li><li>TCP (SYN/ACK) Scan</li><li>UDP Scan</li></ul><p><strong>In addition to these commands, other Nmap options can be used for host discovery, including:</strong></p><p><strong>1. List Scan (-sL)</strong></p><p>The list scan is a method for listing all hosts on a network without actually scanning them. This method can be useful for generating a list of targets for further scanning. <em>To perform a list scan, use the following command:</em></p><p>nmap -sL 192.168.0.0/24</p><p><strong>2. Ping Scan (-sn)</strong></p><p>This option is used to disable port scanning and perform a ping scan. If the scan is run on a LAN, it uses the ARP protocol. If it is run in an external pentest, it uses the default ICMP protocol. If ICMP does not respond, it sends TCP SYN packets on ports 80 and 443.</p><p>nmap -sn 192.168.0.0/24</p><p><strong>3. Never do DNS resolution (-n)</strong></p><p>This option is used to disable DNS resolution. By default, Ping Scan performs DNS resolution to determine the hostname of the target host. However, in some cases, DNS resolution can slow down the scanning process, and the -n flag can be used to disable it.</p><p>Example:</p><p>nmap -n 192.168.1.1</p><p>nmap -n 192.168.1.1/24</p><p>nmap -n example.com</p><p><strong>4. Treat all hosts as online skip host discovery (-Pn)</strong></p><p>This option is used to skip host discovery and treat all hosts as online. When this flag is used, nmap assumes that all the hosts are up and running and it directly scans the targeted ports.</p><p>nmap -v -Pn 192.168.1.1/24</p><p>nmap -Pn 192.168.1.1</p><p>nmap -Pn example.com</p><p><strong>5. TCP SYN/ACK, UDP or SCTP discovery to given ports (-PS/PA/PU/PY[portlist])</strong></p><p>These options specify the type of probe to use for host discovery. They send TCP SYN/ACK, UDP, or SCTP packets to the specified ports to determine which hosts are up.</p><p>nmap -v -sn -PS 192.168.1.1/24</p><p>nmap -v -sn -PA 192.168.1.1/24</p><p>nmap -sn -PU 192.168.1.1/24</p><p><strong>6. ICMP echo, timestamp, and netmask request discovery probes (-PE/PP/PM)</strong></p><p>These options specify the type of ICMP probe to use for host discovery. They send ICMP echo, timestamp, or netmask request packets to determine which hosts are up. <em>To use this option, use the following command:</em></p><ul><li>For ICMP echo:- nmap -v -sn -PE 192.168.1.1/24</li><li>For ICMP timestamp:- nmap -v -sn -PP 192.168.1.1/24</li><li>For ICMP Mask:- nmap -sn -PM 192.168.1.1/24</li></ul><p><strong>7. Specify custom DNS servers ( dns-servers &lt;serv1[,serv2],…&gt;)</strong></p><p>This option allows you to specify custom DNS servers to use for DNS resolution.</p><p>Example: nmap --dns-servers 8.8.8.8 192.168.1.1</p><p><strong>8. — system-dns:</strong></p><p>This option tells Nmap to use the OS’s DNS resolver for DNS resolution.</p><p>Example: nmap --system-dns 192.168.1.1</p><p><strong>9 — traceroute:</strong></p><p>This option performs a traceroute to each host to determine the path between the scanning host and the target host.</p><p>Example: nmap --traceroute 192.168.1.1</p><h3>Port Specification And Scan Order…</h3><p><strong>By default</strong>, Nmap scans <strong><em>the 1000 most common ports</em></strong> used by various services and applications. <strong>Port specification and scan ord</strong>er refer to the process of specifying which ports to scan during network reconnaissance. This is important for effective scanning as it allows you to exclude unnecessary ports and prioritize the scan based on the frequency of usage. Nmap provides several options for port specification and scan order to customize your scans based on your specific needs.</p><p><strong><em>Here are some common options for port specification and scan order:</em></strong></p><p><strong>1. -p &lt;port ranges&gt;:</strong></p><p>This option allows you to specify which ports to scan. You can use a comma-separated list of individual ports, a range of ports separated by a hyphen, or a combination of both. <em>For example:</em></p><p>nmap -v -p0–65535 192.168.1.1</p><p>nmap -v -p 22 192.168.1.1</p><p>nmap -Pn 192.168.1.1/24</p><p>nmap -v -p T:80,443,U:53,111 192.168.1.1</p><p>nmap -v -p- example.com</p><p>2.<strong> — exclude-ports &lt;port ranges&gt;:</strong></p><p>This option allows you to exclude certain ports from the scan. You can use the same syntax as with the -p option to specify the ports to exclude.</p><p>nmap -v --exclude-ports 80 example.com</p><p>nmap -v --exclude-ports 100–400 192.168.1.1/24</p><p>nmap --exclude-ports 1–1000,3389–3390</p><p><strong>3. -F:</strong></p><p>This option enables “fast” mode, which scans a smaller set of ports than the default scan. By default, Nmap scans the 1000 most common TCP ports, but with the -F option it will scan only the 100 most common ports.</p><p>nmap -F 192.168.1.1</p><p>nmap -v -F 192.168.1.1</p><p><strong>4. -r:</strong></p><p>This option tells Nmap to scan the ports in sequential order instead of randomizing the order. This can be useful in certain situations, such as when scanning slow or unreliable networks.</p><p>nmap -r -p- 192.168.1.1–10</p><p>nmap -v -r -F example.com</p><p><strong>5. — top-ports &lt;number&gt;:</strong></p><p>This option specifies the number of most common ports to scan.</p><p>nmap --top-ports 100 192.168.1.1/24</p><p>nmap --top-ports 100 example.com</p><h3>Scan Techniques…</h3><p><strong>Scan techniques</strong> refer to the different methods used by a network scanner to discover and gather information about hosts, networks, and services. Nmap, one of the most popular network scanners, offers a wide range of scan techniques that can be used for various purposes, including network mapping, vulnerability assessment, and penetration testing.</p><p><strong><em>Here are some common options for scan techniques:</em></strong></p><p><strong>1. SYN Scan (-sS)</strong></p><p>This is the most popular and widely used scan technique in Nmap. It sends an SYN packet to the target host and waits for a response. If the target responds with an SYN/ACK packet, it indicates that the port is open, and if it responds with an RST packet, it indicates that the port is closed. This scan technique is also known as a half-open scan because it does not complete the TCP three-way handshake. The SYN scan is fast and stealthy, making it an ideal scan technique for mapping large networks.</p><p>nmap -sS -p- 192.168.1.1/24</p><p>nmap -v -sS -p 21,22,25,80,443 example.com</p><p>nmap -v -Pn -sS example.com/24</p><p><strong>2. Connect Scan (-sT)</strong></p><p>This is a full TCP connection scan that completes the full TCP three-way handshake. This scan technique is slower than the SYN scan and is easily detectable by intrusion detection systems and firewalls. The Connect scan is useful for detecting the presence of certain types of firewalls that block SYN packets.</p><p>nmap -v -sT -p- 192.168.1.1/24</p><p>nmap -v -sT -p 1-100 example.com</p><p>nmap -v -sT example.com/24</p><p>nmap -v -sT -p 80,443,22,21,25,445,69,53 example.com</p><p><strong>3. ACK Scan (-sA)</strong></p><p>This scan technique sends an ACK packet to the target host and waits for a response. If the target responds with an RST packet, it indicates that the port is unfiltered, and if it does not respond at all, it indicates that the port is filtered by a firewall. The ACK scan helps detect the presence of stateless packet-filtering firewalls.</p><p>nmap -v -sA -p- 192.168.1.1/24</p><p>nmap -v -sA -Pn example.com</p><p>nmap -v -sA example.com/24</p><p><strong>4. Window Scan (-sW)</strong></p><p>This scan technique sends a packet with a window size of zero to the target host and waits for a response. If the target responds with an RST packet, it indicates that the port is closed, and if it responds with an SYN/ACK packet, it means that the port is open. The Window scan helps detect the presence of certain types of firewalls that block specific types of packets.</p><p>nmap -sW 192.168.1.1/24</p><p>nmap -v -sW example.com</p><p>nmap -v -sW example.com/24</p><p><strong>5. Maimon Scan (-sM)</strong></p><p>This scan technique is similar to the Window scan, but it sends a packet with the URG flag set instead of a window size of zero. The Maimon scan helps detect the presence of certain types of firewalls that block Window scan packets.</p><p>nmap -sM 192.168.1.1/24</p><p>nmap -v -sM example.com</p><p>nmap -v -sM example.com/24</p><p><strong>6. Customize TCP scan flags (</strong><strong>--scanflags &lt;flags&gt;)</strong></p><p>Customizing TCP scan flags allows for the manipulation and set of TCP flags during a network scan to achieve specific scanning objectives. TCP flags control the state of a TCP connection, and altering them can result in tailored scans that reveal information about the target system, including open ports, service versions, and operating system information.</p><p>nmap -Pn -v --scanflags SYN -p 80,443 example.com</p><p>nmap -Pn -v --scanflags SYN -p 80,443 example.com</p><p><strong>7. UDP Scan (-sU)</strong></p><p>The “-sU” option in nmap stands for UDP scan. This allows the user to scan for open UDP ports on a target system. Unlike TCP, which uses a three-way handshake to establish a connection, UDP is a connectionless protocol that does not require a handshake to establish a connection. This makes UDP scan more challenging, as the scanner must send a UDP packet to each port and wait for a response.</p><p>nmap -sU 192.168.1.1</p><p>nmap -v sU example.com</p><p><strong>8. Idle Scan (-sI)</strong></p><p>The “-sI” option in nmap stands for the idle scan. This technique allows the user to perform a stealthy scan by using a “zombie” host that is already trusted by the target system. The idle scan involves sending a series of packets to the zombie host, which in turn sends packets to the target system. By analyzing the sequence numbers of the packets, nmap can determine which ports are open on the target system without being detected.</p><p>Syntex:- nmap -sI zombie_host target_host</p><p><strong>9. FTP bounce scan (-b)</strong></p><p>The “-b” option in nmap stands for FTP bounce scan. This technique involves using an FTP server as a proxy to scan a target system. The scanner sends a PORT command to the FTP server, which causes the server to connect to the target system and send the scan results back to the scanner. This technique can be useful for bypassing firewalls and other security measures that block direct scans, but it is also considered a security risk and is not commonly used.</p><p>Syntex:-nmap -b ftp_server target_host</p><p><strong>TCP Null, FIN, and Xmas Scans:</strong></p><p>1. A<strong> TCP Null scan</strong> is a type of scan in which an attacker sends a packet with no flags set (i.e., null) to the target system’s ports. If the port is open, the target system will not respond to the packet, while if the port is closed, the target system will send a TCP RST (reset) packet in response.</p><p>nmap -v -sN -p 80,443 192.168.1.1</p><p>nmap -v -sN -p 80,443 example.com</p><p>nmap -v -Pn -sN example.com</p><p>2. A <strong>TCP FIN scan</strong> is a type of scan in which an attacker sends a packet with the FIN flag set to the target system’s ports. If the port is open, the target system will not respond to the packet, while if the port is closed, the target system will send a TCP RST (reset) packet in response.</p><p>nmap -v -sF -p- 192.168.1.1</p><p>nmap -v -sF -p 80,443 example.com</p><p>3. An <strong>Xmas scan </strong>is a type of scan in which an attacker sends a packet with the FIN, PSH, and URG flags set (i.e., “lit up like a Christmas tree”) to the target system’s ports. If the port is open, the target system will not respond to the packet, while if the port is closed, the target system will send a TCP RST (reset) packet in response.</p><p>nmap -v -sX -p 80,443 192.168.1.1</p><p>nmap -v -sX -p 80,443 example.com</p><h3>OUTPUT…</h3><p>The Nmap output is presented in a human-readable format that can be easily understood by network administrators and security analysts. The output can be customized to display specific details, and Nmap supports various output formats, including plain text, XML, and HTML.</p><p><strong><em>Here are some common options for output:</em></strong></p><ol><li><strong>-oN/-oX/-oS/-oG </strong>Output scan in normal, XML, s|&lt;rIpt kIddi3, and Grepable format, respectively, to the given filename.</li></ol><p><strong><em>One of the most basic and important options in Nmap is the output option. By default, Nmap will display the results of the scan on the screen, but you can also save the results to a file using one of the output options.</em></strong></p><blockquote><em>The </em><strong><em>-oN</em></strong><em> option can be used to </em><strong>save the results in normal format to a file.</strong><em> This format is human-readable and easy to understand.</em></blockquote><blockquote>nmap --top-ports 100 192.168.1.1/24 -oN scan-results.txt</blockquote><blockquote>nmap --top-ports 100 example.com -oN scan-results.txt</blockquote><blockquote>nmap -sn -PU 192.168.1.1/24 -oN scan-results.txt</blockquote><blockquote>nmap -v -p0–65535 192.168.1.1 -oN scan-results.txt</blockquote><blockquote>nmap -v -p T:80,443,U:53,111 192.168.1.1 -oN scan-results.txt</blockquote><blockquote><em>The </em><strong><em>-oX </em></strong><em>option can be used to </em><strong>save the results in XML format to a file.</strong><em> This format is machine-readable and can be easily processed by other tools.</em></blockquote><blockquote>nmap --top-ports 100 192.168.1.1/24 -oX scan-results.xml</blockquote><blockquote>nmap --top-ports 100 example.com -oX scan-results.xml</blockquote><blockquote>nmap -sn -PU 192.168.1.1/24 -oX scan-results.xml</blockquote><blockquote>nmap -v -p0–65535 192.168.1.1 -oX scan-results.xml</blockquote><blockquote>nmap -v -p T:80,443,U:53,111 192.168.1.1 -oX scan-results.xml</blockquote><blockquote><em>The </em><strong><em>-oS </em></strong><em>option can be used to</em><strong><em> </em>save the results in s|&lt;rIpt kIddi3 format to a file.</strong><em> This format is similar to the normal format, but it is designed to be easily parsed by scripts.</em></blockquote><blockquote>nmap --top-ports 100 192.168.1.1/24 -oS scan-results.txt</blockquote><blockquote>nmap --top-ports 100 example.com -oS scan-results.txt</blockquote><blockquote>nmap -sn -PU 192.168.1.1/24 -oS scan-results.txt</blockquote><blockquote>nmap -v -p0–65535 192.168.1.1 -oS scan-results.txt</blockquote><blockquote>nmap -v -p T:80,443,U:53,111 192.168.1.1 -oS scan-results.txt</blockquote><blockquote><em>The</em><strong><em> -oG</em></strong><em> option can be used to </em><strong>save the results in Grepable format to a file.</strong><em> This format is designed to be easily parsed by Unix tools like grep and awk.</em></blockquote><blockquote>nmap --top-ports 100 192.168.1.1/24 -oG scan-results.txt</blockquote><blockquote>nmap --top-ports 100 example.com -oG scan-results.txt</blockquote><blockquote>nmap -sn -PU 192.168.1.1/24 -oG scan-results.txt</blockquote><blockquote>nmap -v -p0–65535 192.168.1.1 -oG scan-results.txt</blockquote><blockquote>nmap -v -p T:80,443,U:53,111 192.168.1.1 -oG scan-results.txt</blockquote><p><strong>2. -oA &lt;basename&gt;</strong></p><p>The -oA option can be used to save the results in all three major formats (normal, XML, and Grepable) at once. This can be useful if you want to have multiple copies of the results in different formats, or if you want to compare the results from different formats.</p><ul><li>nmap — top-ports 100 192.168.1.1/24 -oA &lt;filename&gt;</li><li>nmap — top-ports 100 example.com -oA &lt;filename&gt;</li><li>nmap -sn -PU 192.168.1.1/24 -oA &lt;filename&gt;</li><li>nmap -v -p0–65535 192.168.1.1 -oA &lt;filename&gt;</li><li>nmap -v -p T:80,443,U:53,111 192.168.1.1 -oA &lt;filename&gt;</li></ul><p><strong>3. -v: Increase verbosity level (use -vv or more for greater effect)</strong></p><p>The -v option can be used to increase the verbosity level of Nmap. By default, Nmap will only display basic information about the scan, but with the -v option, you can get more detailed information about the scan.</p><p>You can use the -v option multiple times to increase the verbosity level even further. For example, the -vv option will display even more detailed information than the -v option.</p><p><strong>4. -d: Increase debugging level (use -dd or more for greater effect)</strong></p><p>The -d option can be used to increase the debugging level of Nmap. This can be useful if you are trying to troubleshoot a problem with Nmap or if you want to get even more detailed information about the scan.</p><p>Like the -v option, you can use the -d option multiple times to increase the debugging level even further. For example, the -dd option will display even more detailed information than the -d option.</p><p><strong>5.</strong><strong> --reason: Display the reason a port is in a particular state</strong></p><p>The --reason option can be used to display the reason why a port is in a particular state. For example, if a port is shown as open, the --reaso option can be used to display why Nmap believes the port is open.</p><p>This can be useful for understanding why certain ports are open or closed and for troubleshooting problems with the scan.</p><ul><li>nmap --top-ports 100 192.168.1.1/24 --reason</li><li>nmap --top-ports 100 example.com --reason</li><li>nmap -sn -PU 192.168.1.1/24 --reason</li><li>nmap -v -p0–65535 192.168.1.1 --reason</li><li>nmap -v -p T:80,443,U:53,111 192.168.1.1 --reason</li></ul><h3>Service Version Detection…</h3><p>The Service Version Detection feature in Nmap is a powerful tool for identifying the services and versions running on open ports of the target system. This information is useful for identifying vulnerabilities and weaknesses in the target system, which can be used to improve its security posture. By using Nmap’s service/version detection feature, you can gain valuable insights into the target system and make informed decisions regarding its security.</p><p><em>To use the service/version detection feature, you need to specify the ‘-sV’ option along with the TCP Connect Scan. The ‘-sV’ option probes the open ports to determine the service and version information. Additionally,</em> <strong><em>you can use the following options to control the intensity of the version detection:</em></strong></p><p><strong>1. Basic Service Version Detection.</strong></p><p>nmap -sV 192.168.1.1</p><p><strong><em>This command will scan the IP address 192.168.1.1 and attempt to determine the service and version information running on the open ports.</em></strong></p><p><strong>2. Set Version Intensity</strong></p><p>nmap -sV --version-intensity 5 192.168.1.1</p><p>nmap -v -n -sV — version-intensity 5 192.168.1.1</p><p>nmap -v -n -sT -sV --version-intensity 5 192.168.1.0/24</p><p><strong><em>This command will scan the IP address 192.168.1.1 and set the version detection intensity level to 5.</em></strong></p><p><strong>3. Use Version Light</strong></p><p>nmap -sV --version-light 192.168.1.1</p><p><strong><em>This command will scan the IP address 192.168.1.1 and limit the version detection to the most likely probes with intensity level 2.</em></strong></p><p><strong>4. Use Version All</strong></p><p>nmap -sV --version-all 192.168.1.1</p><p><strong><em>This command will scan the IP address 192.168.1.1 and perform every possible version detection probe with an intensity level of 9.</em></strong></p><h3>OS Detection…</h3><p>Nmap’s OS detection feature is a powerful tool for determining the operating system running on the target system. This information is useful for identifying vulnerabilities specific to the operating system and optimizing attacks against the target system. By using Nmap’s OS detection feature, you can gain valuable insights into the target system and make informed decisions regarding its security. However, it is important to note that the OS detection feature is not always accurate and should be used in conjunction with other tools and techniques to confirm the operating system.</p><p><strong><em>Here are some examples of using Nmap’s OS detection feature:</em></strong></p><p><strong>1. Basic OS Detection</strong></p><p>nmap -O 192.168.1.1</p><p>nmap -vv -sT -O -p- 192.168.1.1/24</p><p>nmap -v -O example.com -oA &lt;filename&gt;</p><p><strong>2. Limit OS Detection</strong></p><p>nmap -O --osscan-limit 192.168.1.0/24</p><p><strong><em>This command will scan the network 192.168.1.0/24 and limit OS detection to promising targets. This option is useful when scanning a large number of systems, and you want to reduce the scan time by skipping the OS detection on systems that are unlikely to return useful results.</em></strong></p><p><strong>3. Aggressive OS Detection</strong></p><p>nmap -O --osscan-guess 192.168.1.1</p><p><strong><em>This command will scan the IP address 192.168.1.1 and guess the operating system more aggressively. This option is useful when the target system’s operating system is hidden or deliberately obfuscated.</em></strong></p><p><strong>4. Advanced OS Detection</strong></p><p>nmap -A 192.168.1.1</p><p><strong><em>This command will enable OS detection, version detection, script scanning, and traceroute for the IP address 192.168.1.1. This is useful when performing a comprehensive scan of the target system.</em></strong></p><h3>Script Scan…</h3><p>Nmap Script Scan is a powerful feature of Nmap that allows users to automate tasks using pre-written scripts or write their own scripts using the Lua programming language. The scripts can be used to gather information about hosts, services, and vulnerabilities, or to perform tasks such as brute-force attacks, denial-of-service attacks, and exploitation.</p><p>The Nmap Script Scan feature is activated by using the <strong>“-sC”</strong> option or the “ — script=default” option. This option tells Nmap to run the default script set that comes with the tool. The default script set contains over 600 scripts that cover a wide range of tasks, from information gathering to vulnerability detection.</p><p>nmap -v -p- -sT -sV -sC -T4 192.168.1.0/24</p><p>nmap -v -Pn -sT -sV -O -sC example.com</p><p>nmap -v -Pn -sT -sV -O --script=http-vuln-cve2006-3392.nse example.com</p><p><strong>In conclusion</strong>, Nmap is an incredibly versatile and powerful tool that can be used for network exploration, management, and security auditing. Throughout this article, we have explored the various steps involved in Nmap scanning, including target specification, host discovery, port specification and scan order, and output. We have also provided examples of command usage for each step, along with some common options used with Nmap.</p><p><em>Target specification is a critical step in using Nmap, and there are several ways to specify the target, </em><strong><em>including individual IP addresses or hostnames, CIDR notation, or a range of IP addresses.</em></strong><em> Host discovery is also an essential part of network scanning, and various Nmap techniques can be used to achieve this.</em></p><p><strong>Overall,</strong> by learning how to use Nmap, you will be better equipped to manage and audit your network’s security. Nmap provides invaluable insights into your network’s vulnerabilities, enabling you to proactively secure your systems and protect your data. So, whether you’re an IT professional, a security researcher, or simply interested in network security, Nmap is an essential tool in your toolkit. We hope this article has provided you with the knowledge and confidence to use Nmap effectively.</p><h4><strong>So, happy scanning!</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45d00dd759f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction To Computer Networks]]></title>
            <link>https://medium.com/@riteshs4hu/an-introduction-to-computer-networks-26ad86616a2b?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/26ad86616a2b</guid>
            <category><![CDATA[osi-model]]></category>
            <category><![CDATA[network-topology]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[ipv6]]></category>
            <category><![CDATA[ipv4]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 05:52:40 GMT</pubDate>
            <atom:updated>2023-04-02T05:52:40.081Z</atom:updated>
            <content:encoded><![CDATA[<h4>Network Fundamentals…</h4><p><strong>Introduction to Network.</strong></p><p>A Network is a <em>group of two or more computing devices connected to share resources and exchange information</em>. This can include computers, servers, printers, routers, and other hardware devices. Networks can be connected through wired or wireless connections and are built using hardware and software components, such as routers, switches, access points, and operating systems or applications. The primary purpose of a computer network is to enable efficient communication and resource sharing among connected devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*5Y2cO64sdiazcChnCHityg.jpeg" /></figure><blockquote><strong>Two common categories of computer networks:</strong></blockquote><blockquote><strong><em>1. Client-server networks:</em></strong><em> In a client-server network, one or more central servers provide services to multiple client devices. Clients, such as desktop computers, laptops, and mobile devices, request resources or services from the server, which then responds. This type of network is commonly used in businesses and organizations, where central servers can provide services such as file storage, email, and database management.</em></blockquote><blockquote><strong><em>2. Peer-to-peer (P2P) networks:</em></strong><em> In a P2P network, all devices are considered equal and can communicate with each other directly, without the need for a central server. Each device can act as both a client and a server, sharing resources and data with other devices on the network. This type of network is commonly used for file sharing and collaboration and is often seen in home networks and small businesses.</em></blockquote><h4><strong>Types of Network.</strong></h4><p><strong>1. LAN (Local Area Network):</strong> A LAN is a network that connects devices within a relatively small geographical area, such as a home, office, or campus. LANs are typically used to share resources such as printers and files and can be connected using wired or wireless technologies. A switch is typically used to connect devices in a LAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*TeWluK2xqURrBkMNz5x_MA.png" /></figure><p><strong>2. CAN (Campus Area Network):</strong> A CAN is a network that covers a larger geographical area than a LAN, typically serving sites such as colleges, universities, and business campuses. CANs can be connected using technologies such as fibre optic cables and L3 switches.</p><p><strong>3. MAN (Metropolitan Area Network): </strong>A MAN is a network that covers a larger geographical area than a LAN or CAN, typically covering a single city or region. MANs are typically used by organizations such as universities and businesses to connect multiple LANs. A router is typically used to connect devices in a MAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*x-F2QtoHuuL3IdzKA3LUWw.png" /></figure><p><strong>4. WAN (Wide Area Network): </strong>A WAN is a network that connects devices over a larger geographical area, such as between different cities or even countries. WANs are typically used for communication between remote sites and can be connected using technologies such as leased lines, satellite links, and VPNs. A router is typically used to connect devices in a WAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*zyDpGweQ_-9uDOTKARX0Ow.png" /></figure><p>A <strong>Node</strong> or <strong>Host</strong> refers to any device that is connected to a network and is capable of communicating with other devices on the network. Each node typically has a unique identifier, such as an IP address or a MAC address, which enables it to be identified and communicate with other nodes on the network.</p><h3><strong>IP Address (Internet Protocol Address)…</strong></h3><p>An IP address is a unique identifier for devices on a network, not for the network itself. Each device connected to a network is assigned a unique IP address, which is used to identify and communicate with that device.</p><p>A network can have many devices, each with its unique IP address. The network itself is identified by its unique IP address, called a network address. The network address is used to route data between different networks and identify the specific network a device is connected to.</p><p><strong>For Example:-</strong></p><p>In a typical home network, the router is the device that connects all the devices on the network to the internet. The router is assigned a unique IP address, which is used to identify the network on the internet. Each device on the network, such as a computer, smartphone, or tablet, is assigned its unique IP address. This IP address allows the device to communicate with other devices on the same network and with devices on other networks. For example, if you want to access a website on the internet from your computer, your computer sends a request to the router using its IP address. The router then forwards the request to the internet using its IP address, and the website responds to the request with the data that is requested. In this way, IP addresses allow devices to communicate with each other and with the internet. They are a crucial part of the network infrastructure, allowing data to be sent and received between devices on the network and between networks.</p><h4><strong><em>There are two types of IP addresses:-</em></strong></h4><blockquote><strong><em>1. IPv4 (Internet Protocol version 4):</em></strong><em> This is the most widely used IP address type and uses a 32-bit address format, expressed as a series of four decimal numbers ranging from 0 to 255, separated by periods. For example, 192.168.0.1 is an example of an IPv4 address. IPv4 supports around 4.3 billion unique IP addresses, which are becoming increasingly scarce due to the growth of the internet.</em></blockquote><blockquote><strong>In Short.</strong></blockquote><blockquote>IPv4 addresses use a 32-bit address format, which means that there are 2³² (or approximately 4.3 billion) possible unique IP addresses.</blockquote><blockquote>An IPv4 address is divided into four sections, or octets, separated by dots.</blockquote><blockquote>Each section is represented by an 8-bit number or a value between 0 and 255 in decimal notation.</blockquote><blockquote>The range of each section is from 0 to 255, inclusive.</blockquote><blockquote>An IPv4 address can range from 0.0.0.0 to 255.255.255.255, with the first and last addresses reserved for special purposes (the first for identifying the network and the last for broadcasting to all hosts on the network).</blockquote><blockquote><strong><em>2. IPv6 (Internet Protocol version 6):</em></strong><em> This is a newer IP address type that uses a 128-bit address format, expressed as a series of eight groups of four hexadecimal digits, separated by colons. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334 is an example of an IPv6 address. IPv6 supports a significantly larger pool of unique addresses than IPv4, making it possible to support the increasing number of devices and users on the internet. IPv6 adoption is growing, but it is not yet as widely used as IPv4.</em></blockquote><h4><strong>Classful And Classless…</strong></h4><p>Classful and classless refer to the two different ways of assigning IP addresses. In classful addressing, IP addresses are divided into five classes, <strong>Class A, B, C, D, </strong>and<strong> E, </strong>and each class has a fixed number of network and host bits. Classless addressing, on the other hand, allows for a more flexible allocation of IP addresses, with the network and host bits being defined by the subnet mask.</p><p>Classful addressing divides IP addresses into fixed networks and hosts portions based on the class of the IP address.<strong> Class A, B</strong>, and <strong>C </strong><em>addresses are used for public IP addresses,</em> with <strong><em>Class D reserved for multicasting</em></strong> and <strong><em>Class E reserved for future use. </em></strong>Private IP addresses are reserved for use within private networks and are assigned using a different set of IP ranges.</p><h4><strong>Public And Private…</strong></h4><p>Public and private IP addresses refer to the types of IP addresses used in computer networks. Public IP addresses are used to identify devices on the public internet, while private IP addresses are used for devices within a private network.</p><blockquote><strong><em>Public IP addresses</em></strong><em> are assigned by Internet Service Providers (ISPs) and are unique to each device connected to the internet. There are three ranges of public IP addresses:</em></blockquote><blockquote><strong><em>PUBLIC IP ADDRESS</em></strong></blockquote><blockquote><strong>CLASS A</strong><em> — </em><strong><em>1.0.0.0 to 126.255.255.255</em></strong></blockquote><blockquote><strong>CLASS B —</strong><em> </em><strong><em>126.0.0.0 to 191.255.255.255</em></strong></blockquote><blockquote><strong>CLASS C —<em> 192.0.0.0 to 223.255.255.255</em></strong></blockquote><blockquote><strong><em>Private IP addresses </em></strong><em>are reserved for use within a private network, such as a home or office network. </em><strong><em>Private IP addresses are not unique and can be used by multiple devices within the same network.</em></strong><em> There are three ranges of private IP addresses:</em></blockquote><blockquote><strong><em>PRIVATE IP ADDRESS</em></strong></blockquote><blockquote><strong>CLASS A —<em> 10.0.0.0 to 10.255.255.255</em></strong></blockquote><blockquote><strong>CLASS B — <em>172.16.0.0 to 172.31.255.255</em></strong></blockquote><blockquote><strong>CLASS C — <em>192.168.0.0 to 192.168.255.255</em></strong></blockquote><h4>Subnet Mask….</h4><p>The subnet mask, also known as the network mask or netmask, is used in IP networks to determine the network and host portions of an IP address. It is a 32-bit value that is used to divide an IP address into a network portion and a host portion. The network portion identifies the network that the device belongs to, while the host portion identifies the specific device on the network.</p><p>The subnet mask is typically expressed in dotted decimal notation, just like an IP address. It has four sections, each with eight bits, for a total of 32 bits. The network portion of the IP address is represented by the bits that are set to 1 in the subnet mask, while the host portion is represented by the bits that are set to 0.</p><p><strong><em>The default subnet mask for each class of IP address is:</em></strong></p><ul><li><strong><em>Class A: 255.0.0.0</em></strong></li><li><strong><em>Class B: 255.255.0.0</em></strong></li><li><strong><em>Class C: 255.255.255.0</em></strong></li></ul><h4>Network Topology…</h4><p>Network Topology refers to the physical or logical layout of a computer network. It describes how devices and nodes are connected and how data flows from one device to another in a network.</p><p><strong><em>There are several types of network topologies. Some of the most common ones are:</em></strong></p><p><strong>1. Bus Topology:-</strong> In this topology, all devices are connected to a single cable, known as the backbone. Data flows in both directions along the backbone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*GJjFoX5tLOe3R5G_O3OX4g.jpeg" /></figure><p><strong>2. Star Topology:-</strong> In this topology, all devices are connected to a central hub or switch. Data flows between devices through the hub or switch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*5JaKhXJRBaV0qkV8X6ubyA.jpeg" /></figure><p><strong>3. Ring Topology:-</strong> In this topology, all devices are connected circularly, forming a ring. Data flows in one direction along the ring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*ywUB44Vv8MEWNaSjxefBJA.png" /></figure><p><strong>4. Mesh Topology:-</strong> In this topology, all devices are connected in a peer-to-peer manner. Data can flow through multiple paths between devices, making the network more reliable and fault-tolerant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQ3AV-p4R0KJEleVn60C_g.jpeg" /></figure><p><strong>5. Hybrid Topology:- </strong>In this topology, a combination of two or more topologies is used in a network. For example, a network may use a star-bus topology, where multiple star topologies are connected through a bus backbone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*N7xIqdTSsYyVt3gXMDIa7A.jpeg" /></figure><h3>OSI Model (Open Systems Interconnection)</h3><p>The OSI model serves as a standard reference model for understanding and designing communication systems. It provides a clear separation of functionality between the layers, which allows for easy interoperability between different devices and network architectures.</p><p><strong>7. Application Layer:</strong> The Application Layer is the top layer in the OSI model that enables end-users to interact with the network and access resources such as file sharing, email, and web browsing. It provides services and interfaces to user applications, facilitating the exchange of data and enabling network communication.</p><p><strong><em>Some Examples of application layer protocols include:</em></strong></p><ul><li><strong>HTTP (Hypertext Transfer Protocol):</strong> Port 80 (HTTP) and 443 (HTTPS)</li><li><strong>FTP (File Transfer Protocol): </strong>Port 20 (FTP Data) and 21 (FTP Control)</li><li><strong>SMTP (Simple Mail Transfer Protocol):</strong> Port 25 (SMTP)</li><li><strong>DNS (Domain Name System): </strong>Port 53 (DNS)</li><li><strong>SSH (Secure Shell):</strong> Port 22 (SSH)</li><li><strong>Telnet:</strong> Port 23 (Telnet)</li><li><strong>POP3 (Post Office Protocol):</strong> Port 110 (POP3)</li><li><strong>IMAP (Internet Message Access Protocol):</strong> Port 143 (IMAP)</li></ul><p><strong>6. Presentation Layer:</strong> The presentation layer is responsible for translating data from the application layer into a format that can be transmitted over the network. It handles data encryption and decryption, compression and decompression, and data formatting.</p><p><strong><em>Some Examples of presentation layer protocols include:</em></strong></p><ul><li><strong>JPEG (Joint Photographic Experts Group)</strong> — a compression algorithm used for image files</li><li><strong>MPEG (Moving Picture Experts Group) </strong>— a compression algorithm used for video and audio files</li><li><strong>ASCII (American Standard Code for Information Interchange) </strong>— a character encoding scheme for text-based data</li><li><strong>MIME (Multipurpose Internet Mail Extensions) </strong>— a protocol used to format email messages with multimedia content, such as images and audio files</li><li><strong>XDR (External Data Representation)</strong> — a protocol used for the exchange of data between different systems, regardless of their underlying hardware or software platforms.</li></ul><p><strong>5. Session Layer: </strong>The Session Layer is responsible for managing the communication sessions between two endpoints or systems. It establishes, manages, and terminates sessions between applications running on different devices, and provides synchronization and checkpointing capabilities to ensure that data is transmitted correctly and reliably.</p><p><strong><em>Some Examples of session layer protocols include:</em></strong></p><ul><li><strong>L2TP (Layer 2 Tunneling Protocol) </strong>— A protocol used to establish virtual private network (VPN) connections over the internet or other public networks. It is often used in combination with the Internet Protocol Security (IPsec) protocol to provide secure communication between different networks.</li><li><strong>NetBIOS (Network Basic Input Output System) </strong>— A protocol used to provide services such as file and print sharing between computers on a local area network (LAN). It provides a set of commands and procedures for network communication and resource sharing.</li><li><strong>PPTP (Point-to-Point Tunneling Protocol) </strong>— A protocol used to establish VPN connections over the internet or other public networks. It is often used in combination with the Microsoft Challenge-Handshake Authentication Protocol (MS-CHAP) to provide secure communication between different networks.</li><li><strong>PAP (Password Authentication Protocol) — </strong>A protocol used to authenticate users and devices on a network using passwords. It is a simple and widely-used authentication protocol, but it has some security vulnerabilities and is not recommended for use in high-security environments.</li></ul><p><strong>4. Transport Layer:</strong> The Transport layer is responsible for providing reliable data transmission between two endpoints in a network. It ensures that data is delivered without errors and in the correct order. It also regulates the flow of data between the two endpoints, preventing one endpoint from overwhelming the other with too much data.</p><p>The Transport layer is critical in ensuring that data is delivered correctly and efficiently over a network. It achieves this through the use of protocols such as TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP provides reliable data transmission with error recovery and flow control, while UDP provides a faster, but less reliable transmission method without error recovery or flow control.</p><p><strong>3. Network Layer: </strong>The Network layer receives data from the Transport layer and adds a header to it, which contains the source and destination logical addresses. These addresses are used to identify the source and destination devices on the network. The Network layer then determines the best path for the data to reach its destination, using a process called routing.</p><p><strong><em>Some Examples of network layer protocols include:</em></strong></p><ul><li><strong>Internet Protocol (IP):</strong> The primary protocol used on the Internet for transmitting data between networks. IP is responsible for logical addressing, routing, and fragmentation/reassembly of data packets.</li><li><strong>Internet Control Message Protocol (ICMP): </strong>A protocol used by network devices to communicate error messages and operational information, such as testing network connectivity and troubleshooting.</li><li><strong>Address Resolution Protocol (ARP):</strong> A protocol used to map a device’s physical address (MAC address) to its logical address (IP address) on a local network.</li><li><strong>Routing Information Protocol (RIP): </strong>A distance-vector routing protocol used by routers to exchange information about network topology and determine the best path for data to travel.</li></ul><p><strong>2. Data Link Layer:</strong> The Data Link Layer is also responsible for controlling access to the network media and for error detection and correction. It is the layer on which the switches operate and uses the MAC address to direct frames to the correct destination.</p><p><strong><em>Examples of data link layer protocols include:</em></strong></p><ul><li>Ethernet (IEEE 802.3)</li><li>Wi-Fi (IEEE 802.11)</li><li>Point-to-Point Protocol (PPP)</li><li>High-Level Data Link Control (HDLC)</li></ul><p><strong>1. Physical Layer: </strong>The physical layer is responsible for transmitting raw bits over a physical medium, such as a copper or fibre optic cable. It defines the electrical, mechanical, and procedural specifications for transmitting data.</p><p><strong><em>Examples of physical layer protocols include:</em></strong></p><ul><li>Fibre optic cables (various physical layer standards)</li><li>DSL (Digital Subscriber Line) technologies (various physical layer standards)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*ZGnXoisgbx3EKeKtQyMVFg.png" /><figcaption>OSI Model (Open Systems Interconnection)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26ad86616a2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Overview Of Tunneling Techniques.]]></title>
            <link>https://medium.com/@riteshs4hu/an-overview-of-tunneling-techniques-5c30ff80e209?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c30ff80e209</guid>
            <category><![CDATA[ssh-tunneling]]></category>
            <category><![CDATA[vpn-tunnel]]></category>
            <category><![CDATA[http-tunnel]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[tunneling]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Sun, 12 Mar 2023 18:02:15 GMT</pubDate>
            <atom:updated>2023-04-03T05:46:29.972Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tunneling Technologies And Tools…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bPYLj-MjSADSH6gNlQHt8g.jpeg" /></figure><p><strong>Tunneling</strong> is a technique used in computer networking to encapsulate one network protocol within another network protocol. This allows data to be transmitted across networks that may not natively support the original protocol.</p><p>Tunneling can be used for various purposes, such as providing <strong><em>secure remote access</em></strong> to a<strong><em> private network</em>,</strong> <strong>bypassing firewalls</strong> or <strong><em>other network restrictions</em></strong><em>, </em>or <strong>accessing resources on a different network.</strong></p><h4><strong>Some common tunneling techniques…</strong></h4><p><strong>1. VPN tunneling:-</strong> In VPN tunneling, a VPN client connects to a VPN server and creates a virtual tunnel through which data can be transmitted securely. VPN tunneling can be used for various purposes, including bypassing firewalls, accessing restricted content, and hiding IP addresses.</p><blockquote><strong><em>Dependence of VPN tunneling.</em></strong></blockquote><blockquote>To create a VPN tunnel using SSH, you must have access to the target device, either through root user credentials or an SSH connection of the target root user.</blockquote><p><strong>Creating a VPN Tunnel Using SSH:- </strong>Scenario 1</p><p><em>In this scenario, we will create a VPN tunnel using SSH between two devices. The first device will be the target device, and the second device will be the attacker device.</em></p><p><strong>Step 1:</strong> Make an SSH connection to the target device using the root user credentials.</p><p># ssh username@target_IP</p><p><strong>Step 2:</strong> Edit the SSH configuration file.</p><p>Open the /etc/ssh/sshd_config file using a text editor.</p><p><strong>Step 3</strong>: Permit tunneling in the SSH configuration file.</p><p>Search for the line #PermitTunnel no and uncomment it by removing the # symbol. Change the value from no to yes as shown below.</p><p><strong>Step 4:</strong> Restart the SSH service to apply the changes made in the configuration file.</p><p># systemctl restart sshd</p><p><strong>Step 5:</strong> Make a New SSH connection to the target device using the root user credentials.</p><p># ssh username@target_IP -w any:any</p><p><strong>Step 6: </strong>Assign an IP address to the devices.</p><p>Assign IP addresses to both devices, one as the target and the other as the Attacker. For example, you can assign 10.0.0.2 to the target and 10.0.0.1 to the Attacker using the following command.</p><p># ip addr add 10.0.0.2/24 peer 10.0.0.1 dev tun0</p><p><strong>Step 7:</strong> Bring up the tun0 interface.</p><p># ifconfig tun0 up</p><p><strong>Step 8: </strong>Enable IP forwarding on the target device using the following command.</p><p># echo 1 &gt; /proc/sys/net/ipv4/ip_forward</p><p><strong>Step 9:</strong> Add an iptables rule on the target device to allow the Attacker to access the internet. Use the following command.</p><p># iptables -t nat -A POSTROUTING -s 10.0.0.1 -o enp0s3 -j MASQUERADE</p><p><strong>Step 10: </strong>Check your Target PC Actual IP Address Use the following command. Because Some cases the firewall forward the ssh port to one specific PC.</p><p># ifconfig</p><p><strong>Step 11: </strong>Go to the Attacker’s PC Assign an IP Address and Make Tunneling of the Target PC to the Devices. Use the following command.</p><p># ip addr add 10.0.0.1/24 peer targat_pc_ip/24 dev tun0</p><p><strong>Step 12:</strong> Bring up the tun0 interface.</p><p># ifconfig tun0 up</p><p><strong>Step 13: </strong>Add route on the attacker device.</p><p># route add -net target_pc_ip_rang/subnet gw target_pc_ip</p><p><strong>Creating a VPN Tunnel Using SSH:- </strong>Scenario 2</p><p><em>In this scenario, we will create a VPN tunnel using SSH between two devices. The first device will be the attacker device, and the second device will be the target device.</em></p><p><strong>Step 1:</strong> Make an SSH connection to the target device using the root user credentials.<br># ssh username@target_IP</p><p><strong>Step 2:</strong> Edit the SSH configuration file.<br>Open the /etc/ssh/sshd_config file using a text editor.</p><p><strong>Step 3:</strong> Permit tunneling in the SSH configuration file.<br>Search for the line #PermitTunnel no and uncomment it by removing the # symbol. Change the value from no to yes as shown below.</p><p><strong>Step 4:</strong> Restart the SSH service to apply the changes made in the configuration file. <br># systemctl restart sshd</p><p><strong>Step 5: </strong>Make a New SSH connection to the target device using the root user credentials.<br># ssh username@target_IP -w any:any</p><p><strong>Step 6:</strong> Check your Target PC Actual IP Address Use the following command. Because Some cases the firewall forward the ssh port to one specific PC.<br># ifconfig</p><p><strong>Step 7: </strong>Go to the Attacker’s PC Assign an IP Address and Make Tunneling of the Target PC to the Devices. Use the following command.<br># ip addr add 10.0.0.1/24 peer targat_pc_ip/24 dev tun0</p><p><strong>Step 8:</strong> Bring up the Attacker devices tun0 interface.<br># ifconfig tun0 up</p><p><strong>Step 9:</strong> Assign an IP address to the ssh devices.<br>Assign IP addresses to both devices, one as the target and the other as the Attacker. For example, you can assign 10.0.0.2 to the target and 10.0.0.1 to the Attacker using the following command.<br># ip addr add 10.0.0.2/24 peer 10.0.0.1 dev tun0</p><p><strong>Step 10:</strong> Bring up the target device tun0 interface.<br># ifconfig tun0 up</p><p><strong>Step 11:</strong> Enable IP forwarding on the target device using the following command.<br># echo 1 &gt; /proc/sys/net/ipv4/ip_forward</p><p><strong>Step 12:</strong> Add an iptables rule on the target device to allow the Attacker to access the internet. Use the following command.<br># iptables -t nat -A POSTROUTING -s 10.0.0.1 -o enp0s3 -j MASQUERADE</p><p><strong>Step 13:</strong> Add route on the attacker device.<br># route add -net target_pc_ip_rang/subnet gw target_pc_ip</p><p><strong><em>You have successfully</em></strong><em> created a VPN tunnel using SSH. You can now access the target PC securely and perform various activities like accessing restricted content or bypassing firewalls.</em></p><p><strong>2. SSH tunneling:-</strong> In SSH tunneling, a user connects to a remote server using the SSH protocol and creates a tunnel between their local machine and the remote server. This tunnel allows data to be transmitted securely between the two machines and can be used to bypass network restrictions or provide secure access to resources on a remote network.</p><p><strong>There are three types of SSH tunneling:-</strong></p><blockquote><strong><em>1. Local Port Forwarding:-</em></strong><em> This type of SSH tunneling allows a user to forward traffic from a local port on their machine to a port on a remote machine, through an SSH connection.</em></blockquote><blockquote>Note:- Where the ssh server can be accessed then we can use local port forwarding tunnelling.</blockquote><blockquote><strong>To create a Local Port Forwarding tunnel using ssh, you need to use the following command:</strong></blockquote><blockquote>ssh -N -L [bind_Port]:[target_ip/localhost]:[target_machine_port_number] username@ip</blockquote><blockquote><strong><em>Let’s break down the command:</em></strong></blockquote><blockquote><strong><em>ssh:</em></strong><em> </em>This is the command used to start the SSH connection.</blockquote><blockquote><strong><em>-N:</em></strong><em> </em>Specifies that no remote command will be executed.</blockquote><blockquote><strong><em>-L:</em></strong><em> </em>This option specifies that we want to create a Local Port Forwarding tunnel.</blockquote><blockquote><strong><em>[bind Port number]:</em></strong><em> </em>This is the local port number that we want to forward traffic from. You can choose any unused port number.</blockquote><blockquote><strong><em>[target_ip/localhost]:</em></strong><em> </em>This is the address that the local port should be bound to. In this case, we are binding it to the loopback address, which means that the port can only be accessed from the local machine.</blockquote><blockquote><strong><em>[target_port_number]:</em></strong><em> </em>This is the port number on the remote machine to that we want to forward traffic.</blockquote><blockquote><strong><em>username@ip:</em></strong><em> </em>This is the username and IP address of the remote machine that we want to connect to.</blockquote><blockquote><strong><em>For example,</em></strong><em> if you want to access a web server running on port 80 on a remote server with IP address 10.0.0.100, and you want to forward this traffic to a local port 8080 on your own machine, you can use the following command:</em></blockquote><blockquote>ssh -N -L 8080:10.0.0.100:80 username@10.0.0.100</blockquote><blockquote>Here, the -N option tells SSH not to execute a remote command, and the -L option specifies that we want to create a Local Port Forwarding tunnel. The 8080 port on the client machine will now forward traffic to the 10.0.0.100 server on port 80. Once the tunnel is established, you can open a web browser and navigate to <a href="http://localhost:8080/">http://localhost:8080</a> to access the web server running on the remote machine.</blockquote><blockquote><strong><em>2. Remote Port Forwarding:-</em></strong><em> This type of SSH tunneling allows a user to forward traffic from a remote port on a remote machine to a port on their local machine, through an encrypted SSH connection. Remote port forwarding is useful when a user wants to access resources on their local machine that are only accessible from the remote machine, such as a web server.</em></blockquote><blockquote>Note:- Where ssh client can be accessed then we can use remote port forwarding tunneling.</blockquote><blockquote><strong>To create a Remote Port Forwarding tunnel using ssh, you need to use the following command:</strong></blockquote><blockquote>ssh -N -R [bind_Port]:[localhost]:[target_machine_port_number] [attacker_username@attacker_pc_ip]</blockquote><blockquote><strong><em>Let’s break down the command:</em></strong></blockquote><blockquote><strong><em>ssh:</em></strong><em> </em>This is the command used to start the SSH connection.</blockquote><blockquote><strong><em>-N: </em></strong>Specifies that no remote command will be executed.</blockquote><blockquote><strong><em>-R: </em></strong>Specifies that we want to create a Remote Port Forwarding tunnel.</blockquote><blockquote><strong><em>[bind_Port]: </em></strong>This is the port number on the Remote Server PC that we want to bind the tunnel too.</blockquote><blockquote><strong><em>[localhost]: </em></strong>This is the address that the remote port should be bound to. Since we are binding it to the loopback address, it means that the port can only be accessed from the Remote Server PC.</blockquote><blockquote><strong><em>[target_machine_port_number]: </em></strong>This is the port number on the Target PC that we want to forward traffic to.</blockquote><blockquote><strong><em>[attacker_username@attacker_ip]: </em></strong>This is the username and IP address of the Attacker&#39;s PC.</blockquote><blockquote><strong><em>3. Dynamic Port Forwarding:-</em></strong><em> This type of SSH tunneling allows a user to create a dynamic SOCKS proxy on their local machine, which can be used to forward traffic through an encrypted SSH connection to any destination. Dynamic port forwarding is useful when a user wants to access resources on multiple remote machines through a single SSH connection.</em></blockquote><p><strong>3. HTTP tunneling:-</strong> HTTP tunneling is a technique used to bypass network restrictions and firewalls by encapsulating network traffic within HTTP packets. This allows the traffic to be sent over a different network protocol, such as Secure Shell (SSH), which may be allowed to pass through the firewall. The technique involves wrapping, or “tunneling,” the network traffic within HTTP packets, allowing it to bypass network restrictions and reach its destination. HTTP tunneling is also known as HTTP encapsulation and it can be used for various purposes, such as providing secure remote access to a private network or accessing resources on a different network.</p><p><strong>Create HTTP tunneling Using </strong><a href="https://github.com/jpillora/chisel"><strong>chisel</strong></a><strong>.</strong></p><p><strong>Step 1: </strong>Install Chisel The first step is to install Chisel on both the target and attacker machines. Chisel can be installed using the following command:</p><p># apt install chisel</p><p><strong>Step 2:</strong> We need to create a Chisel server on our attacker PC. This can be done using the following command:</p><p># chisel server -p 21-reverse</p><ul><li>The server the subcommand is used to create a Chisel server.</li><li>The -p an option is used to specify the port number on which the server will listen. In this case, we are using port 21.</li><li>The -reverse an option is used to indicate that the server should initiate connections to clients that connect to it.</li></ul><p><strong>Step 3:</strong> We need to create a Chisel client on the target machine. This can be done using the following command:</p><p>chisel client Attacker_IP:21 R:80:127.0.0.1:8080</p><ul><li>The client the subcommand is used to create a Chisel client.</li><li>The IP address of the attacker machine is specified in place of Attacker_IP.</li><li>The R an option is used to specify a remote port forwarding rule. In this case, we are forwarding traffic from the local port 8080 to the remote server&#39;s port 80 via the Chisel tunnel.</li></ul><p><em>If you want to test tunneling work Call your IP/localhost in the web Browser.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c30ff80e209" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide To Passive Reconnaissance Techniques And Tools.]]></title>
            <link>https://medium.com/@riteshs4hu/a-beginners-guide-to-passive-reconnaissance-techniques-and-tools-b08502ba93?source=rss-ffa740d80d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/b08502ba93</guid>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[passive-reconnaissance]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Ritesh Sahu]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 17:44:37 GMT</pubDate>
            <atom:updated>2023-04-03T05:47:23.698Z</atom:updated>
            <content:encoded><![CDATA[<h4>Passive Reconnaissance…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*tDpFU6fl2RV9PeE2kmtcVg.png" /></figure><p>Passive <a href="https://github.com/InfoSecWarrior/Offensive-Recon/tree/main">Reconnaissance</a> is a type of information-gathering technique used in computer security to gather information about a target system or network without directly engaging with it.</p><p><strong>It involves collecting data from publicly available sources such as:-</strong></p><h4><strong>1. Visit the target website for the manual.</strong></h4><p><em>Employee information</em></p><ul><li>Names</li><li>Job titles</li><li>Responsibilities</li></ul><p><em>Contact information</em></p><ul><li>Physical addresses</li><li>Email Address</li><li>Phone numbers</li></ul><h4><strong>2. To find how search engines crawl a website, webmasters can use both the </strong><a href="https://github.com/InfoSecWarrior/Offensive-Recon/blob/main/Sitemap.md#sitemap"><strong>robots.txt </strong></a><strong>and sitemap files.</strong></h4><p><strong>Sitemaps </strong>and<strong> robots.txt</strong> files are essential tools to aid ethical hackers and pen-testers during reconnaissance. A sitemap provides information to search engine crawlers about the website’s structure and content, while the robots.txt file instructs web crawlers on which parts of the website they can and cannot access. By using these files, ethical hackers and pen-testers can gather valuable information about a website’s structure, identify hidden pages and directories, and find potential vulnerabilities that can be exploited.</p><p><em>There are several websites and tools available to generate sitemaps for a website.</em></p><ul><li><a href="https://www.mysitemapgenerator.com/"><em>My sitemap generator.</em></a></li><li><a href="https://www.xml-sitemaps.com/"><em>XML Sitemaps Generator.</em></a></li><li><a href="https://www.screamingfrog.co.uk/seo-spider/"><em>Screaming frog</em></a></li></ul><h4><strong>3.</strong> <strong>Source code</strong></h4><p>By examining the source code of a website or application, a reconnaissance expert can gain insights into how the system is built, what languages and frameworks are used, and how it functions. This information can help them identify potential vulnerabilities and weaknesses in the system’s design. An attacker who has access to the source code can also identify potential backdoors or hidden functionality that may be exploitable. By analyzing the code, they can understand how the system processes and stores data, which can help them identify potential attack vectors.</p><h4><strong>4. Websites Archive</strong></h4><p>website’s archive can provide valuable insights into the website’s history, development, and content. It can also be useful for recovering lost information or verifying information that was previously available on the website.</p><p><em>Here are a few reasons why someone might want to look at a target’s website Archive:</em></p><ol><li><strong>External resources:</strong> Examining a website’s history can reveal information about its external resources. For example, if a website is used to link to a suspicious domain or IP address, this may indicate that the website has been compromised or is part of a larger network of malicious sites.</li><li><strong>Website structure:</strong> Understanding a website’s history can also provide insight into its structure.</li><li><strong>Website functionality:</strong> Examining a website’s history can also help in identifying changes to its functionality.</li><li><strong>Website traffic: </strong>Understanding a website’s history can also help in identifying changes in traffic. For instance, if a website’s traffic has steadily declined over time, this could indicate that it is losing relevance or that its audience is shifting.</li><li><strong>Website reputation:</strong> Examining a website’s history can also help in identifying its reputation.</li></ol><p><em>Some Of The Websites To Find Websites Archive.</em></p><ul><li><a href="https://web.archive.org/">The Wayback Machine.</a></li><li><a href="https://archive.ph/">Archive Today.</a></li><li><a href="https://archive-it.org/">Archive IT.</a></li><li><a href="https://github.com/Mr-Secure-Code/Offensive-Recon/blob/main/webarchives.loc.gov">Librarian</a></li></ul><h4><strong>5. Identifying the technology</strong></h4><p>When conducting website reconnaissance, identifying the technology stack used to build a website can be an important part of the process.</p><p><em>Here are some reasons why:</em></p><ol><li>Vulnerability identification: Different technologies have different vulnerabilities, and knowing which technology a website is built on can help you identify potential vulnerabilities and exploit them.</li><li>Understanding website functionality: Different technologies are used for different purposes, and knowing the technology used to build a website can give you insight into its functionality.</li><li>Forensic investigation: If you’re investigating a website-related incident, knowing the technology stack used can help you understand how the website was compromised and what data may have been compromised.</li><li>Competitive intelligence: Knowing the technology stack used by your competitors can help you understand their strengths and weaknesses and make more informed decisions about your own technology choices.</li></ol><p><em>Some Of The Websites To Identify the Websites technology</em></p><p><a href="https://builtwith.com/">1.BuiltWith.</a></p><p><a href="https://www.wappalyzer.com/">2. Wappalyzer.</a></p><p><a href="https://www.whatruns.com/">3. WhatRuns.</a></p><h4><strong>6. Whois Lookup</strong></h4><ol><li><strong>WHOIS: </strong>A standard WHOIS lookup provides information about a domain name’s registration details, including the domain name owner, registrar, registration and expiration dates, and contact information. This can be useful for verifying domain ownership, identifying the hosting provider, or conducting research on a particular domain name.</li><li><strong>Reverse WHOIS:</strong> A reverse WHOIS lookup allows you to search for domain names based on specific search criteria, such as the name or email address of the domain name owner. This can be useful for finding related domain names owned by the same entity, identifying potential competitors or partners, or investigating potential cyber threats.</li><li><strong>WHOIS history:</strong> WHOIS history provides information about changes made to a domain name’s registration details over time. This can include changes to the domain name owner, registrar, name servers, or other technical details. WHOIS history can be useful for understanding the history of a particular domain name, identifying potential red flags or security risks, or investigating changes made to a domain name registration.</li></ol><h4><strong>7. IP Addresses</strong></h4><p>An IP address is a unique identifier assigned to every device that connects to the internet. It allows devices to communicate with each other and access online resources. In this post, we’ll explore various tools and resources for working with IP addresses, including how to find domain names from IP addresses, track IP address history, and determine a device’s location.</p><p><strong>Finding Domain Names from IP Addresses</strong></p><p>Sometimes you might have an IP address and need to determine the associated domain name. There are several tools available for this, including:</p><p><a href="https://securitytrails.com/">1. Securitytrails</a></p><p><a href="https://centralops.net/co/DomainDossier.aspx">2. Central OPS</a></p><p>You can also use command-line tools like <a href="https://github.com/Mr-Secure-Code/Linux_Servers/blob/main/Red%20HAT/DNS/DNS%20Client.md#dig">dig</a>, <a href="https://github.com/Mr-Secure-Code/Linux_Servers/blob/main/Red%20HAT/DNS/DNS%20Client.md#host">host.</a>, and <a href="https://github.com/Mr-Secure-Code/Linux_Servers/blob/main/Red%20HAT/DNS/DNS%20Client.md#nslookup">nslookup.</a> to query DNS records for a domain name and retrieve its associated IP address.</p><p><strong>Tracking IP Address History.</strong></p><p>Knowing the history of an IP address can help investigate potential security threats or suspicious activity. Some tools for tracking IP address history include:</p><p><a href="https://viewdns.info/iphistory/">1. ViewDNS</a></p><p><a href="https://securitytrails.com/domain">2. Securitytrails</a></p><p><strong>Determining IP Address Location</strong></p><p>You can also determine the geographical location of an IP address using various IP geolocation tools. Some popular options include:</p><p><a href="https://www.shodan.io/">1. Shodan</a></p><p><a href="https://www.iplocation.net/">2. IP location</a></p><p><a href="https://www.ip2location.com/">3. IP2location</a></p><p><a href="https://ipinfo.io/">4. IPinfo.</a></p><p><a href="https://www.ipvoid.com/">5. IPvoid</a></p><p><a href="https://ipregistry.co/">6. IPregistry</a></p><p><a href="https://check-host.net/">7. Check-host</a></p><p><strong>Tracing the Route of an IP Address.</strong></p><p>You can trace the route that an IP address takes from its source to its destination using a traceroute tool. Some popular traceroute tools include:</p><p><a href="https://www.broadbandsearch.net/trace">1. Network-Tools</a></p><p><a href="https://www.ip2location.com/free/traceroute">2. IP2location</a></p><p><a href="https://centralops.net/co/DomainDossier.aspx">3. Central OPS</a></p><p><a href="https://dnschecker.org/online-traceroute.php">4. DNS-Checker</a></p><h4>8. Google Hacking.</h4><p>Google hacking, also known as Google Dorking, is a technique used in reconnaissance to discover vulnerable websites or web-based applications by using advanced Google search operators. The importance of Google hacking in reconnaissance lies in its ability to uncover information that is not typically visible through standard web searches.</p><p><em>Here are some reasons why Google hacking can be an important tool in reconnaissance:</em></p><ol><li><strong>Discovering vulnerable websites</strong>: By using advanced Google search operators, it is possible to uncover websites that may be vulnerable to hacking, such as those with exposed directories, sensitive files, or outdated software. This can help security researchers and penetration testers identify potential attack vectors and take action to mitigate them.</li><li><strong>Finding sensitive information: </strong>Google hacking can also be used to uncover sensitive information that may not be intended for public views, such as passwords, usernames, email addresses, or confidential documents. This information can be used to conduct targeted attacks or gain unauthorized access to sensitive systems.</li></ol><h4>9. Shodan.</h4><p><a href="https://www.shodan.io/">Shodan</a> is a search engine for internet-connected devices. It allows users to search for specific types of devices (e.g., webcams, routers, servers, etc.) and provides information about the devices that are publicly accessible on the internet. Shodan uses various scanning techniques to gather information about devices, including open ports, banner information, and other metadata.</p><h4>10. GitHub.</h4><p><a href="https://www.github.com/">GitHub</a> is a web-based platform for version control and collaboration that provides hosting for software development projects. It allows users to store and manage their source code, collaborate with others, track issues and bugs, and deploy their applications.</p><ul><li><strong>Discovery of sensitive information: </strong>By conducting Git recon, attackers or researchers may discover sensitive information, such as usernames, passwords, API keys, access tokens, or other confidential data that is inadvertently exposed in Git repositories.</li><li><strong>Reconnaissance of the target’s infrastructure:</strong> By analyzing the target’s Git repositories, researchers or attackers can gain insights into the target’s infrastructure, including the tools and technologies used, the development workflow, the team structure, and potential attack surfaces.</li><li><strong>Social engineering: </strong>Git recon can also be used for social engineering attacks by analyzing the target’s code commits, issues, pull requests, and other public interactions, and crafting convincing phishing emails or messages to deceive the target into revealing sensitive information or granting access.</li></ul><h4>11. OSINT Framework.</h4><p><a href="https://osintframework.com/">OSINT</a> stands for Open-Source Intelligence, which refers to the collection, analysis, and dissemination of information from publicly available sources. These sources can include online and offline sources, such as social media platforms, blogs, news articles, public records, government reports, and other publicly available sources of information.</p><h4>12. IP logger.</h4><p>Using an IP logger in reconnaissance can help identify the IP address and location of a target individual or organization. An IP logger is a tool that generates a unique link or code that, when clicked or accessed, captures the IP address and other metadata of the device used to access it.</p><ol><li><strong>Attribution: </strong>An IP logger can help attribute a specific action or behaviour to a particular individual or organization by capturing their IP address. This can be useful for investigating cyber crimes, identifying potential insider threats, or monitoring the activity of competitors.</li><li><strong>Geolocation:</strong> By capturing the IP address of a target, an IP logger can help identify the location of the device or network used to access it. This information can be useful for identifying potential attack vectors, assessing the risks of a target, or geolocating targets for intelligence or investigative purposes.</li></ol><h4><strong>13. Email Tracking OR Spoofing.</strong></h4><p><strong>Email tracking </strong>can be used in reconnaissance to gather information about the target, such as their <strong><em>IP address, geolocation,</em></strong> and <strong><em>device information.</em></strong> This information can be useful in determining the target’s location, the type of device they are using, and their online activity. Additionally, email tracking can help the attacker determine whether the target has opened or clicked on the email, providing insight into their level of interest or engagement with the content. This information can be used to tailor future attacks or to craft more convincing social engineering attempts.</p><p><strong>E-mail spoofing </strong>can be used to gather sensitive information, steal credentials, or deploy malware on a victim’s device. It is important to be vigilant and cautious when receiving emails, especially if they contain links or attachments, and to verify the authenticity of the sender before taking any action.</p><p><em>Some of the possible information that can be gathered through email spoofing include:</em></p><ul><li><strong>Name of the sender: </strong>The sender’s name can be faked to appear as if the message is coming from a legitimate source.</li><li><strong>Email address: </strong>The email address can be spoofed to look like it is coming from a trusted domain or organization.</li><li><strong>Subject line: </strong>The subject line can be crafted to make the email seem urgent or important, and to encourage the recipient to take action.</li><li><strong>Content: </strong>The content of the email can be written in a way that is convincing and uses social engineering tactics to manipulate the recipient into doing what the attacker wants.</li><li><strong>Attachments:</strong> The email may contain attachments that contain malware or phishing links that are designed to trick the recipient into revealing sensitive information.</li></ul><h4><strong>14. Technical Support Forums</strong></h4><p>Technical support forums are online communities where users can ask questions and receive assistance with technical issues related to software, hardware, or other IT-related topics.</p><p><em>The types of information that can be gathered from these forums may include:</em></p><ul><li><strong>Technical issues:</strong> Users may post questions about technical issues they are experiencing with their hardware, software, or other technical products.</li><li><strong>Error messages: </strong>Users may share error messages they have encountered and ask for help in resolving the issue.</li><li><strong>Troubleshooting tips:</strong> Users may share their tips or solutions to common technical problems.</li><li><strong>Technical documentation:</strong> Users may share technical documentation or manuals for various products, which can help others understand how to use them.</li><li><strong>Software updates:</strong> Users may share information about software updates, including new features, bug fixes, and improvements.</li></ul><p><em>Some Of The Websites.</em></p><ul><li><a href="https://stackoverflow.com/">Stackoverflow</a></li><li><a href="https://www.quora.com/">quora</a></li><li><a href="https://www.glassdoor.co.in/">glassdoor</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b08502ba93" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>