|
adduserfromdb.pl
#!/usr/bin/perl
use DBI;
$dbuser = "xxxx";
$dbpasswd = "xxx";
$db = "xxxx";
$dbh = DBI->connect("DBI:mysql:$db",$dbuser,$dbpasswd);
$query = "select user,passwd from usertable where addornot=0";
$sth = $dbh->prepare($query);
$rv = $sth->execute or die "Can't execute the query:$sth->errstr\n";
while(@row = $sth->fetchrow_array) {
#print "user=".$row[0]."\n";
#print "password=".$row[1]."\n";
@saltchars = (a .. z, A .. Z, 0 .. 9);
srand(time||$$);
$salt = $saltchars[rand($#saltchars)] . $saltchars[rand($#saltchars)];
#print "$salt\t$row[1]\n";
$encrypt_passwd = crypt($row[1],$salt);
#print $encrypt_passwd."\n";
$add_exec = "/usr/sbin/useradd -p ".$encrypt_passwd." ".$row[0];
#对useradd增加参数,可以控制用户的组别、目录、登陆与否、shell等等
#print $add_exec."\n";
system($add_exec);
}
#1;
用户信息表
usertable:
CREATE TABLE usertoadd (
user tinytext NOT NULL,
passwd tinytext NOT NULL,
addornot tinyint(4) DEFAULT '0' NOT NULL
);
| 入侵88red系统的详细过程 | 04-07 |
| 对趋势科技等数万网站被攻击的分 | 03-21 |
| 凡人网络购物系统 V8.0 简体中文 | 03-18 |
| linux平台下渗透日本著名XXXXXX. | 03-18 |
| 搜索框所引起的XSS漏洞 | 03-05 |
| 跳转漏洞的利用 | 03-05 |
| 对复旦大学的一次漫长渗透 | 03-03 |
| .net一句话马以及dx论坛拿shell | 03-01 |
| php渗透入侵过程图文详解 | 03-01 |
| DJ网站的入侵详细过程 | 02-26 |
| BBSXP2008存在后台注射漏洞 | 02-19 |
| Discuz! 6 后台拿Shell的方法 | 02-17 |