某日在網(wǎng)上偶然打開(kāi)一個(gè)網(wǎng)站,是有plmm與你視頻聊天的,但是要手機(jī)注冊(cè)收費(fèi)。就想找找有沒(méi)有漏洞可以不花錢(qián)就與mm聊天。首先找找有沒(méi)有sql的空子可鉆,打開(kāi)一個(gè)帶有參數(shù)的頁(yè)面,http://www.xxx.yyy/abc.jsp?agentid=111116,把后面的參數(shù)改一下試試看http://www.xxx.yyy/abc.jsp?agentid=111116'結(jié)果:
500 servlet exception
java.lang.numberformatexception: for input string: "111116'"
at java.lang.numberformatexception.forinputstring(numberformatexception.java:48)
at java.lang.integer.parseint(integer.java:477)
at java.lang.integer.parseint(integer.java:518)
at _agentdetail__jsp._jspservice(d:/timework/timeweb/udate/agentdetail.jsp:12)
at com.caucho.jsp.javapage.service(javapage.java:75)
at com.caucho.jsp.page.subservice(page.java:506)
at com.caucho.server.http.filterchainpage.dofilter(filterchainpage.java:182)
at com.caucho.server.http.invocation.service(invocation.java:315)
at com.caucho.server.http.httprequest.handlerequest(httprequest.java:246)
at com.caucho.server.http.httprequest.handleconnection(httprequest.java:163)
at com.caucho.server.tcpconnection.run(tcpconnection.java:139)
at java.lang.thread.run(thread.java:534)
看來(lái)是把字符串轉(zhuǎn)換成數(shù)字再處理的,這里好像沒(méi)戲,再繼續(xù)找找看,注冊(cè)和登錄都試過(guò)了,沒(méi)用,后來(lái)偶然發(fā)現(xiàn)一個(gè)地方可以上傳照片,可以研究一下,結(jié)果幸運(yùn),傳了一個(gè)jsp文件上去,居然沒(méi)有提示錯(cuò)誤!后來(lái)順利的由圖片的路徑找到了傳上去的jsp文件的路徑,結(jié)果試著訪問(wèn),一切正常
ok,天助我也!隨便寫(xiě)了一個(gè)訪問(wèn)硬盤(pán)上的目錄和文件的jsp文件,傳了上去,于是通過(guò)jsp文件得到了網(wǎng)站的物理路徑,又寫(xiě)了一個(gè)查看文件內(nèi)容的jsp,傳上去,這下硬盤(pán)上的東西都可以看得一清二楚了,要想不用錢(qián)就可以登錄,還得找到數(shù)據(jù)庫(kù)才行,看看里面的jsp代碼,看不出什么明堂,都是用的javabean寫(xiě)的,估計(jì)是把數(shù)據(jù)庫(kù)的操作都封裝了,看來(lái)從jsp文件下手是沒(méi)希望了,看看web-inf下邊有什么,web.xml看了看,沒(méi)什么用,在看看classes里面,有一個(gè)名字叫做campus.properties的文件,打開(kāi)看看,夢(mèng)寐以求的服務(wù)器ip,端口,sa的密碼都在里面
#campus.properties -- thu jul 01 18:23:20 cst 2004
#thu jul 01 18:23:20 cst 2004
dbconnectiondefaultpool.minconnections=1000
mail.domain=localhost
dbconnectiondefaultpool.server=jdbc/:jtds/:sqlserver/://192.168.1.3/:1433/xxx;charset/=gb2312
mail.encoding=gb2312
infor.typemorepath=typemorelist.jsp
infor.titime=yy-m-d
infor.tilistr=<font size/=2>&/#8226;</font>
sxhcrypt1=426ce28d53728257
infor.msgmorelink=
infor.tipattern=t[m-d]
dbsearchindexer.lastindexed=993035225847
documentoption2=false
infor.css=a3
dbconnectiondefaultpool.logpath=d/://work//web//xxx//web-inf//campusdblog.log
infor.typeviewpath=typeview.jsp
dbconnectiondefaultpool.username=sa
infor.msgmorepath=msgmorelist.jsp
path=d/://work//web//udate//web-inf//classes//campus.properties
setup=true
dbconnectiondefaultpool.connectiontimeout=0.002
mail.smtpport=25
mail.tempdir=d/://myproject//xerinfor//defaultroot//files//mailtmp
campushome=d/://work//web//udate
dbconnectiondefaultpool.maxconnections=3000
infor.tiimgstr=
mail.smtphost=localhost
dbconnectiondefaultpool.driver=net.sourceforge.jtds.jdbc.driver
infor.imgpath=msglist.jsp
infor.msgviewpath=msgview.jsp
dbconnectiondefaultpool.password=xxxxxxxxxxx
(以上關(guān)鍵的地方有所改動(dòng))
有了這些,哈哈,一切都解決了吧!馬上寫(xiě)個(gè)jsp查詢(xún)一下數(shù)據(jù)庫(kù)里面都有什么表,有個(gè)_user表,估計(jì)就是用戶(hù)表,取幾條數(shù)據(jù)試試,果然。。。。
接下來(lái)就好辦了,為了不引懷疑還有讓無(wú)辜的人為我出錢(qián),所以還得注冊(cè)一個(gè)帳戶(hù),但不續(xù)費(fèi)
然后把自己的手機(jī)號(hào)碼用update更新成別的不存在的號(hào)碼,再找到點(diǎn)數(shù)那個(gè)字段,更新成1000000點(diǎn)
哈哈,一切都搞定!登錄一下試試,自己變成有錢(qián)人啦!?。∮捎诓幌敫W(wǎng)站造成不必要的麻煩,還是不打算公布這個(gè)網(wǎng)站出來(lái)了,兄弟姐妹們見(jiàn)諒!
由此可見(jiàn),網(wǎng)站的安全性非常重要,尤其是收費(fèi)的網(wǎng)站,如果不注意,輕則讓別人免費(fèi)參觀,重則所有數(shù)據(jù)都o(jì)ver,想象一下如果執(zhí)行一條delete from _user,這個(gè)網(wǎng)站的損失會(huì)有多大?我以前寫(xiě)代碼的時(shí)候都沒(méi)有注意到此類(lèi)的細(xì)節(jié),經(jīng)過(guò)這次,我想以后一定要注意這些問(wèn)題了。
新聞熱點(diǎn)
疑難解答
圖片精選