Pentesting Tools

Lemma – Harnessing AWS Lambda For Scalable Command-Line Tool Execution

The author of this project is not responsible for any damage or data loss incurred as a result of using this software.

Use this software at your own risk. While efforts have been made to ensure the accuracy and reliability of the software, it is provided “as is” without warranty of any kind.

By using this software, you agree to assume all risks associated with its use. Opinions are that of the author and not that of AWS. Review the AWS pentesting policy prior to executing any security tools on AWS Lambda.

Lemma

Lemma is a Python-based AWS Lambda package and client designed to execute packaged command-line tools in a scalable, remote environment on AWS Lambda.

Lemma takes advantage of the new Response Streaming feature on AWS Lambda to stream real-time stdout back to the user as the tool is running. The Lemma project comprises three main components:

  1. Lemma Lambda Function Package: This package bundles a collection of command-line Linux tools provided by the user, making them accessible via AWS Lambda. It allows users to execute these tools remotely and scale their executions across multiple lambda instances.
  2. Web-CLI: This component provides a web-based terminal interface built with xterm.js, AWS Lambda Web Adapter and FastAPI, accessible via the Lambda URL.
    • This web UI allows users to execute their command-line tools packaged in the Lambda entirely within their web browser.
  3. Terminal-CLI: A python-based command-line interface tool in charge invoking the Lemma Lambda function.
    • This tool facilitates the remote execution of the Lambda-hosted tools from a local environment.
      • It pipes stdin and stdout between local and remote tools, providing the ability to execute and scale cli-based workflows onto lambda and back using pipes.

While the intented use case for Lemma is to run verbose security security tooling on AWS lambda, Lemma can be used for any type of command-line tool you wish to run remotely.

Features

  • Supports both a Web-CLI and a Terminal-CLI
  • Quick and easy build script
  • Support for adding your own custom tools
  • Support for x86_64 and ARM64 lambda types
  • Support for choosing memory, region and timeout
  • Flexible terminal piping support

Installation

Requirements For Lemma Lambda

  1. An AWS account
  2. AWS access credentials with permissions to execute cloudformation templates
  3. Docker, python3 with pip

Lambda Build And Deploy Steps

Steps to build and deploy on a fresh Ubuntu 22 instance

  1. sudo apt update
  2. sudo apt install docker.io python3 python3-pip
  3. git clone https://github.com/defparam/lemma
  4. cd lemma
  5. export AWS_ACCESS_KEY_ID=<your access key id>
  6. export AWS_SECRET_ACCESS_KEY=<your secret access key>
  7. ./build.sh
  8. Fill out all the questions
  9. Copy the lambda URL with the key

Web-CLI:

  1. Open chrome and simply browse to your lambda URL w/key

Terminal-CLI:

  1. While in the lemma directory: pip3 install . (The Terminal-CLI is also available on pypi: pip install lemmacli)
  2. Invoke: lemma
  3. When asked about the lambda URL, paste it into the prompt. This URL will be saved at ~/.lemma/lemma.ini
Varshini

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Kali Linux 2024.4 Released, What’s New?

Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…

2 days ago

Lifetime-Amsi-EtwPatch : Disabling PowerShell’s AMSI And ETW Protections

This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…

2 days ago

GPOHunter – Active Directory Group Policy Security Analyzer

GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…

4 days ago

2024 MITRE ATT&CK Evaluation Results – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

6 days ago

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

1 week ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

1 week ago