Moodle community-based vulnerability scanner

Overview

badmoodle

badmoodle

Moodle community-based vulnerability scanner

Description

badmoodle is an unofficial community-based vulnerability scanner for moodle that scans for canonical and non-canonical Moodle vulnerabilities.

badmoodle's purpose is to help penetration testers, bug hunters and security researchers find more vulnerabilities on moodle instances.

Since badmoodle is community-based, it will scan for two different kind of vulnerabilities:

  • Official vulnerabilities: The canonical ones published in Moodle security advisory blog;

  • Community vulnerabilities: The non-canonical ones that are not present in Moodle security advisory blog.

The community vulnerability scan can run in two modes:

  • Check mode: Only checks if the host is vulnerable or not;

  • Exploit mode: If the host is vulnerable, exploit the vulnerabilities.

If not specified, the scan will run in check mode.

Installation

Installing badmoodle is very simple, it can be performed in just a few steps:

  • Clone the repository:

    git clone https://github.com/cyberaz0r/badmoodle
  • Dive into "badmoodle" directory:

    cd badmoodle
  • Install requirements for Python:

    pip3 install -r requirements.txt
  • Give execution permissions to "badmoodle.py":

    chmod +x badmoodle.py
  • Run "badmoodle.py":

    ./badmoodle.py

If you see the badmoodle logo and help with no errors you are good to go :)

Usage

Using badmoodle is also very simple. Once installed you can run it with the following options:

  • -h, --help

    Show logo and help with options and their descriptions, then exit

  • -u TARGET_URL, --url TARGET_URL

    Moodle target URL (required)

  • -a USERNAME:PASSWORD, --auth USERNAME:PASSWORD

    Moodle username and password separated by ":" (default: none)

  • -p PROXY_ADDRESS:PORT, --proxy PROXY_ADDRESS:PORT

    Proxy used for connecting to moodle (default: none)

  • -H HEADER, --header HEADER

    Headers used for HTTP connections

  • -l LEVEL, --level LEVEL

    Level of tests to perform (default: 1)

  • -v LEVEL, --verbose LEVEL

    Verbosity level (default: 1)

  • -r, --random-agent

    Use a random User Agent for HTTP requests (default: Chrome Win10)

  • -e, --exploit

    Enable exploit mode (default: check mode)

  • -s, --scrape

    Scraping mode: scrape all the pages from moodle and save the result in a JSON file (default: disabled)

  • -U, --update

    Update badmoodle vulnerability database by scraping Moodle security advisory blog and retrieving new modules from GitHub repository

Community Vulnerability Modules

Since Moodle is so strict about their vulnerability disclosure program, a lot of vulnerabilities that security researchers discover and share with Moodle end up rejected or put on hold forever.

All these vulnerabilities will never see the light, they will be left unfixed and forgotten by Moodle... but not by badmoodle ;)

You can just add a community vulnerability module with your exploit code and badmoodle will execute it for you :)

badmoodle is modular, which means that you can add a community vulnerability module that will be executed by badmoodle without interfering with the rest of the code.

Adding a community vulnerability module is very simple: just create a .py file inside the "vulns" directory and badmoodle will execute it alongside the other modules.

badmoodle needs only 2 requirements to make your module work:

  • It must have a boolean variable enabled.

    This boolean variable is used to determine wether badmoodle should run the module or not. This allows to enable or disable modules by simply editing this variable without removing it from the "vulns" folder.

  • It must have the functions check(args, sess, version) and exploit(args, sess, version)

    These are the main functions of the module, the ones badmoodle will call in the core. Through these functions badmoodle will pass to the module the script arguments, the request session object of the script (useful for authenticated sessions) and moodle version.

    The check function is a boolean function that only checks whether the host is vulnerable or not, the exploit function instead will exploit that vulnerability.

    If in check mode badmoodle will call only the check function to only determine whether the host is vulnerable or not, if in exploit mode badmoodle will also call the exploit function for exploiting the vulnerability.

There follows a template for a badmoodle community vulnerability module:

'''
@Title:
MODULE_TITLE

@Author:
MODULE_AUTHOR

@Description:
MODULE_DESCRIPTION
'''


enabled = True


def check(args, sess, version):
	#YOUR_CHECK_CODE_HERE
	#return True if the host is vulnerable, False otherwise


def exploit(args, sess, version):
	#YOUR_EXPLOIT_CODE_HERE

badmoodle comes with 2 community vulnerability modules built-in:

  • A module for a Dashboard Stored XSS vulnerability

  • A module for an Atto Editor Stored XSS vulnerability

Contribute

If you wrote a community vulnerability module for badmoodle and want to share it with the community, you can contribute to the badmoodle project.

Pull requests with new community vulnerability modules are very welcome :)

Also, if you want to report a bug, feel free to open an issue or contact me via mail at [email protected]

Credits

badmoodle is coded by Michele 'cyberaz0r' Di Bonaventura.

A special thanks to Panfilo Salutari for the idea of the concept of the tool.

Thanks to moodlescan (https://github.com/inc0d3/moodlescan) for the specific version check technique and its version database.

You might also like...
An auxiliary tool for iot vulnerability hunter

firmeye - IoT固件漏洞挖掘工具 firmeye 是一个 IDA 插件,基于敏感函数参数回溯来辅助漏洞挖掘。我们知道,在固件漏洞挖掘中,从敏感/危险函数出发,寻找其参数来源,是一种很有效的漏洞挖掘方法,但程序中调用敏感函数的地方非常多,人工分析耗时费力,通过该插件,可以帮助排除大部分的安全

Open source vulnerability DB and triage service.
Open source vulnerability DB and triage service.

OSV - Open Source Vulnerabilities OSV is a vulnerability database and triage infrastructure for open source projects aimed at helping both open source

It's a simple tool for test vulnerability shellshock
It's a simple tool for test vulnerability shellshock

Shellshock, also known as Bashdoor, is a family of security bugs in the Unix Bash shell, the first of which was disclosed on 24 September 2014. Shellshock could enable an attacker to cause Bash to execute arbitrary commands and gain unauthorized access to many Internet-facing services, such as web servers, that use Bash to process requests.

Use FOFA automatic vulnerability scanning tool
Use FOFA automatic vulnerability scanning tool

AutoSRC Use FOFA automatic vulnerability scanning tool Usage python3 autosrc.py -e FOFA EMAIL -k TOKEN Screenshots License MIT Dev 6613GitHub6613

A fast tool to scan prototype pollution vulnerability
A fast tool to scan prototype pollution vulnerability

proto A fast tool to scan prototype pollution vulnerability Syntax python3 proto.py -l alive.txt Requirements Selenium Google Chrome Webdriver Note :

WebScan is a web vulnerability Scanning tool, which scans sites for SQL injection and XSS vulnerabilities
WebScan is a web vulnerability Scanning tool, which scans sites for SQL injection and XSS vulnerabilities

WebScan is a web vulnerability Scanning tool, which scans sites for SQL injection and XSS vulnerabilities Which is a great tool for web pentesters. Coded in python3, CLI. WebScan is capable of scanning and detecting sql injection vulnerabilities across HTTP and HTTP sites.

the metasploit script(POC/EXP) about CVE-2021-22005 VMware vCenter Server contains an arbitrary file upload vulnerability
the metasploit script(POC/EXP) about CVE-2021-22005 VMware vCenter Server contains an arbitrary file upload vulnerability

CVE-2021-22005-metasploit the metasploit script(POC/EXP) about CVE-2021-22005 VMware vCenter Server contains an arbitrary file upload vulnerability pr

 It's a simple tool for test vulnerability Apache Path Traversal
It's a simple tool for test vulnerability Apache Path Traversal

SimplesApachePathTraversal Simples Apache Path Traversal It's a simple tool for test vulnerability Apache Path Traversal https://blog.mrcl0wn.com/2021

Comments
  • Adding severity to report results and removing dynamic database files

    Adding severity to report results and removing dynamic database files

    The idea behind removing the two JSON files is to encourage users of the tool to run badmoodle.py -U to fetch the official, up-to-date database on tool installation.

    Adding the severity is interesting in a CI/CD security pipeline context, it allows the program to make quick decisions and to only flag major vulnerabilities. However, a downside is that the label is used in a very inconsistent way on the official database.

    opened by denisebitca 1
  • Update problem 'All previous versions' cannot be processed

    Update problem 'All previous versions' cannot be processed

    Nice script. Founds properly vulnerabilities on some testing older 3.9 Moodle instance.

    Anyway when I use "--update" it shows an exception. Seems like string 'All previous versions' cannot be processed.

    [+] Moodle version: v3.9
    
    [*] Checking for official vulnerabilities from vulnerability database
    Traceback (most recent call last):
      File "./badmoodle.py", line 235, in <module>
        main()
      File "./badmoodle.py", line 228, in main
        check_official_vulnerabilities(version)
      File "./badmoodle.py", line 86, in check_official_vulnerabilities
        vulnerabilities_found = list_vulnerabilities(version[1:].split('-')[0])
      File "/root/badmoodle/utils/version.py", line 76, in list_vulnerabilities
        if check_in_range(ver, vuln_ver):
      File "/root/badmoodle/utils/version.py", line 61, in check_in_range
        ver_from = int(''.join([str(x).zfill(2) for x in vuln_ver['from'].split('.')]))
    ValueError: invalid literal for int() with base 10: 'All previous versions'
    
    
    
    opened by molu8bits 1
Releases(v0.2)
  • v0.2(Feb 7, 2022)

    • Fixed some bugs
    • Improved modular engine
    • Improved code
    • Implemented colored output
    • Customized argument parser
    • Implemented plugin and themes enumeration (and added plugin/themes list)
    • Implemented JSON output file for saving scan results (with -o/--outfile option)
    • Implemented modules listing option (with -m/--list-modules)
    • Updated vulnerability database
    Source code(tar.gz)
    Source code(zip)
  • v0.1(Nov 27, 2021)

Owner
Michele Di Bonaventura
Penetration Tester and Cyber Security Enthusiast, particularly in Red Teaming and OffSec.
Michele Di Bonaventura
Exploiting CVE-2021-44228 in VMWare Horizon for remote code execution and more.

Log4jHorizon Exploiting CVE-2021-44228 in VMWare Horizon for remote code execution and more. BLOG COMING SOON Code and README.md this time around are

96 Dec 14, 2022
Generate obfuscated meterpreter shells

Generator Evade AV with obfuscated payloads Installation must install dotnet prior to running the script with net45 Running ./generator.py -ip Your-I

Fawaz Al-Mutairi 219 Nov 28, 2022
A Docker based LDAP RCE exploit demo for CVE-2021-44228 Log4Shell

log4j-poc An LDAP RCE exploit for CVE-2021-44228 Log4Shell Description This demo Tomcat 8 server has a vulnerable app deployed on it and is also vulne

60 Dec 10, 2022
Log4j2 CVE-2021-44228 revshell

Log4j2-CVE-2021-44228-revshell Usage For reverse shell: $~ python3 Log4j2-revshell.py -M rev -u http://www.victimLog4j.xyz:8080 -l [AttackerIP] -p [At

FaisalFs 16 Mar 24, 2022
On-demand scanning for container registries

Lacework registry scanner Install & configure Lacework CLI Integrate a Container Registry Go to Lacework Resources Containers Container Image In

Will Robinson 1 Dec 14, 2021
This collection of tools that makes it easy to secure and/or obfuscate messages, files, and data.

Scrambler App This collection of tools that makes it easy to secure and/or obfuscate messages, files, and data. It leverages encryption tools such as

Mystic 2 Aug 31, 2022
NexScanner is a tool which allows you to scan a website and find the admin login panel and sub-domains

NexScanner NexScanner is a tool which helps you scan a website for sub-domains and also to find login pages in the website like the admin login panel

8 Sep 03, 2022
Herramienta para descargar eventos de Sucuri WAF hacia disco.

Descarga los eventos de Sucuri Script para descargar los eventos del Sucuri Web Application Firewall (WAF) en el disco como archivos CSV. Requerimient

CSIRT-RD 2 Nov 29, 2021
🐝 ℹ️ Honeybee extension for export to IES-VE gem file format

honeybee-ies Honeybee extension for export a HBJSON file to IES-VE GEM file format Installation pip install honeybee-ies QuickStart import pathlib fro

Ladybug Tools 4 Jul 12, 2022
Arbitrium is a cross-platform, fully undetectable remote access trojan, to control Android, Windows and Linux and doesn't require any firewall exceptions or port forwarding rules

About: Arbitrium is a cross-platform is a remote access trojan (RAT), Fully UnDetectable (FUD), It allows you to control Android, Windows and Linux an

Ayoub 861 Feb 18, 2021
(D)arth (S)ide of the (L)og4j (F)orce, the ultimate log4j vulnerabilities assessor

DSLF DSLF stands for (D)arth (S)ide of the (L)og4j (F)orce. It is the ultimate log4j vulnerabilities assessor. It comes with four individual Python3 m

frontal 1 Jan 11, 2022
A brute Force tool for Facebook

EliBruter A brute Force tool for Facebook Installing this tool -- $ pkg upgrade && update $ pkg install python $ pkg install python3 $ pkg install gi

Eli Hacks 3 Mar 29, 2022
This repo explains in details about buffer overflow exploit development for windows executable.

Buffer Overflow Exploit Development For Beginner Introduction I am beginner in security community and as my fellow beginner, I spend some of my time a

cris_0xC0 11 Dec 17, 2022
Brute force attack tool for Azure AD Autologon/Seamless SSO

Brute force attack tool for Azure AD Autologon

nyxgeek 89 Jan 02, 2023
MainCoon - an automated recon framework

MainCoon is an automated recon framework meant for gathering information during penetration testing of web applications.

Md. Nur habib 8 Aug 26, 2022
Proof of Concept Exploit for ManageEngine ServiceDesk Plus CVE-2021-44077

CVE-2021-44077 Proof of Concept Exploit for CVE-2021-44077: PreAuth RCE in ManageEngine ServiceDesk Plus 11306 Based on: https://xz.aliyun.com/t/106

Horizon 3 AI Inc 25 Nov 09, 2022
Tor Relay availability checker, for using it as a bridge in countries with censorship

Tor Relay Availability Checker This small script downloads all Tor Relay IP addresses from onionoo.torproject.org and checks whether random Relays are

ValdikSS 161 Dec 30, 2022
Solución al reto BBVA Contigo, Hack BBVA 2021

Solution Solución propuesta para el reto BBVA Contigo del Hackathon BBVA 2021. Equipo Mexdapy. Integrantes: David Pedroza Segoviano Regina Priscila Ba

Gabriel Missael Barco 2 Dec 06, 2021
Time Discretization-Invariant Safe Action Repetition for Policy Gradient Methods

Time Discretization-Invariant Safe Action Repetition for Policy Gradient Methods This repository is the official implementation of Seohong Park, Jaeky

Seohong Park 6 Aug 02, 2022
Yara Based Detection Engine for web browsers

Yobi Yara Based Detection for web browsers System Requirements Yobi requires python3 and and right now supports only firefox and other Gecko-based bro

imp0rtp3 44 Nov 20, 2022