SoFunction
Updated on 2025-02-28

JavaScript Modify Registry Instance Code

Registry instructions for security settings:

Registry path:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones

1. The Zones item contains items represented as each security zone defined by the computer. By default, the following 5 regions are defined (numbered from 0 to 4):

Value

  ------------------------------

0                                                                                                                              �

1

2                                                                                                                              �

3

4

Note: By default, My Computer does not appear in the Area box of the Security tab.

Each of them contains the following DWORD value to represent the corresponding settings on the Custom Security tab.

Note: Unless otherwise stated, each DWORD value is equal to 0, 1, or 3. Generally, setting to 0 will set the specific operation to allow; setting to 1 will cause a prompt; setting to 3 will prohibit the specific operation.

2. Value setting instructions:

Value
  -----------------------------------------------------------------------
1001
1004
1200
1201
1206        Scripts that allow Internet Explorer Webbrowser controls
1400
1402
1405         Execute scripts on ActiveX controls marked as safe to execute scripts
1406         Accessing data resources through domain
1407
1601            Submit non-encrypted form data
1604              Font Download
1605            Run Java
1606              Continuous use of user data
1607
1608                                                                                                                           �
1609                                                           �
1800
1802               Drag or drop or copy and paste files
1803
1804                      Loading programs and files in
1805             Loading programs and files in the web view
1806              Loading applications and unsafe files
1807
1808                                                                                                                           �
1809
1A00
1A02                                                           �
1A03
1A04
1A05                                                                                                                           �
1A06                                                                                                                           �
1A10          Privacy Settings *
1C00
1E05
 
1F00
 
2000             Binary and script behavior
2001
2004
2100             Open a file based on content, not based on file extensions  **
2101                                                           �
2102                                                                                                                           �
2200              Automatic prompt for file download  **
2201                ActiveX    Automatic prompt for control **
2300                                                           �
{AEBA21FA-782A-4A90-978D-B72164C80120}        First Party   Cookie   *
{A8A88C49-5EB2-4990-A1A2-0876022C854F}                                          �

*   Indicates that Internet   Explorer   6   or later settings

**   Indicates that Windows   XP   Service   Pack   2   or later settings

3. The setting of "Prohibit script debugging (others)" in IE browser->Properties->Advanced is in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Disable Debugger (0To enable,1Forbidden)

4. The "Prohibit script debugging (IE)" setting in the registry is located at the location in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\ Disable DebuggerIE (0To enable,1Forbidden)

5. Modify the default security level of IE:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3

Modify "MinLevel" to "10000" (hexadecimal), so that it can be set to a lower security level.

6. Attached Example of modifying the registry:

< language= >
<!-- 
var WshNetwork = new ActiveX ("W .Network");
ComputerName=+"/"+;
//Read the computer name in the registryvar obj = new ActiveX ("W .Shell");
var path="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones";//Register for security settings pathvar advance="HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main";//Register for Advanced Settings Pathvar forward="http://10.149.4.14:9080/sundun_nn/";//The page you jumped to after the modification is successfulvar levelPath="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones";
//Add the website to a trusted sitevar savePath="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains";//Add registry path to trusted sitevar domain="";//domain namevar protocol="http";//protocolvar qianz="www";//Prefix(savePath+"\\"+domain,"");
(savePath+"\\" + domain + "\\"+qianz,"");
(savePath+"\\" + domain + "\\"+qianz+"\\"+protocol,"2","REG_DWORD");
//IE browser—>Tools—>Internet options—>Security—>Local intranet—>Show mixed contentvar str0=path+"\\1\\1609";
//alert((str0));
if((str0)!='0'){//Skip if it has been modified    (str0,0x00000000,"REG_DWORD");
}
//Modify the default security level of IEvar levelStr=levelPath+"\\2\\MinLevel";
if((levelStr)!='10000'){
    (levelStr,"10000");
}
//IE browser -> Tools -> Internet Options -> Security -> Trusted Sites -> Display Mixed Content avar str11=path+"\\2\\1609";
if((str11)!='0'){
    (str11,0x00000000,"REG_DWORD");
}
var str12=path+"\\2\\1001";//Download signed ActiveX controlsif((str12)!='0'){
    (str12,0x00000000,"REG_DWORD");
}
var str13=path+"\\2\\1004";//Download unsigned ActiveX controlsif((str13)!='0'){
    (str13,0x00000000,"REG_DWORD");
}
var str14=path+"\\2\\1200";//Run ActiveX controls and pluginsif((str14)!='0'){
    (str14,0x00000000,"REG_DWORD");
}
var str15=path+"\\2\\1201";//Initialize and script run ActiveX controls that are not marked as safeif((str15)!='0'){
    (str15,0x00000000,"REG_DWORD");
}
var str16=path+"\\2\\1405";//Execute scripts on ActiveX controls marked as safe to execute scriptsif((str16)!='0'){
    (str16,0x00000000,"REG_DWORD");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>ActiveX control automatic promptvar str2=path+"\\3\\2201";
if((str2)!='0'){
    (str2,0x00000000,"REG_DWORD");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>Execute scripts on ActiveX controls marked as safely executable scriptsvar str3=path+"\\3\\1405";
if((str3)!='0'){
    (str3,0x00000000,"REG_DWORD");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>Show mixed contentvar str4=path+"\\3\\1609";
if((str4)!='0'){
    (str4,0x00000000,"REG_DWORD");
}
//IE browser—>Tools—>Internet options—> "Prohibit script debugging (others)" in Advancedvar str5=advance+"\\Disable Debugger";
if((str5)!='0'){
    (str5,"yes");
}
//IE browser—>Tools—>Internet options—> "Prohibit script debugging (IE)" in Advancedvar str6=advance+"\\Disable DebuggerIE";
if((str6)!='0'){
    (str6,"yes");
}
//IE browser—> Tools—> Internet Options—> Advanced "Allow active content to run files on my computer"var str7=advance+"\\FeatureControl\\FEATURE_LOCALMACHINE_LOCKDOWN\\";
if((str7)!='0'){
    (str7,0x00000000,"REG_DWORD");
}
</ >

Example:

 try{ 
var obj = new ActiveX ("W .Shell");
var path="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";//Register for security settings pathvar advance="HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main";//Register for Advanced Settings Pathvar levelPath="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones";
var zspath="HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\WinTrust\\Trust Providers\\Software Publishing";
//Download signed ActiveX controlsvar str1=path+"\\Zones\\3\\1001";
if((str1)!='0'){
 (str1,0x00000000,"REG_DWORD");
 alert("Download signed ActiveX controls");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>ActiveX control automatic promptvar str2=path+"\\Zones\\3\\2201";
if((str2)!='0'){
 (str2,0x00000000,"REG_DWORD");
 alert("ActiveX controls are automatically prompted");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>Execute scripts on ActiveX controls marked as safely executable scriptsvar str3=path+"\\Zones\\3\\1405";
if((str3)!='0'){
 (str3,0x00000000,"REG_DWORD");
 alert("Execute scripts on ActiveX controls marked as safe to execute scripts");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>Show mixed contentvar str4=path+"\\Zones\\3\\1609";
if((str4)!='0'){
 (str4,0x00000000,"REG_DWORD");
 alert("Show mixed content");
}
//IE browser -> Tools -> Internet Options -> Security -> Internet -> No prompt to select a customer certificate when there is no certificate or only one certificatevar str5=path+"\\Zones\\3\\1A04";
if((str5)!='0'){
 (str5,0x00000000,"REG_DWORD");
 alert("Not prompted to select a client certificate when there is no certificate or only one certificate");
}
//IE browser—>Tools—>Internet options—>Security—>Internet—>Submit non-encrypted form datavar str6=path+"\\Zones\\3\\1601";
if((str6)!='0'){
 (str6,0x00000000,"REG_DWORD");
 alert("Submit non-encrypted form data");
}
}catch(e){
 alert("Please set "Initialize and script run for ActiveX controls that are not marked as secure" in your browser's Internet options to "Enable"!\n\n Then refresh this page to log in!"); 
}

Summarize

The above is the JavaScript registry instance code introduced to you by the editor. I hope it will be helpful to everyone!