Move service instructions to readme so that poshc2.service can just be copied to /lib/systemd/system

chunking
m0rv4i 2019-02-13 16:38:06 +00:00
parent 0c8126cdae
commit 892a3f32f7
3 changed files with 33 additions and 16 deletions

View File

@ -27,6 +27,37 @@ chmod +x ./Install.sh
powershell -exec bypass -c "IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/nettitude/PoshC2/master/C2-Installer.ps1')" powershell -exec bypass -c "IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/nettitude/PoshC2/master/C2-Installer.ps1')"
``` ```
## Installing as a service
Installing as a service provides multiple benefits such as being able to log to service logs, viewing with journalctl and automatically starting on reboot.
1. Add the file in systemd
```
cp poshc2.service /lib/systemd/system/poshc2.service
systemctl enable poshc2.service
systemctl start poshc2.service
```
2. Stop the service
```
systemctl stop poshc2.service
```
3. Restart the service
```
systemctl restart poshc2.service
```
4. View the output
```
tail -f -n 50 /var/log/poshc2_server.log
```
5. Or alternatively us journalctl (but note this can be rate limited)
```
journalctl -n 20000 -u poshc2.service -f --output cat
```
## Issues / FAQs ## Issues / FAQs
If you are experiencing any issues during the installation or use of PoshC2 please refer checkout the open issues tracking page within GitHub. If this page doesn't have what you're looking for please open a new issue and we will try to resolve the issue asap. If you are experiencing any issues during the installation or use of PoshC2 please refer checkout the open issues tracking page within GitHub. If this page doesn't have what you're looking for please open a new issue and we will try to resolve the issue asap.

View File

@ -27,6 +27,7 @@ Setting and viewing beacon time is now consistent across config and implant type
Added validation for beacon time that it matches the correct format Added validation for beacon time that it matches the correct format
Fix StartAnotherImplant command for python implant Fix StartAnotherImplant command for python implant
Rename RandomURI column in html output to Context, and print it as domain\username @ hostname Rename RandomURI column in html output to Context, and print it as domain\username @ hostname
Move service instructions to readme so that poshc2.service can just be copied to /lib/systemd/system
4.7 (03/02/19) 4.7 (03/02/19)
============== ==============

View File

@ -4,19 +4,4 @@ Description=PoshC2 Server
[Service] [Service]
Type=simple Type=simple
User=root User=root
ExecStart=/usr/bin/python -u /opt/PoshC2_Python/C2Server.py ExecStart=/bin/bash -c '/usr/bin/python -u /opt/PoshC2_Python/C2Server.py | tee -a /var/log/poshc2_server.log'
# add the file in systemd
vim /lib/systemd/system/poshc2.service
systemctl enable poshc2.service
systemctl start poshc2.service
# stop the service
systemctl stop poshc2.service
# restart the service
systemctl restart poshc2.service
# view the output
journalctl -n 20000 -u poshc2.service -f --output cat