Removed C2Viewer.py and added instructions for same functionality to readme just using system commands

chunking 4.8
m0rv4i 2019-02-13 16:38:17 +00:00
parent 892a3f32f7
commit 7eb6d969ba
3 changed files with 13 additions and 91 deletions

View File

@ -1,91 +0,0 @@
#!/usr/bin/env python
from Colours import *
from Config import *
from DB import *
from Help import *
import time, os
rows = 10
taskid = 0
try:
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
except Exception as e:
print "cls"
print chr(27) + "[2J"
print (Colours.GREEN + "")
print (logopic)
print (Colours.END + "")
try:
taskid = get_seqcount("Tasks") + 1
except Exception as e:
user = "None"
taskid = 1
try:
newtaskid = get_seqcount("NewTasks") + 1
except Exception as e:
user = "None"
newtaskid = 1
try:
implantid = get_seqcount("Implants") + 1
except Exception as e:
user = "None"
implantid = 1
#print newtaskid
while(1):
try:
newtask = get_newtasksbyid(newtaskid)
hostinfo = get_hostinfo(newtask[1])
now = datetime.datetime.now()
command = newtask[2]
print Colours.YELLOW
print "Command issued against implant %s on host %s %s (%s)" % (hostinfo[0],hostinfo[3],hostinfo[11],now.strftime("%m/%d/%Y %H:%M:%S"))
if (command.lower().startswith("$shellcode64")) or (command.lower().startswith("$shellcode64")) :
print "Loading Shellcode",Colours.END
elif (command.lower().startswith("$shellcode86")) or (command.lower().startswith("$shellcode86")) :
print "Loading Shellcode",Colours.END
elif "upload-file" in command.lower():
print "Uploading File",Colours.END
else:
print command,Colours.END
newtaskid = newtaskid + 1
except Exception as e:
user = "None"
try:
completedtask = get_tasksbyid(taskid)
hostinfo = get_hostinfo(completedtask[2])
now = datetime.datetime.now()
if hostinfo:
print Colours.GREEN
print "Command returned against implant %s on host %s %s (%s)" % (hostinfo[0],hostinfo[3],hostinfo[11],now.strftime("%m/%d/%Y %H:%M:%S"))
print completedtask[4],Colours.END
taskid = taskid + 1
except Exception as e:
user = "None"
try:
implant = get_implantbyid(implantid)
if implant:
print Colours.GREEN
print "New %s implant connected: (uri=%s key=%s) (%s)" % (implant[15], implant[1], implant[5], now.strftime("%m/%d/%Y %H:%M:%S"))
print "%s | URL:%s | Time:%s | PID:%s | Sleep:%s | %s (%s) " % (implant[4], implant[9], implant[6],
implant[8], implant[13], implant[11], implant[10])
print Colours.END
implantid = implantid + 1
except Exception as e:
user = "None"
time.sleep(1)

View File

@ -27,6 +27,18 @@ 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')"
```
## Viewing the logs
If you want others to be able to to just view the C2 output you can pipe the C2Server.py to a file and stdout with:
`python -u C2Server.py | tee -a /var/log/poshc2_server.log`
Note the `-u` option is required to prevent buffering.
Then you can view it with
`tail -f -n 50 /var/log/poshc2_server.log`
## 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.

View File

@ -28,6 +28,7 @@ Added validation for beacon time that it matches the correct format
Fix StartAnotherImplant command for python implant
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
Removed C2Viewer.py and added instructions for same functionality to readme just using system commands
4.7 (03/02/19)
==============