Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1185365%22%20slang%3D%22en-US%22%3ESMB%20and%20Null%20Sessions%3A%20Why%20Your%20Pen%20Test%20is%20Probably%20Wrong%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1185365%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%20James%20Kehr%20here%20with%20a%20guest%20post.%20One%20of%20the%20SMB%20cases%20we%20get%20regularly%20at%20Microsoft%20Support%20is%2C%20%E2%80%9Cmy%20pen%20test%20says%20you%20allow%20Null%20sessions!%E2%80%9D%20Followed%20by%20a%20string%20of%20CVE%20numbers%3B%20like%2C%20CVE-1999-0519%20and%20CVE-1999-0520.%20Which%20can%20sometimes%20lead%20to%2C%20%E2%80%9CWhy%20hasn%E2%80%99t%20Microsoft%20fixed%20this%3F%20It%E2%80%99s%20been%2020%20years!%E2%80%9D%20This%20post%20will%20show%20why%20this%20is%20probably%20a%20false%20positive%20on%20modern%20Windows.%20And%20if%20it%E2%80%99s%20not%2C%20someone%20may%20have%20done%20something%20very%20bad%20to%20your%20Windows%20installation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--707799235%22%20id%3D%22toc-hId--707799235%22%3ENull%20sessions%3C%2FH4%3E%0A%3CP%3EOne%20of%20the%20technologies%20I%20have%20worked%20with%20the%20most%20during%20my%20time%20at%20Microsoft%20is%20SMB.%20You%20may%20also%20know%20SMB%20by%20one%20of%20the%20other%20common%20names%3A%20CIFS%20and%20Samba.%20While%20these%20are%20technically%20three%20different%20things%2C%20many%20people%20use%20the%20terms%20interchangeably%20to%20describe%20the%20same%20network%20file%20system%20protocol.%20Why%3F%20That%E2%80%99s%20a%20long%20story%20involving%20IBM%2C%20Microsoft%2C%20Linux%2C%20and%20about%2035%20years%20of%20history.%20All%20you%20need%20to%20know%20is%20that%20at%20Microsoft%20we%20use%20the%20term%20SMB%20(Server%20Message%20Block).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20if%20you%20must%20know%2C%20the%20simplified%20version%20goes%20something%20like%20this%3A%20SMB%20is%20the%20protocol%2C%20CIFS%20is%20an%20old%20dialect%20of%20SMB%2C%20and%20Samba%20is%20the%20Linux%2FUnix-like%20implementation%20of%20the%20SMB%20protocol.%20People%20and%20companies%20get%20familiar%20with%20one%20of%20those%20terms%20and%20stick%20to%20it%2C%20which%20has%20made%20the%20three%20names%20interchangeable%20outside%20of%20technical%20documentation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20is%20a%20Null%20Session%20you%20may%20ask%3F%20A%20null%20session%20implies%20that%20access%20to%20a%20network%20resource%2C%20most%20commonly%20the%20IPC%24%20%22Windows%20Named%20Pipe%22%20share%2C%20was%20granted%20without%20authentication.%20Also%20known%20as%20anonymous%20or%20guest%20access.%20Windows%20has%20not%20allowed%20null%20or%20anonymous%20access%20for%20a%20very%20long%20time.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1779713598%22%20id%3D%22toc-hId-1779713598%22%3ECredentials%20and%20SMB%3C%2FH4%3E%0A%3CP%3EMost%20intrusion%20detection%20software%20doesn%E2%80%99t%20seem%20to%20understand%20how%20Windows%20auth%20works%20over%20SMB%20in%20an%20Active%20Directory%20(AD)%20environment%2C%20and%20that%20is%20usually%20the%20cause%20of%20the%20false%20positive.%20Windows%20and%20SMB%20really%20want%20people%20to%20make%20a%20successful%20connection%20to%20a%20file%20share%20and%20they%20go%20out%20of%20their%20way%20to%20try%20every%20possible%20credential%20available%20to%20complete%20the%20connection.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPeople%20tend%20to%20think%20of%20a%20username%20as%20the%20only%20authentication%20mechanism%20and%2C%20in%20a%20workgroup%2C%20that%20is%20mostly%20right.%20Add%20AD%20to%20the%20mix%20and%20the%20authentication%20story%20changes.%20The%20act%20of%20joining%20a%20computer%20to%20a%20domain%20creates%20a%20computer%20object.%20The%20computer%20object%20(%3CHOSTNAME%3E%24)%20is%20a%20valid%20authentication%20object%20in%20AD%20and%20can%20be%20used%20to%20authenticate%20to%20Windows%20and%20an%20SMB%20share.%20Though%20it%20is%20rare%20that%20SMB%20falls%20back%20to%20the%20computer%2C%20or%20machine%2C%20account%2C%20it%20is%20possible.%3C%2FHOSTNAME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20way%20of%20example%2C%20Hyper-V%20can%20be%20setup%20to%20access%20virtual%20hard%20drives%20over%20SMB%203%20without%20using%20S2D%20or%20a%20SAN.%20This%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fwindows%2Fit-pro%2Fwindows-server-2012-r2-and-2012%2Fjj134187(v%253Dws.11)%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Esetup%3C%2FA%3E%20uses%20the%20machine%20account%20of%20the%20Hyper-V%20host(s)%20to%20access%20the%20SMB%20share%20rather%20than%20a%20user%20or%20a%20service%20account.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20no%20account%20is%20explicitly%20provided%20SMB%20will%20try%20implicit%20credentials.%20First%2C%20the%20logged-on%20user%E2%80%99s%20account%2C%20and%20then%2C%20sometimes%2C%20the%20computer%20object.%20Some%20shares%20and%20third-party%20file%20servers%20with%20certain%20permissions%20will%20allow%20computer%20accounts%20to%20connect.%20You%20may%20have%20limited%20or%20no%20usable%20access%2C%20but%20it%20will%20authenticate.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUsing%20implicit%20credentials%20is%20not%20a%20null%20session%20connection%20since%20credentials%20are%20being%20provided%3B%20even%20though%2C%20they%20were%20not%20explicitly%20provided.%20This%20means%20the%20SMB%20session%20is%20being%20authorized%2C%20and%20therefore%20not%20a%20null%20session.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20are%20implicit%20and%20explicit%20credentials%2C%20exactly%3F%20An%20explicit%20credential%20is%20one%20that%20is%20provided%20as%20part%20of%20authentication.%20It%E2%80%99s%20like%20clicking%20the%20%E2%80%9CConnect%20using%20different%20credentials%E2%80%9D%20checkbox%20when%20mapping%20a%20drive%20with%20File%20Explorer%2C%20or%20%2Fuser%20with%20%E2%80%9Cnet%20use%E2%80%9D.%20%26nbsp%3BImplicit%20credentials%20are%20the%20opposite%20of%20that.%20When%20no%20explicit%20credential%20is%20provided%20it%20is%20implied%20that%20the%20operating%20system%20should%20use%20the%20credentials%20of%20the%20current%20logged-on%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--27740865%22%20id%3D%22toc-hId--27740865%22%3EThe%20Test%3C%2FH4%3E%0A%3CP%3EYou%20don%E2%80%99t%20believe%20me%2C%20do%20you%3F%20The%20pen%20test%20said%20it%E2%80%99s%20a%20null%20session.%20You%20even%20ran%20the%20commands%20to%20prove%20it.%20Now%20you%20think%20Microsoft%20is%20up%20to%20their%20old%20tricks.%20The%2020-year-old%20null%20session%20bug%20still%20isn%E2%80%99t%20fixed!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFine%2C%20let%20me%20prove%20it%20to%20you.%20These%20are%20all%20tests%20anyone%20can%20run%20to%20confirm.%20I%E2%80%99ll%20use%20Wireshark%2C%20the%20industry%20standard%20packet%20capture%20and%20analysis%20tool%2C%20with%20three%20main%20tests%20for%20your%20edification.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EWorkgroup%20to%20Workgroup%3C%2FSTRONG%3E%20%E2%80%93%20Two%20non-domain%20joined%20Windows%2010%201903%20(Spring%202019%20Update)%20systems.%20All%20updates%20installed%2C%20through%20Oct%202019.%20No%20changes%20made%20other%20than%20setting%20up%20a%20file%20share.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EWorkstation%20to%20Workstation%3C%2FSTRONG%3E%20%E2%80%93%20Two%20domain%20joined%20Windows%2010%201903%20(Spring%202019%20Update)%20systems.%20All%20updates%20installed%2C%20through%20Oct%202019.%20No%20changes%20made%20other%20than%20domain%20join%20and%20setting%20up%20a%20file%20share.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EWorkstation%20to%20Domain%20Controller%20(DC)%3C%2FSTRONG%3E%20%E2%80%93%20One%20domain%20joined%20workstation%20to%20the%20DC.%20Workstation%20running%20fully%20patched%20Win10%201903%2C%20DC%20running%20fully%20patched%20Windows%20Server%202019.%20Default%20domain%20policies%2C%20no%20hardening%2C%20no%20extra%20policies%20or%20configuration.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThere%20are%20two%20commands%20commonly%20used%20to%20test%20null%20sessions%2C%20and%20I%E2%80%99ll%20be%20testing%20both%2C%20plus%20one%20extra%20scenario-based%20test.%20This%20first%20command%20explicitly%20sets%20a%20NULL%20user%20(%2Fuser%3A)%20and%20password%20(%22%22)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%3C%2FSTRONG%3E%3CSTRONG%3E%5C%5C%3CIP%20address%3D%22%22%3E%5CIPC%24%20%22%22%20%2Fuser%3A%3C%2FIP%3E%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EThe%20second%20command%20sets%20no%20explicit%20credentials.%20This%20is%20where%20the%20more%20interesting%20behavior%20will%20happen%20because%20it%20leaves%20room%20for%20Windows%20to%20try%20implicit%20credentials.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%3C%2FSTRONG%3E%3CSTRONG%3E%5C%5C%3CIP%20address%3D%22%22%3E%5CIPC%24%3C%2FIP%3E%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EA%20normal%20share%20for%20non-IPC%24%20testing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C%3CIP%20address%3D%22%22%3E%5Cshare%3C%2FIP%3E%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EFor%20domain%20testing%20I%E2%80%99ll%20use%20the%20domain%E2%80%99s%20SYSVOL%20share.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C%3CDC%3E%5CSYSVOL%3C%2FDC%3E%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1835195328%22%20id%3D%22toc-hId--1835195328%22%3EUnderstanding%20IPC%24%3C%2FH4%3E%0A%3CP%3EThe%20inter-process%20communication%20share%20(%22IPC%24%22)%20is%20a%20special%20case.%20It%E2%80%99s%20the%20share%20that%20allows%20remote%20Named%20Pipe%20access.%20Names%20Pipes%20are%20an%20old-school%20method%20used%20to%20allow%20two%20services%20to%20talk%20with%20each%20other%2C%20even%20over%20a%20network%20connection.%20IPC%24%20functionality%20has%20been%20around%20for%20ages%20and%20default%20access%20rules%20to%20IPC%24%20has%20changed%20with%20each%20release%20of%20Windows.%20Older%20versions%20of%20Windows%20may%20behave%20differently%20than%20these%20tests.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ENetwork%20setup%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ESubnet%3A%2010.19.0.0%2F24%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EServer%3A%20%26nbsp%3B%26nbsp%3B%26nbsp%3B10.19.0.1%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ERedWrk%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%2010.19.0.2%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EBlueWrk%3A%26nbsp%3B%26nbsp%3B%2010.19.0.3%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EDomain%20User%20accounts%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ERedUser%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EBlueUser%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EDomain%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ECONSTOSO%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ELocal%20accounts%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ELclRed%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ELclBlue%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EComputer%20names%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ERedWrk%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EBlueWrk%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-652317505%22%20id%3D%22toc-hId-652317505%22%3EHow%20SMB%20Connects%3C%2FH4%3E%0A%3CP%3EThere%E2%80%99s%20a%20bit%20of%20basic%20knowledge%20that%20may%20be%20needed%20before%20we%20proceed.%20There%20are%20three%20key%20SMB%20commands%20used%20for%20authentication%20and%20authorization%3A%20Negotiate%2C%20Session%20Setup%2C%20and%20Tree%20Connect.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ENegotiate%3C%2FSTRONG%3E%20%E2%80%93%20This%20command%20determines%20what%20dialect%20of%20SMB%20(major.minor%20version)%20will%20be%20used%2C%20discovers%20basic%20settings%2C%20and%20can%20perform%20some%20pre-authentication%2C%20depending%20on%20dialect.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESession%20Setup%3C%2FSTRONG%3E%20%E2%80%93%20This%20is%20where%20authentication%20is%20performed.%20Credentials%2C%20Kerberos%20tickets%2C%20or%20security%20tokens%20are%20exchanged%20here%2C%20and%20general%20authorization%20is%20either%20granted%20or%20denied%20at%20this%20step.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ETree%20Connect%3C%2FSTRONG%3E%20%E2%80%93%20This%20is%20where%20authorization%20to%20a%20share%20happens.%20Tree%20Connect%20takes%20the%20security%20account%20from%20Session%20Setup%20and%20uses%20that%20to%20determine%20whether%20access%20to%20the%20individual%20share(s)%20should%20be%20granted.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EBecause%20of%20the%20way%20SMB%20works%2C%20it%E2%80%99s%20possible%20to%20authenticate%20successfully%20but%20not%20get%20access%20to%20any%20resources.%20This%20is%20why%20it%E2%80%99s%20important%20to%20look%20under%20the%20proverbial%20covers%20to%20see%20what%E2%80%99s%20really%20going%20on%20before%20making%20final%20judgement.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20to%20the%20tests%E2%80%A6%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1155136958%22%20id%3D%22toc-hId--1155136958%22%3EWorkgroup%20to%20Workgroup%3C%2FH4%3E%0A%3CP%3EThis%20is%20the%20basic%20home%20scenario.%20Two%20computers%20used%20by%20a%20regular%20folks%20who%20just%20want%20things%20to%20work%20without%20ever%20opening%20a%20settings%20console%20in%20their%20entire%20life.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECommand%3A%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5CIPC%24%20%22%22%20%2Fuser%3A%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EResult%3A%20No%20access%20granted.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_0-1582228625717.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172302i0DEC2EDE552B7D34%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_0-1582228625717.png%22%20alt%3D%22JamesKehr_0-1582228625717.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5CIPC%24%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EResult%3A%20No%20access%20granted.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_1-1582228625720.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172303iC76D71CA59EDAA45%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_1-1582228625720.png%22%20alt%3D%22JamesKehr_1-1582228625720.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENOTE%3A%20Windows%20refused%20to%20complete%20the%20connection%20without%20supplying%20credentials.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5Cshare%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EResult%3A%20No%20access%20granted.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_2-1582228625722.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172304iA9EB04F8490F0C4E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_2-1582228625722.png%22%20alt%3D%22JamesKehr_2-1582228625722.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ENOTE%3A%3C%2FEM%3E%20Windows%20refused%20to%20complete%20the%20connection%20without%20supplying%20credentials.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20all%20expected%20behavior%20because%20RedWrk%20and%20BlueWrk%20have%20no%20inherent%20trust%20between%20each%20other.%20No%20centralized%20authentication%20method%20means%20that%20each%20workgroup%20member%20must%20rely%20on%20their%20local%20security%20database%2C%20which%20does%20not%20contain%20details%20about%20the%20other%20workgroup%20member(s)%20unless%20those%20details%20are%20explicitly%20added.%20This%20means%20that%20all%20anonymous%20and%20implicit%20authentication%20methods%20will%20fail.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1332375875%22%20id%3D%22toc-hId-1332375875%22%3EWorkstation%20to%20Workstation%20(Domain-joined)%3C%2FH4%3E%0A%3CP%3ERedWrk%20and%20BlueWrk%20were%20joined%20to%20the%20domain%20for%20the%20next%20step.%20The%20same%20%E2%80%9Cnet%20use%E2%80%9D%20commands%20were%20run%20from%20RedWrk%20to%20BlueWrk.%20This%20is%20where%20things%20start%20to%20get%20interesting%20for%20us.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECommand%3A%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5CIPC%24%20%22%22%20%2Fuser%3A%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EResult%3A%20No%20change%20in%20behavior.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_3-1582228625726.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172305iF9524A6FBE374A67%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_3-1582228625726.png%22%20alt%3D%22JamesKehr_3-1582228625726.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20first%20example%2C%20with%20%E2%80%9C%3CSTRONG%3E%2Fuser%3A%3C%2FSTRONG%3E%E2%80%9D%2C%20is%20an%20explicit%20null%20credential%2C%20which%20is%20denied%20by%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5CIPC%24%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_4-1582228625727.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172306iD26B431A1C203AFE%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_4-1582228625727.png%22%20alt%3D%22JamesKehr_4-1582228625727.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CAh%20ha!%20It%20worked!%20Vindication!%E2%80%9D%20I%20hear%20you%20cry.%20%E2%80%9CThat%E2%80%99s%20a%20null%20session!%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUm%2C%20no.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERemember%20when%20I%20said%20Windows%20really%20wants%20to%20make%20that%20connection%20work%3F%20Well%2C%20we%20really%20do%2C%20and%20when%20no%20credential%20is%20entered%20Windows%20will%20automatically%20try%20the%20user%E2%80%99s%20domain%20credential.%20This%20is%20the%20implicit%20credential%20I%E2%80%99ve%20been%20talking%20about.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20look%20at%20the%20packet%20capture.%20Specifically%2C%20the%20Session%20Setup%20part%2C%20where%20authentication%20happens.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3ENo.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3ETime%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3ESource%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3EDestination%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3EProtocol%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3ELength%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3EInfo%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E0.061281%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E661%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Request%2C%20NTLMSSP_AUTH%2C%20User%3A%20CONTOSO%5CRedUser%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E11%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E0.093470%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E159%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Response%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20will%20note%20that%20RedWrk%20sent%20the%20CONTOSO%5CRedUser%20account%2C%20even%20though%20we%20didn%E2%80%99t%20explicitly%20set%20that%20credential.%20This%20is%20the%20same%20mechanism%20that%20allows%20you%20to%20connect%20to%20your%20work%20shared%20drives%20through%20Windows%20Explorer%20without%20explicitly%20entering%20your%20Windows%20credentials%2C%20just%20in%20command%20line%20form.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20valid%20domain%20credentials%20were%20passed%20and%20accepted%2C%20this%20is%20not%20a%20null%20session.%20Even%20though%20it%20may%20look%20like%20one%20on%20the%20surface.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20notice%20that%20SMB%20is%20using%20NTLM%20authentication%20and%20not%20Kerberos%20in%20some%20tests.%20This%20can%20happen%20when%20an%20IP%20address%20is%20used%20instead%20of%20a%20hostname%20or%20FQDN%20(Fully%20Qualified%20Domain%20Name).%3C%2FP%3E%0A%3CP%3EThis%20is%20because%20an%20IP%20address%20requires%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fwindows-server%252Fsecurity%252Fkerberos%252Fconfiguring-kerberos-over-ip%26amp%3Bdata%3D04%257C01%257Cnedpyle%2540microsoft.com%257Cca0f8d886122459011bc08d7bc5a0a7c%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637184967217999456%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C-1%26amp%3Bsdata%3DKTvhvKXVnS99PH9GOs6dVr8kC7JMMJs81KjRaXQq%252Flk%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ea%20little%20extra%20setup%3C%2FA%3E%20to%20be%20a%20valid%20Kerberos%20object.%20Also%2C%20NTLM%20is%20in%20plain%20text%20which%20makes%20authentication%20easier%20to%20understand%20in%20the%20context%20of%20an%20article.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.3%5Cshare%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_5-1582228625728.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172307i2A7540E209A516F1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_5-1582228625728.png%22%20alt%3D%22JamesKehr_5-1582228625728.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESame%20story%20as%20the%20previous%20command.%20SMB%20used%20the%20domain%20account%20of%20the%20logged-on%20user%20and%20the%20connection%20was%20successful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%E2%80%99s%20the%20packet%20capture%20data%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E0.027866%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E639%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Request%2C%20NTLMSSP_AUTH%2C%20User%3A%20CONTOSO%5CRedUser%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E11%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E0.035118%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E159%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Response%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--475078588%22%20id%3D%22toc-hId--475078588%22%3EWorkstation%20to%20Domain%20Controller%3C%2FH4%3E%0A%3CP%3ECommand%3A%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.1%5CIPC%24%20%22%22%20%2Fuser%3A%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EResult%3A%20No%20change%20in%20behavior.%20Null%20sessions%20are%20not%20allowed.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_6-1582228625729.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172308i4E39DC0DF43B3C81%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_6-1582228625729.png%22%20alt%3D%22JamesKehr_6-1582228625729.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.1%5CIPC%24%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EThis%20command%20works%20because%20the%20Windows%20user%20credentials%20were%20passed.%20No%20NULL%20sessions%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E17%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E69.625346%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E639%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Request%2C%20NTLMSSP_AUTH%2C%20User%3A%20CONTOSO%5CRedUser%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E18%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E69.632472%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E159%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Response%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Enet%20use%20%5C%5C10.19.0.1%5CSYSVOL%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3EWhat%20have%20we%20here%3F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_7-1582228625730.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172309i0B3E617AE3728D5E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_7-1582228625730.png%22%20alt%3D%22JamesKehr_7-1582228625730.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEverything%20in%20the%20packet%20capture%20looks%20like%20it%20should%20connect%2C%20but%20SYSVOL%20is%20a%20special%20case.%3C%2FP%3E%0A%3CP%3EThe%20SYSVOL%20and%20NETLOGON%20shares%20require%20Keberos%20authentication%20on%20modern%20Windows.%20This%20can%20be%20changed%20by%20policy%2C%20but%20we%20only%20recommend%20it%20when%20you%20have%20a%20legacy%20system%20that%20you%20just%20can%E2%80%99t%20convince%20management%20to%20get%20rid%20of.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fnetwork-security-restrict-ntlm-ntlm-authentication-in-this-domain%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EKerberos%20is%20really%20the%20way%20to%20go.%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20switch%20to%20the%20domain%20name%2C%20which%20switches%20to%20Kerberos%2C%20and%20it%20logs%20right%20in%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JamesKehr_8-1582228625731.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F172310i21C8E20EBDF1BAA7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22JamesKehr_8-1582228625731.png%22%20alt%3D%22JamesKehr_8-1582228625731.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20data%20from%20Wireshark%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E33%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E20.178302%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3EKRB5%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E1379%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ETGS-REQ%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E34%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E20.178941%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3EKRB5%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E1408%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ETGS-REP%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E36%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E20.179357%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E3063%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Request%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E40%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E20.183650%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E10.19.0.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESMB2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3E314%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%0A%3CP%3ESession%20Setup%20Response%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%E2%80%A6%3C%2FP%3E%0A%3CP%3ESMB2%20(Server%20Message%20Block%20Protocol%20version%202)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SMB2%20Header%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Session%20Setup%20Response%20(0x01)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5BPreauth%20Hash%3A%20ce5e61ef7c41ea76682c8bda4ff803ba7f74123a15736201%E2%80%A6%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20StructureSize%3A%200x0009%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Session%20Flags%3A%200x0000%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Blob%20Offset%3A%200x00000048%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Blob%20Length%3A%20184%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Security%20Blob%3A%20a181b53081b2a0030a0100a10b06092a864882f712010202%E2%80%A6%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20GSS-API%20Generic%20Security%20Service%20Application%20Program%20Interface%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Simple%20Protected%20Negotiation%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20negTokenTarg%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20negResult%3A%20accept-completed%20(0)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20supportedMech%3A%201.2.840.48018.1.2.2%20(MS%20KRB5%20-%20Microsoft%20Kerberos%205)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20responseToken%3A%2060819706092a864886f71201020202006f8187308184a003%E2%80%A6%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20krb5_blob%3A%2060819706092a864886f71201020202006f8187308184a003%E2%80%A6%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-2012434245%22%20id%3D%22toc-hId-2012434245%22%3EThe%20Caveat%E2%80%A6%3C%2FH4%3E%0A%3CP%3EThis%20behavior%20is%20not%20necessarily%20default%20in%20older%20versions%20of%20Windows.%20This%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F3034016%2Fipc-share-and-null-session-behavior-in-windows%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Earticle%20covers%20some%20of%20the%20legacy%20Windows%20behavior%3C%2FA%3E%2C%20and%20how%20anonymous%20IPC%24%20access%20can%20be%20prevented.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-204979782%22%20id%3D%22toc-hId-204979782%22%3EKnowing%20is%20Half%20the%20Battle%3C%2FH4%3E%0A%3CP%3EPen%20tests%20can%20only%20go%20into%20so%20much%20depth%20in%20its%20analysis.%20Collecting%20and%20analyzing%20packets%20is%20beyond%20the%20abilities%20of%20most%20products.%20When%20in%20doubt%2C%20validate%20for%20yourself%20whether%20it%E2%80%99s%20a%20false%20positive%20or%20a%20true%20positive.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDownload%20and%20install%20Wireshark%20on%20a%20test%20system%20where%20nothing%20else%20is%20running.%20This%20makes%20reading%20the%20data%20easier.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.wireshark.org%2Fdocs%2Fwsug_html_chunked%2FChapterCapture.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EStart%20a%20Wireshark%20capture%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EReproduce%20the%20issue%20by%20running%20the%20appropriate%20command%20from%20the%20pen%20test.%3C%2FLI%3E%0A%3CLI%3EStop%20the%20Wireshark%20capture.%3C%2FLI%3E%0A%3CLI%3EAdd%20the%20following%20as%20the%20display%20filter%20(case%20sensitive)%3A%20tcp.port%3D%3D445%0A%3CUL%3E%0A%3CLI%3EThis%20filter%20works%20if%20you%20want%20to%20see%20both%20SMB%20and%20Kerberos%20traffic%3A%20tcp.port%3D%3D445%20or%20tcp.port%3D%3D88%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ELook%20at%20the%20SMB%20Session%20Setup%20for%20a%20user%20account%20or%20Kerberos%20ticket.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20false%20positive%20can%20be%20identified%20when%20a%20valid%20authentication%20was%20passed%20under%20the%20covers%20using%20the%20implicit%20credential%20behavior%20of%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOther%20false%20positives%20we%20see%20revolve%20around%20using%20the%20registry%20to%20verify%20SMB%20settings%20and%20SMB%20encryption.%20SMB%20settings%20should%20be%20verified%20via%20PowerShell%2C%20*%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsmbshare%2Fset-smbserverconfiguration%3Fview%3Dwin10-ps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESmbServerConfiguration%3C%2FA%3E%20and%20*%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsmbshare%2Fset-smbclientconfiguration%3Fview%3Dwin10-ps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESmbClientConfiguration%3C%2FA%3E%2C%20and%20through%20packet%20capture%20analysis%20to%20make%20sure%20the%20feature%20is%20working%20properly%3B%20especially%2C%20when%20dealing%20with%20older%20versions%20of%20Windows%20and%20non-Windows%20file%20server%20which%20may%20not%20support%20the%20newest%20features%2C%20or%20have%20the%20full%20SMB%20protocol%20suite%20enabled.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESMB%20encryption%20is%20one%20of%20those%20settings.%20Not%20only%20must%20both%20client%20and%20server%20support%20SMB3%20and%20be%20encryption%20enabled%2C%20but%20file%20share%20or%20server%20must%20explicitly%20enable%20encryption.%20What%20is%20the%20best%20way%20to%20see%20whether%20SMB%20encryption%20and%20other%20security%20features%20are%20working%3F%20You%20guessed%20it%2C%20packet%20capture.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETrying%20to%20determine%20accurate%20results%20from%20pen%20testing%20without%20a%20packet%20capture%20is%20like%20trying%20to%20discover%20life%20in%20the%20deep%20ocean%20by%20staring%20really%20hard%20at%20the%20ocean%20surface%20from%20a%20boat%20deck.%20Sure%2C%20you%20might%20see%20a%20little%20ocean%20life%2C%20but%20you%20won%E2%80%99t%20know%20what%E2%80%99s%20really%20going%20on%20until%20you%20dive%20down%20below%20the%20surface.%20So%20the%20next%20time%20you%20get%20back%20failed%20test%20for%20SMB%20on%20a%20pen%20test%2C%20remember%20to%20check%20those%20packets%20to%20make%20sure%20the%20test%20is%20accurate.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20you%20found%20this%20useful.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20James%20Kehr%2C%20Escalation%20Engineer%2C%20MS%20Networking%20Support%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1185365%22%20slang%3D%22en-US%22%3E%3CP%3ENull%20sessions%20are%20bad%2C%20and%20Windows%20doesn't%20like%20them.%20Learn%20more%20about%20this%20aspect%20of%20SMB%20security%20and%20why%20you%20probably%20don't%20need%20to%20do%20anything%2C%20despite%20what%20your%20auditing%20software%20says.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1185365%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESMB%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Hi everyone, James Kehr here with a guest post. One of the SMB cases we get regularly at Microsoft Support is, “my pen test says you allow Null sessions!” Followed by a string of CVE numbers; like, CVE-1999-0519 and CVE-1999-0520. Which can sometimes lead to, “Why hasn’t Microsoft fixed this? It’s been 20 years!” This post will show why this is probably a false positive on modern Windows. And if it’s not, someone may have done something very bad to your Windows installation.

 

Null sessions

One of the technologies I have worked with the most during my time at Microsoft is SMB. You may also know SMB by one of the other common names: CIFS and Samba. While these are technically three different things, many people use the terms interchangeably to describe the same network file system protocol. Why? That’s a long story involving IBM, Microsoft, Linux, and about 35 years of history. All you need to know is that at Microsoft we use the term SMB (Server Message Block).

 

But if you must know, the simplified version goes something like this: SMB is the protocol, CIFS is an old dialect of SMB, and Samba is the Linux/Unix-like implementation of the SMB protocol. People and companies get familiar with one of those terms and stick to it, which has made the three names interchangeable outside of technical documentation.

 

What is a Null Session you may ask? A null session implies that access to a network resource, most commonly the IPC$ "Windows Named Pipe" share, was granted without authentication. Also known as anonymous or guest access. Windows has not allowed null or anonymous access for a very long time.

 

Credentials and SMB

Most intrusion detection software doesn’t seem to understand how Windows auth works over SMB in an Active Directory (AD) environment, and that is usually the cause of the false positive. Windows and SMB really want people to make a successful connection to a file share and they go out of their way to try every possible credential available to complete the connection.

 

People tend to think of a username as the only authentication mechanism and, in a workgroup, that is mostly right. Add AD to the mix and the authentication story changes. The act of joining a computer to a domain creates a computer object. The computer object (<hostname>$) is a valid authentication object in AD and can be used to authenticate to Windows and an SMB share. Though it is rare that SMB falls back to the computer, or machine, account, it is possible.

 

By way of example, Hyper-V can be setup to access virtual hard drives over SMB 3 without using S2D or a SAN. This setup uses the machine account of the Hyper-V host(s) to access the SMB share rather than a user or a service account.

 

When no account is explicitly provided SMB will try implicit credentials. First, the logged-on user’s account, and then, sometimes, the computer object. Some shares and third-party file servers with certain permissions will allow computer accounts to connect. You may have limited or no usable access, but it will authenticate.

 

Using implicit credentials is not a null session connection since credentials are being provided; even though, they were not explicitly provided. This means the SMB session is being authorized, and therefore not a null session.

 

What are implicit and explicit credentials, exactly? An explicit credential is one that is provided as part of authentication. It’s like clicking the “Connect using different credentials” checkbox when mapping a drive with File Explorer, or /user with “net use”.  Implicit credentials are the opposite of that. When no explicit credential is provided it is implied that the operating system should use the credentials of the current logged-on user.

 

The Test

You don’t believe me, do you? The pen test said it’s a null session. You even ran the commands to prove it. Now you think Microsoft is up to their old tricks. The 20-year-old null session bug still isn’t fixed!

 

Fine, let me prove it to you. These are all tests anyone can run to confirm. I’ll use Wireshark, the industry standard packet capture and analysis tool, with three main tests for your edification.

 

  1. Workgroup to Workgroup – Two non-domain joined Windows 10 1903 (Spring 2019 Update) systems. All updates installed, through Oct 2019. No changes made other than setting up a file share.
  2. Workstation to Workstation – Two domain joined Windows 10 1903 (Spring 2019 Update) systems. All updates installed, through Oct 2019. No changes made other than domain join and setting up a file share.
  3. Workstation to Domain Controller (DC) – One domain joined workstation to the DC. Workstation running fully patched Win10 1903, DC running fully patched Windows Server 2019. Default domain policies, no hardening, no extra policies or configuration.

There are two commands commonly used to test null sessions, and I’ll be testing both, plus one extra scenario-based test. This first command explicitly sets a NULL user (/user:) and password ("")

 

net use \\<IP ADDRESS>\IPC$ "" /user:

The second command sets no explicit credentials. This is where the more interesting behavior will happen because it leaves room for Windows to try implicit credentials.

 

net use \\<IP ADDRESS>\IPC$

A normal share for non-IPC$ testing.

 

net use \\<IP Address>\share

For domain testing I’ll use the domain’s SYSVOL share.

 

net use \\<DC>\SYSVOL

 

Understanding IPC$

The inter-process communication share ("IPC$") is a special case. It’s the share that allows remote Named Pipe access. Names Pipes are an old-school method used to allow two services to talk with each other, even over a network connection. IPC$ functionality has been around for ages and default access rules to IPC$ has changed with each release of Windows. Older versions of Windows may behave differently than these tests.

 

Network setup:

Subnet: 10.19.0.0/24

 

Server:    10.19.0.1

RedWrk:    10.19.0.2

BlueWrk:   10.19.0.3

 

Domain User accounts:

RedUser

BlueUser

 

Domain:

CONSTOSO

Local accounts:

LclRed

LclBlue

 

Computer names:

 

RedWrk

BlueWrk

 

How SMB Connects

There’s a bit of basic knowledge that may be needed before we proceed. There are three key SMB commands used for authentication and authorization: Negotiate, Session Setup, and Tree Connect.

 

  • Negotiate – This command determines what dialect of SMB (major.minor version) will be used, discovers basic settings, and can perform some pre-authentication, depending on dialect.
  • Session Setup – This is where authentication is performed. Credentials, Kerberos tickets, or security tokens are exchanged here, and general authorization is either granted or denied at this step.
  • Tree Connect – This is where authorization to a share happens. Tree Connect takes the security account from Session Setup and uses that to determine whether access to the individual share(s) should be granted.

Because of the way SMB works, it’s possible to authenticate successfully but not get access to any resources. This is why it’s important to look under the proverbial covers to see what’s really going on before making final judgement.

 

On to the tests…

 

Workgroup to Workgroup

This is the basic home scenario. Two computers used by a regular folks who just want things to work without ever opening a settings console in their entire life.

 

Command:

net use \\10.19.0.3\IPC$ "" /user:

Result: No access granted.

JamesKehr_0-1582228625717.png

 

net use \\10.19.0.3\IPC$

Result: No access granted.

JamesKehr_1-1582228625720.png

 

NOTE: Windows refused to complete the connection without supplying credentials.

 

net use \\10.19.0.3\share

Result: No access granted.

JamesKehr_2-1582228625722.png

 

NOTE: Windows refused to complete the connection without supplying credentials.

 

This is all expected behavior because RedWrk and BlueWrk have no inherent trust between each other. No centralized authentication method means that each workgroup member must rely on their local security database, which does not contain details about the other workgroup member(s) unless those details are explicitly added. This means that all anonymous and implicit authentication methods will fail.

 

Workstation to Workstation (Domain-joined)

RedWrk and BlueWrk were joined to the domain for the next step. The same “net use” commands were run from RedWrk to BlueWrk. This is where things start to get interesting for us.

 

Command:

net use \\10.19.0.3\IPC$ "" /user:

Result: No change in behavior.

JamesKehr_3-1582228625726.png

 

This first example, with “/user:”, is an explicit null credential, which is denied by Windows.

 

net use \\10.19.0.3\IPC$

JamesKehr_4-1582228625727.png

 

“Ah ha! It worked! Vindication!” I hear you cry. “That’s a null session!”

 

Um, no.

 

Remember when I said Windows really wants to make that connection work? Well, we really do, and when no credential is entered Windows will automatically try the user’s domain credential. This is the implicit credential I’ve been talking about.

 

Let’s look at the packet capture. Specifically, the Session Setup part, where authentication happens.

 

No.

Time

Source

Destination

Protocol

Length

Info

10

0.061281

10.19.0.2

10.19.0.3

SMB2

661

Session Setup Request, NTLMSSP_AUTH, User: CONTOSO\RedUser

11

0.093470

10.19.0.3

10.19.0.2

SMB2

159

Session Setup Response

 

You will note that RedWrk sent the CONTOSO\RedUser account, even though we didn’t explicitly set that credential. This is the same mechanism that allows you to connect to your work shared drives through Windows Explorer without explicitly entering your Windows credentials, just in command line form.

 

Since valid domain credentials were passed and accepted, this is not a null session. Even though it may look like one on the surface.

 

You may notice that SMB is using NTLM authentication and not Kerberos in some tests. This can happen when an IP address is used instead of a hostname or FQDN (Fully Qualified Domain Name).

This is because an IP address requires a little extra setup to be a valid Kerberos object. Also, NTLM is in plain text which makes authentication easier to understand in the context of an article.

 

net use \\10.19.0.3\share

JamesKehr_5-1582228625728.png

 

Same story as the previous command. SMB used the domain account of the logged-on user and the connection was successful.

 

Here’s the packet capture data:

 

10

0.027866

10.19.0.2

10.19.0.3

SMB2

639

Session Setup Request, NTLMSSP_AUTH, User: CONTOSO\RedUser

11

0.035118

10.19.0.3

10.19.0.2

SMB2

159

Session Setup Response

 

Workstation to Domain Controller

Command:

net use \\10.19.0.1\IPC$ "" /user:

Result: No change in behavior. Null sessions are not allowed.

JamesKehr_6-1582228625729.png

 

net use \\10.19.0.1\IPC$

This command works because the Windows user credentials were passed. No NULL sessions here.

 

17

69.625346

10.19.0.2

10.19.0.1

SMB2

639

Session Setup Request, NTLMSSP_AUTH, User: CONTOSO\RedUser

18

69.632472

10.19.0.1

10.19.0.2

SMB2

159

Session Setup Response

 

net use \\10.19.0.1\SYSVOL

What have we here?

JamesKehr_7-1582228625730.png

 

Everything in the packet capture looks like it should connect, but SYSVOL is a special case.

The SYSVOL and NETLOGON shares require Keberos authentication on modern Windows. This can be changed by policy, but we only recommend it when you have a legacy system that you just can’t convince management to get rid of. Kerberos is really the way to go.

 

A switch to the domain name, which switches to Kerberos, and it logs right in:

JamesKehr_8-1582228625731.png

 

Here is the data from Wireshark:

 

33

20.178302

10.19.0.2

10.19.0.1

KRB5

1379

TGS-REQ

34

20.178941

10.19.0.1

10.19.0.2

KRB5

1408

TGS-REP

36

20.179357

10.19.0.2

10.19.0.1

SMB2

3063

Session Setup Request

40

20.183650

10.19.0.1

10.19.0.2

SMB2

314

Session Setup Response

SMB2 (Server Message Block Protocol version 2)

    SMB2 Header

    Session Setup Response (0x01)

        [Preauth Hash: ce5e61ef7c41ea76682c8bda4ff803ba7f74123a15736201…]

        StructureSize: 0x0009

        Session Flags: 0x0000

        Blob Offset: 0x00000048

        Blob Length: 184

        Security Blob: a181b53081b2a0030a0100a10b06092a864882f712010202…

            GSS-API Generic Security Service Application Program Interface

                Simple Protected Negotiation

                    negTokenTarg

                        negResult: accept-completed (0)

                        supportedMech: 1.2.840.48018.1.2.2 (MS KRB5 - Microsoft Kerberos 5)

                        responseToken: 60819706092a864886f71201020202006f8187308184a003…

                        krb5_blob: 60819706092a864886f71201020202006f8187308184a003…

 

The Caveat…

This behavior is not necessarily default in older versions of Windows. This article covers some of the legacy Windows behavior, and how anonymous IPC$ access can be prevented.

 

Knowing is Half the Battle

Pen tests can only go into so much depth in its analysis. Collecting and analyzing packets is beyond the abilities of most products. When in doubt, validate for yourself whether it’s a false positive or a true positive.

 

  • Download and install Wireshark on a test system where nothing else is running. This makes reading the data easier.
  • Start a Wireshark capture.
  • Reproduce the issue by running the appropriate command from the pen test.
  • Stop the Wireshark capture.
  • Add the following as the display filter (case sensitive): tcp.port==445
    • This filter works if you want to see both SMB and Kerberos traffic: tcp.port==445 or tcp.port==88
  • Look at the SMB Session Setup for a user account or Kerberos ticket.

 

A false positive can be identified when a valid authentication was passed under the covers using the implicit credential behavior of Windows.

 

Other false positives we see revolve around using the registry to verify SMB settings and SMB encryption. SMB settings should be verified via PowerShell, *SmbServerConfiguration and *SmbClientConfiguration, and through packet capture analysis to make sure the feature is working properly; especially, when dealing with older versions of Windows and non-Windows file server which may not support the newest features, or have the full SMB protocol suite enabled.

 

SMB encryption is one of those settings. Not only must both client and server support SMB3 and be encryption enabled, but file share or server must explicitly enable encryption. What is the best way to see whether SMB encryption and other security features are working? You guessed it, packet capture.

 

Trying to determine accurate results from pen testing without a packet capture is like trying to discover life in the deep ocean by staring really hard at the ocean surface from a boat deck. Sure, you might see a little ocean life, but you won’t know what’s really going on until you dive down below the surface. So the next time you get back failed test for SMB on a pen test, remember to check those packets to make sure the test is accurate.

 

I hope you found this useful. 

 

- James Kehr, Escalation Engineer, MS Networking Support