로그인 페이지로의 자동 리디렉션 관찰
이 단계에서는 캡티브 포털이 작동하는 것을 볼 수 있습니다. 캡티브 포털이 있는 네트워크에 연결한 후 웹을 탐색하려는 모든 시도는 일반적으로 가로채져 로그인 또는 서비스 약관 페이지로 리디렉션됩니다.
이것을 시뮬레이션하기 위해 curl 명령을 사용하여 웹사이트에 액세스해 보겠습니다. 방금 시작한 Python 서버가 시뮬레이션된 네트워크 환경을 제어하므로 localhost:8000에 대한 모든 HTTP 요청은 "캡처"되어 포털의 index.html 파일이 제공됩니다.
curl을 사용하여 로컬 서버에 요청을 보냅니다. 이는 새 네트워크에 연결한 후 브라우저의 초기 요청을 모방합니다.
curl http://localhost:8000
이 명령은 가짜 로그인 페이지의 HTML 소스 코드를 반환합니다. 실제 브라우저에서는 이 코드가 그래픽 로그인 양식으로 렌더링됩니다.
<!DOCTYPE html>
<html>
<head>
<title>CorpWifi Login</title>
<style>
body {
font-family: sans-serif;
background: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.login-box {
background: white;
padding: 20px 40px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
text-align: center;
}
input {
margin: 10px 0;
padding: 8px;
width: 200px;
border: 1px solid #ddd;
border-radius: 4px;
}
button {
padding: 10px 20px;
background-color: #1877f2;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
}
</style>
</head>
<body>
<div class="login-box">
<h2>CorpWifi Access</h2>
<p>Please log in to continue.</p>
<input type="text" placeholder="Username" />
<br />
<input type="password" placeholder="Password" />
<br />
<button>Log In</button>
<p style="font-size: 12px; color: #888; margin-top: 15px;">
Powered by CorpWifi-Login.net
</p>
</div>
</body>
</html>