Skip to content

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Memcache Enumerator

A personal cybersecurity learning project developed by me while studying Bash scripting and offensive security.

Memcache Enumerator is a lightweight Bash script designed to explore and enumerate memcache services during authorized security assessments and laboratory exercises.

The project started as a practical way to learn Bash scripting by building a useful tool rather than simply studying commands and syntax in isolation.

About the Project

This is an independently developed project created as part of my learning journey in cybersecurity and penetration testing.

My main goals are to:

  • Improve my Bash scripting skills through practical development.
  • Understand how memcache works and how its text protocol can be used for service enumeration.
  • Learn how to collect, filter and organize information returned by network services.
  • Build small utilities that can be useful in penetration testing labs and security assessments.

The tool is intentionally kept simple. Its functionality and code structure will evolve as I continue learning and improving my scripting skills.

Features

  • Service detection: Checks TCP connectivity to the target memcache service.
  • Version detection: Retrieves the memcache server version.
  • Server statistics: Collects runtime information, connections and cache statistics.
  • Slab enumeration: Retrieves memory allocation and slab statistics.
  • Items enumeration: Collects information about stored items.
  • Settings enumeration: Retrieves server configuration and operational settings.
  • Verbose mode: Displays all statistics returned by the implemented queries.
  • Readable output: Color-coded sections, aligned columns and human-readable units.

Requirements

  • Bash
  • Netcat (nc, netcat or ncat)

The script automatically detects an available Netcat implementation.

Installation

Clone the repository:

git clone <REPOSITORY_URL>
cd <REPOSITORY_NAME>

Make the script executable:

chmod +x memcache-enum.sh

Usage

./memcache-enum.sh <IP> [PORT] [-v]

The default memcache port is 11211.

Basic enumeration

./memcache-enum.sh 192.168.1.100

Custom port

./memcache-enum.sh 192.168.1.100 11211

Verbose mode

./memcache-enum.sh 192.168.1.100 -v

Verbose mode with custom port

./memcache-enum.sh 192.168.1.100 11211 -v

Enumeration Modules

Module Command Description
Version version Retrieves the server version.
Server Status stats Collects general server statistics.
Slabs stats slabs Retrieves memory allocation statistics.
Items stats items Collects stored item statistics by slab class.
Settings stats settings Retrieves server configuration settings.

Output Modes

Normal mode

Displays selected statistics considered useful during an initial assessment, keeping the output compact and readable.

Verbose mode (-v)

Displays all STAT fields returned by the implemented enumeration queries, providing additional information for deeper analysis.

Technical Notes

  • Communication is performed over TCP using the memcache text protocol.
  • The implemented statistics queries are read-only.
  • Some statistics may vary depending on the memcache version and server configuration.
  • The tool currently focuses on service enumeration and does not retrieve the actual contents of cached values.

Disclaimer

This project was created for educational purposes, laboratory environments and authorized security assessments. Only use it against systems for which you have explicit permission to perform security testing.


Developed as part of my journey learning cybersecurity, penetration testing and Bash scripting.

My HackTheBox Profile: https://app.hackthebox.com/public/users/4106172

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages