CN107944279A - BIOS vulnerability scanners and scan method based on UEFI - Google Patents
BIOS vulnerability scanners and scan method based on UEFI Download PDFInfo
- Publication number
- CN107944279A CN107944279A CN201711373147.5A CN201711373147A CN107944279A CN 107944279 A CN107944279 A CN 107944279A CN 201711373147 A CN201711373147 A CN 201711373147A CN 107944279 A CN107944279 A CN 107944279A
- Authority
- CN
- China
- Prior art keywords
- uefi
- bios
- scanning
- vulnerability
- driving
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000003862 health status Effects 0.000 claims abstract description 19
- 238000011068 loading method Methods 0.000 claims abstract description 10
- 230000004048 modification Effects 0.000 claims abstract 2
- 238000012986 modification Methods 0.000 claims abstract 2
- 230000006870 function Effects 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 15
- 230000036541 health Effects 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 2
- 238000012795 verification Methods 0.000 claims 1
- 241000700605 Viruses Species 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000003032 molecular docking Methods 0.000 description 1
- ZRHANBBTXQZFSP-UHFFFAOYSA-M potassium;4-amino-3,5,6-trichloropyridine-2-carboxylate Chemical compound [K+].NC1=C(Cl)C(Cl)=NC(C([O-])=O)=C1Cl ZRHANBBTXQZFSP-UHFFFAOYSA-M 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F21/572—Secure firmware programming, e.g. of basic input output system [BIOS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/03—Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
- G06F2221/034—Test or assess a computer or a system
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,具体的说是一种基于UEFI的BIOS漏洞扫描装置及扫描方法。The invention relates to the technical field of computers, in particular to a UEFI-based BIOS vulnerability scanning device and scanning method.
背景技术Background technique
随着计算机技术和网络信息化的高速发展,计算机病毒爆发的次数以及新型计算机病毒出现的速度都呈现出逐年迅速上升的趋势,如何在第一时间发现、清除病毒成为业界非常关心的问题。为了解决传统BIOS的不足,Intel公司提出了新一代固件技术EFI,后来发展成为UEFI(统一可扩展固件接口)。该技术通过在硬件和操作系统之间增加一层抽象,屏蔽底层硬件特性。通过通用的方式对系统进行环境引导,同时UEFI还提供了一个调试环境,能够让用户在操作系统启动之前运行某些应用程序。With the rapid development of computer technology and network informatization, the number of computer virus outbreaks and the speed of new computer viruses are showing a rapid increase year by year. How to find and remove viruses in the first place has become a matter of great concern to the industry. In order to solve the shortcomings of the traditional BIOS, Intel Corporation proposed a new generation of firmware technology EFI, which later developed into UEFI (Unified Extensible Firmware Interface). This technology shields the underlying hardware features by adding a layer of abstraction between the hardware and the operating system. The environment boots the system in a general way, and UEFI also provides a debugging environment that allows users to run certain applications before the operating system starts.
固件层存在的安全漏洞已成为信息安全业界重要的威胁因素之一,利用其实施的攻击具有不易清除、难以检测、破坏性强等固有特点。因此研究基于固件层的攻击,从底层为计算机安全提供了有力的保障,具有重要的应用价值和研究意义。The security loopholes in the firmware layer have become one of the important threat factors in the information security industry, and the attacks carried out by using them have the inherent characteristics of being difficult to remove, difficult to detect, and highly destructive. Therefore, the study of attacks based on the firmware layer provides a strong guarantee for computer security from the bottom layer, which has important application value and research significance.
BIOS作为固件层必不可少的固件程序,是计算机启动后首先执行的程序,为计算机提供最底层、最直接的硬件控制。UEFI是新一代的BIOS标准,定义了操作系统与硬件平台固件之间的接口规范。它的出现不仅仅改变了传统BIOS的启动方式,解决了传统BIOS难以扩展等问题,并给用户提供了便利的底层开发环境,但同时也不可避免地带来了一些安全隐患。目前,现有技术缺乏对于BIOS漏洞的检测手段。As an essential firmware program in the firmware layer, BIOS is the first program executed after the computer is started, providing the computer with the lowest and most direct hardware control. UEFI is a new generation of BIOS standard, which defines the interface specification between the operating system and hardware platform firmware. Its appearance not only changed the booting method of the traditional BIOS, solved the problem that the traditional BIOS was difficult to expand, and provided users with a convenient underlying development environment, but it also inevitably brought some security risks. At present, the prior art lacks detection means for BIOS vulnerabilities.
发明内容Contents of the invention
为了解决上述问题,提供了一种基于UEFI的BIOS漏洞扫描装置及扫描方法,可以用于各种需要扫描基于UEFI的BIOS漏洞的场景,从而保证BIOS系统的安全可靠。In order to solve the above problems, a UEFI-based BIOS vulnerability scanning device and scanning method are provided, which can be used in various scenarios that need to scan UEFI-based BIOS vulnerabilities, thereby ensuring the safety and reliability of the BIOS system.
本发明实施例提供了一种基于UEFI的BIOS漏洞扫描装置,所述的装置包括:The embodiment of the present invention provides a UEFI-based BIOS vulnerability scanning device, the device comprising:
漏洞库,用于存储漏洞的特征码,在漏洞扫描过程中作为特征码匹配匹配对象,以验证待测BIOS是否存在漏洞;The vulnerability library is used to store the signature code of the vulnerability, which is used as the signature matching object during the vulnerability scanning process to verify whether there is a vulnerability in the BIOS to be tested;
UEFI固件启动信息扫描单元,实现对启动项信息的获取、处理和分析,以验证启动项的合法性;The UEFI firmware startup information scanning unit realizes the acquisition, processing and analysis of startup item information to verify the validity of the startup item;
BIOS配置信息扫描单元,实现对BIOS的基本配置信息的获取、分析,以判断是否符合正常启动的要求;The BIOS configuration information scanning unit realizes the acquisition and analysis of the basic configuration information of the BIOS to determine whether it meets the requirements for normal startup;
驱动健康状况扫描单元,对UEFI BIOS加载的各种设备的驱动以及控制器的状态进行扫描,检测各驱动是否处于正常工作状态或者是否被恶意修改。The driver health status scanning unit scans the drivers of various devices loaded by the UEFI BIOS and the state of the controller, and detects whether each driver is in a normal working state or whether it has been maliciously modified.
本发明实施例还提供了一种基于UEFI的BIOS漏洞扫描方法,所述的方法包括:The embodiment of the present invention also provides a UEFI-based BIOS vulnerability scanning method, the method comprising:
S1:加载用于运行UEFI应用程序的UEFI运行环境;S1: loading a UEFI operating environment for running UEFI applications;
S2:BIOS配置信息扫描单元从SMBIOS数据表中获取BIOS配置信息;S2: The BIOS configuration information scanning unit obtains the BIOS configuration information from the SMBIOS data table;
S3:BIOS漏洞扫描装置调用函数从全局变量中获取UEFI固件启动信息;S3: The BIOS vulnerability scanning device calls a function to obtain UEFI firmware startup information from global variables;
S4:驱动健康状况扫描单元与EFI Driver Health Protocol对接,获取驱动健康状况。S4: The driver health status scanning unit interfaces with the EFI Driver Health Protocol to obtain the driver health status.
进一步的,步骤S1的具体实现过程为:首先,加电后,将平台初始化,之后依次加载UEFI映像和UEFI启动管理器,成功进入系统;然后,终止启动服务返回启动菜单,在启动菜单中选择进入UEFI应用程序,载入临时操作系统,并建立临时操作系统环境。Further, the specific implementation process of step S1 is as follows: first, after powering on, initialize the platform, then load the UEFI image and UEFI boot manager in sequence, and successfully enter the system; then, terminate the boot service and return to the boot menu, and select in the boot menu Enter the UEFI application program, load the temporary operating system, and establish the temporary operating system environment.
进一步的,步骤S2的具体实现过程为:利用协议EFI_SMBIOS_PROTOCOL定义的查询SMBIOS记录的接口来获取相应的BIOS信息。Further, the specific implementation process of step S2 is: using the interface for querying SMBIOS records defined by the protocol EFI_SMBIOS_PROTOCOL to obtain corresponding BIOS information.
进一步的,步骤S3的具体实现过程为:Further, the specific implementation process of step S3 is:
S31:调用EFI_GET_VARIABLE()函数可以获取Boot Order中的值;S31: Call the EFI_GET_VARIABLE() function to obtain the value in Boot Order;
S32:将步骤S31中获取的启动项变量中的描述符分离为各字段,并将各字段注册到Bds Common Option List结构中;S32: Separate the descriptor in the startup item variable obtained in step S31 into each field, and register each field into the Bds Common Option List structure;
S33:通过系统中的属性信息表获取启动性的状态信息。S33: Obtain start-up state information through the attribute information table in the system.
进一步的,步骤S4的具体实现过程为:Further, the specific implementation process of step S4 is:
S41:使用UEFI引导服务中提供的Locate Handle Buffer函数来检索平台中安装了Efi Driver Health Protocol的驱动;S41: Use the Locate Handle Buffer function provided in the UEFI boot service to retrieve the driver in which the Efi Driver Health Protocol is installed in the platform;
S42:循环每一个检索到的驱动句柄,使用UEFI引导服务中提供的HandleProtocol函数来获得一个Driver Health Protocol实例;S42: Loop through each retrieved driver handle, and use the HandleProtocol function provided in the UEFI boot service to obtain a Driver Health Protocol instance;
S43:使用Driver Health Protocol中的Get Health Status方法来获取该驱动以及驱动所管理的控制器的健康状态;S43: Use the Get Health Status method in the Driver Health Protocol to obtain the health status of the driver and the controller managed by the driver;
S44:对返回的状态进行处理,通过COMPONENT_NAME_PROTOCOL获取该驱动或者控制器的名称。S44: Process the returned status, and obtain the name of the driver or controller through COMPONENT_NAME_PROTOCOL.
进一步的,所述的步骤S4还包括:Further, the step S4 also includes:
S45:如果有处于非健康状态下的驱动,则将驱动名称以及驱动状态输出,提示用户需要修改。S45: If there is a driver in an unhealthy state, output the driver name and driver status, prompting the user to modify.
发明内容中提供的效果仅仅是实施例的效果,而不是发明所有的全部效果,上述技术方案中的一个技术方案具有如下优点或有益效果:The effects provided in the summary of the invention are only the effects of the embodiments, rather than all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects:
1、本装置通过BIOS配置信息扫描、启动项信息扫描以及驱动健康状态扫描,实现对BIOS漏洞的扫描,从而保证BIOS系统的安全可靠。同时,本装置与操作系统完全隔离,通过转换控制权的方式实现与固件层的信息交互。1. The device scans BIOS vulnerabilities through BIOS configuration information scanning, startup item information scanning, and driver health status scanning, thereby ensuring the safety and reliability of the BIOS system. At the same time, the device is completely isolated from the operating system, and realizes information interaction with the firmware layer by switching control rights.
2、通过建立运行环境,并调用函数对接以实现BIOS配置信息、启动项信息以及驱动健康状态信息的获取,可以快速实现对BIOS漏洞的全面扫描,增强硬件架构的安全性。2. By establishing the operating environment and calling function docking to realize the acquisition of BIOS configuration information, startup item information and driver health status information, it is possible to quickly realize a comprehensive scan of BIOS vulnerabilities and enhance the security of the hardware architecture.
附图说明Description of drawings
图1是本发明装置实施例的原理图;Fig. 1 is the schematic diagram of device embodiment of the present invention;
图2是本发明装置的实现原理图;Fig. 2 is the realization schematic diagram of device of the present invention;
图3是本发明方法实施例的流程图;Fig. 3 is the flowchart of the method embodiment of the present invention;
图4是本发明运行环境加载的原理图;Fig. 4 is a schematic diagram of loading of the operating environment of the present invention;
图5是本发明属性表的参考图。Fig. 5 is a reference diagram of the attribute table of the present invention.
具体实施方式Detailed ways
为能清楚说明本方案的技术特点,下面通过具体实施方式,并结合其附图,对本发明进行详细阐述。下文的公开提供了许多不同的实施例或例子用来实现本发明的不同结构。为了简化本发明的公开,下文中对特定例子的部件和设置进行描述。此外,本发明可以在不同例子中重复参考数字和/或字母。这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施例和/或设置之间的关系。应当注意,在附图中所图示的部件不一定按比例绘制。本发明省略了对公知组件和处理技术及工艺的描述以避免不必要地限制本发明。In order to clearly illustrate the technical features of this solution, the present invention will be described in detail below through specific implementation modes and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in different instances. This repetition is for the purpose of simplicity and clarity and does not in itself indicate a relationship between the various embodiments and/or arrangements discussed. It should be noted that components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and processes are omitted herein to avoid unnecessarily limiting the present invention.
实施例Example
如图1所示,本发明实施例提供了一种基于UEFI的BIOS漏洞扫描装置,所述的装置包括漏洞库、UEFI固件启动信息扫描单元、BIOS配置信息扫描单元、驱动健康状况扫描单元。As shown in FIG. 1 , an embodiment of the present invention provides a UEFI-based BIOS vulnerability scanning device, which includes a vulnerability library, a UEFI firmware startup information scanning unit, a BIOS configuration information scanning unit, and a driver health status scanning unit.
所述的漏洞库用于存储漏洞的特征码,在漏洞扫描过程中作为特征码匹配匹配对象,以验证待测BIOS是否存在漏洞。The vulnerability database is used to store the characteristic codes of the vulnerabilities, which are used as the matching objects of the characteristic codes in the vulnerability scanning process to verify whether there are vulnerabilities in the BIOS to be tested.
UEFI固件启动信息扫描单元,实现对启动项信息的获取、处理和分析,以验证启动项的合法性。The UEFI firmware startup information scanning unit implements acquisition, processing and analysis of startup item information to verify the validity of the startup item.
BIOS配置信息扫描单元,实现对BIOS的基本配置信息的获取、分析,以判断是否符合正常启动的要求。The BIOS configuration information scanning unit realizes the acquisition and analysis of the basic configuration information of the BIOS, so as to judge whether it meets the requirements of normal startup.
驱动健康状况扫描单元,对UEFI BIOS加载的各种设备的驱动以及控制器的状态进行扫描,检测各驱动是否处于正常工作状态或者是否被恶意修改。The driver health status scanning unit scans the drivers of various devices loaded by the UEFI BIOS and the state of the controller, and detects whether each driver is in a normal working state or whether it has been maliciously modified.
如图2所示,本装置与操作系统完全隔离,通过转换控制权的方式实现与固件层的信息交互。As shown in Figure 2, the device is completely isolated from the operating system, and information interaction with the firmware layer is realized by switching control rights.
如图3所示,本发明实施例还提供了一种基于UEFI的BIOS漏洞扫描方法,所述的方法包括:As shown in Fig. 3, the embodiment of the present invention also provides a kind of BIOS vulnerability scanning method based on UEFI, and described method comprises:
S1:加载用于运行UEFI应用程序的UEFI运行环境。S1: Load the UEFI operating environment for running the UEFI application program.
UEFI允许通过装载UEFI应用程序和UEFI驱动来扩展架构固件。当加载UEFI驱动和UEFI应用程序的时候,驱动和应用程序有权使用UEFI所定义的所有的引导服务和运行时服务。UEFI allows extending the architecture firmware by loading UEFI applications and UEFI drivers. When loading UEFI drivers and UEFI applications, the drivers and applications have access to all boot services and runtime services defined by UEFI.
图4显示了UEFI启动流程图:加电后,第一步是平台初始化,之后UEFI映像将被加载(包括加载UEFI驱动程序和应用程序)之后是加载UEFI启动管理器,如果成功进入系统,将终止启动服务返回启动菜单。而如果在启动菜单中选择进入UEFI应用程序,临时操作系统将被载入,并建立临时操作系统环境。而如果临时操作系统被成功加载,相应的UEFI运行环境即被成功建立。Figure 4 shows the UEFI boot flow chart: After power-on, the first step is platform initialization, after which the UEFI image will be loaded (including loading UEFI drivers and applications), and then the UEFI boot manager will be loaded, and if it successfully enters the system, it will Terminate the boot service to return to the boot menu. And if you choose to enter the UEFI application program in the boot menu, the temporary operating system will be loaded and a temporary operating system environment will be established. And if the temporary operating system is successfully loaded, the corresponding UEFI operating environment is successfully established.
UEFI Shell实现了这种临时操作系统环境,它是一种特殊的UEFI应用程序。UEFIShell提供控制台界面,用于启动应用程序、加载UEFI协议和设备驱动程序以及执行简单的脚本文件。该界面也提供命令界面执行相应命令或UEFI应用程序。事实上,UEFI shell是一个操作环境,作为一个外壳程序负责接收用户交互。它接受用户输入,传递用户输入至内核执行,将执行结果显示给用户。它类似于Windows环境下的cmd或者Linux环境下的Shell界面。This temporary operating system environment is implemented by UEFI Shell, which is a special UEFI application. UEFIShell provides a console interface for launching applications, loading UEFI protocols and device drivers, and executing simple script files. This interface also provides a command interface to execute corresponding commands or UEFI applications. In fact, the UEFI shell is an operating environment that acts as a shell responsible for receiving user interaction. It accepts user input, passes the user input to the kernel for execution, and displays the execution result to the user. It is similar to cmd in Windows environment or Shell interface in Linux environment.
S2:BIOS配置信息扫描单元从SMBIOS数据表中获取BIOS配置信息。S2: The BIOS configuration information scanning unit obtains the BIOS configuration information from the SMBIOS data table.
UEFI中EFI_SMBIOS_PROTOCOL定义了一个增加、删除或者查询SMBIOS记录的接口。UEFI启动时,安装该协议的UEFI驱动程序将负责创建SMBIOS数据表,并将指向该数据表的指针放在EFI系统配置表中。在基于UEFI的病毒扫描引擎的BIOS配置信息扫描中,使用该协议中定义的查询SMBIOS记录的接口来获取相应的BIOS信息。EFI_SMBIOS_PROTOCOL in UEFI defines an interface for adding, deleting or querying SMBIOS records. When UEFI starts, the UEFI driver that installs the protocol will be responsible for creating the SMBIOS data table, and put the pointer to the data table in the EFI system configuration table. In scanning the BIOS configuration information of the UEFI-based virus scanning engine, use the interface defined in the protocol to query SMBIOS records to obtain corresponding BIOS information.
EFI_SMBIOS_PROTOCOL的定义如下所示:The definition of EFI_SMBIOS_PROTOCOL is as follows:
typedef struct_EFI_SMBIOS_PROTOCOL{typedef struct_EFI_SMBIOS_PROTOCOL{
EFI_SMBIOS_ADD Add;EFI_SMBIOS_ADD Add;
EFI_SMBIOS_UPDATE_STRINGUpdate String;EFI_SMBIOS_UPDATE_STRINGUpdate String;
EFI_SMBIOS_REMOVE Remove;EFI_SMBIOS_REMOVE Remove;
EFI_SMBIOS_GET_NEXT Get Next;EFI_SMBIOS_GET_NEXT Get Next;
UINT8Major Version;UINT8MajorVersion;
UINT8Minor Version;UINT8MinorVersion;
}EFI_SMBIOS_PROTOCOL;}EFI_SMBIOS_PROTOCOL;
Get Next函数用于查询所有或者部分SMBIOS记录,其函数声明如下:The Get Next function is used to query all or part of the SMBIOS records, and its function declaration is as follows:
typedeftypedef
EFI_STATUSEFI_STATUS
(EFIAPI*EFI_SMBIOS_GET_NEXT)((EFIAPI*EFI_SMBIOS_GET_NEXT)(
IN CONST EFI_SMBIOS_PROTOCOL*This,IN CONST EFI_SMBIOS_PROTOCOL*This,
IN OUT EFI_SMBIOS_HANDLE*Smbios Handle,IN OUT EFI_SMBIOS_HANDLE*Smbios Handle,
IN EFI_SMBIOS_TYPE*Type,OPTIONALIN EFI_SMBIOS_TYPE*Type, OPTIONAL
OUT EFI_SMBIOS_TABLE_HEADER**Record,OUT EFI_SMBIOS_TABLE_HEADER**Record,
OUT EFI_HANDLE*Producer Handle,OPTIONALOUT EFI_HANDLE*Producer Handle, OPTIONAL
))
其中,Type参数表示要查询的SMBIOS记录的类型,UEFI中定义了40余种SMBIOS记录,这里只扫描了其中比较关键的几项,包括BIOS版本、CPU型号、CPU主频、系统内存信息。Among them, the Type parameter indicates the type of SMBIOS record to be queried. More than 40 kinds of SMBIOS records are defined in UEFI. Here, only a few key items are scanned, including BIOS version, CPU model, CPU main frequency, and system memory information.
如果BIOS版本过低将建议用户更新至最新版本的BIOS,以防低版本的BIOS被发现的漏洞容易遭受恶意的攻击。或者其他的信息不正确,例如CPU主频、系统内存等如果与正常情况不符,也有可能是由于遭到了恶意的篡改,应该提高警惕。If the BIOS version is too low, the user is advised to update to the latest version of the BIOS, in case the vulnerabilities found in the low version BIOS are vulnerable to malicious attacks. Or other information is incorrect, such as CPU frequency, system memory, etc. If it does not match the normal situation, it may also be due to malicious tampering, so you should be more vigilant.
S3:BIOS漏洞扫描装置调用函数从全局变量中获取UEFI固件启动信息。S3: The BIOS vulnerability scanning device calls a function to obtain UEFI firmware startup information from global variables.
UEFI内核中提供的运行时服务在引导和操作系统运行的时候都能调用。运行时服务的这种特性,为底层资源和上层操作系统之间的交互带来便利,但是也从底层为整个计算机系统带来安全隐患。The runtime services provided in the UEFI kernel can be called when booting and when the operating system is running. This feature of the runtime service brings convenience to the interaction between the underlying resources and the upper-level operating system, but also brings security risks to the entire computer system from the bottom.
启动项加载器可以在UEFI BIOS中随意添加或更改启动项。启动项加载可以加载带有运行时服务的Agent入侵程序。该入侵程序通过调用运行时服务把自身的入侵性服务推入操作系统,即可实现UEFI BIOS级的操作系统控制。另外可通过该入侵服务开启的后门访问这台机器的资源。The boot item loader can add or change boot items in UEFI BIOS at will. The startup item loading can load the Agent intrusion program with runtime service. The intrusion program pushes its own intrusive service into the operating system by calling the runtime service, so as to realize UEFI BIOS-level operating system control. In addition, the resources of this machine can be accessed through the backdoor opened by the intrusion service.
为此,基于UEFI的扫描引擎对UEFI的启动项进行了扫描,并推测启动项的合法性。具体的实现方法主要分为以下三个步骤:For this reason, the UEFI-based scanning engine scans the UEFI startup items, and infers the legitimacy of the startup items. The specific implementation method is mainly divided into the following three steps:
第一步,获取启动项信息。启动管理器负责启动UEFI应用程序(包括OS Loader)、UEFI驱动程序等。启动项信息存放在全局变量Boot Order中。Boot Order包含一个UINT16类型的向量,这个向量是由Boot####选项构成的有序列表。向量中的第一个元素是第一个逻辑启动项的值,第二个元素是第二个逻辑启动项的值,以此类推。这些启动项的启动顺序就是启动管理器的默认启动顺序。The first step is to obtain the startup item information. The boot manager is responsible for starting UEFI applications (including OS Loader), UEFI drivers, etc. The startup item information is stored in the global variable Boot Order. Boot Order contains a UINT16 type vector, which is an ordered list of Boot#### options. The first element in the vector is the value of the first logical boot, the second element is the value of the second logical boot, and so on. The startup sequence of these startup items is the default startup sequence of the startup manager.
UEFI运时服务表中定义了获取全局变量的函数接口,EFI_GET_VARIABLE()函数可以获取Boot Order中的值。The function interface for obtaining global variables is defined in the UEFI runtime service table, and the EFI_GET_VARIABLE() function can obtain the value in the Boot Order.
第二步,处理启动项信息。每一个启动项变量都包含一个EFI_LOAD_OPTION描述符。该描述符是一个以字节为单位的可变长度的字段缓存区。The second step is to process the startup item information. Each boot variable contains an EFI_LOAD_OPTION descriptor. This descriptor is a variable-length field buffer in bytes.
缓存区中各字段按以下顺序出现:The fields in the buffer appear in the following order:
UINT16Attributes;//加载项属性UINT16Attributes; //add-in attributes
UINT16File Path List Length;//File Path List的长度UINT16File Path List Length; //The length of the File Path List
CHAR16Description[];//用户可读的描述符CHAR16Description[];//User-readable descriptor
EFI_DEVICE_PATH_PROTOCOL File Path List[];//UEFI设备路径的打包数组EFI_DEVICE_PATH_PROTOCOL File Path List[]; //package array of UEFI device path
UINT8Optional Data[];//二进制数据缓冲区UINT8Optional Data[];//binary data buffer
为了方便调用及分析EFI_LOAD_OPTION描述符中各个字段的信息。通常需要分离各字段,并将各字段注册到Bds Common Option List结构中。In order to facilitate calling and analyzing the information of each field in the EFI_LOAD_OPTION descriptor. It is usually necessary to separate each field and register each field into the Bds Common Option List structure.
第三步,分析启动项信息。分析的主要内容是启动项的属性及所属设备类型等信息。通过各属性描述判断该启动项是否具有潜在威胁。图5的表中列出了启动项的各种属性。The third step is to analyze the startup item information. The main content of the analysis is information such as the attributes of the startup item and the type of device it belongs to. Determine whether the startup item is a potential threat through the description of each attribute. Various attributes of the startup item are listed in the table of FIG. 5 .
EFI_DEVICE_PATH_PROTOCOL协议可以在任何设备句柄中使用,获取相关物理或逻辑设备的通用路径或位置信息。一个无效的句柄指其不能逻辑映射到一个物理设备,即该句柄不支持设备路径协议。设备路径指出该句柄相关的设备位置;而设备路径的大小由构成该设备的结构体决定。The EFI_DEVICE_PATH_PROTOCOL protocol can be used in any device handle to obtain the general path or location information of the related physical or logical device. An invalid handle means that it cannot be logically mapped to a physical device, that is, the handle does not support the device path protocol. The device path indicates the location of the device related to the handle; the size of the device path is determined by the structure that constitutes the device.
启动项的File Path List字段存储了UEFI设备路径信息,通过EFI_DEVICE_PATH_PROTOCOL协议可识别出该启动项所属的设备类型。The File Path List field of the startup item stores UEFI device path information, and the device type to which the startup item belongs can be identified through the EFI_DEVICE_PATH_PROTOCOL protocol.
通过执行以上三个步骤,可以获取所有启动项的值、属性、设备类型等信息,以此判断该启动项是否是正常的启动设备和是否具有潜在的安全威胁,将这些信息作为选择启动方式的依据。By performing the above three steps, you can obtain information such as the value, attribute, and device type of all startup items, so as to judge whether the startup item is a normal startup device and whether it has potential security threats, and use this information as the basis for selecting the startup method. in accordance with.
以下是认为具有威胁的情况:The following situations are considered threatening:
1)将所获的启动项信息与启动管理器的启动菜单进行比较,两者不一致。1) Compare the obtained startup item information with the startup menu of the startup manager, and the two are inconsistent.
2)可以识别出启动项的设备类型信息,但该启动项的属性不是LOAD_OPTION_ACTIVE。2) The device type information of the startup item can be identified, but the attribute of the startup item is not LOAD_OPTION_ACTIVE.
3)启动项的属性为LOAD_OPTION_HIDDEN,但出现在启动菜单中。3) The attribute of the startup item is LOAD_OPTION_HIDDEN, but it appears in the startup menu.
S4:驱动健康状况扫描单元与EFI Driver Health Protocol对接,获取驱动健康状况。S4: The driver health status scanning unit interfaces with the EFI Driver Health Protocol to obtain the driver health status.
步骤S4的具体实现过程为:The specific implementation process of step S4 is:
S41:使用UEFI引导服务中提供的Locate Handle Buffer函数来检索平台中安装了Efi Driver Health Protocol的驱动。Driver Health Handles是已经安装了EfiDriver Health Protocol的驱动句柄,Num Handles则是上述驱动的数量。S41: Use the Locate Handle Buffer function provided in the UEFI boot service to retrieve the driver in which the Efi Driver Health Protocol is installed in the platform. Driver Health Handles is the driver handle that has installed EfiDriver Health Protocol, and Num Handles is the number of the above drivers.
S42:循环每一个检索到的驱动句柄,使用UEFI引导服务中提供的HandleProtocol函数来获得一个Driver Health Protocol实例;S42: Loop through each retrieved driver handle, and use the HandleProtocol function provided in the UEFI boot service to obtain a Driver Health Protocol instance;
S43:使用Driver Health Protocol中的Get Health Status方法来获取该驱动以及驱动所管理的控制器的健康状态;S43: Use the Get Health Status method in the Driver Health Protocol to obtain the health status of the driver and the controller managed by the driver;
S44:对返回的状态进行处理,通过COMPONENT_NAME_PROTOCOL获取该驱动或者控制器的名称。S44: Process the returned status, and obtain the name of the driver or controller through COMPONENT_NAME_PROTOCOL.
所述的步骤S4还包括:Described step S4 also includes:
S45:如果有处于非健康状态下的驱动,则将驱动名称以及驱动状态输出,提示用户需要修改。S45: If there is a driver in an unhealthy state, output the driver name and driver status, prompting the user to modify.
尽管说明书及附图和实施例对本发明创造已进行了详细的说明,但是,本领域技术人员应当理解,仍然可以对本发明创造进行修改或者等同替换;而一切不脱离本发明创造的精神和范围的技术方案及其改进,其均涵盖在本发明创造专利的保护范围当中。Although the specification, drawings and embodiments have described the invention in detail, those skilled in the art should understand that the invention can still be modified or replaced in an equivalent manner; and everything that does not depart from the spirit and scope of the invention The technical solutions and their improvements are all included in the scope of protection of the invention patent.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711373147.5A CN107944279A (en) | 2017-12-19 | 2017-12-19 | BIOS vulnerability scanners and scan method based on UEFI |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711373147.5A CN107944279A (en) | 2017-12-19 | 2017-12-19 | BIOS vulnerability scanners and scan method based on UEFI |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107944279A true CN107944279A (en) | 2018-04-20 |
Family
ID=61941284
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711373147.5A Pending CN107944279A (en) | 2017-12-19 | 2017-12-19 | BIOS vulnerability scanners and scan method based on UEFI |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107944279A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109711161A (en) * | 2018-12-03 | 2019-05-03 | 联想(北京)有限公司 | A kind of monitoring method and electronic equipment |
CN109783146A (en) * | 2019-01-08 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of method of reading service device DMI information under shell |
CN110457907A (en) * | 2019-07-25 | 2019-11-15 | 腾讯科技(深圳)有限公司 | A kind of firmware program detecting method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079003A (en) * | 2006-05-23 | 2007-11-28 | 北京金元龙脉信息科技有限公司 | System and method for carrying out safety risk check to computer BIOS firmware |
CN102270288A (en) * | 2011-09-06 | 2011-12-07 | 中国人民解放军国防科学技术大学 | Method for performing trusted boot on operation system based on reverse integrity verification |
US20150121497A1 (en) * | 2012-04-05 | 2015-04-30 | Toucan System | Method For Securing Access To A Computer Device |
-
2017
- 2017-12-19 CN CN201711373147.5A patent/CN107944279A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079003A (en) * | 2006-05-23 | 2007-11-28 | 北京金元龙脉信息科技有限公司 | System and method for carrying out safety risk check to computer BIOS firmware |
CN102270288A (en) * | 2011-09-06 | 2011-12-07 | 中国人民解放军国防科学技术大学 | Method for performing trusted boot on operation system based on reverse integrity verification |
US20150121497A1 (en) * | 2012-04-05 | 2015-04-30 | Toucan System | Method For Securing Access To A Computer Device |
Non-Patent Citations (1)
Title |
---|
刘宝凯: "基于UEFI的病毒扫描引擎的设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109711161A (en) * | 2018-12-03 | 2019-05-03 | 联想(北京)有限公司 | A kind of monitoring method and electronic equipment |
CN109783146A (en) * | 2019-01-08 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of method of reading service device DMI information under shell |
CN110457907A (en) * | 2019-07-25 | 2019-11-15 | 腾讯科技(深圳)有限公司 | A kind of firmware program detecting method and device |
CN110457907B (en) * | 2019-07-25 | 2021-04-20 | 腾讯科技(深圳)有限公司 | Firmware program detection method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10284591B2 (en) | Detecting and preventing execution of software exploits | |
US10642978B2 (en) | Information security techniques including detection, interdiction and/or mitigation of memory injection attacks | |
CN102902919B (en) | A kind of identifying processing methods, devices and systems of suspicious operation | |
US12001543B2 (en) | System and method for container assessment using sandboxing | |
US9880889B2 (en) | Virtual application extension points | |
US10528735B2 (en) | Malicious code protection for computer systems based on process modification | |
US9594904B1 (en) | Detecting malware based on reflection | |
US8826269B2 (en) | Annotating virtual application processes | |
Oosthoek et al. | Sok: Att&ck techniques and trends in windows malware | |
JP4676744B2 (en) | Security-related programming interface | |
US9336018B2 (en) | Mechanism for class data sharing using extension and application class-loaders | |
US9355246B1 (en) | Tuning sandbox behavior based on static characteristics of malware | |
CN104008340B (en) | Virus scanning and killing method and device | |
CN104268476A (en) | Application running method | |
CN113391874A (en) | Virtual machine detection countermeasure method and device, electronic equipment and storage medium | |
CN107944279A (en) | BIOS vulnerability scanners and scan method based on UEFI | |
US11416614B2 (en) | Statistical detection of firmware-level compromises | |
Xuan et al. | Toward revealing kernel malware behavior in virtual execution environments | |
US10223413B2 (en) | Capturing components of an application using a static post-installation analysis of the system | |
US20220035920A1 (en) | Systems and methods for automatically generating malware countermeasures | |
US10997285B2 (en) | Selectively blocking the loading of a privileged application | |
Sylve | Towards real-time volatile memory forensics: frameworks, methods, and analysis | |
CN118070289A (en) | UEFI firmware vulnerability detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180420 |