CN109241703A - A kind of application software obtains the method and system of android system root authority - Google Patents

A kind of application software obtains the method and system of android system root authority Download PDF

Info

Publication number
CN109241703A
CN109241703A CN201710538867.6A CN201710538867A CN109241703A CN 109241703 A CN109241703 A CN 109241703A CN 201710538867 A CN201710538867 A CN 201710538867A CN 109241703 A CN109241703 A CN 109241703A
Authority
CN
China
Prior art keywords
root
application software
android system
adb
boot
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
Application number
CN201710538867.6A
Other languages
Chinese (zh)
Inventor
田凯
张星辰
丁露露
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Antian Information Technology Co Ltd
Original Assignee
Wuhan Antian Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Antian Information Technology Co Ltd filed Critical Wuhan Antian Information Technology Co Ltd
Priority to CN201710538867.6A priority Critical patent/CN109241703A/en
Publication of CN109241703A publication Critical patent/CN109241703A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention provides the method and systems that a kind of application software obtains android system root authority, the described method includes: modification boot.img makes the adb of android system have root authority, application software has sent root request to the adb after establishing the communication connection of application software and android system, the request message in root request that system analysis obtains, and be that corresponding application software executes root operation according to the request message.Only have adb that there is root authority in android system of the invention, the root of application software needs just to can be achieved by the audit of adb, avoid the case where malice sample extracts root authority using system vulnerability, the deleted possibility of su file in android system, superuser.apk is reduced, safety is improved.

Description

A kind of application software obtains the method and system of android system root authority
Technical field
The invention belongs to application permission fields more particularly to a kind of application software to obtain android system root authority Method and system.
Background technique
Android system is a open source code Mobile operating system based on linux kernel.Root is Linux system Power user in system, it possesses the highest permission of entire linux system.Obtain root authority after, can carry out starting or Stopping process, deletion increase user, use or the disabling operation such as system hardware, therefore, root there are great security risk, Android terminal manufacturer would generally default closing root authority when terminal is dispatched from the factory.
Safety detection company needs to obtain the root authority for detecting the test terminal of malice sample, so as to detection Malice sample such as is scanned, monitors, disabling, unloading at the operation.Currently, the work that test terminal mainly uses third party team to develop Tool obtains root authority: 1, executing root using binary executable su and operate;2, using Superuser.apk to application Carry out empowerment management.
Since the relevant file of above-mentioned root tool and storage path have been exposed through, once occur extracting using system vulnerability The malice sample of root authority can delete the executable files such as su, superuser.apk, and test terminal can not just obtain Root authority, and then malice sample can not be disabled and unload, so that entire detection system is unable to operate normally.In addition, third party Root tool allows all applications to obtain root authority, and there are security risks.
Summary of the invention
The embodiment of the present invention be designed to provide a kind of application software obtain android system root authority method and System, to solve the problems, such as that existing root tool exists.
The embodiments of the present invention are implemented as follows, a kind of method that application software obtains android system root authority, institute State method, comprising:
The boot.img parameter of android system ROM packet is modified, so that only adb has root authority;
Establish the communication connection of application software and android system;
Application software sends root request to the adb;
The request message in root request that parsing obtains, and be corresponding application software according to the request message Execute root operation.
The another object of the embodiment of the present invention is to provide that a kind of application software obtains android system root authority is System, the system, comprising:
Boot.img parameter modifying unit, for modifying the boot.img parameter of android system ROM packet, so that only adb With root authority;
Communication unit, for establishing the communication connection of application software and android system;
Root request transmitting unit, for sending root request from application software to the adb;
Root unit, for obtaining the request message in the root request by parsing, and according to the request message Root operation is executed for corresponding application software.
The embodiment of the present invention makes the adb of android system have root authority, answers in foundation by modifying boot.img Root request is had sent to the adb with application software after the communication connection of software and android system, what system analysis obtained Request message in the root request, and be that corresponding application software executes root operation according to the request message, also Realize the purpose that application software obtains root authority.Only have adb that there is root authority in android system of the invention, answers It needs just to can be achieved by the audit of adb with the root of software, avoids malice sample using system vulnerability and extract root authority The case where, the deleted possibility of su file in android system, superuser.apk is reduced, safety is improved.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is that a kind of application software shown in an exemplary embodiment of the invention obtains android system root authority The flow chart of method;
Fig. 2 is that a kind of application software shown in another exemplary embodiment of the present invention obtains android system root authority Method flow chart;
Fig. 3 is that a kind of application software shown in an exemplary embodiment of the invention obtains android system root authority The structure chart of system;
Fig. 4 is that a kind of application software shown in another exemplary embodiment of the present invention obtains android system root authority System structure chart.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
Android system root is obtained as shown in Figure 1 for a kind of application software shown in an exemplary embodiment of the invention The flow chart of the method for permission, the described method comprises the following steps:
Step S101 modifies the boot.img parameter of android system ROM packet, so that only adb has root authority.
Specifically, the boot.img parameter of modification android system ROM packet, to open the android system ROM packet Adb debug mode so that only adb have root authority.
In embodiments of the present invention, debug mode, that is, debugging mode, the adb with debug mode possess to Android The permission that system is debugged.Android system is to be run according to android system ROM, therefore pass through modification Android Boot.img parameter in system ROM packet can make android system ROM packet open adb debug mode, so that only adb has There is root authority.
Fig. 2 is shown in some embodiments, and the boot.img parameter of the modification android system ROM packet makes adb Specific steps with root authority, comprising:
Step S201, by boot.img analytical tool to the boot.img file in the android system ROM packet into Row parsing, obtains default.prop file.
In embodiments of the present invention, boot.img file is the file that must be loaded when Android phone starting, Boot.img file parsing tool is a tool dedicated for parsing boot.img file, passes through instruction " mkboot Boot.img out " parses the boot.img file in android system ROM packet, is obtained by parsing Default.prop file.
Step S202 modifies to the parameter in the default.prop file, and the modification includes but is not limited to: Ro.secure parameter, ro.debuggable parameter, ro.adb.secure parameter.
In embodiments of the present invention, the ro.secure parameter in default.prop file, ro.debuggable parameter, Ro.adb.secure parameter is parameter relevant to adb, by ro.secure parameter, ro.debuggable parameter, The modification of ro.adb.secure parameter can open adb debug mode.
Modified default.prop file is bundled to the boot.img file by step S203, and will be described Boot.img file brush by packing enters the android system ROM packet.
In embodiments of the present invention, modified default.prop file can not directly make android system ROM Packet opens adb debug mode, it is therefore desirable to modified default.prop file is bundled in boot.img file, Android system ROM packet will be entered by the boot.img file brush being packaged by instruction " mkboot out newboot.img " In.
Step S102 establishes the communication connection of application software and android system.
The method for establishing the communication of application software and android system is more, in the present embodiment preferably such as under type:
Socket means of communication is imported in android system, and Socket Server process is opened by the adb; Socket Client is established in application software.
In embodiments of the present invention, Socket communication is the communication mode that two-way communication is carried out between two programs, Socket communication is being opened in the transmitting that data between two programs can be realized inside android system by Socket communication Later, Socket Server process is opened by adb, adb can receive the application program hair as Socket Client The data sent.Namely application software is communicated by Socket and sends adb for the root request of the application software.
Importing Socket means of communication can be for based on Android automated test frame Android UI Automator (peace Tall and erect automated test frame), in the present embodiment Android automated test frame Android UI can be based on by preset The tool of Automator imported into the android system ROM packet.
In embodiments of the present invention, Android Socket is integrated in the tool based on Android UI Automator Communication mechanism, therefore the tool imported into android system ROM packet can open Socket communication.
Step S103, application software send root request to the adb;
After after application software is established with system and to be communicated, root request can be sent to the adb.
Step S104 obtains the request message in the root request by parsing, and is pair according to the request message The application software answered executes root operation.
In embodiments of the present invention, adb parses the root request that application software is sent, the acquisition request from root request Message is that corresponding application software carries out root according to the request message, so that being embodied as single software provides root authority.
Wherein, the format of the request message are as follows: packet name@order.Such as: com.android.test@ls/data/ system。
The embodiment of the present invention, application software is to the adb after establishing the communication connection of application software and android system Root request is had sent, the request message in root request that system analysis obtains, and be pair according to the request message The application software answered executes root operation, is also achieved that application software obtains the purpose of root authority.Android of the invention Only have adb that there is root authority in system, the root of application software needs just to can be achieved by the audit of adb, avoids malice The case where sample extracts root authority using system vulnerability, reduces su file in android system, superuser.apk quilt The possibility of deletion, improves safety.
It is illustrated in figure 3 a kind of application software shown in an exemplary embodiment of the invention and obtains android system root The structure chart of the system of permission, the system comprises:
Boot.img parameter modifying unit 301, for modifying the boot.img parameter of android system ROM packet, to open The adb debug mode of the android system ROM packet, so that only adb has root authority.
In embodiments of the present invention, debug mode, that is, debugging mode, the adb with debug mode possess to Android The permission that system is debugged, by debugging, adb can make any application software possess root authority.Android system is root According to android system ROM operation, therefore by the boot.img parameter in modification android system ROM packet, can make Adb in android system ROM packet has debug mode.
It is illustrated in figure 4 a kind of application software shown in another exemplary embodiment of the present invention and obtains android system The structure chart of the system of root authority, the boot.img parameter modifying unit 301, comprising:
Default.prop file acquisition subelement 401, for passing through boot.img analytical tool to the Android system Boot.img file in system ROM packet is parsed, and default.prop file is obtained.
In embodiments of the present invention, boot.img file is the file that must be loaded when Android phone starting, Boot.img file parsing tool is a tool dedicated for parsing boot.img file, passes through instruction " mkboot Boot.img out " parses the boot.img file in android system ROM packet, is obtained by parsing Default.prop file.
Parameter modifies subelement 402, for modifying to the parameter in the default.prop file, the modification It include: ro.secure parameter, ro.debuggable parameter, ro.adb.secure parameter.
In embodiments of the present invention, the ro.secure parameter in default.prop file, ro.debuggable parameter, Ro.adb.secure parameter is parameter relevant to adb, by ro.secure parameter, ro.debuggable parameter, The modification of ro.adb.secure parameter can open adb debug mode.
It brushes into subelement 403, for modified default.prop file to be bundled to the boot.img file, And the boot.img file brush by being packaged is entered into the android system ROM packet.
In embodiments of the present invention, modified default.prop file can not directly make android system ROM Adb in packet has debug mode, it is therefore desirable to which modified default.prop file is bundled to boot.img file In, android system ROM will be entered by the boot.img file brush being packaged by instruction " mkboot out newboot.img " Bao Zhong.
Communication unit 302, for establishing the communication connection of application software and android system.
In the present embodiment, communication unit may include the first subelement, the second subelement, in which:
First subelement for importing Socket means of communication to android system, and is opened by the adb Socket Server process.
For example the preset tool based on Android automated test frame Android UI Automator is imported into institute State android system ROM packet.In embodiments of the present invention, it is based on Android UI Automator (Android automatic test frame Frame) tool in be integrated with Android Socket communication mechanism, therefore the tool is imported into android system ROM packet Socket communication can be opened.
In embodiments of the present invention, Socket communication is the communication mode that two-way communication is carried out between two programs, Socket communication is being opened in the transmitting that data between two programs can be realized inside android system by Socket communication Later, Socket Server process is opened by adb, adb can receive the program transmission as Socket Client Data.
Second subelement, for establishing Socket Client in the application software.
Root request transmitting unit 303, for sending root request from application software to the adb.
In embodiments of the present invention, Socket communication is in communication with each other two programs in android system, Therefore after establishing Socket Client in application software, it can be communicated by Socket and send conduct for root request The adb of Socket Server.
Root unit 304 for obtaining the request message in the root request by parsing, and disappears according to the request Breath is that corresponding application software executes root operation.
In embodiments of the present invention, adb parses the root request that application software is sent, the acquisition request from root request Message is that corresponding application software carries out root according to the request message, so that being embodied as single software provides root authority.
Wherein, the format of the request message are as follows: packet name@order.Such as: com.android.test@ls/data/ system。
The embodiment of the present invention, application software is to the adb after establishing the communication connection of application software and android system Root request is had sent, the request message in root request that system analysis obtains, and be pair according to the request message The application software answered executes root operation, is also achieved that application software obtains the purpose of root authority.Android of the invention Only have adb that there is root authority in system, the root of application software needs just to can be achieved by the audit of adb, avoids malice The case where sample extracts root authority using system vulnerability, reduces su file in android system, superuser.apk quilt The possibility of deletion, improves safety.
Those of ordinary skill in the art will appreciate that only being patrolled according to function for each unit included by above-described embodiment It volume is divided, but is not limited to the above division, as long as corresponding functions can be realized;In addition, each function list The specific name of member is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Those of ordinary skill in the art be further appreciated that implement the method for the above embodiments be can It is completed with instructing relevant hardware by program, the program can be stored in a computer-readable storage medium In, the storage medium, comprising: ROM/RAM, disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (8)

1. a kind of method that application software obtains android system root authority, which is characterized in that the method, comprising:
The boot.img parameter of android system ROM packet is modified, so that only adb has root authority;
Establish the communication connection of application software and android system;
Application software sends root request to the adb;
The request message in root request that parsing obtains, and be the execution of corresponding application software according to the request message Root operation.
2. the method as described in claim 1, which is characterized in that the communication link for establishing application software and android system The method connect, comprising:
Preset Socket means of communication is imported to android system, and Socket Server process is opened by the adb, Socket Client is created in the application software.
3. method according to claim 2, which is characterized in that the format of the request message are as follows: packet name@order.
4. method as claimed in any one of claims 1 to 3, which is characterized in that the modification android system ROM packet Boot.img parameter, the method for making adb have root authority include:
The boot.img file in the android system ROM packet is parsed by boot.img analytical tool, is obtained Default.prop file;
Modify to the parameter in the default.prop file, it is described modification include: ro.secure parameter, Ro.debuggable parameter, ro.adb.secure parameter;
Modified default.prop file is bundled to the boot.img file, and the process is packaged Boot.img file brush enters the android system ROM packet.
5. the device that a kind of application software obtains android system root authority, which is characterized in that the system, comprising:
Boot.img parameter modifying unit, for modifying the boot.img parameter of android system ROM packet, so that only adb has Root authority;
Communication unit, for establishing the communication connection of application software and android system;
Root request transmitting unit, for sending root request from application software to the adb;
Root unit is to correspond to for parsing the request message in the root obtained request, and according to the request message Application software execute root operation.
6. system as claimed in claim 5, which is characterized in that the communication unit includes the first subelement, the second subelement, Wherein:
First subelement for importing Socket means of communication to android system, and is opened by the adb Socket Server process;
Second subelement, for establishing Socket Client in the application software.
7. system as claimed in claim 6, which is characterized in that the format of the request message are as follows: packet name@order.
8. such as the described in any item systems of claim 5~7, which is characterized in that the boot.img parameter modifying unit, packet It includes:
Default.prop file acquisition subelement, for passing through boot.img analytical tool to the android system ROM packet In boot.img file parsed, obtain default.prop file;
Parameter modifies subelement, and for modifying to the parameter in the default.prop file, the modification includes: Ro.secure parameter, ro.debuggable parameter, ro.adb.secure parameter;
It brushes into subelement, for modified default.prop file to be bundled to the boot.img file, and by institute It states the boot.img file brush by packing and enters the android system ROM packet.
CN201710538867.6A 2017-07-04 2017-07-04 A kind of application software obtains the method and system of android system root authority Pending CN109241703A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710538867.6A CN109241703A (en) 2017-07-04 2017-07-04 A kind of application software obtains the method and system of android system root authority

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710538867.6A CN109241703A (en) 2017-07-04 2017-07-04 A kind of application software obtains the method and system of android system root authority

Publications (1)

Publication Number Publication Date
CN109241703A true CN109241703A (en) 2019-01-18

Family

ID=65083238

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710538867.6A Pending CN109241703A (en) 2017-07-04 2017-07-04 A kind of application software obtains the method and system of android system root authority

Country Status (1)

Country Link
CN (1) CN109241703A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473502A (en) * 2013-09-16 2013-12-25 惠州Tcl移动通信有限公司 Method and system for acquiring Root rights of android-based mobile terminal
CN104090751A (en) * 2014-06-10 2014-10-08 南靖万利达科技有限公司 Method for acquiring root authority in Android system
CN104506639A (en) * 2014-12-29 2015-04-08 北京奇虎科技有限公司 Root right acquiring method and device
CN105045625A (en) * 2015-07-17 2015-11-11 上海斐讯数据通信技术有限公司 Method for root authority management and control in Android platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473502A (en) * 2013-09-16 2013-12-25 惠州Tcl移动通信有限公司 Method and system for acquiring Root rights of android-based mobile terminal
CN104090751A (en) * 2014-06-10 2014-10-08 南靖万利达科技有限公司 Method for acquiring root authority in Android system
CN104506639A (en) * 2014-12-29 2015-04-08 北京奇虎科技有限公司 Root right acquiring method and device
CN105045625A (en) * 2015-07-17 2015-11-11 上海斐讯数据通信技术有限公司 Method for root authority management and control in Android platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
亿智蘑菇官方微信: "《boot.img拆包,修改adb具有root权限》", 《HTTP://WWW.YZMG.COM/NEWS/SHOW-15074.HTML 》 *

Similar Documents

Publication Publication Date Title
CN108650149B (en) Server testing method, device, equipment and computer readable storage medium
US7979532B2 (en) Systems and methods for using an access point for testing multiple devices and using several consoles
Lee et al. A sealant for inter-app security holes in android
CN105389263B (en) Application software authority monitoring method, system and equipment
CN107273748A (en) A kind of method that Android system Hole Detection is realized based on leak poc
Kim et al. BaseSpec: Comparative Analysis of Baseband Software and Cellular Specifications for L3 Protocols.
CN110602043A (en) API gateway implementation system and method for mobile application
CN110119350A (en) Software Development Kit test method, device and equipment and computer storage medium
Karim et al. Prochecker: An automated security and privacy analysis framework for 4g lte protocol implementations
Hussain et al. Noncompliance as deviant behavior: An automated black-box noncompliance checker for 4g lte cellular devices
CN110427752A (en) A kind of method, mobile terminal and the storage medium of sandbox monitoring application program
CN105975333B (en) The method and device of application program operation control
CN110096446A (en) SDK test platform, test macro and its test method
WO2022257927A1 (en) Key burning method and apparatus, electronic device board card, and storage medium
Fang et al. A static technique for detecting input validation vulnerabilities in Android apps
CN112528296A (en) Vulnerability detection method and device, storage medium and electronic equipment
Mladenov et al. Formal verification of the implementation of the MQTT protocol in IoT devices
CN104486292A (en) Enterprise-resource safety-access control method, device and system
KR101431192B1 (en) Method for Rooting Attack Events Detection on Mobile Device
CN103034811B (en) A kind of method, system and device of file process
Park et al. L2Fuzz: Discovering Bluetooth L2CAP vulnerabilities using stateful fuzz testing
CN111563260B (en) Android application program-oriented Web injection code execution vulnerability detection method and system
Choi et al. Large‐Scale Analysis of Remote Code Injection Attacks in Android Apps
CN109241703A (en) A kind of application software obtains the method and system of android system root authority
Veeraraghava Security analysis of vehicle to vehicle arada locomate on board unit

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190118

WD01 Invention patent application deemed withdrawn after publication