what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

sexy-socket.c

sexy-socket.c
Posted Oct 30, 2003
Authored by DownBload | Site ii-labs.org

Sexy-SOCKET v0.1 is a Linux LKM which restricts creation of AF_INET sockets to the root account only. Works on kernels v2.2.x and 2.4.x.

tags | kernel, root
systems | linux
SHA-256 | a3c145dd51bd805728f98d8a91e71034354796aadf906e473ed5780486e2c771

sexy-socket.c

Change Mirror Download
/*
Sexy-SOCKET v0.1
~~~~~~~~~~~~~~~~
This LKM will provide AF_INET sockets only to root account.
It is created for w4rcr0 wargame (http://www.ii-labs.org/wargame/).
Sexy-SOCKET will work on 2.2.x and 2.4.x kernels.
Coded by DownBload <downbload@hotmail.com> \
Illegal Instruction Labs <www.ii-labs.org>
*/

#define MODULE
#define __KERNEL__
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/unistd.h>
#include <asm/uaccess.h>

extern void *sys_call_table[];

int (*origsock)(int call, unsigned long *args);

// STOLEN KERNEL SOURCE
#define AL(x) ((x) * sizeof(unsigned long))
static unsigned char nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
AL(3),AL(3),AL(4),AL(4),AL(4),AL(6),
AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)};
// END OF KERNEL SOURCE

int *hacksock(int call, unsigned long *args)
{
// STOLEN KERNEL SOURCE
unsigned long a[6];
unsigned long a0,a1;
int err;

if(call<1||call>SYS_RECVMSG)
return -EINVAL;

/* copy_from_user should be SMP safe. */
if (copy_from_user(a, args, nargs[call]))
return -EFAULT;
a0=a[0];
a1=a[1];
// END OF KERNEL SOURCE
if ((current->uid != 0) && (call == SYS_SOCKET) && (a0 == AF_INET))
return -1;
else
return origsock (call,args);
}


int init_module (void)
{
origsock = sys_call_table[__NR_socketcall];
sys_call_table[__NR_socketcall] = hacksock;
return 0;
}


void cleanup_module(void)
{
sys_call_table[__NR_socketcall] = origsock;
}

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close