We modified the FreeBSD C library so that the heap al- locator functions (malloc(), calloc(), realloc()) allo- cate heap objects in ghost memory instead of in traditional memory; the changes generate a 216 line patch. To ease port- ing, we wrote a 667-line system call wrapper library that copies data between ghost memory and traditional mem- ory as necessary. This wrapper library also provides wrap- pers for signal() and sigaction() that register the signal handler functions with Virtual Ghost before calling the ker- nel’s signal() and sigaction() system calls. The com- piler and linker did not always resolve system calls to our wrapper functions properly, so we made some manual mod- ifications to the programs. We also modified the programs to use traditional memory (allocated via mmap()) to store the results of data to be sent to stdout and stderr to reduce copying overhead. In total, our changes to OpenSSH can be applied with a patch that adds 812 and deletes 68 lines of code (OpenSSH contains 9,230 source lines of code).
We tested our applications on the system used for our ex- periments (see Section 8). We used ssh-keygen to generate a new private and public key for DSA authentication; the generated private key was encrypted while the public key was not encrypted. We then installed the public key on an- other system and used ssh to log into that system using DSA authentication.
For ssh-agent, we added code to place a secret string within a heap-allocated memory buffer. The rootkit attacks described in Section 7 attempt to read this secret string. The goal of adding this secret string is that ssh-agent treats it identically to an encryption key (it can use the string internally but never outputs it to another program). We used a secret string as it is easier to find in memory and easier to identify as the data for which our attack searches.
Our enhanced OpenSSH application suite demonstrates that Virtual Ghost can provide security-critical applications with in-memory secrets (e.g., the keys held by ssh-agent) and secure, long-term storage (e.g., the authentication keys created by ssh-keygen and read by ssh). It also demon- strates that a suite of cooperating applications can securely share data on a hostile operating system via a shared appli- cation key.
7. Security Experiments
To evaluate the security of our system, we built a malicious kernel module that attempts to steal sensitive information from a victim process. This module, based on the code from Joseph Kong’s book [18], can be configured by a non- privileged user to mount one of two possible attacks – direct memory access or code injection – on a given victim process. The malicious module replaces the function that handles the read() system call and executes the attack as the victim process reads data from a file descriptor.
In the first attack, the malicious module attempts to di- rectly read the data from the victim memory and print it to the system log.
In the second attack, the malicious module attempts to make the victim process write the confidential data out to a file. The attack first opens the file to which the data should be written, allocates memory in the process’s address space via mmap(), and copies exploit code into the memory buffer. The attack then sets up a signal handler for the victim pro- cess that calls the exploit code. The malicious module then sends a signal to the victim process, triggering the exploit code to run in the signal handler. The exploit code copies the data into the mmap’ed memory and executes a write() sys- tem call to write the secret data out to the file opened by the malicious module.
We used both attacks on our ssh-agent program, described in Section 6. When we install the malicious module with- out instrumenting its code and run ssh-agent with malloc() configured to allocate memory objects in traditional mem- ory, both attacks succeed.
We then recompiled our malicious module using our modified Clang compiler to insert the instrumentation re- quired for Virtual Ghost. We reran both attacks on ssh-agent with malloc() configured to allocate memory objects in ghost memory. The first attack fails because the load/store instrumentation changes the pointer in the malicious mod- ule to point outside of ghost memory; the kernel simply reads unknown data out of its own address space. The sec- ond attack is thwarted because sva.ipush.function() recognizes that the exploit code isn’t one of the functions registered as a valid target of sva.ipush.function().
Note that a number of other possible attacks from within kernel code are simply not expressible in our system, e.g., anything that requires using assembly code in the kernel (such as to access CPU registers), or manipulating the ap- plication stack frames, or modifying interrupted application state when saved in memory. The second attack above illus- trates that much more sophisticated multi-step exploits are needed to get past the basic protections against using assem- bly code or accessing values saved in SVA VM memory or directly reading or writing application code and data (as in the first attack). Virtual Ghost is successfully able to thwart even this sophisticated attack.
8. Performance Experiments
We ran our performance experiments on a Dell Precision T1650 workstation with an Intel⃝R CoreTM i7-3770 proces- sor at 3.4 GHz with 8 MB of cache, 16 GB of RAM, an inte- grated PCIE Gigabit Ethernet card, a 7200 RPM 6 Gb/s 500 GB SATA hard drive, and a 256 GB Solid State Drive (SSD). Files in /usr were stored on the SSD. For network experi- ments, we used a dedicated Gigabit Ethernet network. The client machine was an iMac with a 4-core hyper-threaded Intel⃝R CoreTM i7 processor at 2.6 GHz with 8 GB of RAM.
เราปรับเปลี่ยน FreeBSD c ห้องสมุดเพื่อให้กองอัล - ฟังก์ชันที่ตั้ง ( malloc() calloc() realloc() , , ) ฮัลโหล - เคท กองวัตถุในหน่วยความจำผีแทนในหน่วยความจำแบบดั้งเดิม ; การเปลี่ยนแปลงสร้าง 216 สาย Patch เพื่อความสะดวกในพอร์ต - ไอเอ็นจี เราเขียนพวกระบบสายเรียกห่อที่สำเนาข้อมูลระหว่างหน่วยความจำห้องสมุดผีแบบดั้งเดิม และแหม่ม สถานที่เป็นสิ่งจำเป็นห้องสมุดนี้มีห่อห่อ - ข่าวสารสำหรับ signal() sigaction() ที่ลงทะเบียนและสัญญาณผู้ดูแลการทำงานกับผีเสมือนก่อนเรียกเคอร์เนลและระบบของ signal() sigaction() โทร ดอทคอม - piler และ ลิงเกอร์ ไม่เสมอแก้ไขระบบเรียกฟังก์ชันห่อของเราได้อย่างถูกต้อง เพื่อให้เราได้ทำคู่มือ mod - ifications ไปยังโปรแกรมเรายังแก้ไขโปรแกรมที่ใช้หน่วยความจำแบบดั้งเดิม ( การจัดสรรผ่านทาง mmap() ) เพื่อเก็บผลลัพธ์ของข้อมูลที่จะถูกส่งไปยัง stdout ต่างและการแจ้งข้อความผิดพลาดลดค่าใช้จ่ายในการคัดลอก รวมการเปลี่ยนแปลงของเรา openssh สามารถใช้แพทช์ที่เพิ่มและลบ 68 สายรหัส ( openssh ประกอบด้วย 9230 สายแหล่งที่มาของรหัส ) .
เราได้ทดสอบการใช้งานบนระบบที่ใช้สำหรับอดีต periments ( ดูมาตรา 8 ) เราใช้ Keygen SSH เพื่อสร้างใหม่ส่วนตัวและกุญแจสาธารณะสำหรับ DSA รับรองความถูกต้อง ; สร้างคีย์ส่วนตัวถูกเข้ารหัสในขณะที่คีย์สาธารณะไม่ได้เข้ารหัส จากนั้นเราก็ติดตั้งกุญแจสาธารณะในระบบอื่น ๆและใช้ SSH เพื่อเข้าสู่ระบบโดยใช้ DSA ตรวจสอบ
สำหรับตัวแทน ssh ,เราได้เพิ่มรหัสที่ข้อความลับภายในกองจัดสรรบัฟเฟอร์หน่วยความจำ rootkit โจมตีที่อธิบายไว้ในมาตรา 7 พยายามอ่านข้อความลับนี้ เป้าหมายของการเพิ่มข้อความลับนี้คือตัวแทน ssh ก็ถือเหมือนกันกุญแจการเข้ารหัส ( สามารถใช้สายภายใน แต่ไม่เคยมีผลกับโปรแกรมอื่น )เราใช้สายลับมันเป็นเรื่องง่ายที่จะหาในหน่วยความจำ และง่ายที่จะระบุว่าเป็นข้อมูลที่ค้นหาในการโจมตีของเรา openssh
เพิ่มขึ้นของเราประยุกต์ใช้ชุดสาธิตผีเสมือนสามารถให้ความปลอดภัยกับการใช้งานที่สําคัญในความลับของหน่วยความจำ ( เช่นปุ่มที่จัดขึ้นโดยตัวแทน ssh ) และการจัดเก็บข้อมูลระยะยาว ( เช่น การตรวจสอบปุ่มที่สร้างขึ้นโดยโปรแกรม SSH และ SSH อ่านด้วย )มันก็ปีศาจ - strates ที่ชุดประสานงานการใช้งานอย่างปลอดภัยสามารถแบ่งปันข้อมูลบนระบบปฏิบัติการแบบผ่านการใช้คีย์ที่ใช้ร่วมกัน - ไอออนบวก .
7 การทดลองความปลอดภัย
เพื่อประเมินความปลอดภัยของระบบของเรา เราสร้างโมดูลเคอร์เนลที่เป็นอันตรายที่พยายามที่จะขโมยข้อมูลที่สำคัญจากกระบวนการที่เหยื่อ โมดูลนี้จะขึ้นอยู่กับรหัส จากหนังสือของ โจเซฟ ฮ่องกง [ 18 ]สามารถปรับแต่งได้โดยไม่ใช้สิทธิพิเศษที่จะติดหนึ่งในสองที่เป็นไปได้และหน่วยความจำเข้าถึงโดยตรงไปยังรหัสโจมตีหรือฉีดให้เหยื่อ–ในกระบวนการ โมดูลที่เป็นอันตรายแทนฟังก์ชันที่จัดการระบบเรียก read() และรันเป็นเหยื่อการโจมตีกระบวนการอ่านข้อมูลจากแฟ้มหัวเรื่อง .
ในการโจมตีครั้งแรกโมดูลที่เป็นอันตรายพยายามดิ - rectly ให้อ่านข้อมูลจากเหยื่อหน่วยความจำและพิมพ์เพื่อล็อกระบบ .
ในการโจมตีครั้งที่สอง ความพยายามที่จะทำให้กระบวนการโมดูลเหยื่อเขียนข้อมูลที่เป็นความลับจากแฟ้ม การโจมตีครั้งแรกจะเปิดแฟ้มเพื่อข้อมูลที่ควรจะเขียน การจัดสรรหน่วยความจำในกระบวนการทาง mmap() ที่อยู่พื้นที่ ,ใช้ประโยชน์จากรหัสและสำเนาลงในหน่วยความจำบัฟเฟอร์ โจมตีแล้วติดตั้งสัญญาณจัดการเหยื่อโปรเซสที่เรียกใช้รหัส โมดูลที่เป็นอันตรายแล้วส่งสัญญาณไปยังกระบวนการเหยื่อ กระตุ้นการใช้ประโยชน์จากรหัสเพื่อใช้ในสัญญาณผู้ดูแลรหัสใช้สำเนาข้อมูลลงใน mmap'ed หน่วยความจำและรัน write() sys TEM โทร - เขียนข้อมูลที่เป็นความลับให้ไฟล์เปิดโดยโปรแกรมที่เป็นอันตราย
เราใช้ทั้งการโจมตีโปรแกรมตัวแทน ssh ของเรา อธิบายไว้ในมาตรา 6เมื่อเราติดตั้งโมดูลที่เป็นอันตรายกับ - ออก instrumenting รหัสและใช้ SSH agent malloc() กําหนดจัดสรรวัตถุหน่วยความจำแบบแหม่ม สถานที่ ทั้งการโจมตีสำเร็จ
เราแล้ว recompiled โมดูลที่เป็นอันตรายของเราใช้แคร๊งเรียบเรียงดัดแปลงใส่เครื่องมือ Re - quired สำหรับวิญญาณเสมือนเรา reran ทั้งการโจมตี SSH agent ใน malloc() กําหนดจัดสรรวัตถุหน่วยความจำในหน่วยความจำของผี การโจมตีครั้งแรกล้มเหลวเนื่องจากโหลด / ร้านเครื่องมือวัดการเปลี่ยนแปลงตัวชี้ใน mod - เป็นอันตราย ule จุดภายนอกหน่วยความจำผี ; kernel ก็อ่านข้อมูลที่ออกจากพื้นที่ที่อยู่ของตัวเอง ก.ล.ต. - แต่โจมตีขัดขวาง เพราะ sva.ipush .function() รับรู้ว่ารหัสใช้ประโยชน์ไม่ได้ หนึ่งในหน้าที่จดทะเบียนเป็นเป้าหมายที่ถูกต้องของ SVA . ipush . function() .
ทราบว่าจำนวนของการโจมตีที่เป็นไปได้อื่น ๆจากภายในรหัสโปรแกรม เป็นเพียงไม่ expressible ในระบบ เช่น อะไรที่ต้องใช้ประกอบในรหัส kernel ( เช่นการลงทะเบียน CPU ) หรือการจัดการ AP - รอยจีบซ้อนเฟรมหรือการขัดจังหวะโปรแกรมรัฐเมื่อบันทึกไว้ในความทรงจำ วินาทีโจมตีข้างต้นลลัส - trates มากซับซ้อนมากขึ้น ใช้ต้นทุนจะต้องผ่านการป้องกันขั้นพื้นฐานกับการใช้ assem - รหัสบลายหรือการเข้าถึงค่าที่บันทึกไว้ในหน่วยความจำ VM SVA หรือโดยตรงการอ่านหรือเขียนรหัสโปรแกรมและข้อมูล ( เช่นในการโจมตีครั้งแรก )ผีเสมือนความสามารถที่จะขัดขวางแม้แต่การโจมตีที่ซับซ้อนนี้ .
8 การปฏิบัติการทดลอง
เราวิ่งทดลองประสิทธิภาพของเราบน Dell Precision t1650 เวิร์กสเตชันกับ Intel ⃝ R coretm i7-3770 Proces - ส. ที่ 3.4 GHz กับ 8 MB ของแคช 16 GB of RAM , inte - Gigabit Ethernet - บัตรขูด , 7200 RPM SATA 6 GB / s 500 GB ฮาร์ดไดรฟ์และ 256 GB ของแข็งรัฐไดรฟ์ ( SSD )ไฟล์ใน / usr ก็เก็บไว้บน SSD . สำหรับเครือข่ายประสบการ - มินท์นะ เราใช้เฉพาะ Gigabit Ethernet เครือข่าย เครื่องลูกค้าเป็น iMac กับ 4-core ไฮเปอร์เธรด⃝ R i7 โปรเซสเซอร์ Intel coretm ที่ 2.6 GHz พร้อม RAM 8 GB .
การแปล กรุณารอสักครู่..
