|
.TreeMenu_0 { margin-left:0px; text-align:left; line-height:135%; }
.TreeMenu_0 a { padding-left:4px; color:#444444; display:block; }
.TreeMenu_0 a:hover { color:#000000; }
.TreeNode_1 { padding-left:0px; }
.TreeNode_2 { padding-left:0px; }
.TreeNode_3 { padding-left:15px; }
.TreeNode_4 { padding-left:30px; }
.TreeNode_5 { padding-left:45px; }
.TreeNode_6 { padding-left:60px; }
.TreeNode_7 { padding-left:75px; }
.TreeNode_8 { padding-left:90px; }
.TreeNode_9 { padding-left:105px; }
.TreeNode_1 a { padding-left:12px; background:url(/main/themes/ns/css_Default/TreeNode0.gif) no-repeat; }
.TreeNode_2 a { padding-left:12px; background:url(/main/themes/ns/css_Default/TreeNode1.gif) no-repeat; }
.TreeNode_3 a { padding-left:12px; background:url(/main/themes/ns/css_Default/TreeNode2.gif) no-repeat; }
.TreeNode_4 a, .TreeNode_5 a, .TreeNode_6 a, .TreeNode_7 a, .TreeNode_8 a, .TreeNode_9 a { padding-left:12px; background:url(/main/themes/ns/css_Default/TreeNode3.gif) no-repeat; }
.TreeNode_1, .TreeNode_2, .TreeNode_3, .TreeNode_4, .TreeNode_5, .TreeNode_6, .TreeNode_7, .TreeNode_8, .TreeNode_9 { padding-top:2px; padding-bottom:2px; }
.TreeNode_1:hover, .TreeNode_2:hover, .TreeNode_3:hover, .TreeNode_4:hover, .TreeNode_5:hover, .TreeNode_6:hover, .TreeNode_7:hover, .TreeNode_8:hover, .TreeNode_9:hover { background:#dddddd; }
.TreeMenu_0 .ClassNum { color:#666666; }
.TreeMenu_0 .TreeNode_t { background:#aaaaaa; }
.TreeMenu_0 a.TreeItem_t { color:#ffffff; }
.TreeMenu_0 .ClassDesc { display:block; }
.TreeMenu_0 a { font-family:$BlogTreeItemFont$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
.TreeMenu_0 a:hover { color:$BlogTreeNodeHOverC$; }
.TreeNode_1:hover, .TreeNode_2:hover, .TreeNode_3:hover, .TreeNode_4:hover, .TreeNode_5:hover, .TreeNode_6:hover, .TreeNode_7:hover, .TreeNode_8:hover, .TreeNode_9:hover { background:$BlogTreeNodeHOverB$; }
.TreeMenu_0 a.TreeItem_t { color:$BlogTreeNodeTC$; }
.TreeMenu_0 .TreeNode_t { background:$BlogTreeNodeTB$; }
.TreeNode_1, .TreeNode_2, .TreeNode_3, .TreeNode_4, .TreeNode_5, .TreeNode_6, .TreeNode_7, .TreeNode_8, .TreeNode_9, .TreeNode_t { padding-top:$BlogTreeNodePadding$; padding-bottom:$BlogTreeNodePadding$; }
.TreeMenu_0 { border-bottom:$BlogTreeNodeBorderT$; }
.TreeNode_1, .TreeNode_2, .TreeNode_3, .TreeNode_4, .TreeNode_5, .TreeNode_6, .TreeNode_7, .TreeNode_8, .TreeNode_9, .TreeNode_t { border-top:$BlogTreeNodeBorderT$; }
.TreeMenu_0 { border-top:$BlogTreeNodeBorderB$; }
.TreeNode_1, .TreeNode_2, .TreeNode_3, .TreeNode_4, .TreeNode_5, .TreeNode_6, .TreeNode_7, .TreeNode_8, .TreeNode_9, .TreeNode_t { border-bottom:$BlogTreeNodeBorderB$; }
.TreeNode_1 a { background:$BlogTreeNodeImg1$ no-repeat; }
.TreeNode_2 a { background:$BlogTreeNodeImg2$ no-repeat; }
.TreeNode_3 a { background:$BlogTreeNodeImg3$ no-repeat; }
.TreeNode_4 a, .TreeNode_5 a, .TreeNode_6 a, .TreeNode_7 a, .TreeNode_8 a, .TreeNode_9 a { background:$BlogTreeNodeImg4$ no-repeat; }
.TreeNode_1 a { padding-left:$BlogTreeItem1Margin$; }
.TreeNode_2 a { padding-left:$BlogTreeItem2Margin$; }
.TreeNode_3 a { padding-left:$BlogTreeItem3Margin$; }
.TreeNode_4 a, .TreeNode_5 a, .TreeNode_6 a, .TreeNode_7 a, .TreeNode_8 a, .TreeNode_9 a { padding-left:$BlogTreeItemXMargin$; }
.TreeNode_4, .TreeNode_5, .TreeNode_6, .TreeNode_7, .TreeNode_8, .TreeNode_9 { float:$BlogTreeNode4Float$; }
.TreeNode_1, .TreeNode_2, .TreeNode_3 { clear:both; }
.TreeMenu_0 .ClassName { display:$BlogTreeNodeDispName$; }
.TreeMenu_0 { line-height:$BlogTreeNodeLineHeight$; }
.TreeMenu_0 .ClassNum { display:$BlogTreeNodeDispNum$; }
.TreeMenu_0 .ClassNum { font-family:$BlogTreeNodeFontNum$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
.TreeMenu_0 .ClassDesc { display:$BlogTreeNodeDispDesc$; }
.TreeMenu_0 .ClassDesc { font-family:$BlogTreeNodeFontDesc$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
.TreeMenu_0 .ClassImg { display:$BlogTreeNodeDispImg$; }
.TreeMenu_0 .ClassImg img { height:$BlogTreeNodeSizeImg$; }
.TreeMenu_0 .ClassImg img { margin-right:$BlogTreeNodeRightImg$; }
.TreeMenu_0 .ClassImg img { margin-bottom:$BlogTreeNodeBottomImg$; }
|
| | |
|
$XmlID$ $GroupName$ $CtrlBtn$
$html$
評論: $ChildNum$ 瀏覽: $ClickNum$
於 $Date$ $Time$ 發表
.dataBlogList { } /* MsgInfo Cell */
/* 上方類別選項 */
.BlogListMenu { width:100%; height:30px; text-align:center; line-height:100%; }
.BlogListMenuS { width:1px; background:#ff8844; } /* 選項間隔 */
.BlogListMenuL { width:10px; background:#ff8844; } /* 左邊 td */
.BlogListMenuR { width:10px; background:#ff8844; } /* 右邊 td */
.BlogListMenu0 { background:#ff8844; padding:0px; vertical-align:middle; } /* 選項屬性 */
.BlogListMenu0:hover { background:#ff4422; } /* 選項滑鼠觸碰 */
.BlogListMenu1 { background:#ff4422; padding:0px; vertical-align:middle; } /* 目前選項屬性 */
.BlogListMenu0 a , .BlogListMenu1 a { color:#ffffff; } /* 選項文字屬性 */
.BlogListN_1 { } /* 第一筆資訊 */
.BlogListD_0 { padding:5px; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; } /* 偶數筆資訊 */
.BlogListD_1 { padding:5px; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; } /* 奇數筆資訊 */
/* 資訊狀態列 */
.BlogListCtrlBtn { vertical-align:middle; width:100%; text-align:right; }
.BlogListCtrlBtn .OrdIdx { width:20px; text-align:right; border:1px solid #888888; padding:0px; margin:0px; height:16px; }
.BlogListCtrlBtn .MsgCmd { font-size:11px; border:1px solid #888888; padding:0px; margin:0px; height:18px; }
.BlogListCtrlBtn .XmlID { float:left; font-weight:bold; }
.BlogListCtrlBtn select { display:none; }
/* 資訊區 */
.BlogListHTML { }
/* 資訊區上方資訊 */
.BlogListHTML .BlogInfo1 { width:100%; color:#888888; margin-bottom:10px; border-bottom:1px solid #cccccc; }
.BlogListHTML .BlogInfoAuthor { float:right; } /* 作者 */
.BlogListHTML .BlogInfoClass { width:auto; text-align:left; color:#888888; } /* 類別 */
/* 資訊區下方資訊 */
.BlogListHTML .BlogInfo3 { width:100%; color:#888888; }
.BlogListHTML .BlogInfoStatus { float:right; }
.BlogListHTML .BlogInfoBtn { text-align:left; }
/* 資訊內文 */
#ns_Content .BlogListHTML .meMsg_MsgTitleBlk { margin-bottom:10px; } /* 區塊標頭 */
#ns_Content .BlogListHTML .meMsg_MsgBlk .meMsg_MsgTitle { } /* 主標題 */
#ns_Content .BlogInfoHTML .meMsg_Content { margin-top:10px; }
#ns_Content .BlogListHTML .meMsg_MsgContentBlk { margin-top:30px; } /* 內文段落 */
#ns_Content .BlogListHTML .meMsg_MsgURLList { margin:0px; padding:0px; } /* 相關網址 */
#ns_Content .BlogListHTML .meMsg_MsgURL { list-style:disc; margin-left:40px; } /* 相關網址 */
#ns_Content .BlogListHTML .meMsg_MsgFileList { margin:0px; padding:0px; } /* 相關檔案 */
#ns_Content .BlogListHTML .meMsg_MsgFile { list-style:disc; margin-left:40px; } /* 相關檔案 */
#ns_Content .BlogListHTML .meMsg_MsgFromEnd { } /* 期間 */
#ns_Content .BlogListHTML .meMsg_MsgListBlk { } /* 條列項目 */
#ns_Content .BlogListHTML img { max-width:100%; }
#ns_Content .BlogListHTML .ImgAlignLeft { margin-right:8px; } /* 圖文間距 */
#ns_Content .BlogListHTML .ImgAlignRight { margin-left:8px; } /* 圖文間距 */
/* 分頁控制列 */
.divPageCtrl { margin:10px; clear:both; }
.divPageCtrl table { margin-left:auto; margin-right:auto; }
/* 表格格式 */
.MsgRow1 { margin-top:10px; } /* 第一列 */
.MsgRowN { } /* 其他列 */
.MsgRowD0 { } /* 偶數列 */
.MsgRowD1 { } /* 奇數列 */
.MsgCell1 { padding:0px; } /* 最左欄 */
.MsgCellN { padding:0px; } /* 中間欄 */
.MsgCellX { padding:0px; } /* 最右欄 */
.MsgRGap { border:0px; margin-top:20px; margin-bottom:20px; } /* 列與列中間 */
.cssPagePanel { clear:both; } /* 控制面板列 */
.MsgRow1 { margin-top:$BlogListMsgRow1$; }
.BlogListList { padding-left:$BlogListMsgRowLR$; padding-right:$BlogListMsgRowLR$; }
.MsgRGap { margin-top:$BlogListMsgRGapN$; margin-bottom:$BlogListMsgRGapN$; }
.MsgCell1 { padding-right:$BlogListMsgCGapN$; }
.MsgCellN { padding-left:$BlogListMsgCGapN$; padding-right:$BlogListMsgCGapN$; }
.MsgCellX { padding-left:$BlogListMsgCGapN$; }
.MsgRGap { border-top:$BlogListRS$; }
.MsgCellN { border-left:$BlogListCS$; }
.MsgCellX { border-left:$BlogListCS$; }
.MsgRowD1 { background:$BlogListMsgRowD1$; }
.MsgRowD0 { background:$BlogListMsgRowD0$; }
.BlogListD_1 { background:$BlogListD1$; }
.BlogListD_0 { background:$BlogListD0$; }
.BlogListD_0 { border:$BlogListB$; }
.BlogListD_1 { border:$BlogListB$; }
.BlogListD_0 , .BlogListD_1 { background-image:$BlogListBgImg$; background-position:$pos$; background-repeat:$repeat$; }
.BlogListHTML { width:$BlogListHTMLWidth$; }
.BlogListHTML { margin-top:$BlogListHTMLTop$; }
.BlogListHTML .meMsg_MsgContentBlk.center { padding:$BlogListCntVGap$; margin-right:$BlogListCntVGap$; }
.BlogListHTML .meMsg_MsgContentBlk.left { padding:$BlogListCntVGap$; margin-right:$BlogListCntVGap$; }
.BlogListHTML .meMsg_MsgContentBlk.right { padding:$BlogListCntVGap$; margin-left:$BlogListCntVGap$; }
.BlogListHTML .meMsg_MsgContentBlk.center, .BlogListHTML .meMsg_MsgContentBlk.left, .BlogListHTML .meMsg_MsgContentBlk.right { border:$BlogListCntVB$; }
#ns_Content .meMsg_MsgBlk .meMsg_MsgTitle { font-family:$BlogListTextFont$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
#ns_Content .meMsg_MsgBlk .meMsg_Content { font-family:$BlogListHTMLFont$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
#ns_Content .meMsg_MsgURL { margin-left:$padding$; color:$color$; font-size:$size$; list-style:$BlogListFileSpot$ $pos$ $img$; }
#ns_Content .meMsg_MsgFile { margin-left:$padding$; color:$color$; font-size:$size$; list-style:$BlogListFileSpot$ $pos$ $img$; }
#ns_Content .meMsg_MsgURL a { font-family:$BlogListFileFont$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
#ns_Content .meMsg_MsgFile a { font-family:$BlogListFileFont$; color:$color$; font-size:$size$; font-style:$style$; font-weight:$weight$; }
.BlogListHTML .BlogInfo1 { border-bottom:$BlogListB1$; }
#ns_Content .meMsg_MsgBlk .meMsg_Content { border-top:$BlogListTextHTMLS$; }
.BlogInfoClass { display:$BlogInfoClass$; }
.BlogInfoAuthor { display:$BlogInfoAuthor$; }
.BlogInfo { display:$BlogInfo$; }
.BlogDisp { display:$BlogDisp$; }
.BlogInfoStatus { display:$BlogInfoStatus$; }
.BlogListHTML .BlogListDate { display:$BlogInfoDT$; }
#ns_Content .BlogListHTML .meMsg_MsgContent { display:$BlogContBlk$; }
#ns_Content .BlogListHTML .meMsg_MsgURLList { display:$BlogContBlk$; }
#ns_Content .BlogListHTML .meMsg_MsgFileList { display:$BlogContBlk$; }
#ns_Content .BlogListHTML .meMsg_MsgFromEnd { display:$BlogContBlk$; }
#ns_Content .BlogListHTML .meMsg_MsgListBlk { display:$BlogContBlk$; }
.divPageCtrl { display:$PageCtrlDisp$; }
導向 Ubuntu 的 Apache2 http://..ip.. 至指定 https://domainnamejoe /etc/apache2/sites-available/000-default.conf [code] <VirtualHost *:80>... RewriteEngine on RewriteRule ^ https://domainname/ [END,NE,R=permanent] </VirtualHost>[/code]
|
14430導向 Ubuntu 的 Apache2 http://..ip.. 至指定 https://domainname2024-11-3016:35:101aWayMsgArticle
ZC1081
ZC1081
1
1
0
212
aWay
0
0
/main/wdb2/images/1x1.gif
|
啟用 ErrorDocument 404 顯示空白頁編輯 joe /etc/httpd/conf/httpd.conf [code] AllowOverride All [/code]
cd DOCUMENT_ROOT
編輯 joe .htaccess [code] ErrorDocument 404 /blank.html [/code]
新增 touch blank.html
service httpd restart |
13978啟用 ErrorDocument 404 顯示空白頁2024-06-0718:18:141aWayMsgArticle
ZC1081
ZC1081
2
0
0
296
aWay
0
0
/main/wdb2/images/1x1.gif
|
關閉 /cgi-bin/ 目錄編輯 joe /etc/httpd/conf/httpd.conf [code] #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" [/code] service httpd restart
|
13977關閉 /cgi-bin/ 目錄2024-06-0718:12:351aWayMsgArticle
ZC1081
ZC1081
3
1
0
277
aWay
0
0
/main/wdb2/images/1x1.gif
|
移除 robots.txt 檔案移除 robots.txt 檔案 移除 robots.txt 檔案 移除 robots.txt 檔案 |
13976移除 robots.txt 檔案2024-06-0717:54:451aWayMsgArticle
ZC1081
ZC1081
4
0
0
235
aWay
0
0
/main/wdb2/images/1x1.gif
|
關閉 httpd TRACE 與 TRACK編輯 joe /etc/httpd/conf/httpd.conf [code] TraceEnable off [/code] 測試 curl -v -X TRACE https://xxx.xxx.xxx |
13975關閉 httpd TRACE 與 TRACK2024-06-0717:07:381aWayMsgArticle
ZC1081
ZC1081
5
1
0
240
aWay
0
0
/main/wdb2/images/1x1.gif
|
修正 SSL TLS 1.0, 1.1 問題[code] SSLEngine on SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 SSLHonorCipherOrder off SSLOptions +StrictRequire LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"" vhost_combined LogFormat "%v %h %l %u %t "%r" %>s %b" vhost_common [/code]
驗證網址 https://www.ssllabs.com/
|
13974修正 SSL TLS 1.0, 1.1 問題2024-06-0712:13:391aWayMsgArticle
ZC1081
ZC1081
6
0
0
216
aWay
0
0
/main/wdb2/images/1x1.gif
|
用 namp 查詢 Apache 版本。[code] nmap -sV hostname.com [/code]
隱藏 Apache 版本設定 joe /etc/httpd/conf/httpd.conf [code] ServerTokens Prod ServerSignature Off [/code] |
13035用 namp 查詢 Apache 版本。2024-02-2813:11:201aWayMsgArticle
ZC1081
ZC1081
7
1
0
264
aWay
0
0
/main/wdb2/images/1x1.gif
|
關於 ZAP 弱掃報告的 Secure Header 問題(2)依照上一篇「關於 ZAP 弱掃報告的 Secure Header 問題(1)」的設定,網頁必定跑版。 如果修改如下: [code] script-src 'self' 'unsafe-inline' 'nonce-xxx'; \ style-src 'self' 'unsafe-inline' 'nonce-xxx'; \ [/code] 加上 'unsafe-inline' 可以解決跑版問題,但是 ZAP 弱掃報告會出現兩條缺失: [code] script-src unsafe-inline style-src unsafe-inline [/code] 這意思就是不能用 unsafe-inline。 當移除 unsafe-inline 之後,如果網頁中有 [code] <script>... </script><style type='text/css'>... </style>[/code] 可以加 nonce 解決: [code] <script nonce='xxx'> ... </script><style type='text/css' nonce='xxx'>... </style>[/code] 然後要注意以下幾點: 1.網頁原始碼的 HTML 裡頭,不能有 style='...' 或 onClick='...' 等等 event 的設定,這些都會被瀏覽器阻擋,可以使用 class='...',然後將 css 設定在 style 加 nonce='xxx' 的段落裡頭。 2.如果用 js 執行 obj.innerHTML=s; 或 $(obj).html(s); 動態載入 HTML,則 s 裡頭也不能有 style='...' 或 onClick='...' 等等 event 的設定,這些也會被瀏覽器阻擋,但是 s 裡頭可以使用 class='...',然後要改用 em=$(s); em.css(...); em.click(...); $(obj).html(em); 才能正常載入。 3.在 js 裡頭不能使用 eval(...); 函式。
由於以下格式無法使用 [code] <xxx style='display:none;'>[/code] 必須改為以下格式才會隱藏 [code] <style type='text/css' nonce='xxx'>.linka { display:none; };;</style><xxx class='linka'>[/code]
因此 $('xxx').show(); 會無法直接顯示,必須改為 [code] $('xxx').removeClass('linka').show();;;[/code]
所有的 form 表單都必須加一個 [code] <input type=hidden name='CSRFToken' value='xxxx'>[/code] 其中 xxxx 必須隨機產生,通常在 php 用 md5 計算 time(),並且存在 $_SESSION 裡頭 [code] $_SESSION['CSRFToken'] = md5(time());;;[/code] 等 form submit 之後,在 php 再驗證是否正確。
|
113關於 ZAP 弱掃報告的 Secure Header 問題(2)2023-04-2217:58:251aWayMsgArticle---
ZC1081
ZC1081
8
0
總覽
0
805
aWay
0
0
/main/wdb2/images/1x1.gif
|
關於 ZAP 弱掃報告的 Secure Header 問題(1)如果 ZAP 弱掃報告指出一堆關於 Secure Header 的問題,以 Apache+PHP 為例,可以設定如下: 1.編輯 /etc/httpd/conf.d/secure.conf [code] header unset X-Powered-By ServerTokens Prod ServerSignature Off Header always append X-Frame-Options "SAMEORIGIN " Header always append Frame-Options "SAMEORIGIN" Header always append STRICT-TRANSPORT-SECURITY "max-age=16070400; includeSubDomains" Header always append X-XSS-Protection "1;mode=block" Header always append X-Content-Type-Options "nosniff" Header always append Content-Security-Policy " \ default-src 'self'; \ script-src 'self' 'nonce-xxx'; \ style-src 'self' 'nonce-xxx'; \ img-src 'self'; \ frame-src 'self'; \ frame-ancestors 'self'; \ form-action 'self'; \ " Header always append Permissions-Policy " \ geolocation=(),microphone=(),camera=(),payment=(),magnetometer=() \ " Header always append Referrer-Policy "strict-origin-when-cross-origin" Header always edit Set-Cookie ^(.*)$ "$1;Secure;SameSite=Lax" [/code] 2.必須停用 404 轉址,以下在 .htaccess 設定的 404 轉址設定不能使用,因為 404 轉址會導致 ZAP 的弱掃報告出現一個屬於「中風險」的「發現隱藏檔案」缺失,這有點不知 ZAP 在想什麼。 [code] ErrorDocument 404 /Error404.php [/code] 3.編輯 /etc/php.ini [code] expose_php = Off session.cookie_httponly = 1 session.cookie_samesite = Lax [/code] 4.編輯 /etc/httpd/conf.d/autoindex.conf [code] #Alias /icons/ "/usr/share/httpd/icons/" [/code] 重新啟動 Apache [code] service httpd restart [/code]
|
112關於 ZAP 弱掃報告的 Secure Header 問題(1)2023-04-2217:49:061aWayMsgArticle---
ZC1081
ZC1081
9
1
總覽
0
721
aWay
0
0
/main/wdb2/images/1x1.gif
|
| |
| | |
|
|
| |