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

spoofW.c

spoofW.c
Posted Dec 27, 2000

SpoofW.c "spoofs" messages from any user on the system (can only be used as root, or as normal user on very old systems). Re-written by Root-Dude

tags | root, spoof
systems | unix
SHA-256 | 4a5e56e60655e168369f38dd84cc5052a91abd3ee503bc5cc47330ac24ff1cba

spoofW.c

Change Mirror Download
/*
* spoofW.c (spoofWrite)
*
* written by R00T-dude
*
* "spoofs" messages from any user on the system
* (can only be used as root, or as normal user
* on OLD SYSTEMS !!!)
*
* this was originaly written by a guy claiming
* to be Sir Hackalot, but it suckt, so I totaly
* rewrote it !!
*
* greetz to : |ncubus, f0bic, F_F, nostalgic,
* vorlon, cicero, zym0t1c, segfau|t, demongirl,
* so many other i forgot !
*
*/

#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <sys/utsname.h>
#include <unistd.h>

main(int argc, char **argument)
{
char olm[1024];
char user[25];
char tty[25];
char temp[100];
char tmp[128];
char time[128];
int handle, acnt = 2, i, b, c;
FILE *strm;
FILE *stream;
struct utsname name;
if (argc == 1) {
printf("send one line of txt to a user ... \n");
printf("\nSyntax: %s <tty of the user> [message] (message is an option, you can give it in later if you want!)\n", argument[0]);
printf("Example: %s tty01 You suck\n", argument[0]);
exit(1);
}
printf("OL (OneLiner) Version 2.0\n");
printf("originaly By Sir Hackalot, rewritten By R00T-dude \n");
bzero(temp, sizeof(temp));
strcat(temp, "/dev/");
strcat(temp, argument[1]);
if (argc == 2)
{
printf("\nYou forgot to Supply a ONE LINE MESSAGE\n");
printf("Enter one Here (keep the text less that 1024 chars please) :: ");
fgets(olm, sizeof(olm), stdin);

printf("enter the login name you want to use for the message (less that 25chars) :: ");
fgets(user, sizeof(user), stdin);
for(b=0; b <= sizeof(user); b++)
{
if(user[b] == '\n') /* taking off the nextline character !!! */
{
bzero(&user[b], 1) ;
}
}

printf("what tty do you want %s to appear on :: ", user);
fgets(tty, sizeof(tty), stdin);
for(c=0; c <= sizeof(tty); c++)
{
if(tty[c] == '\n') /* taking off the nextline character !!! */
{
bzero(&tty[c], 1) ;
}
}
printf("Sending to: [%s]\n",temp);

}

strm = fopen(temp,"a+");
if (strm == NULL) {
printf("Error writing to: %s\n",temp);
exit(2);
}
uname(&name);

if (argc == 2) {
fprintf(strm,"\nMessage from %s@%s on %s",user, name.nodename, tty);
fprintf(strm, " at ");
sprintf(tmp, "date +\%k:\%M");
stream = popen(tmp, "r"); /* ok, so this is slow, but I dunno the function to ask the time in c :( */
while(fgets(time, sizeof(time), stream) != NULL)
{
fprintf(strm, "%s", time);
}
pclose(stream);
fprintf(strm,"%s",olm);
fprintf(strm,"EOF");
fclose(strm);
printf("Message Sent.\n");
exit(0);
}

if (argc > 2) {
printf("enter the login name you want to use for the message (less that 25chars) :: ");
fgets(user, sizeof(user), stdin);
for(b=0; b <= sizeof(user); b++)
{
if(user[b] == '\n') /* taking off the nextline character !!! */
{
bzero(&user[b], 1) ;
}
}
printf("what tty do you want %s to appear on :: ", user);
fgets(tty, sizeof(tty), stdin);
for(c=0; c <= sizeof(tty); c++)
{
if(tty[c] == '\n') /* taking off the nextline character !!! */
{
bzero(&tty[c], 1) ;
}
}
printf("Sending to: [%s]\n",temp);
fprintf(strm,"\nMessage from %s@%s on %s",user, name.nodename, tty);
fprintf(strm, " at ");
sprintf(tmp, "date +\%k:\%M");
stream = popen(tmp, "r"); /* ok, so this is slow, but I dunno the function to ask the time in c :( */
while(fgets(time, sizeof(time), stream) != NULL)
{
fprintf(strm, "%s", time);
}
pclose(stream);
while (acnt <= argc - 1) {
fprintf(strm,"%s ",argument[acnt]);
acnt++;
}
fprintf(strm, "\nEOF");
fclose(strm);
printf("Message sent!\n");
exit(0);
}
}
Login or Register to add favorites

File Archive:

July 2024

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