<?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 Khaled Mahmud  on Medium]]></title>
        <description><![CDATA[Stories by Khaled Mahmud  on Medium]]></description>
        <link>https://medium.com/@sujonlondon?source=rss-86c82f15e614------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Khaled Mahmud  on Medium</title>
            <link>https://medium.com/@sujonlondon?source=rss-86c82f15e614------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:56:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sujonlondon/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[PowerShell Security: Monitoring Failed Logins, Adjusting Execution Policies, and Strengthening…]]></title>
            <link>https://medium.com/@sujonlondon/powershell-security-monitoring-failed-logins-adjusting-execution-policies-and-strengthening-f97dbb742202?source=rss-86c82f15e614------2</link>
            <guid isPermaLink="false">https://medium.com/p/f97dbb742202</guid>
            <dc:creator><![CDATA[Khaled Mahmud ]]></dc:creator>
            <pubDate>Mon, 29 Jan 2024 13:21:28 GMT</pubDate>
            <atom:updated>2024-01-29T13:21:28.085Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>PowerShell Security: Monitoring Failed Logins, Adjusting Execution Policies, and Strengthening Cyber Defenses</strong></h4><h4><strong>Introduction</strong></h4><p>To keep our computers secure from sneaky online meddlers, there is a superhero tool called PowerShell. Comprehend a large number of computer protectors working consistently to stop digital sniffers. They do not have much time and need to act fast to figure out what things going wrong. Helping geeks and multinational companies automate tasks. Now, emerge PowerShell, the Robin Hood of cyberspace.</p><p>This pitch unfolds in the realm of monitoring failed logins. There is not much wrapped-up theory, just a step-by-step journey akin to following guidelines, where manoeuvring a few PowerShell settings becomes the superhero cape defending against parallel cyber bad boys. Forget the fancy words and confusing commands — <strong>monitoring failed logins</strong>. This story is all about why it’s important to change a setting in PowerShell and how it helps keep our digital world safe.</p><p>Join me on this journey to empower your PowerShell scripting on cmdlet, where I mix the ideas I have learned in books with real-life actions. I will discover why PowerShell is a superhero in our digital world.</p><h3>Elevating PowerShell for Secure Monitoring</h3><p>To run the “Get-WinEvent” command we can do it in a regular PowerShell console. Running PowerShell with administration privilege can be necessary for certain tasks. Alternatively, I’ll demonstrate a convenient shortcut — pressing “win+X” to open the PowerShell user menu and then selecting “Run as Administrator” or “Terminal (Admin)” This simple yet effective method allows you to elevate your PowerShell session seamlessly.</p><p>To enable us to monitor how failed login commands work on the PowerShell (PS) environment first we have to elevate the PS default Execution policy from <strong>Restricted to Unrestricted</strong>. Before executing commands we should understand the risks; the unrestricted execution policy allows running any unsigned script, potentially introducing security vulnerabilities.</p><p><strong>Elevating Execution Policy:</strong></p><p>1. Check Incumbent/current Policy:</p><p>Open PowerShell as Administrator.</p><p>Type <strong>Get-ExecutionPolicy<em> </em></strong>to view the current policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*fPmUp0ACQn9MHt29" /></figure><p>2. Change Policy Restricted to Unrestricted:</p><ul><li>By commanding to Unrestricted, type <strong>Set-ExecutionPolicy Unrestricted</strong></li></ul><p>And</p><p>Confirm the change by choosing Y and pressing Enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*YSCIFgwCV-Lm0q19" /><figcaption><strong>Set-ExecutionPolicy Unrestricted</strong></figcaption></figure><h3>Risks warning for switching to Unrestricted!</h3><blockquote>Changing the PowerShell execution policy to Unrestricted is like leaving your front door wide open — it allows any script, even potentially harmful ones, to run freely. This can prompt unwanted hackers and information leaks. Make sure to revert to a safer policy after you’ve finished your important tasks to keep your digital home secure.</blockquote><h3>Monitoring Failed Logins:</h3><p>3. Once we have set the PowerShell execution to Unrestricted and now want to monitor failed Logons on our local computer, we can use the Get-WinEvent cmdlet to retrieve events from the security event log; specifically, we will be looking for events with event <strong>ID 4625</strong>, which refers a failed login attempt. By analyzing Event ID 4625, you can gain insights into unsuccessful logon events and take appropriate actions to enhance the security of your system.</p><p>By actively monitoring these events, you can enhance the security posture of your system and respond promptly to any suspicious activities.</p><blockquote>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Format-Table -Property TimeCreated, Id, Message -AutoSiz</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/0*i_TT_WLKB9KWepm5" /><figcaption>-FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Format-Table -Property TimeCreated, Id, Message -AutoSiz</figcaption></figure><h3>Understanding the Command:</h3><p>Understanding the above commands step-by-step:</p><blockquote><strong>-LogName Security&gt;</strong> parameter specifies that you’re looking in the Security event log.</blockquote><blockquote><strong>-FilterXPath “*[System[(EventID=4625)]]”</strong> &gt;parameter filters events based on their event ID, which refers a failed login attempt</blockquote><blockquote><strong>-MaxEvents 10&gt;</strong> parameter limits the output</blockquote><blockquote><strong>Format-Table&gt;</strong> part is used to display the information in a table format</blockquote><blockquote><strong>TimeCreated, Id, and Message&gt;</strong> are the properties of the objects that we want to include in the table.</blockquote><blockquote><strong>-AutoSiz&gt;</strong> is used to automatically adjust the column widths based</blockquote><h3>Alternative Commands:</h3><p>Alternatively, these commands should work in various PowerShell environments due to their version updates and compatibility.</p><blockquote>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]”</blockquote><blockquote>Or</blockquote><blockquote>Get-WinEvent -LogName Security -FilterHashtable @{Id=4625}</blockquote><blockquote>Or</blockquote><blockquote>Get-WinEvent -LogName Security -FilterHashtable @{Id=4625} -MaxEvents 10 | Format-Table -Property TimeCreated, Id, Message -AutoSize</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*90xxMEvizXDcHh3C" /><figcaption>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]”</figcaption></figure><p>The above commands for retrieving security events (Event ID 4625) from the Windows Security log can behave differently across PowerShell versions and Windows environments due to compatibility and parameter set variations. Consider using the<strong> -FilterXPath</strong> approach, which is generally more universally applicable.</p><h3>OutGridView Usage:</h3><p>Well, if these commands work for you, to display the result in the GridView, you can use the OutGridView cmdlet. Here is an example of how we should modify the command by adding <strong>| OutGridView</strong> at the end of the command. It should work and it will open a new window displaying the result in a graphical GridView, helpful for visually inspecting the data, sorting, and filtering.</p><blockquote>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Out-GridView</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hZhhSYMCInRTOyjJ" /><figcaption>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Out-GridView</figcaption></figure><p>If you have encountered an issue with displaying data in <strong>Out-GridView</strong> due to format incompatibility, you might need to adjust the formatting of your data Out-GridView works best with <strong>Select-object</strong> and the format Table cmdlet is typically used for formatting data for the console.</p><p>Try using <strong>Select-Object</strong> to create an Object with the specific properties you want to display and then pipe the result to Out-GridView here is the example;</p><blockquote>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Select-Object TimeCreated, Id, Message | Out-GridView</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/0*lgZ38NHbjzCcKtqM" /><figcaption>Get-WinEvent -LogName Security -FilterXPath “*[System[(EventID=4625)]]” -MaxEvents 10 | Select-Object TimeCreated, Id, Message | Out-GridView</figcaption></figure><h3>Application Log Monitoring</h3><p>4. Monitor application Logs by commanding: Get-WinEvent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*-AqBzfZfS7g3diXc" /><figcaption>Get-WinEvent</figcaption></figure><p>After commanding <strong>Get-WinEvent</strong> if you’re dealing with a large number of logs and want to avoid loading all of them, use the -MaxEvents parameter along with <strong>Get-WinEvent </strong>This parameter limits the number of events that PowerShell retrieves, making it more manageable, when dealing with extensive log data.</p><p>Limit the number of events by the use the <strong>-MaxEvents</strong> parameter. For Instance, to display only the latest 10 events:</p><blockquote>Get-WinEvent -LogName Application -MaxEvents 10</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*lzY3s9UjXWseFaa7" /><figcaption>Get-WinEvent -LogName Application -MaxEvents 10</figcaption></figure><p>5. To retrieve application logs events within the last 24 hours, you can adjust the — FilterHashTable parameter to specify the start time based on the current date. Here is the command:</p><blockquote>Get-WinEvent -FilterHashTable @{LogName=’Application’ ;StartTime=(Get-Date).AddHours(-24)}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/0*b8iZx87jh-HPJRVu" /><figcaption>Get-WinEvent -FilterHashTable @{LogName=’Application’ ;StartTime=(Get-Date).AddHours(-24)}</figcaption></figure><p><strong>Warning: Revert Changes Safely</strong></p><p>After you have completed your research, tasks or testing, restore your system for security to its original state. For example, to set it back to the default <strong>Set-ExecutionPolicy Restricted</strong>. Confirm the change by choosing Y and pressing Enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/0*BvVoAemOEfdZc6ku" /><figcaption>Set-ExecutionPolicy Restricted</figcaption></figure><h4>Key Takeaways:</h4><blockquote><em>Cybersecurity Vigilance: In the dynamic land of cybersecurity, monitoring is crucial for strengthening digital defences.</em></blockquote><blockquote><em>Focus on Failed Logins: This article delves into PowerShell’s security aspect, emphasizing monitoring failed logins and adjusting execution policies.</em></blockquote><blockquote><em>Identifying Security Threats: By monitoring failed login attempts, administrators can swiftly identify potential security threats, enabling proactive measures.</em></blockquote><blockquote><em>Practical Showcase: The article practically demonstrates the effects of relevant PowerShell commands, offering hands-on insights and implications.</em></blockquote><blockquote><em>Get-WinEvent Command: Explore the Get-WinEvent cmdlet to retrieve security events, focusing on Event ID 4625 for failed login attempts.</em></blockquote><blockquote><em>OutGridView Usage: Use OutGridView for visually inspecting, sorting, and filtering results, enhancing the command’s graphical presentation</em>.</blockquote><blockquote>I would love to hear from you! ask questions, or provide feedback in the comments below. Let’s keep the conversation going and empower each other in the ever-evolving landscape of cybersecurity. Together, we can build a stronger digital defence</blockquote><p>Disclaimer:</p><p>This article provides information for educational purposes only. Readers must adhere to local cybersecurity laws and regulations. The author does not endorse illegal or malicious activities. Unauthorized logging should only be pursued with explicit authorization from target entities. The author and publisher disclaim responsibility for any misuse of the presented information</p><p>Written by Khaled Mahmud</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f97dbb742202" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering DNS Reconnaissance or DNS Enumeration: A Comprehensive Guide with Practical Commands and…]]></title>
            <link>https://medium.com/@sujonlondon/mastering-dns-reconnaissance-or-dns-enumeration-a-comprehensive-guide-with-practical-commands-and-585306e6c919?source=rss-86c82f15e614------2</link>
            <guid isPermaLink="false">https://medium.com/p/585306e6c919</guid>
            <dc:creator><![CDATA[Khaled Mahmud ]]></dc:creator>
            <pubDate>Fri, 05 Jan 2024 02:10:23 GMT</pubDate>
            <atom:updated>2024-01-05T02:10:23.180Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Mastering DNS Reconnaissance or DNS Enumeration: A Comprehensive Guide with Practical Commands and Tools</strong></p><p><strong>Introduction</strong>: Embark on a journey into the realm of DNS reconnaissance, also recognized as DNS enumeration, with this in-depth guide. Here, you’ll grasp the fundamental techniques for acquiring vital information about a target or network by delving into the world of DNS records. This article provides easy-to-follow instructions and practical commands for DNS reconnaissance, spotlighting tools like nslookup, dig, and host that caters to diverse operating systems. Whether you’re navigating Windows, Linux, macOS, or PowerShell, delve into the art of performing efficient DNS lookups. Unearth valuable insights into domains, IP addresses, mail servers, and more, elevating your prowess in cybersecurity assessments. Brace yourself to confidently traverse the DNS landscape, employing a mix of classic command-line tools and convenient online utilities. Get ready for a hands-on exploration of DNS reconnaissance that blends the traditional with the modern.</p><p><strong>DNS Reconnaissance</strong></p><p>DNS reconnaissance, or DNS enumeration, is the process of gathering information about a target or network by querying and analyzing Domain Name System (DNS) records. This reconnaissance technique aims to extract valuable details, such as domain names, associated IP addresses, mail servers, and other DNS-related information, to gain insights into the target’s infrastructure.</p><p>DNS reconnaissance is often a preliminary step in the information-gathering phase of cybersecurity assessments, helping identify potential vulnerabilities and facilitating the mapping of network resources.</p><p>To perform DNS regulation, one can start with the “nslookup” command line tool. For instance, to check information related to a company name, such as “example.com,” use the following commands in different environments:</p><p><strong>Windows Environment:</strong></p><p><em>Command Prompt</em></p><p>Executing nslookup Command:</p><p>To perform a DNS lookup, enter the following command in your terminal:</p><p>$ nslookup example.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/0*rN8wcKVyGNnG1HNZ" /></figure><p><strong><em>PowerShell</em></strong></p><p>Open the PowerShell console, and use the resolve- DnsName comdlet. For instance:</p><p>$ Resolve-DnsName example.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*x_fNR9v6kRecc5D2" /></figure><p><strong>Linux / Unix environment</strong></p><p>1. Terminal</p><p>Open terminal. Type Nslookup followed by name or IP address. After command outcome would be similar;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*mc-r0hkB2pRaetvx" /></figure><p>2. dig command</p><p>The dig command (domain information Gropher) is used in Linux/Unix systems for DNS queries for example: dig example.com, the outcome would be like this pattern;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*WwmRYCteBmvpXEM6" /></figure><p><strong>macOS Environment:</strong></p><p>In macOS, the commands are similar to those in Linux. Open the terminal and use either “nslookup” or “dig” commands.</p><p>$ nslookup example.com</p><p>Or</p><p>$ dig example.com</p><p>Network Devices (Router and Switch):</p><p>Some network devices, particularly those with embedded operating systems, are equipped with basic commands available in their command line interface (CLI).</p><p>Online Tools:</p><p>Various websites and utilities offer the functionality of DNS lookups without the need for a command line interface (CLI).</p><ol><li><a href="https://www.nslookup.io/">DNS lookup</a></li><li><a href="https://mxtoolbox.com/">MXToolbox</a></li><li><a href="https://www.dnswatch.info/">DNSWatch</a></li><li><a href="https://www.whatsmydns.net/">WhattsMyDNS</a></li></ol><p>For searching on MXToolbox or other utilities, enter the domain name, such as example.com or exampleltd.com, ensuring authenticity as registered.</p><p>NB. Remember: nslookup is an older tool, and its usage has been deprecated on some platforms in favour of modern DNS utilities and online facilities</p><p><strong>SPF (Sender Policy Framework) or CNAME (Canonical Name)</strong></p><p>General uses:</p><p>host, nslookup and dig commands are all used for DNS-related queries, but they are different in terms of features, output and availability across different operating systems `host` available on Unix-like system (Linux, macOS) as part of the BIND utilities package. Not available by default on Windows.</p><p>Host command features: DNS queries and reverse lookups</p><p>e.g host example.com</p><p>host 192.0.2.0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*CuM6Hs2M6LwuQERK" /></figure><p>dig: The dig (domain information groper) command is used for DNS queries and is commonly found in Unix-like systems. Output; extensive feature, set, DNSSEC, EDNs For example:</p><p>$ dig example.com</p><p>$ dig -X 192.0.2.0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*GL-xTy-Nk74zJGvn" /></figure><p>$ dig -X 192.0.2.0 (The ‘dig’ command with the ‘-x’ flag is typically used for performing reverse DNS lookups)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/0*gldaHB_zR73pRozV" /></figure><p>Nslookup features; include options for debugging and troubleshooting</p><p>$ nslookup example.com</p><p>$ nslookup 192.0.2.0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*jLBK_sN_Bo-5dTw6" /></figure><p>$ dig example.com</p><blockquote><strong><em>Disclaimer:</em></strong></blockquote><blockquote><em>The information in this article is for educational purposes only. Readers are advised to follow local laws and regulations in their areas when using tools for cybersecurity reconnaissance. The author does not endorse illegal or malicious activities. Individuals engaging in reconnaissance should obtain explicit authorization from target entities. The author and publisher are not responsible for any misuse of the presented information.</em></blockquote><blockquote><em>For research and educational purposes, I’ve used example.com and IP addresses from reserved ranges defined in RFC 5735, such as 192.0.2.0, etc. These domain names are reserved by the Internet Engineering Task Force (IETF) for testing, documentation, and educational purposes. The IP addresses are reserved by the Internet Assigned Numbers Authority (IANA) for use in documentation and educational materials. They are not associated with real devices or networks.</em></blockquote><p>Written by Khaled Mahmud</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=585306e6c919" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>