此篇介紹 URL Rewrite 的運用,利用 URL Rewrite 來附加追蹤程式碼,例如:GA 等。或是某些頁面添加一些特定 javascript code
IIS 關閉不安全的 SSL 加密方式(Cipher)
因為 3DES 加密沒有關閉,導致了這個問題,以下是檢測報告的資料。
Insecure Transport: Weak SSL Cipher ( 11285 )
Summary
WebInspect has detected support for weak TLS/SSL ciphers on server https://xxx.xxx.xx:443/
.
The Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols provide a mechanism to help protect authenticity, confidentiality and integrity of the data transmitted between a client and web server. The strength of this protection mechanism is determined by the authentication, encryption and hashing algorithms, collectively known as a cipher suite, chosen for the transmission of sensitive information over the TLS/SSL channel. Most Web servers support a range of such cipher suites of varying strengths. Using a weak cipher or an encryption key of insufficient length, for example, could allow an attacker to defeat the protection mechanism and steal or modify sensitive information.
If misconfigured, a web server could be manipulated into choosing weak cipher suites. Recommendations include updating the web server configuration to always choose the strongest ciphers for encryption.
透過 IIS 來設定 Hidden Segments
此篇提到了網站的目錄不受保護,或者說是敏感性資料夾名稱;簡單說就是整個網站系統有幾個資料夾被使用者得知。
Web Server Misconfiguration: Unprotected Directory ( 10224 )
Summary
IIS/Microsoft product directories were discovered within your web application during a Directory Enumeration scan. Risks associated with an attacker discovering a directory on your application server depend upon what type of directory is discovered, and what types of files are contained within it. The primary threat, other than accessing files containing sensitive discovered, and what types of files are contained within it. The primary threat, other than accessing files containing sensitive information, is that an attacker can utilize the information discovered in that directory to perform other types of attacks. Recommendations include restricting access to important directories or files by adopting a “need to know” requirement for both the document and server root, and turning off features such as Automatic Directory Listings that provide information that could be utilized by an attacker when formulating or conducting an attack.
在 IIS 設定 HSTS 標頭
HSTS 對於公司專案內的部分單位而言幾乎是毫無作用,因為使用的瀏覽器不支援,所以此次被掃出來。
Insecure Transport: HSTS not Set ( 11365 )
Summary
Http Strict Transport Security (HSTS) policy enables web applications to enforce web browsers to restrict communication with the server over an encrypted SSL/TLS connection for a set period. Policy is declared via special Strict Transport Security response header. Encrypted connection protects sensitive user and session data from attackers eavesdropping on network connection.
Consider following attack scenarios:
Users often omit the URI scheme i.e.
https:\\
when typing a URL in location bar to access a website. Also third party websites can link to the site using the “http” scheme instead of “”https”. This could result in an initial connection to a HTTPS-enabled site over an unencrypted channel. An eavesdropping attacker can hijack this unencrypted connection and replace the intended use of HTTPS protocol with HTTP in an attack known as SSLStrip, granting unauthorized access to all subsequent traffic.Websites often transfer non-sensitive resources such as help documents over an unencrypted HTTP connection. Any cookies without a secure flag are sent along with such requests potentially disclosing sensitive user and session data to eavesdropper.
Man-in-the-Middle attacks that exploit user tendencies to override invalid certification warnings, e.g. SSLSniff.
For web sites configured with an accurate HSTS policy, browsers automatically upgrade any HTTP connections to HTTPS. Furthermore, browsers prevent users from overriding any host certificate warnings. HSTS offers an effective defense against above attack scenarios.
Cache-Control 在 IIS 上的設定
前陣子公司專案由第三方弱掃,接下來的筆記就會紀錄多個專案都有的問題點
Cache Management: Insecure Policy ( 11306 )
Summary
WebInspect has detected a potentially unsafe cache control policy for secure content. While content transmitted over an SSL/TLS channel is expected to guarantee confidentiality, administrators must nonetheless ensure that caching of sensitive content is disabled unless absolutely needed. The misconception that secure content caching is disabled by default by user-agents could cause the application to fail the organization’s cache policy by leaving the secure content cacheable by browsers. Unsafe specification such as Cache-Control: public would instruct the browser to persistently cache the content on the hard drive. Caching can be prevented by specifying one of the following three directives in the response headers
· Cache-control: private
· Cache-Control: no-cache
· Cache-Control: no-store
CSS Grid 筆記 21-Flexbox vs CSS Grid
此篇是透過幾個不同的練習範例,運用 flexbox 或是 css grid 來達成目標結果