# Common Binary Exploitation Protections & Bypasses

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF格式的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或 **关注**我们的**Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

## 启用核心文件

**核心文件**是操作系统在进程崩溃时生成的一种文件类型。这些文件捕获了进程在终止时的内存映像，包括进程的内存、寄存器和程序计数器状态等详细信息。这个快照对于调试和理解崩溃原因非常有价值。

### **启用核心转储生成**

默认情况下，许多系统将核心文件的大小限制为0（即不生成核心文件）以节省磁盘空间。要启用核心文件的生成，您可以使用\*\*`ulimit`\*\*命令（在bash或类似的shell中）或配置系统范围的设置。

* **使用ulimit**：命令`ulimit -c unlimited`允许当前shell会话创建无限大小的核心文件。这对于调试会话很有用，但在重新启动或新会话中不会持久保留。

```bash
ulimit -c unlimited
```

* **持久配置**：为了更持久的解决方案，您可以编辑 `/etc/security/limits.conf` 文件，添加类似 `* soft core unlimited` 的一行，这允许所有用户在不必在其会话中手动设置 ulimit 的情况下生成无限大小的核心文件。

```markdown
* soft core unlimited
```

### **使用GDB分析核心文件**

要分析核心文件，您可以使用调试工具如GDB（GNU调试器）。假设您有一个生成了核心转储文件的可执行文件，并且核心文件的名称为 `core_file`，您可以开始分析：

```bash
gdb /path/to/executable /path/to/core_file
```

这个命令将可执行文件和核心文件加载到GDB中，允许您检查程序在崩溃时的状态。您可以使用GDB命令来探索堆栈、检查变量，并了解崩溃的原因。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hacktricks.xsx.tw/binary-exploitation/common-binary-protections-and-bypasses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
