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
Tamil S

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

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

3 hours ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

1 day ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

4 weeks ago