当前位置:网站首页>Method of realizing program startup and self startup through registry
Method of realizing program startup and self startup through registry
2022-07-26 23:55:00 【Red blue red】
List of articles
One 、 Preface
generally speaking , After the Trojan or virus runs successfully on the server , One thing I will do is to add myself to the boot item , To achieve persistent residence on the target server .
To achieve self startup , There are several ways , Have a task plan 、 service 、 Registration Form . Task planning is relatively , More obvious , It is easy to be found by the administrator , And service , It's not universal , For example win10 and win8 Services that can be generated directly on , stay win7 And the following operating systems are often not used . And the safest way is to realize self startup by modifying the registry . The advantage of this method is , Applicable to the full version windows System , So the most stable .
Some people may have questions , I'm not a hacker , Why learn this ? It's very simple , As a penetration tester , It is a necessary skill to check the existence of viruses and Trojans in the system , Many virus Trojans are made immune , It's difficult to identify by anti-virus software alone , Therefore, you need to check manually , The startup item is one of the items to be checked , Therefore, only to understand its attack methods , To know how to clean it up and take defensive measures .
Two 、 There are two ways to modify the registry
There are two main ways to modify the registry , One is to modify manually in the graphical interface , The other is to use the command line to operate , This requires a certain understanding of the relevant commands . Next, demonstrate one by one as follows .
( One ) Manually modify the registry
First enter... On the command line :
regedit
After opening the registry , Locate in the following position :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
On the desktop 1.exe File as an example , stay run Create a new one on the right A string value , Take any name , I'm going to set it to zero aaa. First of all to see 1.exe Path to file :
C:\Users\ASUS\Desktop\1.exe
Then double click. aaa And change its value to :
"C:\Users\ASUS\Desktop\1.exe" /start

Then open the task manager , stay start-up You can see in the module ,1.exe Has been added to the startup item .
( Two ) The command line modifies the registry
The main way to modify the registry through the command line is to use reg Command to change .
You can enter the following commands on the command line to view help :
reg /?

One of the parameters we need to use is :
reg add
This means adding or modifying . If there is nothing, it will increase , The existing ones cover ( Name and type ). The syntax of this command and the meaning of its parameters can be entered on the command line :
reg add /?

Here are two things we need to pay attention to , First , The path should be enclosed in double quotation marks , secondly , There is a space after the double quotation marks , After the space /start Parameters .
The construction statement is as follows :
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v bbb /t REG_SZ /d "\"C:\Users\ASUS\Desktop\1.exe\" /start" /f
Be careful ,/d All the contents in the double quotation marks after the parameter indicate that you want to write bbb Key content , Because this parameter will recognize double quotation marks , So escape is used here . meanwhile , Spaces are also enclosed in double quotes , Therefore, there is no need to deal with it separately .
Note that it is best to run the command prompt as an administrator when modifying the registry , In order to avoid the situation of insufficient authority .
Check the registry :
Command executed successfully !
3、 ... and 、 Query registry key value
Use the following command :
reg query
I don't know the syntax of this command , No problem , Use the following command to query help :
reg query /?

Use this syntax , We can query the key value just generated :
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v bbb

Four 、 Summary
This article shares two ways to modify the registry to realize the automatic operation of the specified program , At the same time, we share the query methods of registry keys , I hope it is helpful for everyone to learn penetration testing .
边栏推荐
猜你喜欢

2. Realize the map of navigation bar and battle page

1. Configuration environment and project creation

At 12:00 on July 17, 2022, the departure of love life on June 28 was basically completed, and it needs to rebound

第二部分—C语言提高篇_12. 动/精态库的封装和使用

上千Tile的倾斜模型浏览提速,告别一块一块往外蹦的尴尬

Paging plug-in -- PageHelper

【2016】【论文笔记】差频可调谐THz技术——

【C语言】经典的递归问题

In depth interpretation of the investment logic of the consortium's participation in the privatization of Twitter

Meeting OA my meeting
随机推荐
Dynamic SQL
07 design of ponding monitoring system based on 51 single chip microcomputer
Public cloud security and compliance considerations
18. Opening and saving file dialog box usage notes
NFT展示指南:如何展示你的NFT藏品
Meeting OA my meeting
Typescript notes
08_ Event modifier
Paging plug-in -- PageHelper
Galaxy securities online account opening commission, is online account opening safe for customer managers
Azure Synapse Analytics 性能优化指南(4)——使用结果集缓存优化性能
[C language] array
[shader realizes shine effect _shader effect Chapter 3]
C language array
Three effective strategies for the transformation of data supply chain to be coordinated and successful
The NFT market pattern has not changed. Can okaleido set off a new round of waves?
Part II - C language improvement_ 11. Pretreatment
[H5 bottom scrolling paging loading]
1. Configuration environment and project creation
Part II - C language improvement_ 7. Structure