<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>7yrv0id Blogs.</title><link>https://blog.7yrv0id.com/</link><description>Recent content on 7yrv0id Blogs.</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 14 Mar 2026 04:36:01 +0000</lastBuildDate><atom:link href="https://blog.7yrv0id.com/index.xml" rel="self" type="application/rss+xml"/><item><title>WriteUP-CVE-2018-1160</title><link>https://blog.7yrv0id.com/posts/cve-2018-1160/</link><pubDate>Sat, 14 Mar 2026 04:36:01 +0000</pubDate><guid>https://blog.7yrv0id.com/posts/cve-2018-1160/</guid><description>&lt;h1 id="cve-2018-1160"&gt;CVE-2018-1160&lt;/h1&gt;
&lt;p&gt;题材以及内容来源于pwnable，还算有意思的
然后本次我的测试及复现要特别感谢wetw0rk的思路参考。&lt;/p&gt;
&lt;p&gt;由于文章复盘在我实际操作结束后一个月左右，所以我不会讲的太细，其中包括众多技术细节相关截图以及相关图表也没有得到保存&lt;/p&gt;
&lt;p&gt;所以在这里我就口述主要思路以及我觉得可能需要做归档的部分了，需要详细了解漏洞细节的可以移步别的文章。&lt;/p&gt;
&lt;p&gt;首先，目标是是netatalk的&lt;code&gt;67256322aa5a1fff01de471d6787d1d862678746&lt;/code&gt;commit，已确定在这次commit之后已经得到修复，具体涉及版本号没去看，感兴趣的自己去了解，本文只做针对此次commit为基础的复现。&lt;/p&gt;
&lt;h3 id="漏洞产生原因简述"&gt;漏洞产生原因简述：&lt;/h3&gt;
&lt;p&gt;git原文&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;CVE-2018-1160: libatalk/dsi: add correct bound checking to dsi_opensession
The memcpy
memcpy(&amp;amp;dsi-&amp;gt;attn_quantum, dsi-&amp;gt;commands + i + 1, dsi-&amp;gt;commands[i]);
trusted dsi-&amp;gt;commands[i] to specify a size that fits into dsi-&amp;gt;attn_quantum. The
sizeof attn_quantum is four bytes. A malicious client can send a dsi-&amp;gt;command[i]
larger than 4 bytes to begin overwriting variables in the DSI struct.
dsi-&amp;gt;command[i] is a single char in a char array which limits the amount of data
the attacker can overwrite in the DSI struct to 0xff. So for this to be useful
in an attack there needs to be something within the 0xff bytes that follow
attn_quantum. From dsi.h:
uint32_t attn_quantum, datasize, server_quantum;
uint16_t serverID, clientID;
uint8_t *commands; /* DSI recieve buffer */
uint8_t data[DSI_DATASIZ]; /* DSI reply buffer */
The commands pointer is a heap allocated pointer that is reused for every packet
received and sent. Using the memcpy, an attacker can overwrite this to point to
an address of their choice and then all subsequent AFP packets will be written
to that location.
If the attacker chose the preauth_switch buffer, overwriting the function
pointer there with functions pointers of his choice, he can invoke this
functions over the network,
Signed-off-by: Ralph Boehme &amp;lt;slow@samba.org&amp;gt;
(cherry picked from commit b6895be)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;所以，这里的触发点在于memcpy，由于DSI协议中用户对dsi结构体的内容控制边界没有得到妥善处理导致这里的memcpy的size args可以被控制&lt;/p&gt;</description></item></channel></rss>