Skip to content

Instantly share code, notes, and snippets.

View pldmgg's full-sized avatar

Paul DiMaggio pldmgg

View GitHub Profile
@pldmgg
pldmgg / latest_sshd_logs
Created September 8, 2018 15:16
latest_sshd_logs
PS C:\Users\zeroadmin> sshd -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 414
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 414
debug3: __PROGRAMDATA__\\ssh/sshd_config:15 setting HostCertificate C:/ProgramData/ssh/ssh_host_rsa_key-cert.pub
debug3: __PROGRAMDATA__\\ssh/sshd_config:39 setting AuthorizedKeysFile C:/ProgramData/ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:79 setting Subsystem powershell C:/symlinks/pwsh.exe -sshs -NoLogo -NoProfile
debug3: checking syntax for 'Match User *'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.4
debug1: private host key #0: ssh-rsa SHA256:zAHg3bc18X10GwZFbfjky0Qwba1MvAG55IOzxodUdsY
@pldmgg
pldmgg / latest_sshd_config
Created September 8, 2018 14:48
latest_sshd_config
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
@pldmgg
pldmgg / SSHD_Results_SSHExe_No_DefaultShell_In_Registry
Created September 6, 2018 18:35
SSHD_Results_SSHExe_No_DefaultShell_In_Registry
PS C:\Users\zeroadmin> sshd -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 414
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 414
debug3: __PROGRAMDATA__\\ssh/sshd_config:15 setting HostCertificate C:/ProgramData/ssh/ssh_host_rsa_key-cert.pub
debug3: __PROGRAMDATA__\\ssh/sshd_config:39 setting AuthorizedKeysFile C:/ProgramData/ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:79 setting Subsystem powershell C:/symlinks/pwsh.exe -sshs -NoLogo -NoProfile
debug3: checking syntax for 'Match User *'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.4
debug1: private host key #0: ssh-rsa SHA256:zAHg3bc18X10GwZFbfjky0Qwba1MvAG55IOzxodUdsY
@pldmgg
pldmgg / SSHD_Results_New-PSSession_No_DefaultShell_In_Registry
Created September 6, 2018 18:33
SSHD_Results_New-PSSession_No_DefaultShell_In_Registry
PS C:\Users\zeroadmin> sshd -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 414
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 414
debug3: __PROGRAMDATA__\\ssh/sshd_config:15 setting HostCertificate C:/ProgramData/ssh/ssh_host_rsa_key-cert.pub
debug3: __PROGRAMDATA__\\ssh/sshd_config:39 setting AuthorizedKeysFile C:/ProgramData/ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:79 setting Subsystem powershell C:/symlinks/pwsh.exe -sshs -NoLogo -NoProfile
debug3: checking syntax for 'Match User *'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.4
debug1: private host key #0: ssh-rsa SHA256:zAHg3bc18X10GwZFbfjky0Qwba1MvAG55IOzxodUdsY
@pldmgg
pldmgg / updated_sshd_config
Created September 6, 2018 18:25
SSHD_Pub_Cert_Auth_Testing
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
@pldmgg
pldmgg / sshd_ddd_output.txt
Last active September 5, 2018 15:22
sshd.exe -ddd Output for pwsh `New-PSSession -KeyFilePath` Testing
# Output from SSHD on zerowin16sshb.zero.lab
PS C:\Users\zeroadmin> sshd.exe -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 507
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 507
debug3: __PROGRAMDATA__\\ssh/sshd_config:15 setting HostCertificate C:/ProgramData/ssh/ssh_host_rsa_key-cert.pub
debug3: __PROGRAMDATA__\\ssh/sshd_config:39 setting AuthorizedKeysFile C:/ProgramData/ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:77 setting Subsystem sftp sftp-server.exe
debug3: __PROGRAMDATA__\\ssh/sshd_config:78 setting Subsystem powershell C:/Program Files/Powershell/6-preview/pwsh.exe -sshs -NoLogo -NoProfile
@pldmgg
pldmgg / sshd_config
Last active September 6, 2018 18:27
sshd_config for pwsh 6.1.0-rc1 with OpenSSH-Win64 7.7.2.0 Testing
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
@pldmgg
pldmgg / 1Home.png
Last active December 8, 2019 06:27
PUDNetworkMonitor
1Home.png
@pldmgg
pldmgg / AllInfo.md
Created July 17, 2018 09:52
OpenSSH Public Cert Auth Issues

"OpenSSH for Windows" version

PS C:\Users\zeroadmin> ((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
7.7.1.0
PS C:\Users\zeroadmin> ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Windows Server 2016 Standard Evaluation
PS C:\Users\zeroadmin> Get-Command ssh.exe

CommandType Name Version Source
@pldmgg
pldmgg / Instructions_For_Set-AnacondaEnv.ps1
Last active July 7, 2020 06:07
Set Anaconda Usage Instructions
# Launch Windows PowerShell 5.1 or PowerShell Core 6.x and download the AnacondaEnv.psm1 Module
# to your Downloads folder (or wherever you like)
PS C:\Users\zeroadmin> $AnaEnvModuleUrl = "https://github.com/pldmgg/misc-powershell/blob/master/MyModules/AnacondaEnv/AnacondaEnv.psm1"
PS C:\Users\zeroadmin> $OutputPath = "$HOME\Downloads\AnacondaEnv.psm1"
PS C:\Users\zeroadmin> Invoke-WebRequest -Uri $AnaEnvModuleUrl -OutFile $OutputPath
# Import the AnacondaEnv Module
PS C:\Users\zeroadmin> Import-Module $OutputPath
# Now the following functions are available to you in your current PowerShell Session: Set-AnacondaEnv, Revert-AnacondaEnv