<?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 Harsh Vanasiwala on Medium]]></title>
        <description><![CDATA[Stories by Harsh Vanasiwala on Medium]]></description>
        <link>https://medium.com/@harshvanasiwala18?source=rss-6a5517f92ce4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YplT7A0Y6KhRpvdDmuoJCQ.png</url>
            <title>Stories by Harsh Vanasiwala on Medium</title>
            <link>https://medium.com/@harshvanasiwala18?source=rss-6a5517f92ce4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:05:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshvanasiwala18/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[The Great AI Bamboozle: When Robots Learned to Lie (And How We’re Fighting Back)]]></title>
            <link>https://medium.com/@harshvanasiwala18/the-great-ai-bamboozle-when-robots-learned-to-lie-and-how-were-fighting-back-4ef185985bc5?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ef185985bc5</guid>
            <category><![CDATA[threat]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-cyber-security]]></category>
            <category><![CDATA[deepfakes]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 02:47:17 GMT</pubDate>
            <atom:updated>2024-11-21T02:47:17.615Z</atom:updated>
            <content:encoded><![CDATA[<p>Your granny unintentionally spreading minion memes was the largest tech issue at the time, do you recall? The good old days were over. These days, AI systems are capable of forging anything, from your ex’s face dancing in locations they have never visited to your boss’s voice asking for a “totally legitimate” wire transfer. And believe me, neither situation turns very well.</p><h3>The Numbers That’ll Make You Want to Live in a Cave</h3><pre>Year | Total Deepfakes | Detection Rate | Avg Cost per Attack<br>2019 | 14,678          | 70%           | $25,000<br>2020 | 45,040          | 75%           | $30,000<br>2021 | 145,227         | 82%           | $35,000<br>2022 | 279,022         | 88%           | $38,000<br>2023 | 400,000+        | 92%           | $42,000<br><br>Source: https://eftsure.com/statistics/deepfake-statistics/</pre><pre>Year | Total Losses ($B) | Complaints | Avg. Loss<br>2019 | 3.5               | 467,361    | $7,500<br>2020 | 4.2               | 791,790    | $5,300<br>2021 | 6.9               | 847,376    | $8,140<br>2022 | 10.3              | 800,944    | $12,860<br>2023 | 12.5              | 800,944    | $15,607<br><br>Source: https://www.aha.org/system/files/media/file/2024/03/fbi-internet-crime-report-2023.pdf</pre><h4>Top AI-Enabled Cyber Attacks of 2024:</h4><p>Verizon. (2024). “Data Breach Investigations Report.” <em>Verizon Enterprise Solutions</em>:</p><ol><li>The “I’m Totally Your CEO” Voice Scam</li><li>The “This Celebrity Definitely Endorsed This Crypto” Scheme</li><li>The “Your Face Is Now Selling Something Questionable in Kazakhstan” Campaign</li></ol><h3>Latest Defense Mechanisms:</h3><p>According to the National Institute of Standards and Technology (NIST):</p><p><strong>Zero-Trust Architecture:</strong></p><ul><li>Trust no one, not even yourself</li><li>Actually, especially not yourself</li><li>Your coffee maker? Definitely suspicious</li></ul><p><strong>Multi-Factor Authentication:</strong></p><ul><li>Something you know (password)</li><li>Something you have (phone)</li><li>Something you are (increasingly anxious)</li><li>Something you regret (that haircut from 2003)</li></ul><h3>The Statistical Reality Check</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*wk50AT1HafJbwiSoNhImsQ.png" /></figure><h3>Practical Tips for Staying Safe</h3><p><strong>Verify, Then Verify Again:</strong></p><ul><li><em>If your boss asks for gift cards at 3 AM, maybe double-check</em></li><li><em>When your “grandmother” suddenly speaks fluent Klingon, be suspicious</em></li><li><em>If an investment opportunity sounds too good to be true, it probably involves at least three different types of fraud</em></li></ul><p><strong>Update Your Security:</strong></p><ul><li><em>Strong passwords (No, “StrongPassword123!” isn’t better)</em></li><li><em>Biometric authentication</em></li><li><em>Perhaps a moat around your computer</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ef185985bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Web of Digital Tracking]]></title>
            <link>https://medium.com/@harshvanasiwala18/the-hidden-web-of-digital-tracking-d28f79f87c71?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d28f79f87c71</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[adsense]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 18:38:24 GMT</pubDate>
            <atom:updated>2024-11-07T18:38:24.293Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Story of Two Profiles and One Search</h3><p>You have two Google accounts open at your desk: sergeybrin@alphabet.com for personal use and laarypage@alphabet.com for work. “Whoop” is found by using the work profile. Unexpectedly, you discover that in addition to receiving pertinent YouTube suggestions on your work account, Whoop ads begin to surface on Instagram linked to your account, even on your mobile device.</p><p>How did this occur? Let’s explore the intriguing (and sometimes worrisome) realm of digital fingerprinting and cross-device tracking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MvukaKQyI4Y8yrInoEcXCA.png" /><figcaption>Digital Trail: How Your Online Activity Leads to Targeted Ads</figcaption></figure><h3>The Technical Deep Dive</h3><p><strong>Initial Search and Identity Association: </strong>Upon searching for “Whoop,” multiple tracking mechanisms are triggered at the same time</p><p><strong><em>Cookie Synchronization:</em></strong><em> Google keeps track of all authorized sessions even when you are signed into your work account.<br></em><strong><em>Device Fingerprinting:</em></strong><em> A digital fingerprint was created by capturing the distinct features of your browser.<br></em><strong><em>IP Address Correlation: </em></strong><em>Both accounts were linked to the IP address that was logged from your desktop.</em></p><p><strong>The Cross-Platform Data Flow: </strong>The data from your search doesn’t stay contained within Google’s ecosystem. Here’s how it spreads</p><p><em>1. Google’s advertising network (Google Ads) records your interest in fitness devices<br>2. This data is shared with partner advertising networks<br>3. Facebook/Meta’s advertising platform receives this information through:</em></p><p><strong>Mobile Device Connection: </strong>The connection to your mobile device occurs through several vectors</p><p><strong><em>Common WiFi Networks</em></strong><em>: Your devices sharing the same network<br></em><strong><em>Google Services</em></strong><em>: Chrome sync, Google Play Services<br></em><strong><em>Cross-Platform Login Data</em></strong><em>: Using the same accounts across devices<br></em><strong><em>Behavioral Patterns</em></strong><em>: Time and location-based correlations</em></p><h4>The Security Implications</h4><p>This cross-device tracking raises several security concerns:</p><ol><li><strong><em>Privacy Boundary Blurring</em></strong><em>: Personal and professional digital lives become intermingled</em></li><li><strong><em>Data Aggregation</em></strong><em>: Creates comprehensive user profiles across devices</em></li><li><strong><em>Attack Surface Expansion</em></strong><em>: More connection points mean more potential vulnerabilities</em></li><li><strong><em>Identity Correlation</em></strong><em>: Easier to link anonymous activities to real identities</em></li></ol><h3>Privacy Analysis Script: A Brief Understanding</h3><pre>#Run the Script<br><br>python privacy_analysis.py</pre><p>The script will:<br>1. <em>Show your system information<br>2. Display network details<br>3. Allow you to enter search queries for analysis</em></p><p>For each search query, it analyzes:<br>1. <em>Cookies (especially ad-related ones)<br>2. URL tracking parameters<br>3. Response headers</em></p><pre>import platform<br>import socket<br>import uuid<br>from datetime import datetime<br>import requests<br>import random<br>import logging<br>import urllib.parse<br>from http.cookies import SimpleCookie<br><br># Set up logging<br>logging.basicConfig(level=logging.INFO, format=&#39;%(asctime)s - %(levelname)s - %(message)s&#39;)<br>logger = logging.getLogger(__name__)<br><br>def get_random_user_agent():<br>    &quot;&quot;&quot;Return a random browser user agent to simulate different browsers.&quot;&quot;&quot;<br>    user_agents = [<br>        &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/91.0.4472.124 Safari/537.36&quot;,<br>        &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Safari/605.1.15&quot;,<br>        &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Firefox/89.0&quot;<br>    ]<br>    return random.choice(user_agents)<br><br>def create_headers():<br>    &quot;&quot;&quot;Create headers that browsers typically send with requests.&quot;&quot;&quot;<br>    return {<br>        &#39;User-Agent&#39;: get_random_user_agent(),<br>        &#39;Accept&#39;: &#39;text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8&#39;,<br>        &#39;Accept-Language&#39;: &#39;en-US,en;q=0.5&#39;,<br>        &#39;Accept-Encoding&#39;: &#39;gzip, deflate, br&#39;,<br>        &#39;DNT&#39;: &#39;1&#39;,  # Do Not Track request<br>        &#39;Connection&#39;: &#39;keep-alive&#39;,<br>        &#39;Upgrade-Insecure-Requests&#39;: &#39;1&#39;<br>    }<br><br>def print_header():<br>    &quot;&quot;&quot;Print the report header with timestamp&quot;&quot;&quot;<br>    print(&quot;\n=== Privacy Check Report ===&quot;)<br>    print(f&quot;Timestamp: {datetime.now().strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)}&quot;)<br><br>def print_system_info():<br>    &quot;&quot;&quot;Print basic system information that websites can typically detect&quot;&quot;&quot;<br>    print(&quot;\n=== System Information ===&quot;)<br>    system_info = {<br>        &quot;Operating System&quot;: platform.system(),<br>        &quot;OS Version&quot;: platform.version(),<br>        &quot;Machine Type&quot;: platform.machine(),<br>        &quot;Processor&quot;: platform.processor(),<br>        &quot;Hostname&quot;: socket.gethostname(),<br>        &quot;Device ID&quot;: str(uuid.getnode())<br>    }<br>    <br>    for key, value in system_info.items():<br>        print(f&quot;{key}: {value}&quot;)<br><br>def print_network_info():<br>    &quot;&quot;&quot;Print network-related privacy information&quot;&quot;&quot;<br>    print(&quot;\n=== Network Information ===&quot;)<br>    try:<br>        # Get public IP<br>        ip_response = requests.get(&#39;https://api.ipify.org?format=json&#39;)<br>        public_ip = ip_response.json()[&#39;ip&#39;]<br>        <br>        # Get local IP<br>        hostname = socket.gethostname()<br>        local_ip = socket.gethostbyname(hostname)<br>        <br>        print(f&quot;Public IP: {public_ip}&quot;)<br>        print(f&quot;Local IP: {local_ip}&quot;)<br>    except Exception as e:<br>        print(f&quot;Could not fetch network info: {str(e)}&quot;)<br><br>def analyze_search_tracking(query):<br>    &quot;&quot;&quot;Analyze tracking data from a Google search&quot;&quot;&quot;<br>    print(&quot;\n=== Search Tracking Analysis ===&quot;)<br>    <br>    try:<br>        # Google search URL and parameters<br>        base_url = &quot;https://www.google.com/search&quot;<br>        params = {<br>            &#39;q&#39;: query,<br>            &#39;hl&#39;: &#39;en&#39;,<br>            &#39;gl&#39;: &#39;us&#39;,<br>            &#39;pws&#39;: &#39;0&#39;,<br>            &#39;safe&#39;: &#39;active&#39;,<br>            &#39;source&#39;: &#39;hp&#39;,<br>            &#39;ei&#39;: datetime.now().strftime(&#39;%Y%m%d_%H%M%S&#39;)<br>        }<br>        <br>        headers = create_headers()<br>        full_url = f&quot;{base_url}?{urllib.parse.urlencode(params)}&quot;<br>        <br>        # Make the request<br>        print(f&quot;\nAnalyzing search request for: &#39;{query}&#39;&quot;)<br>        response = requests.get(full_url, headers=headers, allow_redirects=True)<br>        <br>        # Analyze cookies<br>        print(&quot;\nCookies Analysis:&quot;)<br>        if response.cookies:<br>            for cookie in response.cookies:<br>                print(f&quot;\nCookie: {cookie.name}&quot;)<br>                print(f&quot;Value: {cookie.value}&quot;)<br>                print(f&quot;Domain: {cookie.domain}&quot;)<br>                print(f&quot;Expires: {cookie.expires}&quot;)<br>                print(f&quot;Secure: {cookie.secure}&quot;)<br>                print(f&quot;HttpOnly: {cookie.has_nonstandard_attr(&#39;HttpOnly&#39;)}&quot;)<br>                <br>                # Identify ad-related cookies<br>                if any(ad_term in cookie.name.lower() for ad_term in [&#39;ad&#39;, &#39;track&#39;, &#39;targeting&#39;, &#39;analytics&#39;]):<br>                    print(&quot;⚠️ This cookie may be used for advertising purposes&quot;)<br>        else:<br>            print(&quot;No cookies received&quot;)<br>        <br>        # Analyze tracking parameters<br>        print(&quot;\nTracking Parameters:&quot;)<br>        tracking_params = [&#39;utm_&#39;, &#39;gclid&#39;, &#39;fbclid&#39;, &#39;msclkid&#39;]<br>        found_params = [param for param in params.keys() if any(t in param for t in tracking_params)]<br>        if found_params:<br>            print(&quot;Found tracking parameters:&quot;, &#39;, &#39;.join(found_params))<br>        else:<br>            print(&quot;No common tracking parameters detected&quot;)<br>        <br>        # Analyze response headers<br>        print(&quot;\nResponse Headers Analysis:&quot;)<br>        tracking_headers = [&#39;set-cookie&#39;, &#39;x-client-data&#39;, &#39;alt-svc&#39;]<br>        for header in tracking_headers:<br>            if header in response.headers:<br>                print(f&quot;Found {header}: {response.headers[header]}&quot;)<br><br>    except requests.exceptions.RequestException as e:<br>        print(f&quot;Error during analysis: {str(e)}&quot;)<br><br>def main():<br>    print(&quot;Running comprehensive privacy check...&quot;)<br>    print_header()<br>    print_system_info()<br>    print_network_info()<br>    <br>    # Add search analysis<br>    while True:<br>        query = input(&quot;\nEnter a search query to analyze tracking (or &#39;quit&#39; to exit): &quot;)<br>        if query.lower() == &#39;quit&#39;:<br>            break<br>        analyze_search_tracking(query)<br>    <br>    print(&quot;\nPrivacy check complete!&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d28f79f87c71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping CVEs to the MITRE ATT&CK Framework: Why It Matters and the Story Behind cve2ttp]]></title>
            <link>https://medium.com/@harshvanasiwala18/mapping-cves-to-the-mitre-att-ck-framework-why-it-matters-and-the-story-behind-cve2ttp-a5c0958ee3d1?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5c0958ee3d1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 17:56:52 GMT</pubDate>
            <atom:updated>2024-10-18T17:56:52.105Z</atom:updated>
            <content:encoded><![CDATA[<p>Consider a cybersecurity squad engaged in combat on a dynamic battlefield. New vulnerabilities, or CVE IDs, appear daily like holes in their defenses. Hackers can get access to systems by taking advantage of certain CVEs. However, being aware of a crack does not equate to understanding how an adversary will exploit it. Similar to a military playbook, MITRE ATT&amp;CK fills in this gap by detailing the several attack methods an adversary could employ to exploit those flaws.</p><p>This information isn’t always easily available, though. What if there was an easy method to link an attacker’s strategy to a CVE? This is where <a href="https://cve2ttp.onrender.com/">cve2ttp</a>, my website, comes into play.</p><h4>The First Step: Understanding Tactics</h4><p>cve2ttp is designed to map a CVE ID to its relevant MITRE ATT&amp;CK tactics — key stages in an attacker’s playbook. While the site doesn’t dive into specific techniques, the strategic insights it provides are invaluable.</p><h4>Why?</h4><p>Because tactics tell us the “why” and “when” of an attack. They help organizations understand which goals attackers are trying to achieve, such as initial access, persistence, or privilege escalation. By connecting a CVE to a tactic, you help security teams prioritize their defenses and understand the bigger picture of how an adversary may operate.</p><h3>The Importance of Mapping CVEs to MITRE ATT&amp;CK</h3><ol><li><strong>Contextualizing Vulnerabilities</strong>: A CVE is only a technical description and a number without any context. However, when you relate that CVE to the strategies of a particular attacker, you end up with a description of the attacker’s goals. You shift your perspective from “This vulnerability allows X exploit,” to believing, “An attacker could use this to achieve persistence or escalate privileges.”</li><li><strong>Prioritizing Security Responses</strong>: Not every CVE is made equally. Security teams can prioritize their reaction by mapping CVEs to the MITRE ATT&amp;CK framework. Depending on the organization’s present risk profile, a vulnerability related to the execution or lateral movement approach may be addressed more urgently than one related to reconnaissance.</li><li><strong>Building Proactive Defense Strategies</strong>: Organizations can be proactive rather than reactive by knowing the strategies an attacker can employ based on a CVE. Before an attack ever occurs, they can strengthen defenses in the areas that support those strategies.</li><li><strong>Bridging the Gap Between Security and Management</strong>: The specific technical aspects of CVEs are not of interest to the higher-ups. They want to know the whole picture and the risk. This larger story is provided by mapping CVEs to the MITRE ATT&amp;CK framework, making it simpler to discuss and explain at the organizational level.</li></ol><h3>Why Not Techniques?</h3><p>For the time being, my platform deliberately ignores techniques in favor of tactics, which is an important choice. Techniques can be very complex and require a high level of skill to completely comprehend and implement, even though they are crucial for focusing security efforts. Since tactics provide a more accessible and strategic entry point, I am focusing on them for the time being.</p><p>By emphasizing strategies, cve2ttp offers a convenient starting point for security analysts and CISOs alike. As a result, teams can create a strategy map without being mired in specifics. I intend to add techniques as the platform develops, but for the time being, focusing on tactics keeps things straightforward and useful.</p><h3>The Bigger Picture</h3><p>A better method of comprehending, monitoring, and defending against cyberattacks is required due to their increasing complexity. Vulnerabilities can no longer be addressed by organizations alone. They require a map that demonstrates not just the locations of the fissures but also how attackers could use them to further their objectives.</p><p>You contribute to the provision of this map by mapping CVEs to MITRE ATT&amp;CK techniques. You provide security teams with a crucial manual that helps them comprehend the thinking of the attacker in addition to highlighting vulnerabilities. One CVE at a time, your website, cve2ttp, is a crucial component of developing stronger cyber protection tactics.</p><p>Knowing your adversary’s strategies might make the difference between being caught off guard and remaining ahead of the game in the cybersecurity space. You’re assisting organizations in taking that important first step using cve2ttp.</p><h3><strong>Screenshot — CVE2TTP</strong></h3><p>Link: <a href="https://cve2ttp.onrender.com/">https://cve2ttp.onrender.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dHbGHVAz787NSu8y67x5mw.png" /><figcaption>Tenable — Latest CVE (<a href="https://www.tenable.com/cve/newest">https://www.tenable.com/cve/newest</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BsLL465GYttXbwP2KW1XCg.png" /><figcaption>CVE2TTP (<a href="https://cve2ttp.onrender.com/">https://cve2ttp.onrender.com/</a>)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5c0958ee3d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging AI for Finding Security Controls on CVEs]]></title>
            <link>https://medium.com/@harshvanasiwala18/leveraging-ai-for-finding-security-controls-on-cves-1a92e90acc2e?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a92e90acc2e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[log4j]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python-automation]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Mon, 26 Aug 2024 02:07:26 GMT</pubDate>
            <atom:updated>2024-08-26T02:07:26.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Efficient and precise identification of security controls is critical in the field of cybersecurity. Automating this process through the incorporation of AI technology, like Google’s Gemini AI, is a promising approach. This article investigates the use of Gemini AI to extract pertinent security controls from NIST SP 800–53 to fix particular vulnerabilities, like CVE-2021–44228 (Log4j).</p><h3>Benefits and Applications</h3><ul><li><strong>Efficiency: </strong>Time is saved and the possibility of human mistakes in determining pertinent controls for particular vulnerabilities is decreased when security measures are extracted automatically.</li><li><strong>Comprehensive Analysis: </strong>Organizations can improve their overall security posture by utilizing AI to ensure a more thorough study of applicable security procedures.</li><li><strong>Scalability:</strong> The method is adaptable to various security frameworks and weaknesses, which makes it a useful tool for cybersecurity experts.</li></ul><h3>CODE</h3><pre>import google.generativeai as genai<br><br># Set the API key<br>genai.configure(api_key=api_key)<br><br># Create a GenerativeModel object<br>model = genai.GenerativeModel(&#39;gemini-1.5-flash&#39;)<br><br># Generate content using the model<br>result_info = model.generate_content(f&#39;&#39;&#39;<br>Provide Security Controls from NIST SP 800-43 that are applied for <br>CVE-2021-44228. Provide type of control, control number, <br>and control title in a json format.&#39;&#39;&#39;)<br><br># Print the generated content<br>with open(&#39;output.txt&#39;, &#39;w&#39;) as f:<br>    f.write(result_info.text)</pre><p>This script leverages Google’s Gemini AI to automatically extract relevant security controls from the NIST SP 800–53 framework that can mitigate a specific vulnerability, such as CVE-2021–44228 (Log4j). The process is straightforward, allowing the user to obtain critical controls in a structured JSON format.</p><p><strong>Key Steps:</strong></p><ol><li><strong>Configure the API</strong>: The script first configures the Gemini AI API using a provided key (genai.configure(api_key=api_key)), enabling secure access.</li><li><strong>Create a GenerativeModel Object</strong>: The code initializes a generative model using Google’s Gemini version 1.5, specifically the “flash” variant, optimized for efficient and contextual content generation.</li><li><strong>Generate Content</strong>: The AI model is prompted to extract security controls from NIST SP 800–53 that are relevant to CVE-2021–44228. The prompt requests the control type, control number, and control title, delivered in JSON format for easier parsing and automation.</li><li><strong>Output the Result</strong>: The generated information is then saved to a text file, enabling further analysis or integration into a larger workflow.</li></ol><h3>OUTPUT</h3><pre>[<br>   {<br>      &quot;type&quot;:&quot;Technical&quot;,<br>      &quot;control_number&quot;:&quot;AC-1(2)&quot;,<br>      &quot;control_title&quot;:&quot;System and Information Integrity&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Technical&quot;,<br>      &quot;control_number&quot;:&quot;AC-1(3)&quot;,<br>      &quot;control_title&quot;:&quot;System and Information Integrity&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Technical&quot;,<br>      &quot;control_number&quot;:&quot;AC-1(4)&quot;,<br>      &quot;control_title&quot;:&quot;System and Information Integrity&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Technical&quot;,<br>      &quot;control_number&quot;:&quot;AC-6(1)&quot;,<br>      &quot;control_title&quot;:&quot;System and Communications Protection&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Technical&quot;,<br>      &quot;control_number&quot;:&quot;AC-6(3)&quot;,<br>      &quot;control_title&quot;:&quot;System and Communications Protection&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Management&quot;,<br>      &quot;control_number&quot;:&quot;CM-5(2)&quot;,<br>      &quot;control_title&quot;:&quot;Configuration Management&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Management&quot;,<br>      &quot;control_number&quot;:&quot;CM-5(3)&quot;,<br>      &quot;control_title&quot;:&quot;Configuration Management&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Management&quot;,<br>      &quot;control_number&quot;:&quot;CM-6(1)&quot;,<br>      &quot;control_title&quot;:&quot;Configuration Management&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Management&quot;,<br>      &quot;control_number&quot;:&quot;CM-6(5)&quot;,<br>      &quot;control_title&quot;:&quot;Configuration Management&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Operational&quot;,<br>      &quot;control_number&quot;:&quot;OP-1(1)&quot;,<br>      &quot;control_title&quot;:&quot;Operational Environment&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Operational&quot;,<br>      &quot;control_number&quot;:&quot;OP-3(1)&quot;,<br>      &quot;control_title&quot;:&quot;Operational Environment&quot;<br>   },<br>   {<br>      &quot;type&quot;:&quot;Operational&quot;,<br>      &quot;control_number&quot;:&quot;OP-3(2)&quot;,<br>      &quot;control_title&quot;:&quot;Operational Environment&quot;<br>   }<br>]</pre><p>Since the Gemini 1.5 Flash model was trained using data from before November 2023, the information supplied is still relevant as of that date. You would need to use an updated version of the model or fine-tune it using the most recent data to ensure correct results. Since industry standards change quickly in response to new needs and developments, having the most recent AI model with current data is crucial for finding security controls using AI for CVEs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a92e90acc2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating AI with OSINT: Ethical Use and Practical Applications]]></title>
            <link>https://medium.com/@harshvanasiwala18/integrating-ai-with-osint-ethical-use-and-practical-applications-e4fa7ebbd9f1?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4fa7ebbd9f1</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 17:24:41 GMT</pubDate>
            <atom:updated>2024-08-25T17:24:41.663Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gooS4ZvTB6w9TeF6.png" /><figcaption><a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.zenarmor.com%2Fdocs%2Fnetwork-security-tutorials%2Fwhat-is-osint&amp;psig=AOvVaw3V6sMYFvEdKs4ONbfwGCUA&amp;ust=1724689016727000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBQQjRxqFwoTCOji4rLFkIgDFQAAAAAdAAAAABAJ">OSINT</a></figcaption></figure><p>AI technologies are perfect for OSINT operations because they can handle large volumes of data quickly and accurately. Here are a few examples of how AI and OSINT might work together:</p><ol><li>AI can automate the gathering and processing of data from various sources, including social media, news websites, and public records. After that, machine learning algorithms can analyze this data to find trends and patterns.</li><li>Natural Language Processing (NLP): NLP is a useful tool for intelligence analysis since it can be used to translate content written in other languages, extract pertinent information from text data, and evaluate text data.</li><li>Image and Video Analysis: AI is capable of analyzing multimedia files, and recognizing faces, objects, and even emotions. This is important for intelligence gathering and operations.</li></ol><h3>Ethical Use of AI in OSINT</h3><p>In this case, protecting privacy and meeting the requirements of relevant legislation need to be considered as the first ethical issues when using AI for OSINT.<br>1. <strong>Privacy Issues: </strong>Be sure that data collection does not violate people’s rights or laws on privacy. Personal data shall not be collected without consent.<br>2. <strong>Fairness and Bias:</strong> The training dataset can lead to biases in the AI model. Not only that but also, from time to time, auditing should be done to make sure that AI is going to give unbiased and just results.<br>3. <strong>Openness: </strong>AI systems process diverse data and use it for several purposes. It is in the best interest of the public, just like the stakeholders, to have an increased level of trust.</p><h3>Code Snippet</h3><pre>import google.generativeai as genai<br><br>genai.configure(api_key=api_key)<br><br>model = genai.GenerativeModel(&#39;gemini-1.5-flash&#39;)</pre><p>Google Gemini provides 15 requests per minute, which is why I use it. I also use the Duck Duck Go Search Python package, which features an AI conversation feature. Users could misuse the request, though. Thus, their access to it is restricted to certain requests. I am analyzing the information using Google Gemini.</p><pre>from duckduckgo_search import DDGS<br>import time<br><br># Query to search<br>query = &quot;Query to search&quot;<br><br># Initialize the search object<br>results = DDGS().text(query, max_results=5)<br><br># List to store search results<br>search_results = []<br><br># Track the start time<br>start_time = time.time()<br><br># Extract Personal Information from the text<br>for i, result in enumerate(results, start=1):<br>    # Check if 15 requests have been made and if it&#39;s within 1 minute<br>    if i % 15 == 0:<br>        elapsed_time = time.time() - start_time<br>        if elapsed_time &lt; 60:<br>            # Sleep for the remaining time to make it a 1-minute interval<br>            time.sleep(60 - elapsed_time)<br>        # Reset the start time after sleeping<br>        start_time = time.time()<br><br>    # Extract the URL from the result<br>    URL = result[&#39;href&#39;]<br>    Snippet = result[&#39;body&#39;]<br>    <br>    # Extract the email address from the URL<br>    result_info = model.generate_content(f&#39;&lt;Prompt&gt; &quot;{query}&quot;: {Snippet}&#39;)<br><br>    try:<br>        # Append the result to the search_results list<br>        search_results.append(result_info.text)<br>    except:<br>        # If the extraction fails, append the URL to the search_results list<br>        search_results.append(URL)<br><br># Write the results to a file<br>with open(&#39;search_results.txt&#39;, &#39;w&#39;) as f:<br>    # Write each item in the search_results list to the file<br>    for item in search_results:<br>        f.write(&quot;%s\n&quot; % item)</pre><p>The DDGS().text method is being used in this script to look for websites that are relevant to a given query. I have included a counter system to keep track of how many requests have been made. To prevent overwhelming the search engine or hitting rate constraints, the script will halt for 60 seconds if the counter rises above 15 in a minute.</p><p>Each website’s content, or body, is included in the search results and can be analyzed to provide more specific details. The BeautifulSoup library can be used to scrape more data from the website content for more sophisticated content extraction.</p><p>After obtaining the pertinent content, you can utilize prompts to further filter the data, draw important conclusions, and save the data in a file for further examination. This approach is particularly useful for collecting and analyzing information from multiple sources.</p><p><strong>Note: This information is provided solely for educational purposes. Unauthorized or unethical use of these techniques may result in legal consequences. Always ensure that your actions are compliant with applicable laws and ethical guidelines.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4fa7ebbd9f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Cybersecurity Landscape: Ensuring Game Security in the Age of Advanced Anti-Cheat…]]></title>
            <link>https://medium.com/@harshvanasiwala18/navigating-the-cybersecurity-landscape-ensuring-game-security-in-the-age-of-advanced-anti-cheat-18d3f13e29d7?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/18d3f13e29d7</guid>
            <category><![CDATA[valorant]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[game-security]]></category>
            <category><![CDATA[anti-cheat-system]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 02:48:43 GMT</pubDate>
            <atom:updated>2024-08-21T02:48:43.626Z</atom:updated>
            <content:encoded><![CDATA[<h3>Navigating the Cybersecurity Landscape: Ensuring Game Security in the Age of Advanced Anti-Cheat Technologies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHQlVnUKoIyKuPkawSsiog.jpeg" /><figcaption><a href="https://www.pinnacle.com/en/esports-hub/betting-articles/valorant/valorant-vs-csgo-pro-perspective/wlr2wkkrczpxakbg"><strong>Riot Games Vs Valve Corporation</strong></a></figcaption></figure><h3>Let&#39;s Understand, What is Anti-Cheat?</h3><p>I used to play <em>Grand Theft Auto</em>, and like many others, I would use cheat codes to increase health and money. While it was fun, relying on cheat codes is not really how the game is meant to be played — it’s essentially cheating and could be seen as a sign of being inexperienced or unable to complete the game fairly.</p><p>Most games like <em>GTA</em> are campaign-based, but then there are competitive games like <em>Counter-Strike</em>, <em>Valorant</em>, <em>PlayerUnknown’s Battlegrounds (PUBG)</em>, <em>League of Legends</em>, <em>Dota</em>, and others. In these types of games, you play against real players online, and using cheats in these environments is not only unfair but also illegal and can lead to being banned.</p><p>This is where anti-cheat systems come into play. They help maintain fair competition by detecting and preventing cheating, ensuring everyone has an equal chance in the game. VACNet and Vanguard are a few renowned anti-cheat engines.</p><p>Source: <br><a href="https://en.as.com/meristation/news/is-vanguard-anti-cheat-bad-for-my-pc-riot-games-responds-to-the-accusations-of-it-bricking-pcs-n/">https://en.as.com/meristation/news/is-vanguard-anti-cheat-bad-for-my-pc-riot-games-responds-to-the-accusations-of-it-bricking-pcs-n/</a></p><blockquote>Below are few illustartion of Cheating</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*bRwUsDe0pE1rcMQc.gif" /><figcaption><a href="https://makeagif.com/gif/no-vac-2017-csgo-wallhack-download-19022017-undetected-5MrOMJ"><strong>Wall Hacking</strong></a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*-mmUNM1FfKp7Cf8k.gif" /><figcaption><a href="https://makeagif.com/gif/csgo-overwatch-aimbot-hacks-episode-5-7o2b9L"><strong>Aim BOT</strong></a></figcaption></figure><h3>CSGO VACNet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*wRi1Nw6v2e7PEITm.png" /><figcaption><a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.reddit.com%2Fr%2FGlobalOffensive%2Fcomments%2F10gwlju%2Fvac_ban_stats_for_2022_significantly_less_vac%2F&amp;psig=AOvVaw0XgqVZxYTNtgEvURKPX4sq&amp;ust=1724294814871000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBQQjRxqFwoTCPjA1PGIhYgDFQAAAAAdAAAAABAJ"><strong>VACNet Stats</strong></a></figcaption></figure><p>VACNet is an anti-cheat solution that utilizes machine learning technology to analyze gameplay data, focusing on specific patterns like movement and shooting behaviors. It scans for cheat signatures, detects modifications in game files, and monitors suspicious activities during gameplay to ensure a smooth and fair experience for all players. VACNet functions as an application-level cheat engine, continuously working in the background to identify and block cheaters.</p><h3><strong>Riot Games Vanguard</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AQNs-FVtsDwuR8Oi.jpg" /><figcaption><a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fplayvalorant.com%2Fen-us%2Fnews%2Fdev%2Fanti-cheat-update-winter-2023%2F&amp;psig=AOvVaw0lcTH4S6Y28Nq6jEQvhZLY&amp;ust=1724294748804000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBQQjRxqFwoTCNiF6tGIhYgDFQAAAAAdAAAAABAE"><strong>Vanguard Stats</strong></a></figcaption></figure><p>Riot Games’ Vanguard is another anti-cheat engine that operates using kernel-level detection. In simple terms, this means it runs as a driver with system-level privileges that exceed even those of an administrator. Vanguard continuously compares actual game data with user inputs, such as keystrokes and mouse movements, to detect suspicious activity. Based on predefined rules, it can issue bans for players engaged in cheating. Since it operates at the kernel level, it can enforce hardware bans, making it difficult for the same cheater to play on that device again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*kb74ceBW2HbD5mFIVZx53w.png" /></figure><p>Source: <a href="https://gist.github.com/stdNullPtr/2998eacb71ae925515360410af6f0a32?permalink_comment_id=5046673">https://gist.github.com/stdNullPtr/2998eacb71ae925515360410af6f0a32?permalink_comment_id=5046673</a></p><h3>Security Issues with Riot Games’ Vanguard</h3><p>Vanguard operates similarly to rootkits, having privileges beyond those of an administrator. This gives it the capability to access and alter system settings, potentially record screenshots, and make changes without user permission. Additionally, Riot Games, which developed Vanguard, is owned by a Chinese company, raising concerns about access to sensitive kernel-level data. If a hacker were to exploit Vanguard, it could lead to the theft of highly confidential information, posing serious privacy and security risks.</p><p>Riot Games’ Vanguard has faced accusations and concerns from the gaming community about potentially taking unauthorized screenshots of users’ systems. Some sources have claimed that the software’s deep integration at the kernel level could enable it to capture sensitive information without users’ knowledge. However, Riot Games has repeatedly denied these claims, stating that Vanguard does not collect or transmit personal data beyond what is necessary for cheat detection. Despite this, the level of access and control Vanguard has over a user’s system continues to be a point of concern, particularly regarding privacy and potential misuse if the system were to be exploited by malicious actors.</p><p>Sources:<br><a href="https://www.resetera.com/threads/riot-added-vanguard-to-league-of-legends-people-reporting-bricked-computers.861276/">https://www.resetera.com/threads/riot-added-vanguard-to-league-of-legends-people-reporting-bricked-computers.861276/</a></p><p><a href="https://www.reddit.com/r/riotgames/comments/1cn7xgy/can_someone_explain_why_vanguard_is_bad/">https://www.reddit.com/r/riotgames/comments/1cn7xgy/can_someone_explain_why_vanguard_is_bad/</a></p><h3>References:</h3><p>[1] “Riot Game’s Anti-Cheat Software Vanguard is Reportedly Bricking and Taking Screenshots of Users’ PCs”, AFKGaming</p><p>[2] “Valorant fans justify Riot’s anti-cheat measures for collecting PC screenshots”, Sportskeeda</p><p>[3]YouTube video: “Why Riot’s new anti-cheat is a HUGE problem.”</p><p>[4]YouTube video: “Explains kernel level anti-cheat”</p><p>Citations:<br>[1] <a href="https://afkgaming.com/gaming/general/riot-games-anti-cheat-software-vanguard-is-reportedly-bricking-and-taking-screenshots-of-users-pcs">https://afkgaming.com/gaming/general/riot-games-anti-cheat-software-vanguard-is-reportedly-bricking-and-taking-screenshots-of-users-pcs</a><br>[2] <a href="https://www.sportskeeda.com/valorant/valorant-fans-justify-riot-s-anti-cheat-measures-collecting-pc-screenshots">https://www.sportskeeda.com/valorant/valorant-fans-justify-riot-s-anti-cheat-measures-collecting-pc-screenshots</a><br>[3]<a href="https://www.youtube.com/watch?v=nk6aKV2rY7E">https://www.youtube.com/watch?v=nk6aKV2rY7E</a><br>[4]<a href="https://www.youtube.com/watch?v=GrzuiJezZEo">https://www.youtube.com/watch?v=GrzuiJezZEo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18d3f13e29d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Dorking: A Powerful Technique for Cybersecurity Professionals]]></title>
            <link>https://medium.com/@harshvanasiwala18/google-dorking-a-powerful-technique-for-cybersecurity-professionals-c4b86bcd22a2?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4b86bcd22a2</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Thu, 18 Jul 2024 18:38:30 GMT</pubDate>
            <atom:updated>2024-07-18T18:38:30.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgn4736WBWdCkSOsw_NTDw.png" /><figcaption>gOOgle DORK</figcaption></figure><p>Google Dorking, may also referred to as Google Hacking. It is a very powerful method that uses search operators to get access to sensitive content on the internet. This methodology is used for both offensive and defensive approaches.</p><h4>The Importance of Google Dorking in Cybersecurity</h4><ol><li><strong><em>Vulnerability Assessment: </em></strong>Cybersecurity Professionals use Google Dorking to find unidentified vulnerabilities in web applications and networks.</li><li><strong><em>Information Gathering:</em></strong> In the Recon phase of security assessment, Google Dorking can be utilized to find confidential information.</li><li><strong><em>Threat Intelligence: </em></strong>Google Dorking can be used to find Data leaks and track Malware Distribution, and Any Potential Threats.</li><li><strong><em>Defensive Measures: </em></strong>Enterprises use Google Dorking methodology to ensure the leak of any sensitive data and audit any online presence if that is exposed to the public.</li><li><strong><em>Penetration Testing: </em></strong>Ethical Hackers use Google Dorking to find security flaws before any threat actor can exploit them and also to simulate real work attacks.</li></ol><h4>Key Google Dorking Techniques</h4><p><em>Note: It should be noted that using Google Dorking unethically may lead to some legal issues. If you are attempting to do this on any website, you need some authorization. This is purely for educational purposes.</em></p><pre>&quot;XYZ&quot; - Exact Pharse Search<br><br>Example, &quot;internal server error&quot;</pre><pre>cache: - Cached Page Retrieval<br><br>Example, cache:example.com</pre><pre>filetype: - Specific File Type Search<br><br>Example, confidential filetype:pdf</pre><pre>allintext: - Keyword Search in Page Content<br><br>Example, allintext: username password filetype:log</pre><pre>site: - Domain-Specific Search<br><br>Example, site:example.com password</pre><p>If you want to can explore the <a href="https://www.exploit-db.com/google-hacking-database">Google Hacking Database</a> by ExploitDB.</p><h4>Best Practices for Using Google Dorking in Cybersecurity</h4><ol><li>Obtain Proper Authorization</li><li>Use a VPN or Proxy</li><li>Document Your Findings</li><li>Stay Updated</li><li>Combine with Other Tools</li></ol><p><strong><em>Check out my </em></strong><a href="https://www.linkedin.com/in/harsh-vanasiwala18/"><strong><em>LinkedIn</em></strong></a><strong><em>, </em></strong><a href="https://x.com/HVanasiwala"><strong><em>Twitter</em></strong></a><strong><em>, and </em></strong><a href="https://github.com/HarshVanasiwala-18"><strong><em>GitHub</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4b86bcd22a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shodan Automation using Python]]></title>
            <link>https://medium.com/@harshvanasiwala18/shodan-automation-using-python-2b6a334668fc?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b6a334668fc</guid>
            <category><![CDATA[shodan]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 00:54:13 GMT</pubDate>
            <atom:updated>2024-07-19T00:39:51.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A88xFg2plljGze-egoV9FQ.png" /><figcaption><a href="https://www.kolibers.com/blog/shodan.html">SOURCE</a></figcaption></figure><p>Link to Shodan: <a href="https://www.shodan.io/dashboard">https://www.shodan.io/</a><br><strong>Note: </strong>Shodan should be used ethically and for educational purposes only. Ethical abuse can lead to legal troubles and I am not in support of that.</p><p>In contrast to standard search engines (Google, Bing, Duck Duck Go, and more), Shodan assesses and indexes internet-connected devices instead of websites. It gathers data from devices (webcams, servers, smart appliances, control systems, and more) that are directly linked to the internet.</p><p><strong>Key Features:<br></strong><em>Device Discovery<br>Security Analysis<br>Network Monitoring<br>Research<br>Market Research<br>Infrastructure management</em></p><blockquote><strong>Use of Shodan effectively and ethically</strong><br>1. Learn the syntax of search queries, as it is different from that of typical search engines. <br>2. It should be used ethically for approved research and to strengthen one’s own infrastructure. <br>3. When scanning or gaining access to devices found on Shodan, this should have ethical and legal implications.</blockquote><h3>Usage of Python To Automate Shodan</h3><pre>import shodan<br>import time<br>import requests<br>import re<br><br># your shodan API key<br>SHODAN_API_KEY = &#39;&lt;SHODAN_API_KEY&gt;&#39;<br>api = shodan.Shodan(SHODAN_API_KEY)</pre><p>You may need to install libraries: shodan, time, re, and requests.</p><pre>pip install &lt;library&gt;</pre><pre># requests a page of data from shodan<br>def request_page_from_shodan(query, page):<br>    while True:<br>        try:<br>            instances = api.search(query, page=page)<br>            return instances<br>        except shodan.APIError as e:<br>            print(f&quot;Error: {e}&quot;)<br>            time.sleep(5)</pre><p>The main motive of the function “<strong><em>request_page_from_shodan</em></strong>” is to ask Shodan for a page of data based on a certain query and page number.</p><pre># Outputs the data to a file<br>query = &#39;&lt;Enter Shodan Query&gt;&#39;<br>page = 1<br><br>results = request_page_from_shodan(query, page)<br>with open(&#39;shodan_data.txt&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:<br>    f.write(str(results))</pre><p>This block of code will call the function “<strong><em>request_page_from_shodan</em></strong>” where you will be mentioning the query and number of pages. Afterward, it will store the data in a file called “<strong><em>shodan_data.txt</em></strong>”</p><h3>Need of Shodan Automation using Python</h3><p>Security professionals, researchers, and network administrators can identify vulnerabilities more efficiently, and keep an eye on the digital assets. and remained informed about any security threats that persist inside the networks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b6a334668fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python for Cybersecurity]]></title>
            <link>https://medium.com/@harshvanasiwala18/python-for-cybersecurity-9f49833a100f?source=rss-6a5517f92ce4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f49833a100f</guid>
            <dc:creator><![CDATA[Harsh Vanasiwala]]></dc:creator>
            <pubDate>Mon, 24 Apr 2023 22:03:55 GMT</pubDate>
            <atom:updated>2023-04-24T22:03:55.172Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jx9XHYNY0yiCh-M05iaamw.jpeg" /><figcaption>Soruce: <a href="https://johnsyvineela.medium.com/python-for-cyber-security-lesson-1-introduction-to-python-1976d817976">https://johnsyvineela.medium.com/python-for-cyber-security-lesson-1-introduction-to-python-1976d817976</a></figcaption></figure><p>Hello, I am <a href="http://harshvanasiwala.xyz/"><strong>Harsh Vanasiwala</strong></a> a cyber security student with focus on Threat Intelligence, Open-Source Intelligence, Digital Forensics and Python. I will be writing a blog that is focused on exploring the intersection of Python and Cybersecurity, where I will try to share my insights and knowledge on this topic.</p><p>I infer that you folks will be having a significant amount of python knowledge. If not you can refer to this video <a href="https://www.youtube.com/watch?v=eWRfhZUzrAc"><strong>Python for Beginners — Full Course freeCodeCamp</strong></a><strong>. </strong>This will help you to increase your understanding of the language.</p><p><a href="https://www.pythoncheatsheet.org/"><strong>Python Cheat sheet</strong></a></p><p><strong><em>Why Python is popular for cybersecurity?</em></strong></p><blockquote>Easy to Learn</blockquote><blockquote>Versatility</blockquote><blockquote>Extensive Library Support</blockquote><blockquote>Interpreted Language</blockquote><p><strong><em>What all Topics I will cover</em></strong></p><blockquote>Vulnerability Assessment using Python Libraries</blockquote><blockquote>Dark Web Information Gathering with Python</blockquote><blockquote>CTI and OSINT-related Python Scripts</blockquote><p><strong><em>Why I will use Python?</em></strong></p><blockquote><strong>Automation: </strong>Scanning for open ports with a Python script is more faster and more efficient than manually verifying each server. By automating the process, you can save a significant amount of time and work.</blockquote><blockquote><strong>Accuracy:</strong> A manual search is prone to mistakes and oversights. A Python script ensures that all ports are scanned and that the results are accurate.</blockquote><blockquote><strong>Scalability: </strong>If you need to scan numerous servers or ports, you can quickly modify and scale a Python script to suit the task. A manual search is far more difficult to scale.</blockquote><blockquote><strong>Customization:</strong> You can use Python to modify your scanning script to include extra checks or functionality, such as scanning for specific vulnerabilities or services. This can add even more value.</blockquote><h3>Vulnerability Assessment using Python Libraries</h3><p>You work for a huge game production company named “Pixel Play,” and your job is to identify all the open ports on a set of game development servers. The servers are named after well-known video game characters such as “Mario”, “Sonic”, “Link”, and “Master Chief”. You’ve been provided a list of IP addresses that belong to these servers, and it’s your job to identify open ports.</p><p><strong>Prerequisites:</strong> Nmap, Python</p><p>You should install Nmap 7.92, as latest version have some OpenSSL issue “<a href="https://nmap.org/dist/"><strong>https://nmap.org/dist/</strong></a>”</p><p>You need to install <strong>subprocess</strong> library in Python. Python has <strong>nmap-python</strong> libaray. However, I use subprocess as I can get more verbose output.</p><pre>pip install subprocess</pre><p><em>Python code</em></p><pre>import subprocess<br><br>targets = [&lt;Server IPs List&gt;]<br><br>for target_ip in targets:<br>    nmap_argument = [&quot;nmap&quot;, &quot;-p-&quot;, target_ip]<br><br>    process = subprocess.Popen(nmap_argument, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)<br>    output, error = process.communicate()<br><br>    if error:<br>        print(f&quot;# {error.strip()}&quot;)<br>        exit(1)<br><br>    open_ports = []<br>    for line in output.splitlines():<br>        if &quot;open&quot; in line:<br>            port = line.split()[0]<br>            port_number = port.split(&quot;/&quot;)[0]<br>            open_ports.append(port_number)<br>    if open_ports:<br>        for open in open_ports:<br>            print(f&quot;{target_ip} Open port: {open}&quot;)<br>    else:<br>        print(&quot;No open ports&quot;)</pre><p>This code performs a port scan on a list of servers specified by their IP addresses. It uses the subprocess module in Python to execute the Nmap tool and parse its output.</p><p>First, the code defines a list of IP addresses in the targets variable. Then, it loops through each IP address and executes Nmap with the -p- argument to scan for all ports.</p><p>The subprocess.Popen() function is used to execute the Nmap command with the specified arguments. The output of the command is captured using the communicate() function, which returns a tuple of strings representing the standard output and error of the process. The universal_newlines=True argument ensures that the output is returned as a string instead of bytes.</p><p>The output of the Nmap command is parsed to extract the open ports. If there are open ports, the IP address and port numbers are printed to the console. If there are no open ports, the console prints a message indicating this.</p><p>Overall, this code is useful for quickly scanning a list of servers to determine if any ports are open. It can be used as part of a larger security assessment or for general system administration tasks.</p><p>You can check out my project, where I used nmap for risk scoring “<a href="https://github.com/HarshVanasiwala-18/CVE-Scanner-and-Risk-Evaluator"><strong>CVE-Scanner-and-Risk-Evaluator</strong></a>”.</p><h3>Dark Web Information Gathering with Python</h3><p>You are an undercover government agent tasked with investigating a hidden group known as “The Cactus Society.” They are well-known for their passion for succulents and cactus, yet there are suspicions that they are involved in illegal operations.</p><p>To research this group, you must first gain access to its website, which is only accessible via the dark web. Accessing the black web, on the other hand, is dangerous and might be tracked back to you. You decide to utilize Tor, a software that allows you to visit the dark web anonymously, to avoid this.</p><p>Your objective is to access The Cactus Society’s website and scrape information from their homepage.</p><p><strong>Prerequisites:</strong> stem, requests, bs4, Tor, Python</p><p>You need to install Tor browser <strong>“</strong><a href="https://www.torproject.org/"><strong>https://www.torproject.org/</strong></a><strong>”</strong></p><pre>pip install requests<br>pip install stem<br>pip install bs4 </pre><pre>import stem.process<br>import requests<br>from bs4 import BeautifulSoup<br><br>try:<br>    tor_path = r&quot;&lt;tor.exe path&gt;&quot;<br><br>    tor_process = stem.process.launch_tor_with_config(<br>        tor_cmd=tor_path,<br>        config={<br>            &#39;SocksPort&#39;: &#39;9050&#39;,<br>        }<br>    )<br>except Exception as e:<br>    print(e)<br>    pass<br><br>try:<br>    url = &#39;&lt;onion link&gt;&#39;<br>    session = requests.session()<br>    session.proxies = {&#39;http&#39;: &#39;socks5h://localhost:9050&#39;, &#39;https&#39;: &#39;socks5h://localhost:9050&#39;}<br><br>    response = session.get(url)<br><br>    soup = BeautifulSoup(response.content, &#39;html.parser&#39;)<br>    print(soup.prettify())<br><br>    tor_process.kill()<br>except Exception as e:<br>    print(e)</pre><p>stem.process is a library that allows us to launch and control Tor instances programmatically. requests is a popular library for making HTTP requests in Python, and BeautifulSoup is a library that makes it easy to parse HTML and XML documents.</p><p>The tor_path variable should be set to the path of the Tor executable on the system. The launch_tor_with_config() function takes a configuration object as an argument, which we set to use the SocksPort 9050. This is because Tor listens on port 9050 by default for SOCKS connections. If Tor fails to launch, the except block will print the error message and continue with the rest of the script.</p><p>We set the http and https proxies to socks5h://localhost:9050, which means that requests made through this session will go through Tor using SOCKS5 protocol. Then, we make an HTTP GET request to the specified url and parse the HTML content using BeautifulSoup. Finally, we print the prettified HTML content and kill the Tor process. If any exception occurs, we print the error message.</p><p>Note that this code only accesses a hypothetical website, and in a real-world scenario, accessing illegal or malicious websites may have legal or security consequences.</p><h3>CTI and OSINT-related Python Scripts</h3><p>You are a spy working for the top-secret agency “Ghost Protocol”. Your mission is to extract sensitive information from a document that has been encrypted and sent to your agency. You have managed to decrypt the document and find that it contains a message that needs to be decoded. However, the message is hidden within a large amount of text, and you need to find and extract the relevant information using the script provided.</p><p>The document is from a notorious criminal mastermind called “Dr. X”, who has been using multiple aliases and domains to operate his criminal network. Your task is to extract any mentions of Dr. X’s aliases, domains, and file names that might lead you to his whereabouts.</p><p>Good luck, agent!</p><p><strong>Prerequisites:</strong> re, pdfminer, nltk, regex</p><pre>pip install re<br>pip install pdfminer<br>pip install nltk<br>pip install regex</pre><pre>import regex<br>from pdfminer.high_level import extract_text<br>from nltk import sent_tokenize<br>import re<br><br>regex_ipv6 = r&#39;([a-f0-9:]+:+)+[a-f0-9]+&#39;<br>regex_ipv4 = r&#39;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}&#39;<br>regex_filename = r&#39;[A-Za-z0-9-_\·]+\.(txt|php|exe|dll|bat|sys|htm|html|js|jar|jpg|png|vb|scr|pif|chm|zip|rar|cab|pdf|doc|docx|ppt|pptx|xls|xlsx|swf|gif|bat|pdf)&#39;<br>regex_filepath = r&#39;[a-z A-Z]:(\\([0-9 a-z A-Z _]+))+&#39;<br>regex_sha1 = r&#39;[a-f0-9]{40}|[A-F0-9]{40}&#39;<br>regex_sha256 = r&#39;[a-f0-9]{64}|[A-F0-9]{64}&#39;<br>regex_sha512 = r&#39;[a-f0-9]{128}|[A-F0-9]{128}&#39;<br>regex_md5 = r&#39;[a-f0-9]{32}|[A-F0-9]{32}&#39;<br>regex_cve = r&#39;CVE-[0-9]{4}-[0-9]{4,6}&#39;<br>regex_domain = r&#39;[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]\.[a-zA-Z]{2,6}&#39;<br>regex_url = r&#39;(https?|ftp|file)://[-A-Za-z0-9+&amp;@#/%?=∼ _|! : , .;]+[-A-Za-z0-9+&amp;@#/%?=∼ _|]&#39;<br>regex_list = {&#39;FILENAME&#39; : regex_filename, &#39;FILEPATH&#39; : regex_filepath, &#39;IPV4&#39; : regex_ipv4, &#39;IPV6&#39; : regex_ipv6, &#39;SHA1&#39; : regex_sha1, &#39;SHA256&#39; : regex_sha256, &#39;SHA512&#39; : regex_sha512, &#39;MD5&#39; : regex_md5, &#39;CVE&#39;: regex_cve, &#39;URL&#39; : regex_url, &#39;DOMAIN&#39; : regex_domain}<br><br>file = open(directory, &#39;rb&#39;)<br><br>if file:<br>    text = extract_text(file)<br>    text = text.replace(&#39;\n&#39;, &#39; &#39;).replace(&#39;\r&#39;, &#39;&#39;).replace(&#39;\t&#39;, &#39;&#39;).replace(&#39;\f&#39;, &#39;&#39;)<br>    sentences = sent_tokenize(text)<br>else:<br>    file.close()<br><br>entities = []<br><br>for sentence in sentences:<br>    for key, value in regex_list.items():<br>        regex = r&#39;\b&#39; + value + r&#39;\b&#39;<br>        if re.search(regex, sentence, re.IGNORECASE):<br>            for match in re.finditer(regex, sentence, re.IGNORECASE):<br>                entities.append((match.group(), key))<br><br>for enity in entities:<br>    print(enity)</pre><p>This code appears to extract entities from a PDF file located in a given directory. It uses regular expressions to identify various types of entities, such as file names, IP addresses, URLs, and cryptographic hashes, among others. It then applies the regular expressions to each sentence in the extracted text and stores the matched entities in a list of tuples, where each tuple contains the entity and its corresponding type.</p><p>The code uses the pdfminer library to extract text from the PDF file and the nltk library to tokenize the extracted text into sentences. It also defines a dictionary regex_list that maps each entity type to its corresponding regular expression pattern.</p><p>Overall, this code seems like a good starting point for entity extraction from PDF files, but it may need to be customized or modified depending on the specific requirements of the task or the format of the PDF files being processed.</p><p>P.S This is only for educational purpose only.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f49833a100f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>