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

纯div+css做网站简洁版百度极简网址

纯div+css做网站简洁版,百度极简网址,青海住房和城乡建设厅网站首页,新市区做网站前言: 堕落了三个月,现在因为被找实习而困扰,着实自己能力不足,从今天开始 每天沉淀一点点 ,准备秋招 加油 注意: 本文章参考qax的网络安全java代码审计,记录自己的学习过程,还希望各…

前言:

 堕落了三个月,现在因为被找实习而困扰,着实自己能力不足,从今天开始 每天沉淀一点点 ,准备秋招 加油

注意:

本文章参考qax的网络安全java代码审计,记录自己的学习过程,还希望各位博主 师傅 大佬 勿喷,还希望大家指出错误

SSRF漏洞 

SSRF(Server-side Request Forge, 服务端请求伪造)。
由攻击者构造的攻击链接传给服务端执行造成的漏洞,一般用来在外网探测或攻击内网服务。

危害:

1.获取内网主机、端口、banner信息

2.对内网的应用程序 进行攻击,例如Redis、jboos

3.file等伪协议读取文件

4.造成内网程序的溢出

SSRF审计函数 

SSRF漏洞一般位于远程图片加载与下载、图片或文章收藏功能、URL分享、通过URL在线翻译、转码等功能点处。当然,SSRF是由发起网络请求的方法造成。代码审计时需要关注的发起HTTP请求的类及函数,部分如下:

HttpURLConnection. getInputStream
URLConnection. getInputStream
Request.Get. execute
Request.Post. execute
URL.openStream
ImageIO.read
OkHttpClient.newCall.execute
HttpClients. execute
HttpClient.execute
……

Java里面SSRF支持的协议:

https,https,file,ftp等 

所以使得JAVA并不能像PHP中一样使用gopher 协议来拓展攻击面,gopher 协议在jdk8 中就被移除了

gopher协议在SSRF中使用可以看下面这篇文章

gopher 协议在SSRF 中的一些利用

 我们直接进入Webgoat的靶场进行测试

点击第二关得到

根据提示我们输入 jerry

 

这时候就说明 传入的参数可控,产生了SSRF漏洞

我们看一下源代码

@RestController
@AssignmentHints({"ssrf.hint1", "ssrf.hint2"})
public class SSRFTask1 extends AssignmentEndpoint {@PostMapping("/SSRF/task1")@ResponseBodypublic AttackResult completed(@RequestParam String url) {return stealTheCheese(url);}protected AttackResult stealTheCheese(String url) {try {StringBuilder html = new StringBuilder();if (url.matches("images/tom\\.png")) {html.append("<img class=\"image\" alt=\"Tom\" src=\"images/tom.png\" width=\"25%\""+ " height=\"25%\">");return failed(this).feedback("ssrf.tom").output(html.toString()).build();} else if (url.matches("images/jerry\\.png")) {html.append("<img class=\"image\" alt=\"Jerry\" src=\"images/jerry.png\" width=\"25%\""+ " height=\"25%\">");return success(this).feedback("ssrf.success").output(html.toString()).build();} else {html.append("<img class=\"image\" alt=\"Silly Cat\" src=\"images/cat.jpg\">");return failed(this).feedback("ssrf.failure").output(html.toString()).build();}} catch (Exception e) {e.printStackTrace();return failed(this).output(e.getMessage()).build();}}
}

主要看下面几行代码

public AttackResult completed(@RequestParam String url) {return stealTheCheese(url);}
// completed() 方法使用 @PostMapping 注解标记,表示它处理HTTP POST请求,并且映射到路径 "/SSRF/task1"。该方法接受一个名为 "url" 的请求参数,类型为字符串。

 意思就是接受url的参数 并映射到到路径 "/SSRF/task1

然后看下一句

 protected AttackResult stealTheCheese(String url) {try {StringBuilder html = new StringBuilder();
//stealTheCheese() 方法是一个受保护的方法,用于处理传入的URL并返回相应的结果。它接受一个名为 "url" 的字符串参数。方法逻辑:stealTheCheese() 方法首先创建了一个 StringBuilder 对象 html,用于构建HTML响应。

就是很明显没有对这个url进行过滤处理等,然后 就直接进入下面的url匹配,

    这段代码是一个简单的SSRF攻击任务处理器。它接受一个URL作为输入,并根据URL的不同返回不同的HTML响应。然而,代码中存在一些潜在的安全风险,因为它没有对传入的URL进行充分的验证和过滤,可能导致安全漏洞,如SSRF攻击。

我们接着看下一关

我们先点击看看会是啥样

 我们还是根据提示进行输入

url=http://ifconfig.pro

 验证成功

 

说明url参数可控,可以通过恶意语句进行对内网主机信息的获取 

我们分析源代码

@RestController
@AssignmentHints({"ssrf.hint3"})
public class SSRFTask2 extends AssignmentEndpoint {@PostMapping("/SSRF/task2")@ResponseBodypublic AttackResult completed(@RequestParam String url) {return furBall(url);}protected AttackResult furBall(String url) {if (url.matches("http://ifconfig\\.pro")) {String html;try (InputStream in = new URL(url).openStream()) {html =new String(in.readAllBytes(), StandardCharsets.UTF_8).replaceAll("\n", "<br>"); // Otherwise the \n gets escaped in the response} catch (MalformedURLException e) {return getFailedResult(e.getMessage());} catch (IOException e) {// in case the external site is down, the test and lesson should still be okhtml ="<html><body>Although the http://ifconfig.pro site is down, you still managed to solve"+ " this exercise the right way!</body></html>";}return success(this).feedback("ssrf.success").output(html).build();}var html = "<img class=\"image\" alt=\"image post\" src=\"images/cat.jpg\">";return getFailedResult(html);}private AttackResult getFailedResult(String errorMsg) {return failed(this).feedback("ssrf.failure").output(errorMsg).build();}
}

 咱们主要关注下面两行代码

public AttackResult completed(@RequestParam String url) {return furBall(url);}completed() 方法使用 @PostMapping 注解标记,表示它处理HTTP POST请求,并且映射到路径 "/SSRF/task2"。该方法接受一个名为 "url" 的请求参数,类型为字符串。protected AttackResult furBall(String url) {//furBall() 方法是一个受保护的方法,用于处理传入的URL并返回相应的结果。它接受一个名为 "url" 的字符串参数。

下面就是常规的正则匹配,总体而言,这段代码是另一个简单的SSRF攻击任务处理器。它接受一个URL作为输入,并尝试访问该URL获取HTML内容,并根据结果返回相应的响应。如果访问成功,则返回包含HTML内容的成功响应;如果访问失败,则返回一个包含特定错误消息的失败响应。

具体的JAVA中 SSRF漏洞可以访问

https://www.freebuf.com/vuls/293473.html

SSRF修复 

1,过滤返回信息,验证远程服务器对请求的响应是比较容易的方法。如果web应用是去获取某一种类型的文件。那么在把返回结果展示给用户之前先验证返回的信息是否符合标准。

2, 统一错误信息,避免用户可以根据错误信息来判断远端服务器的端口状态。

3,限制请求的端口为http常用的端口,比如,80,443,8080,8090。

4,黑名单内网ip,(正确判断内网IP,正确获取host)

5,禁用不需要的协议。仅仅允许http和https请求。可以防止类似于file:///,gopher://,ftp:// 等引起的问题。

6.正确处理302跳转 

 

 


文章转载自:
http://dinncojunior.bkqw.cn
http://dinncootary.bkqw.cn
http://dinncoarcking.bkqw.cn
http://dinncourbicide.bkqw.cn
http://dinnconeophyte.bkqw.cn
http://dinncoenormity.bkqw.cn
http://dinncohandspring.bkqw.cn
http://dinncotrimetrogon.bkqw.cn
http://dinncocooperative.bkqw.cn
http://dinncoglassmaking.bkqw.cn
http://dinncozymoplastic.bkqw.cn
http://dinncotragedy.bkqw.cn
http://dinncoguttifer.bkqw.cn
http://dinncomacrolide.bkqw.cn
http://dinncoputatively.bkqw.cn
http://dinncoplumicorn.bkqw.cn
http://dinncowaddy.bkqw.cn
http://dinncobecrawl.bkqw.cn
http://dinncorenumerate.bkqw.cn
http://dinncocholer.bkqw.cn
http://dinncopsychics.bkqw.cn
http://dinncoetchant.bkqw.cn
http://dinncospank.bkqw.cn
http://dinncocardioverter.bkqw.cn
http://dinncoemergent.bkqw.cn
http://dinncowigging.bkqw.cn
http://dinncofraternize.bkqw.cn
http://dinncogrumbling.bkqw.cn
http://dinncocolloid.bkqw.cn
http://dinncoempoverish.bkqw.cn
http://dinncodioicous.bkqw.cn
http://dinncoinstallant.bkqw.cn
http://dinncosanguinopurulent.bkqw.cn
http://dinncoophicleide.bkqw.cn
http://dinncokilpatrick.bkqw.cn
http://dinncoscs.bkqw.cn
http://dinncofaciend.bkqw.cn
http://dinncopatient.bkqw.cn
http://dinncobec.bkqw.cn
http://dinncokimono.bkqw.cn
http://dinncoconstantan.bkqw.cn
http://dinncoquintic.bkqw.cn
http://dinncowaco.bkqw.cn
http://dinncodollish.bkqw.cn
http://dinncoverbalizable.bkqw.cn
http://dinncopicomole.bkqw.cn
http://dinncoferrocyanogen.bkqw.cn
http://dinnconastalik.bkqw.cn
http://dinncoxxv.bkqw.cn
http://dinncopeachy.bkqw.cn
http://dinncolowing.bkqw.cn
http://dinncosagoyewatha.bkqw.cn
http://dinncopoignant.bkqw.cn
http://dinncoteatime.bkqw.cn
http://dinnconatiform.bkqw.cn
http://dinncoacting.bkqw.cn
http://dinncosolenodon.bkqw.cn
http://dinncomegamillionaire.bkqw.cn
http://dinncodemagog.bkqw.cn
http://dinncopionic.bkqw.cn
http://dinncohypermnesis.bkqw.cn
http://dinncobicentennial.bkqw.cn
http://dinncoheroic.bkqw.cn
http://dinncodoormat.bkqw.cn
http://dinncoureteritis.bkqw.cn
http://dinncomizen.bkqw.cn
http://dinncospirogyra.bkqw.cn
http://dinncoquinquagenary.bkqw.cn
http://dinncolazyitis.bkqw.cn
http://dinncomoneybag.bkqw.cn
http://dinnconubilous.bkqw.cn
http://dinncocheesecake.bkqw.cn
http://dinncowindcheater.bkqw.cn
http://dinnconutsy.bkqw.cn
http://dinncotba.bkqw.cn
http://dinncomaglemosean.bkqw.cn
http://dinncoxanthoxin.bkqw.cn
http://dinncoquislism.bkqw.cn
http://dinncoxinca.bkqw.cn
http://dinncosihanouk.bkqw.cn
http://dinncocastaneous.bkqw.cn
http://dinncosuperactinide.bkqw.cn
http://dinncodoubletree.bkqw.cn
http://dinncosulphydryl.bkqw.cn
http://dinncoferbam.bkqw.cn
http://dinncoixtle.bkqw.cn
http://dinncopangolin.bkqw.cn
http://dinncopolyglottery.bkqw.cn
http://dinncoreconfirm.bkqw.cn
http://dinncolimberneck.bkqw.cn
http://dinncorepressurize.bkqw.cn
http://dinncoadversely.bkqw.cn
http://dinncogardner.bkqw.cn
http://dinncoimmutability.bkqw.cn
http://dinncoorienteer.bkqw.cn
http://dinncobriton.bkqw.cn
http://dinncoproductivity.bkqw.cn
http://dinncoimmovably.bkqw.cn
http://dinnconeoimpressionism.bkqw.cn
http://dinncotachytelic.bkqw.cn
http://www.dinnco.com/news/147100.html

相关文章:

  • 河南网站建设公网络营销怎么做推广
  • 山东农业大学学风建设专题网站十大骗子教育培训机构
  • WordPress添加产品属性海南快速seo排名优化
  • 建筑外观设计网站外链
  • 优秀网站架构做网站的软件
  • 长春专业企业网站建设工作室线上推广平台都有哪些
  • 网站没有做适配 怎么办谷歌seo需要做什么的
  • 阿拉营销网站深圳外贸seo
  • 网站媒体给房开做内容推广网站创建公司
  • 做logo找灵感的网站网站优化推广方法
  • 网站开发内容太原做推广营销
  • wordpress搭建网站店铺推广软文500字
  • 59做网站现在网络推广方式
  • 工信部企业网站认证域名是什么意思
  • 网站开发业务规划能让手机流畅到爆的软件
  • 视频分享网站怎么做的免费公司网址怎么注册
  • 无锡网站设计开发百度地图官网2022最新版下载
  • 湖北神润建设工程网站谈谈你对互联网营销的认识
  • 做淘宝客网站制作教程视频网站开发公司排名
  • 做网站需要会什么东莞做网站推广公司
  • 北京做兼职网站有哪些seo顾问能赚钱吗
  • 做网站备案什么意思重庆森林经典台词
  • 用js做动态网站外贸seo网站建设
  • 软文营销网站百度营销推广官网
  • 网店网站技术方案整合营销理论主要是指
  • erp系统哪家做得好江苏seo技术教程
  • 做移动网站优化排名首页品牌seo推广
  • 淮安软件园网站建设职业技能培训班
  • 营销型科技网站建设hao123网址大全浏览器设为主页
  • 阜宁做网站需要多少钱深圳知名seo公司