Skip to content

Commit 526911f

Browse files
committed
Init of Kubesploit code
1 parent c0f097a commit 526911f

File tree

130 files changed

+5018
-3598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+5018
-3598
lines changed

.gitattributes

-5
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

-25
This file was deleted.

.gitignore

-10
This file was deleted.

Dockerfile

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
FROM golang:stretch
1+
FROM golang:1.14.15-alpine3.13 as builder
2+
23

34
# Build the Docker image first
45
# > sudo docker build -t merlin .
56

67
# To start the Merlin Server, run
78
# > sudo docker run -it -p 443:443 --mount type=bind,src=/tmp,dst=/go/src/github.com/Ne0nd0g/merlin/data merlin
89

9-
RUN apt-get update && apt-get install -y git make vim gcc-mingw-w64
10-
WORKDIR $GOPATH/src/github.com/Ne0nd0g
11-
RUN git clone https://github.com/Ne0nd0g/merlin
1210

13-
WORKDIR $GOPATH/src/github.com/Ne0nd0g/merlin
14-
RUN go mod download
15-
RUN make generate-agents
11+
RUN mkdir /src
12+
ADD . /src
13+
WORKDIR /src
14+
1615

17-
VOLUME ["data"]
18-
EXPOSE 443
16+
RUN apk update && apk upgrade && apk add bash && apk add vim && go get github.com/mitchellh/gox
17+
# RUN gox -ldflags "-s -w" -osarch linux/386 -output "merlin"
18+
RUN go build cmd/merlinserver/main.go
19+
#FROM alpine:latest
20+
#COPY --from=builder /src/merlin /app/
21+
#WORKDIR /app
1922

20-
CMD ["go", "run", "cmd/merlinserver/main.go"]
23+
#ENTRYPOINT ["bash -c /src/merlin"]

LICENSE

+57-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
GNU GENERAL PUBLIC LICENSE
1+
Copyright (c) 2021 CyberArk Software Ltd. All rights reserved.
2+
3+
GNU GENERAL PUBLIC LICENSE
24
Version 3, 29 June 2007
35

46
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -618,4 +620,57 @@ an absolute waiver of all civil liability in connection with the
618620
Program, unless a warranty or assumption of liability accompanies a
619621
copy of the Program in return for a fee.
620622

621-
END OF TERMS AND CONDITIONS
623+
END OF TERMS AND CONDITIONS
624+
625+
How to Apply These Terms to Your New Programs
626+
627+
If you develop a new program, and you want it to be of the greatest
628+
possible use to the public, the best way to achieve this is to make it
629+
free software which everyone can redistribute and change under these terms.
630+
631+
To do so, attach the following notices to the program. It is safest
632+
to attach them to the start of each source file to most effectively
633+
state the exclusion of warranty; and each file should have at least
634+
the "copyright" line and a pointer to where the full notice is found.
635+
636+
{one line to give the program's name and a brief idea of what it does.}
637+
Copyright (c) 2020 CyberArk Software Ltd. All rights reserved.
638+
639+
This program is free software: you can redistribute it and/or modify
640+
it under the terms of the GNU General Public License as published by
641+
the Free Software Foundation, either version 3 of the License, or
642+
(at your option) any later version.
643+
644+
This program is distributed in the hope that it will be useful,
645+
but WITHOUT ANY WARRANTY; without even the implied warranty of
646+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
647+
GNU General Public License for more details.
648+
649+
You should have received a copy of the GNU General Public License
650+
along with this program. If not, see <http://www.gnu.org/licenses/>.
651+
652+
Also add information on how to contact you by electronic and paper mail.
653+
654+
If the program does terminal interaction, make it output a short
655+
notice like this when it starts in an interactive mode:
656+
657+
kubesploit Copyright (c) 2020 CyberArk Software Ltd. All rights reserved.
658+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
659+
This is free software, and you are welcome to redistribute it
660+
under certain conditions; type `show c' for details.
661+
662+
The hypothetical commands `show w' and `show c' should show the appropriate
663+
parts of the General Public License. Of course, your program's commands
664+
might be different; for a GUI interface, you would use an "about box".
665+
666+
You should also get your employer (if you work as a programmer) or school,
667+
if any, to sign a "copyright disclaimer" for the program, if necessary.
668+
For more information on this, and how to apply and follow the GNU GPL, see
669+
<http://www.gnu.org/licenses/>.
670+
671+
The GNU General Public License does not permit incorporating your program
672+
into proprietary programs. If your program is a subroutine library, you
673+
may consider it more useful to permit linking proprietary applications with
674+
the library. If this is what you want to do, use the GNU Lesser General
675+
Public License instead of this License. But first, please read
676+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

MITIGATION.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Modules Mitigations
2+
<table>
3+
<tbody>
4+
<tr>
5+
<th>Module </th>
6+
<th align="center">Description</th>
7+
<th align="center">Mitigation</th>
8+
</tr>
9+
<tr>
10+
<td>
11+
Mount Container Breakout
12+
</td>
13+
<td align="left">
14+
Can be exploit on privileged containers or containers with privilege to mount. <br>
15+
Creates mount from the container to the host and has access to the host files. <br>
16+
</td>
17+
<td align="left" >Reduce container privileges. Prevent creation of privileged containers or with the permissions to mount.</td>
18+
</tr>
19+
<tr>
20+
<td>
21+
docker.sock Breakout
22+
</td>
23+
<td align="left">
24+
Can be exploit on containers with docker.sock mounted. <br>
25+
It uses docker.sock to create new vulnerable (privileged, with mounts, etc.) container and escape to the host. <br>
26+
</td>
27+
<td align="left" >Prevent creating containers with docker.sock mounted.</td>
28+
</tr>
29+
<tr>
30+
<td>
31+
runC (CVE-2019-5736) Breakout
32+
</td>
33+
<td align="left">
34+
This module exploit vulnerable runC to escape to the host. <br>
35+
</td>
36+
<td align="left" >Make sure to have updated runC version (>1.0.0-rc6).</td>
37+
</tr>
38+
<tr>
39+
<td>
40+
Kubelet attack
41+
</td>
42+
<td align="left">
43+
Some Kubernetes cluster might have nodes with Kubelet open for anonymous requests. <br>
44+
This module exploit this by listing the pods vulnerable for RCE, run commands inside them and scan the service account tokens from all the pods. <br>
45+
</td>
46+
<td align="left" >Make sure that all the kubelets have the config file `/var/lib/kubelet/config.yaml` with the following: <br>
47+
1. No allowing anonymous request: `authentication: anonymous: enabled: false`. <br>
48+
2. Preventing authorization to anyone: `authorization: mode:` NOT set with AlwaysAllow. <br>
49+
</td>
50+
</tr>
51+
52+
</tbody>
53+
</table>

0 commit comments

Comments
 (0)