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

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Useful Bug Bounty And Security Related Write-ups : A Comprehensive Guide For Enthusiasts

This repo contains all variants of information security & Bug bounty & Penetration Testing write-up…

8 hours ago

Admin-Panel-Dorks : Mastering Google Dorks To Uncover Hidden Admin Panels

site:*/sign-in site:*/account/login site:*/forum/ucp.php?mode=login inurl:memberlist.php?mode=viewprofile intitle:"EdgeOS" intext:"Please login" inurl:user_login.php intitle:"Web Management Login" site:*/users/login_form site:*/access/unauthenticated site:account.*.*/login site:admin.*.com/signin/…

8 hours ago

Conduwuit : Pioneering A New Era In Matrix Homeservers

Matrix is an open network for secure and decentralized communication. Users from every Matrix homeserver…

8 hours ago

LSMS – Linux Security And Monitoring Scripts

Linux Security And Monitoring Scripts are a collection of security and monitoring scripts you can…

8 hours ago

Fiber – Using Fibers To Run In-Memory Code

A fiber is a unit of execution that must be manually scheduled by the application…

8 hours ago

XSS-Exploitation-Tool : A Penetration Testing Tool

XSS Exploitation Tool is a penetration testing tool that focuses on the exploit of Cross-Site…

8 hours ago