View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008159 | Kali Linux | Kali Package Bug | public | 2023-01-24 22:28 | 2023-08-25 16:20 |
Reporter | th3fr0x3n | Assigned To | |||
Priority | high | Severity | block | Reproducibility | always |
Status | closed | Resolution | open | ||
Product Version | 2022.4 | ||||
Summary | 0008159: WSL kex and SSH errors | ||||
Description | Kali running in WSL failing to run kali in windows mode. ESM and SL will open. Linking other issue https://bugs.kali.org/view.php?id=7586 as it seems very simular creating new issue because I have the same error but also issues with running ssh. SSH will not start for IPv4 was running systemd at one point and got the error report that ssh failed to bind to port 22 on 0.0.0.0 because the address was already in use. | ||||
Steps To Reproduce | kex --win sudo service ssh start | ||||
Attached Files | |||||
Okay, confession time. SSH: The script runs netsh portproxy commands that forward ports like 22 from the outside into the kali vm. I set this script to run at startup and didn't have any issues starting services on the kali machine. what changed? I am not to sure but now if the port proxy is running for 22 the kali machine detects this as the port being used and fails to start up the service for the port. Solution: run the script after the ssh service is running and it works just fine. However: This still hasn't resolved the Kex issues so I am not sure if we should close this issue but seeing how the ssh problem was the only thing that made this issue unique from https://bugs.kali.org/view.php?id=7586 then I understand if the reasoning for resolving it. NIC-BRIDGE.ps1 (1,255 bytes)
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" $found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; if( $found ){ $remoteport = $matches[0]; } else{ echo "The Script Exited, the ip address of WSL 2 cannot be found"; exit; } #[Ports] #All the ports you want to forward separated by coma $ports=@(22,80,443,5901,10000,3000,5000); #[Static ip] #You can change the addr to your ip config to listen to a specific address $addr = '0.0.0.0' ; $ports_a = $ports -join ","; #Remove Firewall Exception Rules iex "Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' "; #adding Exception Rules for inbound and outbound Rules iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP"; iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP"; for( $i = 0; $i -lt $ports.length; $i++ ){ $port = $ports[$i]; iex "netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr"; iex "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport"; } Write-Output $addr |
|
This report has been filed against an old version of Kali. We will be closing this ticket due to inactivity. Please could you see if you are able to replicate this issue with the latest version of Kali Linux (https://www.kali.org/get-kali/)? If you are still facing the same problem, feel free to re-open the ticket. If you choose to do this, could you provide more information to the issue you are facing, and also give information about your setup? |
|