<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Linux - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/linux/</link><description>Linux - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Sun, 12 Jan 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/linux/" rel="self" type="application/rss+xml"/><item><title>Linux cron 定时任务</title><link>https://rd163.visword.com/posts/crontab/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/crontab/</guid><description><![CDATA[<p><code>cron</code> 是类 Unix 系统中基于时间的任务调度器，守护进程 <code>crond</code>(在 Debian/Ubuntu 上叫 <code>cron</code>)每分钟扫描一次 crontab 表，匹配到当前时间就触发对应命令。它的用途非常广泛：定期备份、日志轮转、证书续期、数据同步、健康检查……几乎所有&quot;每隔一段时间就要跑一遍&quot;的需求都可以交给它。这篇文章梳理 crontab 的表达式语法、常用命令、系统级目录约定，以及生产环境里最容易踩到的坑。</p>]]></description></item><item><title>Linux LD_PRELOAD 技术介绍</title><link>https://rd163.visword.com/posts/linux-ld-preload/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-ld-preload/</guid><description><![CDATA[<h2 id="ld_preload-介绍" class="headerLink">
    <a href="#ld_preload-%e4%bb%8b%e7%bb%8d" class="header-mark"></a>LD_PRELOAD 介绍</h2><p>LD_PRELOAD 是 Linux/Unix 系统的一个环境变量，它能够影响程序运行时的链接行为，允许在程序启动前指定优先加载的动态链接库。借助这个环境变量，可以在主程序与其依赖的动态链接库之间插入额外的动态库，甚至覆盖系统标准函数库中的实现。</p>]]></description></item><item><title>Linux 反弹 Shell</title><link>https://rd163.visword.com/posts/linux-reverse-shell/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-reverse-shell/</guid><description><![CDATA[<h2 id="前言" class="headerLink">
    <a href="#%e5%89%8d%e8%a8%80" class="header-mark"></a>前言</h2><p>在渗透测试（Penetration Testing）和攻防演练中，Linux 主机上获取一个可交互的命令行是最常见的诉求之一。当目标机由于防火墙、NAT、动态 IP 等原因无法被直接访问时，常规的「正向连接」就会失效，此时需要用到<strong>反弹 Shell（Reverse Shell，又称反向 Shell）</strong>。</p>]]></description></item><item><title>Linux 网络命名空间</title><link>https://rd163.visword.com/posts/linux-net-namespace/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-net-namespace/</guid><description><![CDATA[<p>网络命名空间（network namespace，常缩写为 netns）是 Linux 内核提供的一种资源隔离机制。它让不同进程看到完全独立的网络栈：网卡接口、路由表、防火墙规则、ARP 表、端口号乃至 <code>/proc/net</code> 与 <code>/sys/class/net</code> 的视图，彼此互不干扰。</p>]]></description></item><item><title>Linux 中的虚拟网络接口</title><link>https://rd163.visword.com/posts/linux-virtual-network-interfaces/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-virtual-network-interfaces/</guid><description><![CDATA[<h2 id="tuntap" class="headerLink">
    <a href="#tuntap" class="header-mark"></a>tun/tap</h2><ul>
<li>对应字符设备 <code>/dev/net/tun</code>。</li>
<li>是操作系统内核中的虚拟网络设备，由用户层程序提供数据的接收与传输。</li>
<li>普通的物理网络接口如 <code>eth0</code>，它的两端分别是内核协议栈和外面的物理网络。而对于 TUN/TAP 虚拟接口如 <code>tun0</code>，它的一端一定连接着用户层程序，另一端则视配置方式的不同而变化，可以直连内核协议栈，也可以是某个 bridge。</li>
<li>TUN 和 TAP 的区别在于工作的网络层次不同：用户程序通过 TUN 设备只能读写网络层的 IP 数据包，而 TAP 设备则支持读写链路层的数据包（通常是以太网数据包，带有 Ethernet header）。</li>
<li>TUN 与 TAP 的关系，就类似于 socket 与 raw socket。</li>
<li>TUN/TAP 应用最多的场景是 VPN 代理，比如 clash、tun2socks。</li>
</ul>
<h2 id="ipip" class="headerLink">
    <a href="#ipip" class="header-mark"></a>ipip</h2><p>即 IPv4 in IPv4，在 IPv4 报文的基础上再封装一个 IPv4 报文。</p>]]></description></item><item><title>Linux 中通过函数名字符串在 C/C++ 里获取并调用函数地址</title><link>https://rd163.visword.com/posts/linux-get-func-addr-by-name/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-get-func-addr-by-name/</guid><description>&lt;p>在写服务端代码时，有时会遇到这样一个需求：手里只有一段字符串形式的函数名（比如从配置文件、RPC 路由表或测试 harness 里读出来）,却要据此拿到函数的内存地址并调用它。这在 C/C++ 这种编译期绑定（static binding）的语言里并不天然——编译器在编译期就把函数调用绑成了固定地址，符号信息默认只在链接阶段使用，运行期通常不可见。&lt;/p></description></item><item><title>ptrace 学习笔记</title><link>https://rd163.visword.com/posts/linux-ptrace-intro/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/linux-ptrace-intro/</guid><description><![CDATA[<p><code>ptrace(2)</code> 是 Linux(以及多数现代 Unix)提供的一个系统调用,允许一个进程(<strong>tracer</strong>,跟踪者)观察、控制另一个进程(<strong>tracee</strong>,被跟踪者)的执行,并读写其内存与寄存器。它是 <code>strace</code>、<code>gdb</code> 等工具的底层基石(perf trace 走的是 perf_event_open tracepoint 路径,刻意避开 ptrace 的高开销),也是反调试、沙箱、热补丁等技术的实现入口。本文整理其工作模型、常用 request 与典型示例。</p>]]></description></item><item><title>Tmux</title><link>https://rd163.visword.com/posts/tmux/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/tmux/</guid><description><![CDATA[<p>Tmux 是一个终端复用器（terminal multiplexer），采用 ISC 许可证发布，作者 Nicholas Marriott，源码托管在 <a href="https://github.com/tmux/tmux" target="_blank" rel="noopener noreferrer">tmux/tmux</a>。它最核心的能力是把&quot;会话&quot;与&quot;终端窗口&quot;彻底解绑：进程在服务器后台持续运行，关闭终端、SSH 掉线都不会让任务中断。本文整理 Tmux 的层级模型、常用命令与配置要点，便于日常查阅。</p>]]></description></item><item><title>tproxy（透明代理）</title><link>https://rd163.visword.com/posts/tproxy/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/tproxy/</guid><description><![CDATA[<h2 id="什么是透明代理" class="headerLink">
    <a href="#%e4%bb%80%e4%b9%88%e6%98%af%e9%80%8f%e6%98%8e%e4%bb%a3%e7%90%86" class="header-mark"></a>什么是透明代理</h2><p><a href="https://www.kernel.org/doc/html/latest/networking/tproxy.html" target="_blank" rel="noopener noreferrer">tproxy</a> 即 transparent（透明）proxy。这里的 transparent 有两层含义：</p>
<ul>
<li><strong>对 client（客户端）透明</strong>：客户端无需任何额外配置，既不必修改请求地址，也不必采用代理协议与代理服务器协商。相比之下，socks 或 http 代理都需要在客户端显式设置代理地址，并在发起请求时通过代理协议告知代理服务器真实的目标地址。</li>
<li><strong>对 server（服务端）透明</strong>：服务端看到的是 client 端的地址，而非 proxy 的地址，仿佛请求从未经过中转。</li>
</ul>
<p>换句话说，在一条透明的链路里，两端都不知道代理的存在。这与传统代理协议（如 HTTP CONNECT、SOCKS5）形成鲜明对比，后者要求应用感知代理并主动与之交互。</p>]]></description></item><item><title>server-management</title><link>https://rd163.visword.com/posts/server-management/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/server-management/</guid><description>&lt;p>服务器运维管理(Server Management)是指对 Linux/Windows 服务器从上线到下线全生命周期的配置、监控、部署、安全与维护工作。对个人开发者和中小团队而言,如何在「效率」与「可控性」之间取得平衡,是选型时最核心的问题。本文按运维工作的几个维度梳理常见思路,并对比三类管理方式:原生命令行、配置管理工具、Web 管理面板。&lt;/p></description></item></channel></rss>