ดาวโหลด บทความ สถิติผู้ใช้ เกี่ยวกับเรา ติดต่อเรา
HomeVestaCP

เปลี่ยน VestaCP Admin Panel ไป port อื่น แล้วใส่หน้าปลอมไว้ให้ login ด้วย

1. เพิ่ม port ใน csf ก่อน เช่น 8555
2. เปลี่ยน port 8083 เป็นเลขอื่น
nano /usr/local/vesta/nginx/conf/nginx.conf
    # Vhost
    server {
        listen          8555;
        server_name     _;
3. ถึงตอนนี้หากมีคนเขาหน้า 8083 จะไม่เจอหน้า login
แต่หากเขาใช้โปรแกรม portscan แปปเดียวจะรู้ว่า เราเปลี่ยนไปใช้พอร์ท 8555
ดังนั้นเราจะเปลี่ยน link login ด้วย
nano /usr/local/vesta/web/index.php
<?php
session_start();
if (isset($_SESSION['user'])) {
    header("Location: /list/user/");
} else {
    include('index_da.php');
#    header("Location: /login/");
}
4. สร้างไฟล์ index ปลอมๆ เหมือน directadmin
nano /usr/local/vesta/web/index_da.php
<html>
<head>
<title>DirectAdmin Login</title>
<meta name="robots" content="noindex,nofollow">
<style>
*{ FONT-SIZE: 8.5pt; FONT-FAMILY: verdana; } b { FONT-WEIGHT: bold; } .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; border-radius: 3px; box-shadow: 1px 1px 3px #727272; } td.list { BACKGROUND: #EEEEEE; white-space: nowrap; } input { border-radius: 3px; padding-left: 4px; padding-right: 4px; } .inset { border: 1px inset #DDDDDD; } #footer { position: fixed; bottom: 0; width: 100%; padding-bottom: 20px; text-align: center; color: #A1A1A1; } #outofsync { font-weight: bold; color: #990000; }</style>
</head>
<body onload="document.form.username.focus();if(document.form.referer.value.indexOf('#')==-1)document.form.referer.value+=location.hash;">
<center><br><br><br><br>
<h1>DirectAdmin Login Page</h1>
<? if ($_POST) { ?>
<h1>Invalid login. Please verify your Username and Password</h1>
<? } ?>
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>Please enter your Username and Password</td></tr>
<form action="/CMD_LOGIN" method="POST" name="form">
<input type=hidden name=referer value="/">
<tr><td class=list align=right>Username:</td><td class=list><input class=inset type=text name=username autocapitalize='none'></td></tr>
<tr><td class=list align=right>Password:</td><td class=list><input class=inset type=password name=password></td></tr>
<tr><td class=listtitle align=right colspan=2><input type=submit value='Login'></td></tr>
</form>
</table>
</center>
<div id='footer'><?=date('D M j G:i:s Y')?>
<div id='outofsync'></div></div>
</body></html>
<script language="JavaScript">computer_time=Math.floor(Date.now()/1000); server_time=<?=time()?>; time_diff=Math.abs(computer_time-server_time); if (time_diff>86400) { document.getElementById('outofsync').innerHTML='Computer or server time out of sync by '+(Math.round(100*time_diff/3600)/100)+' hours.';}</script>
5. สร้าง folder ปลอมด้วย
mkdir /usr/local/vesta/web/CMD_LOGIN

6. สร้างหน้าปลอมอีกหน้านึง
nano /usr/local/vesta/web/CMD_LOGIN/index.php
<html>
<head>
<title>DirectAdmin Login</title>
<meta name="robots" content="noindex,nofollow">
<style>
*{ FONT-SIZE: 8.5pt; FONT-FAMILY: verdana; } b { FONT-WEIGHT: bold; } .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; border-radius: 3px; box-shadow: 1px 1px 3px #727272; } td.list { BACKGROUND: #EEEEEE; white-space: nowrap; } input { border-radius: 3px; padding-left: 4px; padding-right: 4px; } .inset { border: 1px inset #DDDDDD; } #footer { position: fixed; bottom: 0; width: 100%; padding-bottom: 20px; text-align: center; color: #A1A1A1; } #outofsync { font-weight: bold; color: #990000; }</style>
</head>
<body onload="document.form.username.focus();if(document.form.referer.value.indexOf('#')==-1)document.form.referer.value+=location.hash;">
<center><br><br><br><br>
<h1>DirectAdmin Login Page</h1>
<? if ($_POST) { ?>
<h1>Invalid login. Please verify your Username and Password</h1>
<? } ?>
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>Please enter your Username and Password</td></tr>
<form action="" method="POST" name="form">
<input type=hidden name=referer value="/">
<tr><td class=list align=right>Username:</td><td class=list><input class=inset type=text name=username autocapitalize='none'></td></tr>
<tr><td class=list align=right>Password:</td><td class=list><input class=inset type=password name=password></td></tr>
<tr><td class=listtitle align=right colspan=2><input type=submit value='Login'></td></tr>
</form>
</table>
</center>
<div id='footer'><?=date('D M j G:i:s Y')?>
<div id='outofsync'></div></div>
</body></html>
<script language="JavaScript">computer_time=Math.floor(Date.now()/1000); server_time=<?=time()?>; time_diff=Math.abs(computer_time-server_time); if (time_diff>86400) { document.getElementById('outofsync').innerHTML='Computer or server time out of sync by '+(Math.round(100*time_diff/3600)/100)+' hours.';}</script>
7. ตอนนี้เราสร้างหน้า login ปลอมๆเสร็จแล้ว ต่อให้ยิงรหัสผ่านกี่ครั้งก็เข้าระบบเราไม่ได้
ต่อไปเราต้องย้าย url จริงด้วย นั่นคือ /login
8. เปลี่ยน url login ของ vesta
cd /usr/local/vesta/web
mv login new-name
9. แก้ไขไฟล์นี้ด้วย
nano /usr/local/vesta/web/templates/login.html
<form method="post" action="/new-name/" >
10. หลังจากนี้เวลาเราจะเข้าหน้า login ของ vesta เราก็เข้าที่
www.domain.com:8555/new-name/

โดยปล่อยให้พวก bot ไป login กันที่
www.domain.com:8555/

11. เปลี่ยน favicon ด้วย
cd /usr/local/vesta/web
mv favicon.ico faviconv.ico
แล้วหาทาง copy favicon.ico ของ directadmin มาแทน

31 ส.ค. 62
© 2000 - 2024 palthai.com. All rights reserved.