dark_pyrro Posted January 17 Share Posted January 17 Yes Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 Okay, I saved it and ran the following commands, but still showing an error, so I know I messed up somewhere. (Ubuntu 22.04.1 LTS) sudo systemctl daemon-reload sudo systemctl enable cloudc2.service sudo systemctl start cloudc2.service sudo systemctl status cloudc2.service Active: failed (Result: exit-code) since Wed 2024-01-17 17:12:22 UTC; 11s ago Process: 11402 ExecStart=/usr/local/bin/c2-3.3.0_amd64_linux -hostname x -https -db /var/cloudc2/c2.db (code=exited, status=1/FAILURE) Jan 17 17:12:22 ip-x systemd[1]: Started Hak5 Cloud C2. Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [*] Initializing Hak5 Cloud C2 v3.3.0 Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [*] Hostname: x Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [*] DB Path: /var/cloudc2/c2.db Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [*] Validating License Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [*] License Valid Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [!] Error starting SSH server: listen tcp 0.0.0.0:2022: bind: address already in use Jan 17 17:12:22 ip-x systemd[1]: cloudc2.service: Main process exited, code=exited, status=1/FAILURE Jan 17 17:12:22 ip-x systemd[1]: cloudc2.service: Failed with result 'exit-code'. ~ Quote Link to comment Share on other sites More sharing options...
dark_pyrro Posted January 17 Share Posted January 17 Regarding 1 hour ago, NickBeanDNB said: Jan 17 17:12:22 ip-x c2-3.3.0_amd64_linux[11411]: [!] Error starting SSH server: listen tcp 0.0.0.0:2022: bind: address already in use you need to check and verify what I said in the beginning of this thread when getting that error. I.e. you can't have other things running on the VPS on port 2022 at the same time as C2 (or multiple instances of C2, or anything else that might use port 2022). Check your running processes (ps ax) and/or what ports that are used by running processes ( sudo ss -tulpn | grep 2022 or sudo netstat -tulpn | grep 2022 ) Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 You are right, I think 2 instances are running somehow. Also, I did not check my processes earlier when you mentioned it. Thank you again for your help. ubuntu@ip-X:~$ sudo ss -tulpn | grep 2022 tcp LISTEN 0 4096 *:2022 *:* users:(("c2-3.3.0_amd64_",pid=10519,fd=7)) ubuntu@ip-X:~$ sudo netstat -tulpn | grep 2022 tcp6 0 0 :::2022 :::* LISTEN 10519/./c2-3.3.0_am Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 10510 ? S 0:00 sudo ./c2-3.3.0_amd64_linux -hostname X -https 10511 ? Ss 0:00 sudo ./c2-3.3.0_amd64_linux -hostname X -https 10512 ? Sl 0:00 ./c2-3.3.0_amd64_linux -hostname X -https 10519 ? Tl 0:00 ./c2-3.3.0_amd64_linux -hostname X -https Quote Link to comment Share on other sites More sharing options...
dark_pyrro Posted January 17 Share Posted January 17 That's too many processes running C2. Two processes are enough. Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 Thank you!! Would the next step be the kill the processes by PID and then restarting the .service? Quote Link to comment Share on other sites More sharing options...
dark_pyrro Posted January 17 Share Posted January 17 Next step would be to investigate why you have that many C2 processes running in parallel. If that isn't solved, you will end up in the same situation over and over again when the VPS is started. Quote Link to comment Share on other sites More sharing options...
dark_pyrro Posted January 17 Share Posted January 17 (if it's not a result of you manually starting C2 in a specific session without reboot) Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 1 hour ago, dark_pyrro said: (if it's not a result of you manually starting C2 in a specific session without reboot) Let's say that is what I did. What would be the correct process to resolve it? Also, seeking to understand here, if I were to remove the CloudC2 directory and database file(s), reboot, and then manually run C2 again, would it start? Quote Link to comment Share on other sites More sharing options...
dark_pyrro Posted January 17 Share Posted January 17 4 minutes ago, NickBeanDNB said: Let's say that is what I did. What would be the correct process to resolve it? If you have a C2 service set up and you started C2 manually in parallel to that, then a reboot should solve it (i.e. the manually started C2 instance won't be started on a reboot, only the configured service). 5 minutes ago, NickBeanDNB said: if I were to remove the CloudC2 directory and database file(s), reboot, and then manually run C2 again, would it start? The service wouldn't start if the files (binary, db, and such) isn't located were the service file says they should be located. Manually starting C2 shouldn't be an issue, but it would create a new database if not using any existing one. Quote Link to comment Share on other sites More sharing options...
NickBeanDNB Posted January 17 Author Share Posted January 17 I removed the db file and reran the command without https and I can access the WebUI again. I had to reset it up from scratch, but hey, I am happy to be here, lol. Thanks for your help and walking me though this. I really appreciate your time and I know you didn't have to. I hope the rest of your day goes well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.