<?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 Pratik Sakariya on Medium]]></title>
        <description><![CDATA[Stories by Pratik Sakariya on Medium]]></description>
        <link>https://medium.com/@pratiksakariya19?source=rss-4ff5ad72894a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7pd2-g2O2Ra67vPs</url>
            <title>Stories by Pratik Sakariya on Medium</title>
            <link>https://medium.com/@pratiksakariya19?source=rss-4ff5ad72894a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:38:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pratiksakariya19/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[Footprinting HTB Hard Level Lab]]></title>
            <link>https://pratiksakariya19.medium.com/footprinting-htb-hard-level-lab-45189d4e9d7c?source=rss-4ff5ad72894a------2</link>
            <guid isPermaLink="false">https://medium.com/p/45189d4e9d7c</guid>
            <dc:creator><![CDATA[Pratik Sakariya]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 14:15:30 GMT</pubDate>
            <atom:updated>2025-01-22T14:15:30.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*XdbRyM1CehnsXGiyKekUNw.jpeg" /></figure><p>Footprinting is a crucial first step in penetration testing and ethical hacking, enabling security professionals to gather information about a target system. This guide outlines a step-by-step process to perform footprinting and network analysis using tools like ping, nmap, and openssl. Each step includes detailed commands and their purposes.</p><h3>Step 1: Setup and Initial Commands</h3><ol><li><strong>Start your machine and identify the target IP address. </strong>Open a terminal.</li><li><strong>Create directories for organized work:-</strong></li></ol><pre>mkdir footprinting<br>cd footprinting<br>mkdir hard<br>cd hard</pre><p><strong>3. Verify connectivity with the target system:</strong></p><pre>ping &lt;ip address</pre><h3>Step 2: Nmap Scanning</h3><ol><li>Navigate to the working directory:</li></ol><pre>cd footprinting/hard/</pre><p>2. Run a basic Nmap scan and save results:</p><pre>nmap &lt;ip address&gt; -F &gt; nmap.txt<br>cat nmap.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*pp19xHMIIQZKxWlMNqXzxA.png" /></figure><p>The -F flag performs a fast scan to identify open ports. Results are saved to nmap.txt for review.</p><p>3. Explore Nmap’s script directory:</p><pre>cd /usr/share/nmap/scripts/<br>ls -l | grep snmp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*C-0qT9HFQrOIsPMO4BmDSQ.png" /></figure><p>This lists SNMP-related scripts, useful for discovering vulnerabilities in SNMP services.</p><p>4. Perform an advanced Nmap scan:</p><pre>sudo nmap &lt;ip address&gt; -sC -p161 -Pn -sU</pre><ul><li>-sC: Uses default scripts.</li><li>-p161: Targets SNMP port.</li><li>-Pn: Skips host discovery.</li><li>-sU: Performs a UDP scan.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*-zv65JU-90838cnAh6JqVA.png" /></figure><h3>Step 3: SSL Analysis with OpenSSL</h3><ol><li>Inspect SSL/TLS certificates on the target:</li></ol><pre>openssl s_client -connect &lt;ip address&gt;:imaps</pre><p>This command connects to the IMAPS service on the target, retrieving SSL certificate details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*GkFr1H0cAETPIDzf99vbag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*DB1os0jSncWJLUqE-tH5OA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*sZvctBmb3n4uAUHOUH1rqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*bmKaxT4iDEnRjzs8Y_gLDw.png" /></figure><h3>Step 4: SSH Access</h3><p>1.<strong>Copy the OpenSSH private key:</strong></p><ul><li>Use the provided private key to create an authentication file:</li></ul><pre>nano id_rsa<br>Paste the private key and save the file.</pre><p>2. Set appropriate permissions:</p><pre>chmod 600 id_rsa</pre><p>3. Connect to the target via SSH:</p><pre>ssh -i id_rsa tom@&lt;ip address&gt;<br>This establishes a secure connection to the target machine.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*mETw7jACPVixBLgklm3niQ.png" /></figure><h3>Step 5: MySQL Database Exploration</h3><ol><li>Access the MySQL database:</li></ol><pre>mysql -u tom -p<br>Enter the username and password when prompted.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*98MK03qWzos_x3YwL74Jkg.png" /></figure><p>2. List available databases:</p><pre>show databases;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*5FwHqZVGidsPui9AJG-mdw.png" /></figure><p>3. Use a specific database:</p><pre>use users;</pre><p>4. Query user information:</p><pre>select * from users;<br>This retrieves and displays user data from the selected database.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*5VUpzE4_yxUzzZHbYBjC7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*qU7f1eTcsOgNax0cDv9wlQ.png" /></figure><h3>Conclusion</h3><p>This guide provides a foundational approach to footprinting and network analysis. Each step helps uncover potential vulnerabilities and equips security professionals with actionable intelligence. Ensure ethical practices and authorized access when performing these activities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45189d4e9d7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Used To Elastic SIEM Home Lab]]></title>
            <link>https://pratiksakariya19.medium.com/a-simple-used-to-elastic-siem-home-lab-f6e247abf7b9?source=rss-4ff5ad72894a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6e247abf7b9</guid>
            <dc:creator><![CDATA[Pratik Sakariya]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 14:35:14 GMT</pubDate>
            <atom:updated>2024-07-16T18:20:39.013Z</atom:updated>
            <content:encoded><![CDATA[<p>Using the Elastic web Portal amd a kali Linux virtual machine, i’ll walk you through the process of setting up home lab for Elastic Stack Security Information and Event Management (SIEM) in this guide. Additionally, you will discover how to create security events within the kali virtual machine, configure an agent to send information to the SIEM and query and examine the SIEM logs. This is an excellent project to highlight on your CV and bring up during interviews.</p><h3><strong>Prerequisites</strong></h3><p>Before we Get started, make you have the following:</p><ol><li>VirtualBox or VMware</li><li>Basic knowledge of Linux and virtualization software</li></ol><h3><strong>Overview of the tasks</strong></h3><ol><li>Set up a free Elastic Account or 7th day extends once more chances.</li><li>Install the kali VM</li><li>Set up the Linux virtual machine’s Elastic Agent to gather logs and send them to the SIEM. <br>On the Kali virtual machine, create security events.<br>To locate security events in the Elastic SIEM, run a query.</li><li>In order to visualize security occurrences, create a dashboard. <br>For security events, create notifications.</li></ol><p>Please be aware that the Elastic web console’s layout and appearance are subject to change with updates. Though they may need to be changed for newer versions of the Elastic web console, the instructions given here are correct as of the day they were created. Please let me know in the comments if you see any inconsistencies or modifications to the online console that impact the accuracy of these instructions so that I can make the necessary updates.</p><h3><strong>Task 1: Set up an Elastic Account</strong></h3><p>In order to build up a cloud Elastic instance on which we can run the SIEM, we must first create a free account. Take these actions to accomplish that:</p><ol><li>Sign up for a free trial to use Elastic Cloud at <a href="https://cloud.elastic.co/registration">https://cloud.elastic.co/registration</a></li><li>Once you have an Elastic account, log in the to the Elastic Cloud console at <a href="https://cloud.elastic.co/login">https://cloud.elastic.co/login</a></li><li>Click on “Start your free Trial.</li><li>Click on the “Create Deployment” button and select “Elasticsearch” as the deployment type.</li><li>Choose a region and deployment size that fits your needs and click on “Create Deployment.”</li><li>wait for the configuration to complete.</li><li>once the deployment is ready, click “continue.”</li></ol><h3><strong>Task 2: Setting up the Linux VM</strong></h3><p>The Linux VM has to be configured next. I’ll be using Kali Linux and Oracle VirtualBox, but you may use any Linux operating system and virtualization program for this.</p><h4>To set it up, follow these steps:</h4><ol><li>download the kali Linux VM Form the official kali Website at <a href="https://www.kali.org/get-kali/#kali-virtual-machines">https://www.kali.org/get-kali/#kali-virtual-machines</a></li><li>Open your favorite virtualization program, like VMware or VirtualBox, and create a new virtual machine (VM) using the Kali VM file.</li><li>Launch the virtual machine and adhere to the on-screen instructions to install Kali.</li><li>After the installation is finished, enter the username and password for the Kali virtual machine, “kali,” and log in.</li></ol><p><strong>Note:</strong> You can look at something similar on YouTube under the topic “How to create a virtual machine using VirtualBox/VMware with a Kali VM file” if you run into any problems with this specific task.</p><h4>Task 3: Setting up the Agent to collect Logs</h4><p>An agent is a piece of software that is put on a server or other type of device in order to gather and transmit data to a centralized system for monitoring and analysis. Security-related events from your endpoints are gathered and sent to your Elastic SIEM instance through the usage of an agent.</p><p><strong>Follow these steps to configure the agent to gather logs from your Kali virtual machine and forward them to your Elastic SIEM instance:</strong></p><ol><li>Log in to your Elastic SIEM instance and navigate to the Integrations page by: clicking on the Kibana main menu bar at the top left, then selecting “Integrations” at the bottom.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osl6J6I_wU7iTAlITd5Omg.png" /></figure><p>2. Search for “Elastic Defend” and click on it to open the integration page.</p><p>3. Click on “Install Elastic Defend” and follow the instructions provided on the integration page to install the agent on your Kali VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*zenjgzSqgX1okTtz2J-owQ.png" /></figure><p>4. Paste that command into the Kali terminal (command line).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNyRuaIEWiTpe7cmn3VRqA.png" /></figure><p>5. A notice stating that the “Elastic Agent has been successfully installed” will appear when the agent has been installed, which may take a few minutes. It may take a few minutes for the logs to show up in the SIEM, but it will begin automatically gathering and transmitting data to your Elastic SIEM server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-NATTeR-QwarR1Wpl3k8Q.png" /></figure><p>Use this command to make sure the agent has been installed correctly: sudo systemctl elastic-agent.service status</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWLqBY2aWHv9I99anBzkig.png" /></figure><p>If you get an error installing the agent, make sure that your Kali is connected to the internet before proceeding by pinging google.com.</p><h4>Task 4: Generating Security Events on the Kali VM</h4><p>You can create some security-related events on your Kali virtual machine (VM) to confirm that the agent is operating as intended. We can use a tool like Nmap to accomplish this. A free and open-source tool for network administration, exploration, and security auditing is called Nmap (Network Mapper). Its purpose is to identify hosts and services on a computer network, generating a network “map” in the process. Nmap may be used to find out what operating system and software are installed on a target system, check hosts for open ports, and obtain further network information.</p><p><strong>To run an Nmap scan, follow these steps:</strong></p><ol><li>Set up Nmap in the virtual Linux machine. Nmap is preloaded in Kali, if you’re not using it. To install it, open a new Terminal and type the following command: sudo install nmap from apt-get.</li><li>Use the following command to do a scan on a Kali machine: sudo nmap . If you set up your Kali virtual machine over a “bridged” network, you can also do a scan on your host computer.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*kVg8_0w4jZgddVwMCt1uMA.png" /></figure><p>3. Several security events are produced by this scan, including the identification of services that are utilizing open ports and the discovery of such ports. Do several additional Nmap scans, using the commands “nmap -sS ,” “nmap -sT ,” “nmap -p- ,” and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRt_72R9q95EMZIkWWmVxg.png" /></figure><h4>Task 5: Querying for Security Events in Elastic SIEM</h4><ol><li>We can now begin searching through and examining the SIEM’s logs after moving data from the Kali VM.</li></ol><p><strong>To do this, follow these steps:</strong></p><ol><li>To see the logs from the Kali virtual machine, within your Elastic Deployment, click the three horizontal line menu icon in the top-left corner and select the “Logs” option under “Observability.”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXyUuFhdoXEnptntPY5qTQ.png" /></figure><p>2. To filter the logs, type a search term into the search bar. For instance, use the following query to find all logs pertaining to Nmap scans: event.action: “nmap_scan” or process.args: “sudo”.</p><p>3. Click on the “Search” button to execute the search query.But please note that it can sometimes take a while for the events to populate and show up on the SIEM, so this query might not work right away.</p><p>4. The results of the search query will be displayed in the table below. You can click on the three dots next to each event to view more details.</p><p>By generating and analyzing different types of security events in Elastic SIEM like the one above, or generating authentication failures by typing in the wrong password for a user or attempting SSH logins an incorrect password, you can gain a better understanding of how security incidents are detected, investigated, and responded to in real-world environments.</p><h4><strong>Task 6: Create a Dashboard to Visualize the Events</strong></h4><p>The SIEM app’s dashboards and visualizations can be used to examine logs and spot trends or abnormalities in the data. You could, for instance, make a straightforward dashboard that tracks the number of security events over time.</p><p>Here’s how you can do that:</p><ol><li>Navigate to the Elastic web portal at <a href="https://cloud.elastic.co/">https://cloud.elastic.co/.</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hx7TX1BEgoo3YYmqVJcZ1A.png" /></figure><p>3. Click on the Create dashboard” button on the top right to create a new dashboard.</p><p>4. Click on the “Create Visualization” button to add a new visualization to the dashboard.</p><p>5. Select “Area” or “Line” as the visualization type, depending on your preference. this will create a chart that shows the count of events over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljUptCjI5MifEBUCgsvNVA.png" /></figure><p>7. Click on the “Save” button to save the visualization and then complete the rest of the settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpt7X1mSgHtKLM2ClgAmmg.png" /></figure><p>Task 7 : Create an Alert</p><p>Alerts are an essential component of a SIEM that help identify security events and quickly address them. Alerts can be set up to perform particular actions when predetermined criteria are fulfilled, and they can be generated using established rules or bespoke queries. We will go through the process of setting up an alert in the Elastic SIEM instance to find Nmap scans in this task. These instructions will help you set up an alert that will scan your logs for Nmap scan events and alert you when they are found.</p><p><strong>Here are the Steps:</strong></p><ol><li>Click on the menu icon on the top-left, then under “Security,” click on “Alerts.”</li><li>Click on “Manage rules” at the top right.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*QuFtGfctEHQfu32cTNTkiw.png" /></figure><p>3. Click on the “Create new rule” button at the top right.</p><p>4. Under the “Define rule” section, select the “Custom query” option from the dropdown menu.</p><p>5. Under “Custom query,” set the conditions for the rule. You can use the following query to detect Nmap scan events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*jw3Ka_ByWW9M0ytbueKERQ.png" /></figure><p>This query will match all events with the action “nmap_scan.” Then click “Continue.”</p><p>6. Under the “About rule” section, give your rule a name and a description (Nmap Scan Detection).</p><p>7. Set the severity level for the alert, which can help you prioritize alerts based on their importance. Keep all the other default settings under “Schedule rule” and click “Continue.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1CxZdR3sbu6rkGbqttW6JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*nARuymDwQ62n8ck-09-jCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*-1_-EI4JDE8DLlbYcHXvLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*75HB4UkhkrE4U48SZF6JOA.png" /></figure><p>8. In the “Actions” section, select the action you want to take when the rule is triggered. You can choose to send an email notification, create a Slack message, or trigger a custom webhook.</p><p>9. Finally, click the “Create and enable rule” button to create the alert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*d7m3GGUZZvVe6wEhMB3lzQ.png" /></figure><p>The alert will keep an eye out for Nmap scan events in your logs after you’ve generated it. The alarm will sound and the chosen action will be carried out if a Nmap scan event is found. Under “Security,” go to the “Alerts” section to view and manage your notifications.</p><h4><strong>Conclusion</strong></h4><p>Elastic SIEM and a Kali virtual machine have been used to build up a home lab in this guide. We used the Elastic Beats agent to transfer data from the Kali virtual machine to the SIEM Nmap was used to generate security events on the Kali VM; and the Elastic web interface was used to query and analyze the logs in the SIEM. In order to detect security incidents, we also designed an alert and a dashboard to visualize security occurrences.</p><p>using the help of this home lab, you can acquire and hone the skills required for efficient security monitoring and incident response using Elastic SIEM. By following these steps, you can enhance your security monitoring abilities and obtain practical experience with utilizing a SIEM, which will help you become a great security analyst or engineer.</p><p>Thank you for taking the time to read this blog post. I hope you found it informative and gained some valuable insights that you can apply to your own projects. To learn more, check out Elastic’s YouTube channel to find tutorials on how to use their SIEM. Until next time, take care!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6e247abf7b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Port Scanner Using Python library Socket]]></title>
            <link>https://pratiksakariya19.medium.com/port-scanner-using-python-library-socket-2c1144eda975?source=rss-4ff5ad72894a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c1144eda975</guid>
            <dc:creator><![CDATA[Pratik Sakariya]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 05:39:28 GMT</pubDate>
            <atom:updated>2024-04-05T05:39:28.334Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong><em>Introduction-</em></strong></blockquote><blockquote>A Port scanner is a crucial tool for network security professionals and enthusiasts. It allows you to discover open, closed pr filtered ports on a target system. In this tutorial, we’ll create basic port scanner using python library socket.</blockquote><blockquote><strong><em>Pre requirements</em></strong></blockquote><p>Before we live into the code , ensure you have python installed on your system. You can download it from the official python website <a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a> .</p><blockquote><strong><em>Code Implementing: -</em></strong></blockquote><p>Below is the Port Scanner Using Python library Socket :</p><ol><li>Import the Socket Library :</li></ol><pre>import socket</pre><p>2. Define and user input and initiate scanning the port scanner Function:</p><pre>import scoket<br>s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br><br>host = input(&quot;please enter the ip you want to scan: &quot;)<br>port = int(input(&quot;please enter the you want to scan: &quot;))<br>s.settimeout(5)<br>def portScanner(port):<br>    if s.connect_ex(host, port)):<br>         print(&quot;the port is closed&quot;)<br>    else:<br>        print(&quot;the port is open&quot;)<br>portScanner(port)</pre><blockquote><strong><em>3. Explanation: -</em></strong></blockquote><ul><li>We import scoket Library that takes the user input (IP address and port number</li><li>After check if and else condition check is port a open or close.</li><li>We print that the port is open or close give the output.</li><li>Finally, we user show the output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjP2mGM4qDAjJqGJmU6Y3A.png" /></figure><blockquote><strong><em>Usage: -</em></strong></blockquote><ol><li>Run the script in your terminal or any python IDE.</li><li>Enter the target host’s IP address.</li><li>Specify the stating and ending port numbers.</li><li>The script will scan the specified and few the display the results.</li></ol><blockquote><strong><em>Conclusion: -</em></strong></blockquote><p>This port scanner provides a foundation for more advanced network scanning tools. Remember to use is responsibly you and only on systems you have permission to scan.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c1144eda975" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>