security - !!! 面试 经常有人问 ^_^ 的问题汇总 security questions interview
访问量: 1100
渗透测试基本流程:
如果XSS得到内网的网址,该怎么办?
XSS的几种方式 https://blog.csdn.net/qq_43679507/article/details/84105722
1. 基于反射, 例如 baidu.com?name=<script>alert(1)</script>
这样的话,把上面链接发给别人,别人点击了之后, 会把 <script>内容显示在input 中。如果该网站的input没有对<script>进行转义,则会在受害者的电脑上显示 alert.
2. 基于存储
例如,攻击者在某个提交表单的地方,提交了一段script. 管理员在后台查看的时候,就会运行该script
解决方案:保存到数据库之前,对用户提交的表单进行转义
3. 基于DOM
a.com#javascript:alert(1)
a.com#vbscirpt:
a.com#data:
上面3个都是伪协议。 ( javascript: , vbscript: , data: )
还有 <img src=2 onerror="javascript... onload="javascript....
记得css中也可以有这样的东东
谈一下钩子框架 hook
1. frida: 超级强大的钩子框架,可以针对android, ios, windows, 等系统做钩子。
frida-client 安装在PC端,可以直接执行脚本: python脚本中,包含js代码,作用于android
frida-server安装在安卓端
2. edxposed
都是在root设备上。
用什么工具做代码审计
内网渗透
CVE的漏洞原理,随便挑一个

谈一下WAF
如果对方机器隐藏在CDN之后,拿到普通权限后,如何反射到外网?
如何提权
windows下:很多方式
https://zhuanlan.zhihu.com/p/555380991
CVE-2020-0796 https://www.cnblogs.com/-chenxs/p/12618678.html
CVE-2018-8120 https://www.cnblogs.com/-mo-/p/11404598.html
CVE-2017-0213 https://www.cnblogs.com/-mo-/p/11446144.html
MS16-075(RottenPotato) https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS16-075
linux下:很多方式。
应急响应
1. 准备,方案等。
2. 检测,判断事故情况
3. 止损。做相关修复(打补丁)
4. 根除隐患。
5. 恢复业务到正常。
6. 复盘总结
具体的应急响应分类:
shell 被上传,
数据泄露
勒索病毒
挖矿
DDOS
DNS劫持
网页被篡改
安卓反编译
这个就不说了,
apktool -> dex
frida -> dex
dex -> jar
jar -> class
class -> java
修改smali.
重新编译 apksigner
接口签名
弄过海外网站没有
SQLI的盲注?
常见的注入方式:
参数类型分类:数字型、字符型
注入手法分类: 联合查询注入、报错注入、基于布尔的盲注、基于时间的盲注、HTTP头注入、宽字节注入、堆叠查询、二阶注入
代码审查 Security Audit
https://www.comparitech.com/net-admin/network-security-auditing-tools/
基本都是使用软件
Nessus 全球排名第一的
PhpCodeChecker: 专门检查php
Here is our list of the eleven best network security auditing tools:
SolarWinds Access Rights Manager – FREE TRIAL An access control system that helps protect the user accounts and device access. This tool also includes extensive network and system auditing tools. It runs on Windows Server.
Syxsense Manage – FREE TRIAL A cloud-based system management service that is able to document and monitor networked endpoints across sites.
ManageEngine ADAudit Plus – FREE TRIAL Analyze user access accounts, log user activity, and audit the system for data security standards. It runs on Windows Server.
Papertrail – FREE TRIAL A cloud-based log manager and audit archiving service that includes data searching and analysis features.
ManageEngine Log360 – FREE TRIAL This SIEM includes log management for an audit trail and also provides compliance reporting. Runs on Windows Server.
LogicGate A cloud-based IT governance, risk assessment, and security standards auditing tool.
Splunk Enterprise Security A network security system that includes incident response auditing and standards compliance auditing.
Acunetix A suite of software testing tools that focus on the vulnerabilities in Web applications. It is available for Windows, macOS, and Linux.
Nessus A vulnerability assessment tool in free and paid versions that includes auditing reports. It is available for Windows, macOS, and Linux.
常用软件:
信息搜集 theHarvester, shuize
查看子域名,favicon hash : fofa.info
meta sploit framework 工具集
burp suite 抓包
kali linux
sqlmap, sqlninjia
nmap
sonar-qube, sonar-scanner: 扫描 漏洞,扫描源代码
nessus: 扫描
acunatix ( awvs ) : 扫描。
fofa: 资产搜集的网站
shodan: 同fofa
exploit-db.com: 查找漏洞的网站
暴力破解: hydra, patator
web3 相关
contract 常见漏洞:
1. 重入 reentry
基本原理:攻击者先调用智能合约中的某个函数,如提款函数。若智能合约在执行该函数时,先进行外部调用(如向攻击者合约转账),再更新内部状态(如扣除攻击者余额),就会产生漏洞。此时,攻击者的合约接收到调用或资金后,会通过 fallback 函数立即回调原合约的同一个或另一个存在漏洞的函数。由于原合约状态未更新,攻击者可再次获得调用权限,重复请求资金转移,直至合约资金耗尽或达到 gas 限额。
解决办法:考虑使用 transfer 和 send 方法代替 call 方法,它们默认有较低的 gas 限额
2. 上溢,下溢
3. 意外的ether. 错误的使用了this.balance, 与 selfdestruct()函数
4. 收款黑洞。合约里没有transfer方法,只有收款方法。
5. 整数溢出 / 下溢
智能合约中整数运算未做边界检查时,可能导致数值超出类型范围(溢出)或低于最小值(下溢)。例如,使用 uint256 类型的余额变量,若执行balance -= amount时 amount 大于 balance,会导致余额变为极大值。攻击者可利用此漏洞凭空生成代币或绕过金额限制,常见于代币转账、拍卖等涉及数值计算的场景。防范需使用 SafeMath 库或 Solidity 0.8.0 + 的内置溢出检查。
6. 权限控制缺陷
因访问控制逻辑设计不当,导致未授权用户可调用敏感函数。例如,合约未正确验证msg.sender权限,攻击者可直接调用withdrawAll()转走资金;或使用tx.origin而非msg.sender验证,被中间人攻击劫持权限。典型案例包括管理员私钥泄露后攻击者接管合约,或普通用户越权修改核心参数。需严格使用角色管理(如 OpenZeppelin 的 AccessControl)控制函数访问。
7. delegatecall 恶意代码注入
8. 逻辑漏洞(条件竞争)
多步操作中因状态更新顺序错误,引发条件竞争。例如,众筹合约中,攻击者可在 “检查是否达到众筹目标” 与 “发放代币” 的间隙,通过高频交易抢先完成操作,导致代币超发。又如,闪电贷攻击利用交易原子性,在一个区块内完成借款、操纵价格、还款的闭环,窃取套利空间。需通过原子化操作或时间锁机制避免中间状态被利用。