This project is a browser based web app designed to allow a user to evaluate Lacework anomaly detection. The nodejs app, when run, generates a baseline amount of activity for Lacework to detect. It also includes a reverse shell feature to allow the tester to trigger anomalous and known-bad alerts commonly seen in real-world breaches.
NOTE: This project does allow unauthenticated access to a shell on the host / network it is running on. It also serves html direct from the filesystem with a very barebones nodejs based http server. It is highly recommended to only allow access to it from controlled IP ranges. Use at your own risk, no warranties or liability is assumed
When run as a container, the app will make outbound connections to two public facing anonymous APIs (the baseline activity). These APIs are:
- The Hacker News "new stories" feed
- The Cat Facts "random cat fact" API
After 3 hours of running / baselining, a reverse shell is enabled, which allows the tester to run any shell command as the user who owns the parent process. Examples of the types of tests one can run are:
curl
a known bad host such as https://donate.v2.xmrig.comnmap
the local subnet- Downloading and running crypto miners
- Opening a true reverse shell with
nc
- Ensure you have
docker
installed locally - Run
docker build -t [your preferred repo name / tag]
- Run
docker push [your preferred repo name / tag]
to push to your preferred registry
- Ensure you have
nodejs
andnpm
available - Navigate to the
app
directory - Run
npm install
- Run
node server.js
- Open a browser to
http://localhost:8080/ntg-frontend.html
- Create a new task definition in the AWS console
- Leave all defaults
- Add a container definition and specify the docker image name / registry where you pushed the build. Alternatively, you can use
jdvogt/nodejs-reverse-shell:latest
orpublic.ecr.aws/f9l6s8l3/nodejs-reverse-shell:latest
if you did not push to a registry - Add an environment variable
LaceworkAccessToken
and set the value to a valid access token from your Lacework console - Save the task definition and select
Actions -> Run
- Select your VPC and a public subnet
- Ensure your security group allows inbound access on port 8080 from your IP address or network you will be accessing the application from
- Ensure you have enabled Assignment of Public IP
- Run the task
At this point your task should be starting up.
- Click on the running task, and find the public IP address
- Open a new browser tab and navigate to
http://[the ip of the running task]/ntg-frontend.html
- Install
npm
andnodejs
withapt-get
oryum
git clone https://github.com/lacework-community/reverse-shell-simulation-app.git reverse-shell-simulation-app
cd reverse-shell-simulation-app/app
node server.js &
disown
- At this point you can access the app from http://<public_ip>:8080/ntg-frontend.html
- Documentation TBD
The running container will make periodic calls to the aforementioned APIs, and after 3 hours a reverse shell will be enabled. Follow the suggestions in the browser for commands to use to trigger anomalies.
MIN_TIME
: Optional. Set the minimum time before the reverse shell console is enabled (in seconds).