
로컬 파일 포함(Local File Inclusion) 취약점을 탐지하고 악용하는 Python3 도구로, 크롤링, 경로 순회 및 필터 우회 페이로드, 그리고 로그 포이즈닝 또는 PHP 래퍼를 통한 자동 리버스 셸 기능을 제공합니다.
• 이 도구는 교육 목적으로만 사용됩니다.
• 개발자와 협력자는 이 도구의 불법적인 사용에 대해 책임지지 않습니다.
LFITester는 서버가 로컬 파일 포함(LFI) 공격에 취약한지 테스트하는 Python3 도구입니다.
Linux/Unix 시스템에서 실행되지만 Windows에서도 실행할 수 있습니다. 이 프로그램을 사용하려면:
• 시스템에 Python3가 설치되어 있어야 하며, 없으면 https://www.python.org/downloads/ 에서 다운로드할 수 있습니다.
• pip도 필요하며, 없는 경우 Linux에서는 sudo apt install python3-pip 를 실행하세요.
• 프로그램을 다운로드하거나 시스템에 저장소를 복제하세요 git clone https://github.com/kostas-pa/LFITester.git
• LFITester 폴더로 이동하세요
• 먼저 sudo chmod +x setup.sh 명령을 실행하세요
• 그런 다음 sudo ./setup.sh 를 실행하면 필요한 패키지가 자동으로 설치됩니다
• 그 후에는 간단히 lfitester를 명령으로 실행할 수 있습니다.
• 공격을 시작하기 전에 --update 플래그를 실행하는 것이 권장됩니다
$python3 LFITester.py
└──╼ $./LFITester.py
_ ______ _____ _______ _
| | | ____|_ _|__ __| | |
| | | |__ | | | | ___ ___| |_ ___ _ __
| | | __| | | | |/ _ \/ __| __/ _ \ '__|
| |____| | _| |_ | | __/\__ \ || __/ |
|______|_| |_____| |_|\___||___/\__\___|_|
**********************************************************************************************************************************************************************************************
LFITester
Automated LFI Testing
**********************************************************************************************************************************************************************************************
usage: LFITester.py [-h] [-u URL] [-L URL_File] [-c] [-v] [-o [OUTFILE]] [--creds [user:pass]] [-p] [--autopwn IP]
[-m Payload] [-f] [--update] [--batch-ans BATCH] [-s] [--poc-file POC] [-H HEADERS] [-C COOKIES]
Payload Modes:
0: Simple bash TCP
1: Alternative bash TCP
2: Simple sh UDP
3: Alternative sh TCP
4: Perl TCP
5: Alternative Perl TCP
6: Python TCP
7: Alternative python TCP
8: Alternative 2 python TCP
9: Alternative 3 python TCP
10: Alternative (No Spaces) python TCP
11: Alternative (No Spaces) 2 python TCP
12: Alternative (No Spaces) 3 python TCP
13: Alternative (No Spaces) Shortened python TCP
14: Alternative (No Spaces) Shortened 2 python TCP
15: Alternative (No Spaces) Shortened 3 python TCP
16: Alternative (No Spaces) Shortened Further python TCP
17: Alternative (No Spaces) Shortened Further 2 python TCP
18: Alternative (No Spaces) Shortened Further 3 python TCP
19: Python3 TCP
20: Alternative python3 TCP
21: Alternative 2 python3 TCP
22: Alternative 3 python3 TCP
23: Alternative (No Spaces) python3 TCP
24: Alternative (No Spaces) 2 python3 TCP
25: Alternative (No Spaces) 3 python3 TCP
26: Alternative (No Spaces) Shortened python3 TCP
27: Alternative (No Spaces) Shortened 2 python3 TCP
28: Alternative (No Spaces) Shortened 3 python3 TCP
29: Alternative (No Spaces) Shortened Further python3 TCP
30: Alternative (No Spaces) Shortened Further 2 python3 TCP
31: Alternative (No Spaces) Shortened Further 3 python3 TCP
32: Php exec
33: Php shell_exec
34: Php over sh
35: Php system
36: Php passthru
37: Php popen
38: Php proc_open
39: Ruby
40: Ruby Alternative
41: Go
42: Netcat sh
43: Netcat bash
44: Netcat alternative bash
45: Netcat openBSD
46: Ncat
47: Ncat UDP
options:
-h, --help show this help message and exit
-u URL, --url URL The url to test. The URL usually is http://[URL]?[something]=
-L URL_File, --list-url URL_File
Input a list of URLs from an external file. The URLs format usually is http://[URL]?[something]=
-c, --crawl use the crawler to test all the endpoints
-v, --verbose Increase output verbosity
-o [OUTFILE], --output [OUTFILE]
The file to save the results
--creds [user:pass] The credentials to login
-p, --enable-proxies Enable proxy redirection. Default proxies are free and you can change them. If you don't want the
default proxies you can supply your own and this option will be overridden! Note that the proxies
will be picked at random for each request
--autopwn IP If the webapp is vulnerable to LFI then it will attempt to exploit it and give back a shell. This
option requires your IP in order to connect with the revshell
-m Payload, --mode Payload
Select the payload that suits best. Try different ones if the exploit doesn't work.
-f, --force Treat endpoint as alive even if it returns 404
--update Update LFITester
--batch-ans BATCH Answer all yes/no
-s, --stealth Enable stealth mode
--poc-file POC Your custom poc file.
-H HEADERS, --headers HEADERS
Add extra headers
-C COOKIES, --cookies COOKIES
Add extra cookies
-r PACKET_FILE, --packet-file PACKET_FILE
Import headers/cookies/body from a packet file (HTTP or Burp format)
Proxies in the list must be in the following format: protocol://{proxyip}
username:password (newline). If you dont have a authenticated
proxy then skip the username:password entry and go for a new line
Examples:
LFITester.py -u "http://URL?smt=" = test one specific endpoint
LFITester.py -L test.txt = test a list of endpoints from file
LFITester.py -c -u "http://URL" = crawl and test all endpoints of that URL
LFITester.py -c -L test.txt = crawl and test all endpoints for every URL in the file
LFITester.py --creds abc:abc -u "http://URL?smt=" = test one specific endpoint which requires a login
Developers: Konstantinos Papanagnou (https://github.com/Konstantinos-Papanagnou)
Konstantinos Pantazis (https://github.com/kostas-pa)
Timothy Stowe (https://github.com/timothy90990)
• 기본 사용법: python3 LFITester.py -u "http://myvulnerabledomain/vulnerable/application?test_param="
• http://url?param1=1¶m2=2처럼 쿼리 매개변수가 2개인 URL에서 문제가 발생하면 "http://url?param1=1¶m2=2"처럼 ""로 감싸서 실행해 보세요.
• 사용자이고 Git에 관한 오류가 발생하면 **sudo lfitester [flags]**처럼 sudo 명령으로 lfitester를 실행해 보세요.
• 라이브러리에서 문제가 발생하면 --update 플래그를 실행한 다음 sudo pip3 install -r requirements.txt를 실행해 보세요. 요구 사항이 변경되었을 수 있습니다.
• 출력 파일에서 색상이 보이지 않고 대신 색상 코드가 보이면 [your text editor] display ANSI color codes를 검색해 보세요.
• setup.sh가 python 패키지를 설치할 수 없으면 sudo pip3 install [package] 명령으로 수동 설치해 보세요.
• 멈추는 경우에는 일단 Enter 키를 눌러 주세요 :)
• 이상한 인코딩 결과가 나오면 Burp 파일을 포함하여 매개변수에서 모든 값을 제거해 보세요.
• 이 프로젝트가 마음에 드신다면 스타를 눌러 주시기 바랍니다.
• 이 프로젝트를 도와주고 지식을 제공해 준 모든 기여자에게 감사드립니다.