<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by GHOSPT on Medium]]></title>
        <description><![CDATA[Stories by GHOSPT on Medium]]></description>
        <link>https://medium.com/@wong1234.pe?source=rss-6393aad0dbd1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mvSWkQ8lsaWiwOOx</url>
            <title>Stories by GHOSPT on Medium</title>
            <link>https://medium.com/@wong1234.pe?source=rss-6393aad0dbd1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:07:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wong1234.pe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Finding my first privilege escalation: a NOPASSWD misconfiguration in g-helper-linux]]></title>
            <link>https://medium.com/@wong1234.pe/local-privilege-escalation-via-user-owned-opt-ghelper-directory-with-nopasswd-sudo-rule-067c7fc47d0d?source=rss-6393aad0dbd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/067c7fc47d0d</guid>
            <category><![CDATA[cve]]></category>
            <dc:creator><![CDATA[GHOSPT]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 06:13:38 GMT</pubDate>
            <atom:updated>2026-11-02T18:25:36.911Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีครับ ผม GHOSPT ผมได้ไปเจอช่องโหว่ misconfiguration ของ โปรแกรมนึงที่เป็น open source มาครับ สำหรับใครที่ใช้ Laptop Asus ที่มี <strong>Armoury Crate</strong> อาจเจอปัญหา แล้วต้องหา program optimize อื่นมาใช้ อาจจะพอคุ้นๆ หูกันบ้างอย่าง</p><pre>https://github.com/utajum/g-helper-linux</pre><p>G-Helper 1.0.79 &lt;= version &lt;= v1.0.97(Linux) ซึ่งผมได้เจอช่องโหว่นี้จากการที่ เพื่อนของผมได้ใช้ program นี้ในการ optimize เครื่องแล้วพบว่าสามารถ kill process ไหนก็ได้ ด้วยสิทธิ์ root ซึ่งตัว program ถูกออกแบบมาให้ทำได้อยู่แล้วเพราะมีการ สร้าง config กับไฟล์ <strong>sudoers.d</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*bjCyWwQgbpEUuEg7_gbJ_Q.png" /></figure><p>จากภาพ ก็จะเห็นได้ว่าเรายินยอมให้ใช้ได้ โดยคำสั่งที่ใช้ได้ก็จะมีเพียง สิ่งที่ gpu-helper ทำได้ เช่น kill และการอ่านค่าจาก hardware แต่กลับพบว่า Path ที่เก็บbinary gpu-helper นั้นไม่ปลอดภัย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*8RxS-yQ6KTfl2ee6jVaLsw.png" /></figure><p>เห็นได้ว่า directory นี้อนุญาต ให้ user สามารถ เขียนอะไรลงไปก็ได้ใน folder รวมถึงการที่สามารถเปลี่ยนชื่อไฟล์ใน folder นี้ได้ทำให้เกิดการปลอม binary file ใน path นี้ได้ ผมได้ทดสอบ ว่าความร้ายแรงหาก Laptop ที่ใช้ program นี้โดน RCE(Remote Code Execution) จะสามารถโดน Local Privilege Escalation ได้หรือป่าว (directory สามารถอ่านเขียนจาก user ที่เป็น directory owner เท่านั้น)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*OcWACUVi6JHZUQTet-M1Rw.png" /></figure><p>จาก PoC ( Proof of Concept) ที่ผมทำขึ้นพบว่า</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*uNnHwnTxUpSYSDP0O6hbmA.png" /></figure><p>ซึ่งทำให้เกิดการ Privilege Escalation ได้จริง และ ค่อนข้างอันตราย</p><p>ช่องโหว่นี้เกิดจากการ Script install.sh ใน บรรทัดที่ 525–528 ซึ่งไม่ควรมีอยู่<br>ที่เราทำการ Curl มาแล้ว Run script ดังกล่าว</p><pre>curl -sL https://raw.githubusercontent.com/utajum/g-helper-linux/master/install/install.sh | sudo bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*EUhODGjnf5bHpAHSTlfi5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*Tjj1Zrvk3AdAgbrr1j-uRQ.png" /></figure><p>ซึ่งเห็นได้ว่าพยายามทำการเปลี่ยนให้ directory ghelper ใน /opt เป็นของ user โดยไม่มีความจำเป็นเพราะ การที่ให้ user เป็นเจ้าของ path ที่อยู่ใน NOPASSWD ROOT ทำให้เกิดการปลอมแปลงชื่อ binary หรือ เขียนไฟล์ขึ้นมาทดแทนตัว binary ที่ถูกตั้งใน path ของ NOPASSWD ROOT และ ตัว binary กำหนดสิทธิ์ไว้เป็น 755 ซึ่งอนุญาตให้สามารถ execute โดยทุกคนได้ รวมถึงตัว program เก็บ config file ไว้ใน<br>~/.config/ghelper ไม่มีผลต่อการใช้งานของ user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*7WaMJh1phF9aMGkg1BycnQ.png" /></figure><p>วิธีการแก้ไข</p><p>จะเห็นได้ว่าตอนติดตั้งจะใช้คำสั่ง</p><pre>curl -sL https://raw.githubusercontent.com/utajum/g-helper-linux/master/install/install.sh | sudo bash</pre><p>สำหรับคนที่ยังไม่เคยใช้แล้วกลัวว่าจะมีปัญหาหากต้องใช้ program นี้ ทำได้โดย</p><p>ให้โหลด script ลงมาบนเครื่องแล้ว “ลบ” บรรทัดดังกล่าวออก แล้วรัน script ได้ตามปกติเลย</p><p>สำหรับคนที่ใช้อยู่แล้ว</p><pre>sudo chown root:root /opt/ghelper</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k8c1fvXMUjTGJeRSahisjQ.png" /></figure><p>PoC ( Proof Of Concept )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*XZo-YsccE4CAnK_iKkH6yg.png" /></figure><p>clear.sh ใช้ เพื่อล้าง exploit file ทิ้งหลังจาก exploit.sh ให้กลับสู่ default เหมือนตอน install</p><p>ตอนนี้ผมกำลังรอเลข CVE ครับ ส่วนตัวโปรแกรมได้ทำการ publish patched version เรียบร้อย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9keh_Vyt5rtbOikqj-_GZw.png" /></figure><p>ทั้งหมดนี้ ผมค้นพบจากการฟังเพื่อนที่ใช้ program นี้อยู่แล้วรู้สึกว่าการตั้งค่า<br>permission ที่ผิดปกติ และ ช่องโหว่บางอย่างจนนำมาสู่การทำ PoC ที่กล่าวมา</p><p>ขอบคุณทุกคนที่อ่านมาจนถึงตรงนี้นะครับ การเขียน medium ครั้งนี้ของผมอาจจะไม่ได้สมบูรณ์มาก เพราะเป็นครั้งแรกของผมในการเขียนอะไรแบบนี้</p><p>หากต้องการติดต่อสอบถามเพิ่มเติม สามารถติดต่อได้ที่ IG: why_perty<br>Facebook: Peter Cha<br>LinkedIn: <a href="https://www.linkedin.com/in/chayutphol-wongsaichuea-73a55a308/">https://www.linkedin.com/in/chayutphol-wongsaichuea-73a55a308/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=067c7fc47d0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>