NHAS / reverse_ssh

SSH based reverse shell
BSD 3-Clause "New" or "Revised" License
899 stars 127 forks source link

How to support Windows Server 2008 #167

Open fjh1997 opened 4 weeks ago

fjh1997 commented 4 weeks ago
C:\Windows\system32>ba.exe
ba.exe
fatal error: bcryptprimitives.dll not found
runtime: panic before malloc heap initialized

It seems golang version above 1.20 not support windows 7 or 2008,how to downgrade go to support it?

PS: Here’s my patch. I made these changes to the code and downgraded the versions of Golang (to 1.20) and gVisor(20230927004350-cbd86285d259) to make it work on Windows Server 2008. But how can we integrate this into the project? Maybe we could add a parameter to select the Windows version? diff.patch.txt

NHAS commented 3 weeks ago

Did you build it with go version 1.20? Or just downgrade the module file to 1.20?

If you open a pull request I'd be happy to add this. Im just typically on a dev machine that has a newer version of go installed.

fjh1997 commented 3 weeks ago

Did you build it with go version 1.20? Or just downgrade the module file to 1.20?

If you open a pull request I'd be happy to add this. Im just typically on a dev machine that has a newer version of go installed.

I used Go 1.20 to compile this client because the highest version of Go that supports Windows Server 2008 is Go 1.20. I haven't tried the newer versions of Go with downgraded module yet, but according to this issue , it might not work due to this commit in Go. I just found a method to patch for higher versions of Go: https://github.com/stunndard/golangwin7patch. I haven't tried it yet, but I think it's much more convenient than downgrading Go.

NHAS commented 3 weeks ago

Yeah definitely more convenient than downgrading. Its a shame that the patcher needs windows to run otherwise I'd just include it in the docker container and add a flag for building things to enable windows 7 support.