11/27/2023

win11 cannot open security panel - fix issue with powershell cmd

type "powershell" in search bar and choose run with admin and type in following cmd:

 Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage


secure more for win11 login

 @echo off

REM *** Make sure to run this script with administrative privileges ***


REM *** Backup the registry ***

reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System backup.reg


REM *** Modify the registry ***

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v dontdisplaylastusername /t REG_DWORD /d 1 /f


echo Registry modification complete.


REM *** Optional: Display the modified registry key ***

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v dontdisplaylastusername


pause


11/22/2023

如何將 NIST 網路安全框架套用到您的系統上

 要將 NIST 網路安全框架套用到您的系統上,您可以遵循以下步驟:


步驟 1:評估系統的現狀


首先,您需要評估您的系統的現狀,包括其安全措施、風險和漏洞。您可以使用各種工具和方法來進行評估,例如:


資訊安全風險評估:資訊安全風險評估是一種系統性的方法,用於識別和評估系統面臨的安全風險。

滲透測試:滲透測試是一種模擬攻擊者嘗試入侵系統的過程,以識別系統的安全漏洞。

資訊安全診斷:資訊安全診斷是一種全面的評估,用於識別系統的安全問題。

在進行評估時,您需要關注以下方面:


系統的資產和資訊:您需要識別系統中的重要資產和資訊,包括數據、應用程式和系統。

系統面臨的風險:您需要識別系統面臨的安全風險,包括自然災害、人為錯誤和惡意攻擊。

系統的安全措施:您需要評估系統現有的安全措施,包括防火牆、入侵偵測系統和安全策略。

步驟 2:制定改進計劃


根據評估結果,您需要制定改進計劃,以提高系統的安全性。改進計劃應包括以下內容:


具體的目標和措施:您需要明確改進計劃的目標,並制定具體的措施來實現目標。

責任人和時間表:您需要指定每項措施的責任人和時間表。

評估和監控機制:您需要制定評估和監控機制,以確保措施得到有效實施。

在制定改進計劃時,您需要考慮以下因素:


組織的風險承受能力:您需要根據組織的風險承受能力,制定合理的改進計劃。

組織的資源能力:您需要根據組織的資源能力,制定可行的改進計劃。

步驟 3:實施改進措施


根據改進計劃,您需要實施改進措施。在實施過程中,您需要進行定期評估,以確保措施得到有效實施。


在實施改進措施時,您需要注意以下事項:


充分溝通:您需要充分溝通改進措施的內容和目的,以獲得組織成員的理解和支持。

逐步推進:不要試圖一次性實施所有改進措施。您需要根據組織的情況,逐步推進改進措施,以確保措施得到有效實施。

步驟 4:持續監控和改進


資訊安全是一個持續的過程。您需要持續監控系統的安全性,並根據需要進行改進。


在持續監控時,您需要關注以下方面:


系統的安全狀態:您需要定期評估系統的安全狀態,以確保系統的安全性。

新的安全威脅:您需要關注新的安全威脅,並採取措施應對新的安全威脅。

在改進時,您需要根據監控結果,制定新的改進措施,以保持系統的安全性。


以下是一些具體的實施步驟建議:


識別功能域


建立資產清單,包括數據、應用程式和系統等。

使用風險評估方法,識別系統面臨的安全風險。

保護功能域


實施防火牆、入侵偵測系統和安全策略等安全控制。

管理系統的訪問權限,並定期進行身份驗證和授權。

偵測功能域


監控系統的環境,以識別可能的安全威脅或事件。

使用安全監控和事件管理系統,收集和分析安全事件。

回應功能域


制定安全事件響應計劃,以在發生安全威脅或事件時採取措施。

建立應急計劃,以應對自然災害等意外事件。

復原功能域


制定災難復原計劃,以在發生災難時恢復系統和資訊。

11/14/2023

What is CORS

 CORS stands for Cross-Origin Resource Sharing. It is a security feature implemented by web browsers to control how web pages in one domain can request and interact with resources hosted on another domain.


In a web application, a web page often makes requests to a different domain for resources such as images, stylesheets, scripts, or data through XMLHttpRequest or Fetch API. However, due to the same-origin policy enforced by web browsers, these requests are typically restricted to the same domain for security reasons.


CORS allows a server to specify who can access its resources and under what conditions. It involves both server-side HTTP headers and client-side JavaScript APIs.


Here's a brief overview of how CORS works:


Client-Side (Browser): When a web page makes a cross-origin request using JavaScript (e.g., through XMLHttpRequest or Fetch API), the browser adds an "Origin" header to the request, indicating the origin (domain, protocol, and port) of the requesting site.


Server-Side (Server): The server then needs to handle this request and include appropriate CORS headers in the response. These headers include:


Access-Control-Allow-Origin: Specifies which origins are allowed to access the resource. It can be a specific origin, a comma-separated list of origins, or a wildcard (*) indicating that any origin is allowed.

Access-Control-Allow-Methods: Specifies the HTTP methods (e.g., GET, POST) that are allowed when accessing the resource.

Access-Control-Allow-Headers: Specifies which HTTP headers can be used when making the actual request.

Access-Control-Allow-Credentials: Indicates whether the browser should include credentials (like cookies or HTTP authentication) when making the actual request.

Access-Control-Expose-Headers: Specifies which headers should be exposed to the browser in the response.

Preflight Requests: For certain types of requests (e.g., those with certain methods or headers), the browser may send a preflight request (an HTTP OPTIONS request) to the server to check if the actual request is safe to send. The server responds with the appropriate CORS headers to indicate whether the actual request should proceed.


CORS is an important security feature that helps prevent malicious websites from making unauthorized requests on behalf of a user. It enables controlled sharing of resources across different origins while maintaining security on the web.

11/08/2023

前端簡單防禦機制 JS 防止按右鍵 與 開發者模式

<script type="text/javascript">

document.onkeydown = function (event) {

     event = (event || window.event);

     if (event.keyCode == 123 || event.keyCode == 18)

     {

           return false;

     }

}

document.addEventListener('contextmenu', event => event.preventDefault());

</script>



chatGPT:

  <script>

    document.oncontextmenu = document.onkeydown = function(e) {

      if (e.keyCode === 123 || e.type === 'contextmenu') {

        e.preventDefault();

      }

    };

  </script>