How can I remotely administrate after accidentally disabling SMBv1 and SMBv2 Protocol?
I been hardening things up as my division is under audit and the report mentioned how SMBv1 needs to be disabled and something about signing SMB2 too. Instead, I disabled both SMBv1 and SMBv2.
Is there another way to gain access to the systems so I don't need to drive in, not able to use RDP if they're using it, or TeamViewer.
I like to do is psexec \host cmd, then ran powershell, then
Set-SmbServerConfiguration -EnableSMB2Protocol $true -force but b/c the host or IP cant be discovered, it won't work.
There must be another way I can gain entry to these systems.
Ideas? I tried Remote Computer Management, PDQ, ...
Posted Oct 27, 2022, 8:18 PM UTC
I think you should still be able to use remote WMI over DCOM in a default Windows server install, even today. So unless you've already disabled that as well (you should) then you can still remotely create powershell processes with arguments which is all you need to get yourself out of this.
If it is disabled - you can also push out a group policy to turn it back on.
I don't think group policies can be read / applied from domain controllers as long as SMB is completely broken across the domain
To be sure I followed you correctly, I did this:
PS C:\Windows\system32> invoke-wmimethod -computername jsmith-lt -class win32_process -name create -argumentlist "powershell.exe -executionpolicybypass -command Set-SmbServerConfiguration -EnableSMB2Protocol $true -force"This was outputted:
Afterwards, I went to Start > Run on my desktop and
\\jsmith-lt\c$was still not found. If I go to the PC directly, or TeamView in, run the powershell directly in an administrative shell, it took immediate effect (no reboot needed).The problem with this method is that other than the fact that a process was started, you don't get any information or output back. So you have to make sure in advance that your quoting and escaping and parameters are correct.
In this specific case I'd try wrapping the -Command you're passing in nested, escaped quotes and I'd also escape the dollar sign in front of true so that that doesn't get evaluated prematurely by your local shell.
I think I understand what you meant but it seems to not be working still:
Was everything escaped correctly? Powershell escaping is kinda weird and I am not used to it.
You're forgetting a space after ExecutionPolicy and I'm also not sure whether you need the backslashes, I wouldn't think so.