栏目分类
安全资讯 | 硬件产品 | 软件产品 | 安全基础 | 病毒专区 | 黑客技术 | 防火墙 | 安全方案
排行榜
·“黑客”教你如何远程控制计算机
·破解WindowsXP登陆口令
·手把手教你盗号!--啊拉QQ大盗
·迎刃而解——常用密码破解完全手册
·全球杀毒软件大评比55款防毒软件排名
·为您支招局域网内如何防止ARP欺骗
·CCProxy代理软件中隐藏的阴谋
·教你入侵网吧服务器
·Windows系统中常用密码的破解方法
·解析来自Autorun.inf文件的攻击
·我这样破解万象免费上网
·破解网吧还原精灵一些常用的方法
·远程控制新法宝---DMRC软件包
·又一聊天工具中招一分钟快速破解UC密码
·愚公移山文档密码全面暴力破解
·远程控制软件VNC教程和对内网机器控制的实现
·黑客技术入门篇:铿锵三节课
·c#.net如何获取本机ip
·木马传播新方式图片木马技术解析
·卡巴斯基反病毒软件网络版

    您现在的位置: Linux宝库 >> 安全 >> 黑客技术 >> 文章正文
一个su后门程序
Linux宝库 收集整理  作者:Linux宝库  时间:2007-12-31  收藏本站
来自:http://doc.linuxpk.com/79303.html
联系:linuxmine#gmail.com
分类:[黑客技术]
  

  本代码为假冒的su,用于捕获以root身份登陆的非授权用户。两刃剑。 /** From:

  CERT Tools* To:

  cert-tools@cert.org* Subject: Quiet list* Date:

  Wed, 31 Aug 1994 10:37:16 -0400** Its been quiet, here is something to stir things up a little :-)**

  - Shawn* Shawn F. Mckay

  phone: 617-253-2583* Dept. of Electrical Eng. & Computer Science

  email: shawn@eddie.mit.edu* M.I.T. / room 38-388 / Cambridge, MA

  02139 / USA* ** PGP Key available on request ****/


  /** Dummy "su" program. Intended to help an intruder who does not* know the system (many work from "cheat sheets") to trip alarms* so the rightful sysadmin folks can charge to the rescue.** Author: Shawn F. Mckay (shawn@aradia.uucp)* Revision Date: 94-08-29* Version: 1.1* Copyright (c) 1989-1994 Shawn F. Mckay, All Rights Reserved.* May not be sold for profit without written concent of author.* No warranty of ANY KIND is implied, use at your own risk!** Installation Notes:*

  a) Create a directory in a secret place mode 770 (group whlcp)*

  b) Move your real copy of "su" to this new location*

  Make it also group whlcp and mode 4510*

  c) Now, install this here su into the old location of your*

  systems su program. (mode 4511) (usually /bin or /usr/bin).*

  This program needs to be setuid root to be beleived, but as*

  you can see, it does NOT run as root, it runs as daemon as*

  soon as its run.*

  d) Finally, make sure to add yourself to whlcp group as needed.*

  e) Act quickly if you detect a violation of any kind**

  Also note, you will probably need to modify /etc/crontab to*

  advise any system shell Scripts where the "real" su went. You*

  should probably try and ensure these places are also non-world*

  readable.** The above should work for almost ANY UNIX system. As always, use* your judgement.*/


  

  #include#include

  char uname[10], tname[20];extern char *getlogin(), *ttyname();

  main (argc, argv)char **argv;{char *key, *t;

  /*

  * If an intruder is to buy this, we must LOOK like a

  * real copy of "/bin/su"

  */


  if (geteuid ()) {

  fprintf (stderr, "su: not properly installed

  ");

  exit (1);} else {

  /*

  * Become daemon, "Right away!"

  */


  setgid (1);

  setuid (1);}


  /*

  * Discover our uname / location

  */


  if ((t = getlogin ()) == NULL)

  strcpy (uname, "unknown");else

  strcpy (uname, t);


  if ((t = ttyname(2)) == NULL)

  strcpy (tname, "unknown");else

  strcpy (tname, t);


  /*

  * Open log, and gripe!

  */


  #ifdef LOG_AUTHopenlog ("su", LOG_PID, LOG_AUTH);#elseopenlog ("su", LOG_PID);#endifsyslog (LOG_NOTICE, "SU attempt failed by %s on %s

  ",uname, tname);

  syslog (LOG_NOTICE, "User tried to become %s using su

  ",(argc > 1 ? argv[1] : "root"));


  /*

  * Query for a password, to look real

  */


  key = (char *)getpass ("Password: ");

  /*

  * Also, send email here, to add to the "feel" of delay...

  */


  sendmail (argc, argv);(void)crypt (key, "XX");/* Look and feel tactic */

  /*

  * Of course, we knew this was coming!

  */


  printf ("Sorry

  ");


  exit (1);}

  /** sendmail()* Blast off an email message about this attempt. Quick and sweet*/

  

  sendmail (argc, argv)char **argv;{FILE *pbuf;long Clock;

  if (access ("/usr/bin/mail", 0))

  return (0);


  if ((pbuf = popen ("/usr/bin/mail root", "w")) == NULL)

  return (0);


  time (&Clock);

  fprintf (pbuf, "

  SECURITY VIOLATION NOTICE:

  ");fprintf (pbuf, "Attempt failed to run su by %s from %s %s",uname, tname, ctime (&Clock));


  fprintf (pbuf, "User tried to become %s using su

  ",(argc > 1 ? argv[1] : "root"));


  fprintf (pbuf, "

  .

  ");pclose (pbuf);


  return (1);}
本文来自:http://doc.linuxpk.com/79303.html
 
     最新更新
·新人零起步接触黑客之网站入侵知识
·辨别入侵检测系统性能的方法
·黑客入侵万象服务器的方法
·隐匿行踪“隐形”账号让肉鸡长寿
·穷追猛打:破译Foxmail“密码天书”
·入侵宝典用SlimFTP将肉鸡改为私人服务器
·如何突破TCP-IP过滤防火墙进入内网
·黑客必学――开启肉鸡终端全攻略
·网吧必杀技巧:如何进入网吧主机
·黑友必备利用FTP服务器的漏洞找肉鸡
·黑客知识巧妙配合asp木马取得管理权限
·利用“http暗藏通道”大举攻破局域网
·基础知识初级黑客安全技术命令详解
·防不胜防黑客入侵手法计中计
·从后台得到webshell十大技巧大汇总
·新人零起步接触黑客之利用暴库漏洞
·新人零起步接触黑客之注入漏洞的利用
·新人零起步接触黑客之经典上传漏洞
·谁更安全?黑客眼中的防火墙与路由器
·安全必知:黑客入侵无线网络常用手段
·黑客攻击揭密分析选定的网络攻击(图)
·安全必知 黑客网络攻击的一般过程
·菜鸟必看:学习黑客技术的基本环境
·黑客新技术灰鸽子巧妙利用全攻略
·安全攻略:突破组策略运行限制的方法
·基础知识:黑客如何查找网络安全漏洞
·黑客如何利用Ms05002溢出找“肉鸡”
·当姜太公成为黑客时网络钓鱼技术实现
·黑客攻击行为的特征分析及反攻击技术
·权限保卫战――可怕的Rootkit木马后门