Notes Site.
post @ 2024-10-10

File Inclusion

下表显示了哪些函数可以执行文件以及哪些函数只能读取文件内容:

功能 阅读内容 执行 远程 URL
PHP
include()/include_once()
require()/require_once()
file_get_contents()
fopen()/file()
NodeJS
fs.readFile()
fs.sendFile()
res.render()
Java
include
import
.NET
@Html.Partial()
@Html.RemotePartial()
Response.WriteFile()
include

常见可读文件C:\Windows\boot.ini/etc/passwd,结合FUZZ技术测试。

Baisc bypass

双写

针对 LFI 的最基本过滤器之一是搜索和替换过滤器,它只是删除 ( ../) 的子字符串以避免路径遍历(非递归)。

1
$point = str_replace('../', '', $_GET['point']);
1
....//

编码

Read More
post @ 2024-10-07

SMB

TCP 445 用于直接通过 TCP/IP 传输的 SMB(常见于 SMBv2 和 SMBv3)

TCP/UDP 137-139 用于基于 NetBIOS 的 SMB(通常为 SMBv1)

Interact

运行 | 文件夹

1
\\192.168.220.129\share\

cmd | powershell

1
2
C:\> dir \\192.168.220.129\share\
PS C:\> Get-ChildItem \\192.168.220.129\share\

Mount SMB - CMD

1
2
3
4
5
6
7
8
9
10
# 连接到文件共享并将其内容映射到驱动器号 n
C:\> net use n: \\192.168.220.129\share [/user:uname passwd]

# 统计文件数量
C:\htb> dir n: /a-d /s /b | find /c ":\"

# 查找特定文件
C:\> dir n:\*cred* /s /b
# or
C:\> findstr /s /i cred n:\*.*
Read More
⬆︎TOP