fimap v2.0

July 12, 2026 · View on GitHub

fimap is a tool which can find, prepare, audit, exploit and even search automatically for local and remote file inclusion bugs in webapps. fimap aims to be what sqlmap is for SQL injection — but for LFI/RFI bugs.

Original author: Iman Karim (fimap v1.00, 2009–2012, GPLv2)

fimap v2.0 is a full Python 3 rewrite: async I/O, type-safe configuration, zero exec() calls, SSL verification on by default, no pickle. All original exploit logic preserved and extended with modern LFI→RCE techniques.

Original project home: fimap.googlecode.com (archived)


What fimap Does

Scanning & Discovery

  • Single URL, mass URL list, or Google search scanning.
  • Identify file inclusion bugs: include, include_once, require, require_once.
  • Scans GET parameters, POST parameters, and HTTP headers.
  • Blind mode (--enable-blind) for servers with error messages disabled.
  • AutoAwesome mode: auto-discover forms, cookies, and links, then scan them.
  • Harvest mode: crawl a site recursively and collect URLs.

Exploitation

  • Interactive exploit shell (-x) with tab-completion and command execution.
  • Non-interactive exploiting (--x-cmd).
  • Reverse shells, payload execution, file read/write.

LFI→RCE Techniques

  • Logfile Injection — 5 vectors across 66 log paths:
    • LA Authorization header (base64-encoded, survives URI mangling)
    • LH Apache User-Agent (with ?-path fallback)
    • LF vsftpd FTP username injection
    • LS SSH username injection (paramiko)
    • LE Email/SMTP injection
  • /proc/self/environ — User-Agent reflection in process environment.
  • PHP_SESSION_UPLOAD_PROGRESS — Forge PHP sessions via multipart POST.
  • PHP filter chains — Generate arbitrary PHP code from php://filter without file writes (full 64-char base64 alphabet mapped).
  • pearcmd.php RCE — Docker/default PHP image gadget (+config-create+).
  • php://input — POST body code injection.
  • phar:// deserialization — Trigger deserialization via phar:// wrapper.
  • zip:// wrapper — Include PHP from inside uploaded ZIP archives.

Payload Engineering

  • Relative/absolute path handling with automatic prefix/suffix calculation.
  • Null-Byte poisoning (%00) for suffix removal.
  • Dot-Truncation for suffix removal (Windows + Unix).
  • Directory traversal multiplication (-M).

Remote File Inclusion

  • Dynamic RFI with FTP upload/delete (ftplib).
  • Dynamic RFI with local HTTP server.
  • php_b64 payload encoder for RFI delivery.

Infrastructure

  • Proxy support (--http-proxy).
  • Colored terminal output (-C).
  • Full argparse CLI — all 38+ original flags + --encode-chain, --oob-domain.
  • XML result storage (~/fimap_result.xml), JSON headers.
  • Plugin interface for custom exploit modules (stub, planned).

Credits

  • Original Author & Main Developer: Iman Karim — created fimap, designed the scanning engine, exploit logic, language definition system, and plugin architecture.

  • Python 3 Rewrite & Extensions: This continuation.

  • New Techniques (v2.0):

  • External Libraries (original):

  • Trusted Plugins (original):

    • Metasploit binding — Xavier Garcia
    • Weevily Injector — Darren "Infodox" Martyn (insecurety.net)
    • AES Reverse Shell — Darren "Infodox" Martyn

Feature Parity

FeatureStatusNotes
Single URL scan (-s)✅ Python3async, concurrent
Mass URL scan (-m)✅ Python3async, concurrent with semaphore
AutoAwesome mode (-4)✅ Python3form scanning + cookie capture + link harvest
Crawler/Harvester (-H)✅ Python3BS4, same-domain BFS
Sniper scan (regex-based LFI detection)✅ Python3all original regex preserved
Blind scan (--enable-blind)✅ Python3path traversal + nullbyte
Null-Byte poisoning✅ Python3identical logic
Dot-Truncation✅ Python3difflib.SequenceMatcher, Python3 API fix
Language definitions (YAML)✅ Python3PHP: 16 exec methods, 11 include patterns, 5 extensions
XML result storage (~/fimap_result.xml)✅ Python3JSON headers (was pickle), xml.etree.ElementTree
Proxy support (--http-proxy)✅ Python3via httpx
Colored output (--enable-color)✅ Python3ANSI terminal colors
GET/POST/Header parameter scanning✅ Python3all three injection vectors
SSL verification✅ Enabled by default--insecure to disable
Interactive exploit shell (-x)✅ Python3domain/vuln menus, exec probing, command loop, tab-complete
Dynamic RFI (FTP/local modes)✅ Python3ftplib FTP upload/delete, local file write/delete, php_b64 encoder
Logfile Injection (LA/LH/LF/LS/LE)✅ Python35 vectors, 66 log paths
Authorization header injection (LA)✅ Python3base64-encoded, survives URI mangling
php://input wrapper✅ Python3POST body code injection via wrapper sub-menu
data:// wrapper✅ Python3inline base64 PHP via data:// URI
expect:// wrapper✅ Python3direct command execution (expect extension)
file:// wrapper✅ Python3alternative file access path
Slash-Dot (/.) suffix bypass✅ Python3bypass substr($file,-4) extension guards
Advanced LFI fuzz payloads✅ Python323 payloads: Unicode bypass, double encoding, WAF evasion
Log path auto-discovery✅ Python3canary seeding + wordlist probing across 66 paths
Chainable payload encoding✅ Python3url → double_url → base64 chain for WAF evasion
OOB DNS callback✅ Python3blind LFI confirmation via DNS lookup stub
PHP_SESSION_UPLOAD_PROGRESS✅ Python3multipart POST → forged session → include
PHP filter chains (arbitrary code)✅ Python3convert.iconv chains, 64/64 base64 chars mapped
pearcmd.php RCE✅ Python3Docker/default PHP gadget, +config-create+
phar:// deserialization✅ Python3wrapper support in config
zip:// wrapper✅ Python3include PHP from uploaded ZIP
/proc/self/* entries✅ Python3fd/{0,1,2}, status, cmdline, environ
CLI (python -m fimap)✅ Python3full argparse port of all 38+ original flags
Plugin system❌ Not portedplanned (importlib-based, no exec)
Google scan (-g)❌ DeprecatedGoogle HTML scraping broken since ~2014
Bing scan (-B)❌ RemovedBing API v2 defunct
--update-def❌ RemovedGoogle Code URLs dead
--install-plugins❌ RemovedGoogle Code URLs dead
--show-my-ip❌ Removedhardcoded endpoint defunct
Perl language support❌ Removednon-functional in original (generated PHP code)

Security Improvements vs Original

ConcernOriginal (Python2)Rewrite (Python3)
exec() calls3 (quiz gen, plugin loading)0
Header serializationpickle.dumps + base64JSON
SSL certificate verificationDisabled globally (ssl.CERT_NONE)Enabled by default
YAML/config loadingN/A (XML + exec() quiz code)yaml.safe_load(), pure Python quiz
Socket timeoutGlobal socket.setdefaulttimeout()Per-request httpx.Timeout
ConfigurationLoose dict with string keysTyped AppConfig dataclass
BeautifulSoupBS3 (bundled, Python2-only)BS4 (packaged dependency)

Project Structure

fimap/
├── config/              # YAML language definitions (was: config/*.xml)
│   ├── generic.yaml     #   Global scan config, blind files, shell commands, 66 log paths
│   └── php.yaml         #   PHP exec methods, payloads, detectors
├── scanners/            # Scan modes (single, mass, autoawesome)
├── exploit/             # Interactive exploit shell, RFI, log injection, modern techniques
│   ├── shell.py         #   Domain/vuln selection, injection testing, command loop, wrappers
│   ├── rfi.py           #   Dynamic RFI: FTP/local upload/delete, chainable encoding
│   ├── log_inject.py    #   Logfile injection: 5 vectors (LA/LH/LF/LS/LE), 66 paths, auto-discovery
│   ├── php_session.py   #   PHP_SESSION_UPLOAD_PROGRESS technique
│   ├── proc_environ.py  #   /proc/self/environ header injection
│   ├── proc_fd.py       #   /proc/self/fd error log injection
│   ├── phpinfo_race.py  #   PHPInfo temp file race condition LFI→RCE
│   ├── php_filters.py   #   PHP filter chain generator (arbitrary code, no files)
│   ├── oob.py           #   Out-of-band DNS callback for blind LFI confirmation
│   └── haxhelper.py     #   Plugin bridge (command execution, file upload)
├── plugins/             # Ported exploit plugins
│   └── msf/             #   Metasploit integration (XML-RPC listener)
├── scanner.py           # Core async scanning engine
├── language.py          # YAML loader, quiz generators, language registry
├── http_client.py       # httpx async wrapper (SSL verify ON by default)
├── models.py            # VulnReport, FileEntry, ExecMethod, Payload dataclasses
├── config.py            # Typed AppConfig + RFIConfig
├── crawler.py           # Async URL harvester (BS4)
├── xml_store.py         # XML result persistence (JSON headers, no pickle)
├── utils.py             # Logger, colored output, box drawing
├── report.py            # Re-exports VulnReport from models
├── cli.py               # Full argparse CLI (all 38+ original flags)
├── __init__.py          # Package metadata
└── __main__.py          # Entry point → cli.main()

Installation

pip install httpx pyyaml beautifulsoup4 paramiko
python cli.py --help

Requirements: Python 3.10+, httpx, pyyaml, beautifulsoup4, paramiko.


License

GNU General Public License v2.0 — same as original fimap.