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/

随时掌握互联网精彩
- 在看 | 服务器一夜挤爆!复旦发布中国版ChatGPT出师不利
- 微服务就是一个大泥潭!
- 一个不会画画的人,用 AI 生成的画作拿下了大赛第一,还不违规......
- LLVM与代码混淆技术,详解3种经典代码混淆方式+2种变体
- 黑鲨5 Pro体验报告:战力十足,痛快为赢
- 硬件工程师年薪26万美元、软件工程师30万,在谷歌打工“香”吗?
- 抢先看!华为全联接2021 | 深耕数字化 引领数字基础设施创新
- 马化腾首次回应反垄断;乔布斯 1973 年求职申请表被拍出22.24万美元;英特尔新CEO表示很乐意为苹果代工 | 极客头条
- 在吗?你有一条来自5G时代的未读消息
- Dropbox 的崛起之路,创始人曾拒绝乔布斯天价收购
- vivo X60 Pro+:专业影像,强劲性能
- INSEC WORLD | CSO与创新,圆桌大咖秀
赞助链接