-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added basic support for Sliver #267
base: master
Are you sure you want to change the base?
Conversation
Hey thank you for this. Looks really cool. Before merging, we would need to do some testing of this. The core RedELK developers do not use Sliver in their ops, and are limited in time to do testing. So for now, we want to postpone merging this just a bit until at least we have the other milestones completed. if there is somebody else who can help with testing this Sliver integration, that help is very much appreciated! |
The basics work. However, anything that requires fetching blobs is still missing:
It's my 1st time setting up a lab with both redelk & sliver. Meaning it might be a config error. However, a quick comparison of what this PR processes and actual logs did show some discrepancies. Simple example: only |
@MarcOverIP Anything that involved fetching blobs was not implemented since at the time of the PR files downloaded, implants created and screenshots were base64 encoded within the logs and required additional work to extract and upload the blobs in RedELK. As sated in the initial comment my PR was mostly to provide basic support for Sliver. |
@MarcOverIP & @whitecod which kind of testing would need to be done on this to have it merged? |
Thank you @whitecod for your continued effort on this while we are slow in responding. @alcastronic if you want to review: check if the relevant items mentioned in the wiki page are done and no errors are presented. In our experience, its mainly Logstash parsing errors and inconsistency in naming that are most likely to give issues. |
elkserver/docker/redelk-base/redelkinstalldata/42_redelk-base-docker-init.sh
Show resolved
Hide resolved
elkserver/docker/redelk-base/redelkinstalldata/scripts/modules/enrich_sliver/module.py
Show resolved
Hide resolved
@MarcOverIP I noticed an error coming up lately related to filebeat requiring seccomp permissions for rseq. That happened on Ubuntu 22.04 LTS and I fixed it adding the snipped of code below at the end of
Some context here Since it's not related to Sliver development I am not not sure if I should
Let me know what you prefer. |
I have had a quick look into that. So far I can tell,
|
The summary dashboard shows sliver sessions however there is a discrepancy since logs that are present only on the c2 sever are logged as a separate "host". The actual host The same is the case in the "Red Team Operations" dashboard. The additional host is also shown in the "Implants" dashboard I'm not sure wether that is as issue or not. It however seems inconsistent with other c2. For example cobalt strike leaves the host empty in cases where the command can not be related to an infected host. @whitecod & @MarcOverIP what do you think about that? |
All of the testing has been done on the current master branch of RedElk since I have simply used an existing installation and have added/changed the files that where touched by this MR. Overall I think the commands and other loot types like API-keys could be parsed better and the missing command output is not nice. Also the hostname issue could be improved to show either no host or the target system. However the integration as such works and does not produce errors. |
@alcastronic did you apply the changes I pushed last week? As of Sliver v1.5 the logs don't contain the command output so there is no way to add them to RedElk. Regarding having the C2 server as an additional host that would make sense in case a C2 operator run commands on the C2 server directly (e.g. create a new implant profile) and you want to keep track of when that happened but I wouldn't want to have the C2 server showing up as an implant. |
@whitecod yes, I used the files from this merge request. They should also contain the changes that you had pushed last week. It might be possible to create an export script for command output ran on beacons, which are stored in the sqlite.db. Regarding having the C2 server as an additional host I agree with you. I think for this to be in the desired state, the mapping of the |
Thank you for raising this! Doesn't seem like an edge case, but Im surprised we didn't encounter this ourselves. I assume it concerns also the filebeat installations on redirs and not only on c2 servers? Going forward I think it is best to make a dedicated PR. That way we can track this better. |
On the wiki we have listed the meaning of most ES fields: https://github.com/outflanknl/RedELK/blob/master/example-data-and-configs/RedELKFieldnamesV2.md. I this case |
Agree with both you and @whitecod regarding remarks on Too bad Sliver doesn't have implant output in log files. Having implant output data in RedELK is kind of core functionality in our use case of RedELK to be honest. Too bad this would require extra effort. But I agree that we could add this later as well. Anything else that needs to be tested with this PR? |
@MarcOverIP From my side the @whitecod Can you fix that? |
@alcastronic If you have the fix already I can test it and add a commit in my PR or I will work on that in the next couple of weeks when I get some time. |
@whitecod I have exams ahead so won't be able to work on this in the next two week. Currently I do not have a fix at hand. |
Not sure what you exactly mean. Overall, you want the agent.name to be present as it represents the name given during installation time. Later on this is used for scripts to make clickable links, etc. host.name is name of the host where the implant is running. Ideally you want both. But as Sliver doesn't have the implant logs, I guess you can just remove all the host.* fields (as they all relate to implant data, not intended for C2 server data). |
@alcastronic @whitecod, do we still think this makes sense when the C2 framework has no implant logs available to ingest and show? |
@MarcOverIP For completeness I would like to see commands run on the server itself for auditing purposes (e.g. enabling listeners, creating implant profiles or adding operators). I tried to remove those logs setting the |
Weird. I suppose it could be empty as its a non-ECS naming standard field. You sure there is no Logstash rule your are (mis) triggering? |
@whitecod I haven't found the time to review all the many changes within this PR. There's 100 something files changed, some on on linting things, some on seemingly small things, but also core items. It would really help me if we could focus on the core items for Sliver and not on the rest. Is there a way you can tune your PR to be more focussed on the important core items? |
@MarcOverIP my initial commit included just the few files related to Sliver. In August 2024 I rebased from outflank/RedELK master and made couple of changes to the sliver files. 99% of the file changes listed are related to previous commits that came from the rebase but I didn't expect them to show up in the PR. |
It's fixed now. Apparently it is a known issue when you rebase into a branch for an open PR. I switched target branch and back to force a sync. |
/etc/cron.d/redelk
file inside the container is writable by group/other and that causes cron to skip the execution.