-
Notifications
You must be signed in to change notification settings - Fork 0
/
dff.files.class.php
178 lines (137 loc) · 6.14 KB
/
dff.files.class.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
<?php
/*
DFF Scaner v 1.1 [php5] [ 5/12/2007 8:19 PM ]
- Files class [files scan]
Ivan Markovic <ivanm@security-net.biz>
http://security-net.biz
About: Dictionary scanner for common files on web locations.
- extended from main class
Usage:
-------------------------------------------------------------------
require_once 'dff.files.class.php';
// Create object
$dff = new dffFiles();
// Chose url to scan
$dff->url = 'http://www.security-net.biz/';
// Chose first letters
$dff->names_by_letter = array('w','a','t','b');
// Custom names
$dff->custom_names = array('admin', 'blog', 'forum', 'crm');
// Use dictionary file, select mode
$dff->use_dic_file = 'MERGE_CUSTOM';
// Path od dictionary file
$dff->dic_file = 'dic.txt';
// cURL
// Use proxy
$dff->curl_proxing = '';
// Follow redirection
$dff->curl_follow = 'YES';
// Nobody
$dff->curl_nobody = 'YES';
// Set user agent
$dff->curl_useragent = '';
// Set reffer
$dff->curl_reffer = '';
// Chose level of in_deep
$dff->in_deep = 1;
// Dislay as fonded pages that are similar to custom 404
$dff->display_similiar = 0;
// Set custom 404, leave empty for discover
$dff->c404 = '';
// Display message with mommentary url
$dff->trying = 0;
// FILE scan
// Chose first letters
$dff->file_names_by_letter = array('w','a','t','b');
// Custom names
$dff->file_custom_names = array('admin', 'blog', 'forum', 'crm');
// Use dictionary file, select mode
$dff->file_use_dic_file = 'MERGE_CUSTOM';
// Path od dictionary file
$dff->file_dic_file = 'dic_file.txt';
// Custom extensions
$dff->file_extensions = array('.bak','.dat','.txt');
// Scan
$dff->scan_it();
-------------------------------------------------------------------
Comment: Please be free to send remarks and ideas.
Legal staff:
Use it at your own risk. I will not be responsible
for any damages done that might result from using
this script. It is written for educations purpose.
Thanks people from: http://sla.ckers.org/forum/
# [License]
#
# 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
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See 'LICENSE' for more information.
*/
// Include main class
require_once 'dff.main.class.php';
class dffFiles extends dff {
protected $default_names_temp = array(); // Temp buff for default names
var $file_names_by_letter = array(); // Scan by letter
var $file_custom_names = array(); // Custom names of folders to scan
var $file_use_dic_file = 'NO'; // Use dic file (NO,YES,MERGE_CUSTOM,MERGE_DEFAULT)
var $file_dic_file = ''; // Dictionary file
var $file_dic_file_delimiter = ','; // Delimiter (',','\n',...)
var $file_extensions = array(
'.dat','.phps','.php~','.php','.reg','.txt','.bak','.bak~','.php.bak','.db','.rdf','.pl',
'.cgi','.class','.sql','.sh','.bat','.exe','.dll','.mdb','.xls','.doc','.bin','.zip','.tar.gz',
'.inc','.ini','.conf','.pcf','.xls','.pwd','.inf','.pgp','.skr','.asa','.batch','.cron','.ica',
'.cfg','.tpl','.old','.new','.'
);
function dffFiles() {
parent::__construct();
}
public function scan_it() {
// Make files array
function array_make($val, $file_extensions) {
$default_names_temp = array();
foreach($file_extensions as $f_key => $f_val) {
$val_temp = $val . $f_val;
array_push($default_names_temp,$val_temp);
}
return $default_names_temp;
}
// Scan for folders
parent::scan_it();
// Prepare scan function for files scan
$this->use_dic_file = $this->file_use_dic_file;
$this->dic_file = $this->file_dic_file;
$this->dic_file_delimiter = $this->file_dic_file_delimiter;
$this->custom_names = $this->file_custom_names;
// Prepare names
parent::prepare_names();
// Create names of files
$default_names_temp = '';
foreach ($this->default_names as $d_key => $d_val) {
if ($this->names_by_letter != '') {
if (in_array($d_val[0],$this->file_names_by_letter)) {
$default_names_temp .= "," . implode(",",array_make($d_val, $this->file_extensions));
}
} else {
$default_names_temp .= "," . implode(",",array_make($d_val, $this->file_extensions));
}
}
// Prepare scan function
$this->default_names = explode(",",$default_names_temp);
$this->found_in_levels = $this->founded;
// Scan it
echo '<hr color="blue" /> Switch to files scanning ... <hr color="blue" />';
parent::scan_levels();
echo '<hr color="green" /><strong> Job done. </strong> Time: ' . date("l dS of F Y h:i:s A") . '<br /><hr color="green" />';
}
}