原則上 ssh port 能不要全部開啟事最好的,如果一定要開啟的話,必需要作些防護措施,
port 22 一旦開啟後最容易遇到的就是會有人不斷的try密碼
設計原理:
- 抵擋 ssh 暴力攻擊
- 如果連續攻擊3次以上則抵擋
- 利用 TCP-Wrapper 偵測是否有登入失敗 ,有失敗才執行shell
Continue reading “[Linux] 防 ssh 暴力攻擊 使用iptables & shell @ CentOS” »
原則上 ssh port 能不要全部開啟事最好的,如果一定要開啟的話,必需要作些防護措施,
port 22 一旦開啟後最容易遇到的就是會有人不斷的try密碼
設計原理:
Continue reading “[Linux] 防 ssh 暴力攻擊 使用iptables & shell @ CentOS” »
mkdir /etc/firewall
touch /etc/firewall/iptables.sh
chmod 755 /etc/firewall
vi /etc/firewall/iptables.sh
寫入以下內容
近日公司部份客戶發現有被hacker 嘗試的 存取 linux 下的 /etc/passowrd 檔,請參照下圖

很明顯的看到是在要取得 password 檔的內容,另外在從MySQL資料庫中也發現到
看到這幾筆資料 , 就覺得有問題了:
| 44 | `cat /etc/passwd` | y |
| 45 | cat /etc/passwd | y |
| 46 | ;cat /etc/passwd; | y |
| 47 | |cat /etc/passwd | y |
| 48 | cat /etc/passwd | y |
| 49 | <cat /etc/passwd | y |
| 50 | ../../../../../../../../etc/passwd | y |
| 51 | ../../../../../../../../etc/passwd | y |
| 52 | ../../../../../../../../etc/passwd | y |
| 53 | ../../../../../../../../etc/passwd .html | y |
| 54 | ../../../../../../../../etc/passwd .jpg | y |
| 55 | .\\./.\\./.\\./.\\./.\\./.\\./etc/passwd | y |
| 56 | /etc/passwd | y |
| 57 | /./././././././etc/passwd | y |
| 58 | ..\..\..\..\..\..\..\..\etc/passwd | y |
| 59 | ../..//../..//../..//../..//../..//../..//../..//../..//etc/passwd | y |
| 60 | ../…/.././../…/.././../…/.././../…/.././../…/.././../…/.././etc/passwd | y |
| 61 | <../../../../../../../../etc/passwd | y |
function denySystemConfig($aryParm){
if (!eregi("/etc",$aryParm)) return $aryParm;
else return false;
}
[道歉啟事]
本站有部份資料是來自於網路文章,或同事貢獻的文章,只做摘錄存檔。
部份找的出處的文章均都會附上來源,對於部份原始作者 ,如果不願意 接受轉載,均可以告知一聲,
並將會將其文章刪除掉,對於「砍掉重練真的比較好嗎?」該文作者造成不便。
在這邊致上12萬分的歉意,目前已經該文刪除,並會於近期內刪除一些找不到出處來源的文章。
安裝proftp MySQL 模組,位於 sentos 上可以找到 rpm 安裝
[root@phptw home]#yum install proftpd-mysql
登入 MySQL
[root@phptw home]#mysql -u root -p
或可以輸入
Continue reading “[Linux][CentOs] proftpd + MySQL + virtual user @CentOs5” »
更換主機商了,從北美的 波士頓機房 到 台灣的是方機房 = ="
速度快多了…
摳摳也變多了….
<style>
/*產品介紹/廠商連結*/
.BR{
display:block;
width:920px;
margin:0 auto;
text-align:right;
margin-bottom:20px;
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #666666;
padding-right:30px;
float:right;
}
.BR ul{
float:right;
}
.BR li{
display:block;
padding:0 10px;
float:left;
}
.BR li a{
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 13px;
line-height: 22px;
color: #CCCCCC;
font-weight:bolder;
text-decoration:none;
}
.BR li a:hover{
text-decoration:underline;
}
/*—-左品牌選單—–*/
#ADLeft{
margin:10px 0 0 10px;
float:left;
display:block;
width:200px;
border:1px solid #B02300;
}
.ADMain ul{
}
.ADMain li{
margin:5px;
text-align:center;
background-color:#860000;
height:26px;
}
.ADMain li a{
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
color:#C5C5C5;
font-weight:bolder;
line-height:26px;
text-decoration:none;
}
.ADMain li a:hover{
color:#DDD;
}
/*—-左品牌次選單—–*/
.ADSub ul{
margin:0 auto;
}
.ADSub li{
margin:2px auto;
text-align:center;
display:block;
background-color:#666;
border-bottom: 1px solid #999;
width:95%;
height:22px;
}
.ADSub li a{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#E9E9E9;
line-height:22px;
text-decoration:none;
}
.ADSub li a:hover{
color:#fff;
text-decoration:none;
}
/*–產品照片名稱列表–*/
#ProList{
width:700px;
float:right;
margin:10px;
}
#ProList ul{
float:left;
border-bottom:#666 1px solid;
margin:6px 8px;
width:200px;
}
#ProList li{
/*float:left; */
}
#ProList li.PRO{
display:block;
/*border: 1px solid #666;*/
width:200px;
height:200px;
}
#ProList li.NAME{
text-align:center;
display:block;
/*margin-bottom:10px;*/
}
#ProList li.PRO a{
}
#ProList li.NAME a{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#C5C5C5;
line-height:26px;
text-decoration:none;
}
#ProList li.PRO a:hover{
}
#ProList li.NAME a:hover{
color:#e5e5e5
}
/*—————–audio-des頁面
—————–*/
/*–內容寬度–*/
.ProDes{
display:block;
width:800px;
padding:10px;
margin:0 auto;
margin-top:20px;
}
/*右方描述*/
#DesRight{
width:360px;
float:right;
padding-right:20px;
}
h3{
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
color:#FFF;
line-height:25px;
}
.AT{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#EBEBEB;
line-height:22px;
}
/*–左方大小圖–*/
#DesLeft{
width:300px;
margin-right:10px;
float:left;
padding-top:3px;
padding-bottom:8px;
}
/*大圖*/
.DesProPic{
float:left;
width:300px;
height:300px;
padding-top:2px;
}
.Back{
float:right;
padding-right:10px;
}
</style>
<script>
/**
* 利用 javascrip 控制 選單顯示
* 有兩種模式:
* 1.控制單一顯示 example: <div onClick="showDisplay('show1');">
* 2.控制單一顯示,其他則收起來 example: <div onClick="showDisplay('show1',3);">
* 其中 show 值必需要 1 –>3 , show1 -> show2 -> show3
* @author wenchi
* @version 20080604
* @link http://blog.phptw.idv.tw/read-165.html
* @see http://blog.phptw.idv.tw/read-165.html
* @parm string idName 控制 的 ID,exmaple <div id="show1">
* @parm int displayCount 要控的 ID 數量, 預設值 為 0
* @parm string 要控制的ID 索引值 例如 show1 為show, 預設為 show
* @return void
*/
function showDisplay(idName){
var displayCount=0;
var showID="show";
if(typeof arguments[1] == "number") var displayCount=arguments[1];
if(typeof arguments[2] == "string") var showID=arguments[2];
if (displayCount>0){
for (var i=1;i<=displayCount;i++) document.getElementById(showID+i).style.display="none";
}
var result=document.getElementById(idName).style.display;
if (result=="none") document.getElementById(idName).style.display="block";
else document.getElementById(idName).style.display="none";
return ;
}
</script>
</head>
<body>
<div style="width:300px">
<ul class="ADMain" id="ADMain">
<li onClick="showDisplay('show1');"><a href="#"><span onmouseover="this.style.cursor='hand'">Westlake Audio</span></a></li>
<span id="show1" style="display:none">
<ul class="ADSub"><!–次選單–>
<li><a href="#">系列一</a></li>
<li><a href="#">系列二</a></li>
</ul>
</span>
<li onClick="showDisplay('show2',4);"><a href="#"><span onmouseover="this.style.cursor='hand'">cello</span></a></li>
<span id="show2" style="display:none">
<ul class="ADSub"><!–次選單–>
<li><a href="#">系列一</a></li>
<li><a href="#">系列二</a></li>
</ul>
</span>
<li onClick="showDisplay('show3');"><a href="#"><span onmouseover="this.style.cursor='hand'">Jadis</span></a></li>
<span id="show3" style="display:none">
<ul class="ADSub"><!–次選單–>
<li><a href="#">系列一</a></li>
<li><a href="#">系列二</a></li>
</ul>
</span>
<li onClick="showDisplay('show4',4);"><a href="#"><span onmouseover="this.style.cursor='hand'">Wadia</span></a></li>
<span id="show4" style="display:none">
<ul class="ADSub"><!–次選單–>
<li><a href="#">系列一</a></li>
<li><a href="#">系列二</a></li>
</ul>
</span>
</ul>
</div>
</body>
</html>
下載範例:
20080604.rar (1.96 KB , 下載:466次)