-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
213 lines (175 loc) · 5.84 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?
/*
* From xtr4nge
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @Goty
*/
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>FruityWifi</title>
<script src="../js/jquery.js"></script>
<script src="../js/jquery-ui.js"></script>
<link rel="stylesheet" href="../css/jquery-ui.css" />
<link rel="stylesheet" href="../css/style.css" />
<link rel="stylesheet" href="../../../style.css" />
<script>
$(function() {
$( "#action" ).tabs();
$( "#result" ).tabs();
});
</script>
</head>
<body>
<?
include "_info_.php";
include "../../config/config.php";
include "../../login_check.php";
include "../../functions.php";
include "../menu.php";
/**
* load class form other files
*/
function __autoload($class_name) {
include $class_name . '.php';
}
?>
<br>
<div class="rounded-top" align="left">
<b>Reaver</b>
</div>
<div class="rounded-bottom">
version <?=$mod_version?><br>
reaver <font style="color: lime">installed</font>
</div>
<br>
<?php
// wash
if (isset ( $_POST ['wash'] )) {
// START wash command
$wash = new Wash ( $_POST ['iface'] );
$wash->setTime ( $_POST ['time'] );
$wash->washStart ();
$wash->setWashResult ();
$networks = $wash->generateNetworks ();
session_Start ();
$_SESSION ['networks'] = $networks;
}
// reaver
if (isset ( $_POST ['net'] )) {
if (isset ( $_POST ['reaver_start'] )) {
if (isset ( $_SESSION ['networks'] )) {
session_start ();
$reaver = new Reaver ( $_SESSION ['networks'] [$_POST ['net']], $_POST ['iface']);
$reaver->startAttack ();
$reaver->setReaverResult ();
}
}
}
else {
if (isset ( $_POST ['reaver_stop'] )) {
Reaver::stopAttack ();
}
}
?>
<hr>
<form action="index.php" method="post" style="margin: 0px" id="wash">
<div id="action" class="module">
<ul>
<li><a href="#action-1">Wash</a></li>
<li><a href="#action-2">Reaver</a></li>
<script>
</script>
</ul>
<div id="action-1">
Wash Time <select name="time">
<option value="10">10s</option>
<option value="20">20s</option>
<option value="30">30s</option>
<option value="40">40s</option>
<option value="50">50s</option>
</select> Mon interface<select name="iface">
<option value="mon0">mon0</option>
</select>
<p>Options
<p><input type="submit" value="Start" name="wash" />
</div>
</form>
<form action="index.php" method="post" style="margin: 0px" id="reaver">
<div id="action-2">
Reaver <select class="input" name="net">
<?
for($i = 0; $i < count ( $networks ) - 1; $i ++) {
$essid = $networks [$i]->getEssid ();
echo "<option value=" . $i . ">$essid</option>";
}
?>
</select> Mon interface<select name="iface">
<option value="mon0">mon0</option>
</select>
<p>Options<br> <input type="checkbox" name="defaultpin" value="" checked>Try with default pin
<input type="checkbox" name="dbpin" value="" checked>Use WPSdb
<p><input type="text" name="" value="" maxlength="8">Use your own
pin<br>
<?php
// check if reaver is running
if (Reaver::checkReaver () > 2) {
print "<p>reaver is <span style='color:lime'><b>running</b> ";
print ' <p><input type="submit" name="reaver_stop" value="Stop">';
} else {
print '<p><input type="submit" name="reaver_start" value="Start">';
}
?>
</div>
</div>
</form>
<br>
<div id="result" class="module">
<ul>
<li><a href="#result-1">Output</a></li>
<li><a href="#result-2">History</a></li>
</ul>
<div id="result-1">
<form id="formLogs" name="formLogs" method="POST" autocomplete="off">
<input value="refresh" type="button"
onclick='window.location.reload(true);'> <br>
<?
if ($logfile != "" and $action == "view") {
$filename = $mod_logs_history . $logfile . ".log";
} else {
$filename = $mod_logs;
}
$data = open_file ( $filename );
$data_array = explode ( "\n", $data );
$data = implode ( "\n", $data_array );
?>
<?php if (isset($_POST['wash'])){?>
<textarea id="output" class="module-content"><?=$wash->getWashResult();?></textarea>
<?php
} else {
if (isset ( $_POST ['reaver_start'] )) {
?>
<textarea id="output" class="module-content"><?=$reaver->getReaverResult();?></textarea>
<?php }}?>
<input type="hidden" name="type" value="logs">
</form>
</div>
<div id="result-2">
<?
$logs = glob ( $mod_logs_history . '*.log' );
print_r ( $a );
for($i = 0; $i < count ( $logs ); $i ++) {
$filename = str_replace ( ".log", "", str_replace ( $mod_logs_history, "", $logs [$i] ) );
echo "<a href='?logfile=" . str_replace ( ".log", "", str_replace ( $mod_logs_history, "", $logs [$i] ) ) . "&action=delete'><b>x</b></a> ";
echo $filename . " | ";
echo "<a href='?logfile=" . str_replace ( ".log", "", str_replace ( $mod_logs_history, "", $logs [$i] ) ) . "&action=view'><b>view</b></a>";
echo "<br>";
}
?>
</div>
</div>
</body>
</html>