CTF实战练习:web-Loginme
本文为看雪论坛优秀文章
看雪论坛作者ID:H3h3QAQ
package middleware
import (
"github.com/gin-gonic/gin"
)
func LocalRequired() gin.HandlerFunc {
return func(c *gin.Context) {
if c.GetHeader("x-forwarded-for") != "" || c.GetHeader("x-client-ip") != "" {
c.AbortWithStatus(403)
return
}
ip := c.ClientIP()
if ip == "127.0.0.1" {
c.Next()
} else {
c.AbortWithStatus(401)
}
}
}
Gin is a web framework written in Go (Golang). It features a martini-like API with performance that is up to 40 times faster thanks to httprouter. If you need performance and good productivity, you will love Gin.
-------------------------------------------------------------------------------
Gin 是一个用 Go (Golang) 编写的 Web 框架。它具有类似martini-like的 API,由于 httprouter,性能提高了 40 倍。如果您需要性能和良好的生产力,您会喜欢 Gin。
func LocalRequired() gin.HandlerFunc {
return func(c *gin.Context) {
if c.GetHeader("x-forwarded-for") != "" || c.GetHeader("x-client-ip") != "" {
c.AbortWithStatus(403)
return
}
ip := c.ClientIP()
if ip == "127.0.0.1" {
c.Next()
} else {
c.AbortWithStatus(401)
}
}
}
if c.GetHeader("x-forwarded-for") != "" || c.GetHeader("x-client-ip") != "" {
c.AbortWithStatus(403)
return
}
1、首先构造ip伪造;
2、在age变量中存在ssti信息泄露出flag;
看雪ID:H3h3QAQ
https://bbs.pediy.com/user-home-921448.htm
# 往期推荐
球分享
球点赞
球在看
点击“阅读原文”,了解更多!
[广告]赞助链接:
关注数据与安全,洞悉企业级服务市场:https://www.ijiandao.com/
让资讯触达的更精准有趣:https://www.0xu.cn/
关注KnowSafe微信公众号
随时掌握互联网精彩
随时掌握互联网精彩
- 英美启用《数据访问协议》,将可便捷调用彼此互联网用户数据
- 历史上的今天:PHP公开发布;iPhone 4 问世;万维网之父诞生
- 看雪招聘 | 令人心动的offer,让你薪满益足!
- 研究人员在Google Play商店发现新的银行木马
- 新手福利老手也有!!你确定不领一波
- Windows 11预览版安装避坑指南
- Qt 串口通信接收数据不完整,怎么解决?
- 和旧版Edge浏览器说再见!微软将不再提供技术支持
- 钥匙失灵,汽车司机被困车外,究竟为何?
- 小米 11 发布,售价 3999 元起;罗永浩回应败诉半导体公司;deepin 20.1(1010) 发布|极客头条
- 腾讯云数据库三大产品线统一升级为TDSQL,这是要集中力量干大事!
- 怎么申请SSL SSL申请步骤是什么?
赞助链接