{"id":2110,"date":"2021-01-09T14:18:46","date_gmt":"2021-01-09T13:18:46","guid":{"rendered":"https:\/\/andreas-klingler.de\/infosec\/?p=2110"},"modified":"2024-09-29T10:44:52","modified_gmt":"2024-09-29T08:44:52","slug":"139-445-smb","status":"publish","type":"post","link":"https:\/\/infosec.andreas-klingler.de\/?p=2110","title":{"rendered":"139\/445 <span class=\"caps\">SMB<\/span>"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Note<\/em>: 139 = Net\u00adBIOS is a ses\u00adsion lay\u00ader pro\u00adto\u00adcol and ser\u00advice and dif\u00adfer\u00adent from 445&nbsp;<span class=\"caps\">SMB<\/span>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enumeration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Mandatory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have no cre\u00adden\u00adtials&nbsp;yet:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Enu\u00admer\u00adate enum4linux:<br><code>enum4linux -a $target<\/code><\/li>\n\n\n\n<li>Enu\u00admer\u00adate shares:<br><code>smbmap -r -H $<code>target<\/code> -u Guest<\/code><br><code>smbmap -r -H $<code>target<\/code><\/code><br><code>nmap --script smb-enum-shares.nse -p445 $target<\/code><br><code>smbclient --no-pass -L \/\/$target<\/code><\/li>\n\n\n\n<li>Per\u00adform nbtscan to query valid Net\u00adBIOS names:<br><code>nbtscan -r 10.0.0.0\/24<\/code><\/li>\n\n\n\n<li>Per\u00adform nmap script scan(s): (! Don\u2019t use all of them, <a href=\"https:\/\/andreas-klingler.de\/infosec\/?p=3889\" data-type=\"post\" data-id=\"3889\">see the nmap script post<\/a> and chosse promis\u00ading nmap scripts!)<br><code>nmap --script=smb-* -p445 $target<\/code><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you have already user credentials:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Enu\u00admer\u00adate shares:<br><code>smbmap -u L4mpje -p 'bureaulampje' -d WORKGROUP -H $target -R<\/code><\/li>\n\n\n\n<li>Exe\u00adcute a com\u00admand (alter\u00adna\u00adtive\u00adly with <a href=\"https:\/\/andreas-klingler.de\/infosec\/?p=1324\" data-type=\"post\" data-id=\"1324\">pht-winexe<\/a>, <a href=\"https:\/\/andreas-klingler.de\/infosec\/?p=1222\" data-type=\"post\" data-id=\"1222\">Impack\u00adet tools<\/a>, see also <a href=\"https:\/\/andreas-klingler.de\/infosec\/?p=1839\" data-type=\"post\" data-id=\"1839\">Win\u00addows Com\u00admand exe\u00adcu\u00adtion<\/a>):<br><code>smbmap -u ariley -p 'pass' -d WORKGROUP -x 'whoami' -H $target<\/code><\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">On Windows<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Enu\u00admer\u00adate open shares to the tar\u00adget dc01:<br><code>&gt;net view \\\\dc01 \/all<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Optional<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Try oth\u00ader pro\u00adgrams for enu\u00admer\u00ada\u00adtion<a href=\"https:\/\/andreas-klingler.de\/infosec\/?p=1473\" data-type=\"post\" data-id=\"1473\"> from the <span class=\"caps\">SMB<\/span> blog&nbsp;post.<\/a><\/li>\n\n\n\n<li>Try to spray passwords.<\/li>\n\n\n\n<li>If you have access with smb\u00adclient, try alter\u00adna\u00adtive data streams:<br><code>smb: \\C.Smith\\HQK Reporting&gt; allinfo \"Debug Mode Password.txt\"<\/code><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Note: 139 = Net\u00adBIOS is a ses\u00adsion lay\u00ader pro\u00adto\u00adcol and ser\u00advice and dif\u00adfer\u00adent from 445&nbsp;<span class=\"caps\">SMB<\/span>. Enu\u00admer\u00ada\u00adtion Manda\u00adto\u00adry If you have no cre\u00adden\u00adtials&nbsp;yet: If you have already user cre\u00adden\u00adtials: On Win\u00addows Optional<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[36],"tags":[37,54],"class_list":["post-2110","post","type-post","status-publish","format-standard","hentry","category-port","tag-checklist","tag-smb"],"_links":{"self":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2110"}],"version-history":[{"count":13,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2110\/revisions"}],"predecessor-version":[{"id":4478,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2110\/revisions\/4478"}],"wp:attachment":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}