"The Stealthy Blood-Sucker for LFI Post-Exploitation"
"The Stealthy Blood-Sucker for LFI Post-Exploitation"
Anopheles is a specialized reconnaissance toolkit designed to automate privilege escalation and sensitive information gathering by traversing the Linux /proc filesystem via Local File Inclusion (LFI) vulnerabilities.
Version 1.1 introduces significant enhancements in terminal stability for Windows environments and greatly improved visibility during large-scale scans.
Anopheles leverages an LFI vulnerability as a "needle" to perform a comprehensive scan of the target system's internal process structure, which is normally invisible from the outside. It is specifically optimized for identifying the owner (UID) of particular TCP ports and extracting their execution paths and arguments.
- Phase 1 (Connectivity): Automatically validates the effectiveness of the traversal depth (10 levels) via
/etc/passwdread tests. - Phase 2 (TCP Mapping): Identifies the target user (UID) by performing hexadecimal analysis on
/proc/net/tcp. - Phase 3 (Deep Scan): Performs a sequential PID enumeration
- Latin-1 Memory Recovery: Safely decodes
/proc/[PID]/cmdlineeven when binary data is present, minimizing the text loss seen in conventional tools. - Smart Sanitization: Automatically strips null bytes (
\x00) and non-ASCII control characters, completely eliminating "garbage characters" (mojibake) in Windows environments.
- Banner Realignment: Fixed the alignment issue between the ASCII "Mosquito" icon and the "ANOPHELES" text for a more professional look.
- Dynamic Progress Spinner: Implemented a rotating spinner for each PID request, allowing operators to instantly verify that the scan is progressing.
- Completion Signal: Displays a summary upon completion of the full scan to notify the operator.
- Requests Optimization: Improved scan stability under unstable network conditions through optimized timeout settings and exception handling.
- Winpty Support: Designed with consideration for signal transmission issues specific to Windows Git Bash (MINGW64).
We highly recommend using winpty when running in Windows (Git Bash/MINGW64) environments.
python anopheles.py -u http://hoge.hoge:8000/ -p page -P 6048 --max 1000winpty python anopheles.py -u http://hoge.hoge:8000/ -p page -P 6048 --max 1000| Option | Argument | Description |
|---|---|---|
-u |
TARGET_URL |
The target URL (e.g., http://airplane.thm:8000/) |
-p |
PARAMETER |
Parameter name vulnerable to LFI (e.g., page, file) |
-P |
PORT |
Target port number to identify the UID (e.g., 6048) |
--max |
MAX_PID |
Upper limit for PID brute-forcing (Default: 1000) |
This tool is intended for educational purposes and authorized security testing (Penetration Testing) only. The developer assumes no liability for any misuse or damage caused by this tool. Use it responsibly and only on systems you have explicit permission to test.
Anopheles は、Linuxの /proc ファイルシステムから、権限昇格や機密情報の列挙を自動化するためのLFI(Local File Inclusion)特化型偵察ツールキットです。
v1.1 では、Windowsターミナル環境での表示の堅牢性と、大規模スキャンにおける視認性が大幅に強化されました。
本ツールは、Webアプリケーションに存在するLFI脆弱性を「針」として利用し、本来外部からは不可視であるターゲットシステム内部のプロセス構造を全走査します。 特に、特定のTCPポートをリスニングしているプロセスの所有者(UID)の特定と、その実行パス・引数(Command Line)を静的に抽出することに最適化されています。
- Phase 1 (Connectivity):
/etc/passwdの読み取りテストにより、トラバーサル深度(10階層)の有効性を自動検証。 - Phase 2 (TCP Mapping):
/proc/net/tcpの16進数解析による、ポート占有ユーザー(UID)の特定。 - Phase 3 (Deep Scan): PID全走査。対象UIDに紐づくプロセスのみをリアルタイムでフィルタリング。
- Latin-1 Memory Recovery: バイナリデータが混在する
/proc/[PID]/cmdlineを安全にデコードし、従来発生していたテキストの欠落を最小化。 - Smart Sanitization: ヌルバイト(
\x00)や非ASCII制御文字を自動除去。Windows環境における「文字化け(Non-ASCII garbage)」を完全に排除。
- Banner Realignment: アスキーアートの「蚊」アイコンと「ANOPHELES」テキストの行ズレを完全に修正し、視認性を向上。
- Dynamic Progress Spinner: 各PIDへのリクエストごとに回転するスピナーを実装。スキャンのハングアップを即座に判別可能。
- Completion Signal: 全スキャン終了時にサマリーを表示し、オペレーターへ完了を通知。
- Requests Optimization: タイムアウト設定と例外処理の最適化により、不安定なネットワーク環境下でのスキャン安定性を向上。
- Winpty Support: Windows Git Bash上での信号伝達問題を考慮した設計。
Windows (Git Bash/MINGW64) で実行する場合は、winpty の併用を推奨します。
# 基本実行例
python anopheles.py -u http://hoge.hoge:8000/ -p page -P 6048 --max 1000# Git Bash/MINGW64 実行例
winpty python anopheles.py -u http://hoge.hoge:8000/ -p page -P 6048 --max 1000| オプション | 引数名 | 説明 |
|---|---|---|
-u |
TARGET_URL |
ターゲットとなるURL (例: http://hoge.hoge:8000/) |
-p |
PARAMETER |
LFI脆弱性を持つパラメータ名 (例: page, file) |
-P |
PORT |
UIDを特定するための対象ポート番号 (例: 6048) |
--max |
MAX_PID |
総当たりを行うPIDの上限値 (デフォルト: 1000) |
本ツールは、教育および正当な権限を持つセキュリティテスト(ペネトレーションテスト)の目的のみで作成されています。本ツールの誤用や、それによって生じた損害について、開発者は一切の責任を負いません。必ず許可を得たシステムに対してのみ、責任を持って使用してください。