{"id":226,"date":"2025-01-26T00:00:00","date_gmt":"2025-01-25T23:00:00","guid":{"rendered":"https:\/\/kosokoking.com\/?p=226"},"modified":"2025-01-24T19:53:59","modified_gmt":"2025-01-24T18:53:59","slug":"unmasking-nfs-dns-recon-tactics-unveiled-now","status":"publish","type":"post","link":"https:\/\/kosokoking.com\/index.php\/security\/unmasking-nfs-dns-recon-tactics-unveiled-now\/","title":{"rendered":"Unmasking NFS &amp; DNS: Recon Tactics Unveiled Now"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When it comes to network reconnaissance and exploitation, two services often overlooked yet brimming with potential are&nbsp;<strong>Network File System (NFS)<\/strong>&nbsp;and&nbsp;<strong>Domain Name System (DNS)<\/strong>. Both are staples in many environments, yet they can be mis-configured in ways that expose sensitive data or provide footholds for attackers. Let us dissect a systematic approach to probing these services, complete with actionable insights and technical details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Unpacking NFS: Gaining Access to Shared Resources<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">NFS is widely used for sharing files across systems in Unix\/Linux environments, but its improper configuration can lead to significant security risks. Here, we focus on how to enumerate and exploit an NFS share exposed on ports&nbsp;2049&nbsp;and&nbsp;111.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Initial Enumeration<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by identifying the services running on the target system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nmap 10.129.14.128 -p111,2049 -sV -sC<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command scans for open ports, probes service versions (<code>-sV<\/code>), and runs default scripts (<code>-sC<\/code>). If NFS is detected, you can dig deeper using specialised scripts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nmap --script nfs* 10.129.14.128 -sV -p111,2049<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Exported Shares<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once NFS is confirmed as active, use&nbsp;showmount&nbsp;to list exported directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>showmount -e 10.129.14.128<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This reveals which directories are shared and accessible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Mounting the Share<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If an exported directory is identified, mount it locally for inspection:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir target-NFS<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mount -t nfs 10.129.14.128:\/ .\/target-NFS\/ -o nolock<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cd target-NFS<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;nolock&nbsp;option bypasses file-locking issues that might arise during the mount process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Exploring the Share<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once mounted, analyse the directory structure and permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tree .<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -l mnt\/nfs\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -n mnt\/nfs\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Look for sensitive files or directories that could provide valuable information or further access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Clean Up<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After completing your reconnaissance or exploitation, unmount the share to avoid leaving traces.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo umount .\/target-NFS<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>DNS Reconnaissance: Mapping the Network<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">DNS is the cornerstone of modern networks, translating human-readable domain names into IP addresses. However, misconfigurations like open zone transfers can expose a treasure trove of information about internal infrastructure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Configuration Files<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by reviewing DNS configuration files if you have access:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/bind\/named.conf.local<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/bind\/db.domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These files often reveal domain names, sub-domains, and other critical details.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Basic Queries<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use\u00a0<code>dig<\/code>\u00a0to query specific records from the DNS server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dig ns inlanefreight.htb @10.129.14.128<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>dig CH TXT version.bind @10.129.120.85<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first command retrieves name server (NS) records, while the second attempts to extract the DNS server\u2019s version\u2014a potential vulnerability indicator.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Zone Transfers<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A mis-configured DNS server may allow unauthorised zone transfers, exposing all its records:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dig axfr inlanefreight.htb @10.129.14.128<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>dig axfr internal.inlanefreight.htb @10.129.14.128<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Zone transfers provide a complete view of DNS records, including internal domains and sub-domains.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Sub-domain Enumeration<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Leverage tools like&nbsp;dnsenum&nbsp;to automate Sub-domain discovery:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnsenum --dnsserver 10.129.14.128 --enum -p 0 -s 0 \\<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-o subdomains.txt \\<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-f \/opt\/useful\/SecLists\/Discovery\/DNS\/subdomains-top1million-110000.txt inlanefreight.htb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This approach systematically probes for sub-domains using a wordlist.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion: The Devil\u2019s in the Details<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Both NFS and DNS offer indispensable functionality in networked environments but can become liabilities when improperly secured. By methodically enumerating these services using tools like\u00a0nmap,\u00a0showmount,\u00a0dig, and\u00a0dnsenum, you can uncover vulnerabilities that might otherwise go unnoticed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you are a penetration tester or a system administrator shoring up defences, understanding these techniques is critical for staying ahead of potential attackers. Remember, security is only as strong as its weakest link and with services like NFS and DNS, those links are often hiding in plain sight.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Discover how to securely mount NFS shares, conduct DNS zone transfers, and uncover subdomains in plain sight. Strengthen your defense now. Boost security now!!!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[177,174,176,52,173,95,162,178,172,175],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-security","tag-cybersecurity-best-practices","tag-dns","tag-enumeration","tag-network-security","tag-nfs","tag-nmap","tag-penetration-testing","tag-subdomain-enumeration","tag-vulnerability-assessment","tag-zone-transfers"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":1,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kosokoking.com\/index.php\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}