-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallfiles.php
121 lines (101 loc) · 2.35 KB
/
allfiles.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
<?php
$final= [];
$root= $_SERVER["DOCUMENT_ROOT"];
$rdi= new RecursiveDirectoryIterator($root);
$rii= new RecursiveIteratorIterator($rdi);
$files= [];
foreach ($rii as $file){
if($file->isDir()){
continue;
}
$files[]= $file-> getPathname();
}
$hide= "/^\.htaccess|\.htpasswd|\.php|\.jpg/";
$show= "/\.html|\.js|\.txt/";
$showall= "/.*/";
foreach($files as $file){
$file= str_replace($root,"", $file);
$ext= pathinfo(parse_url($file, PHP_URL_PATH), PATHINFO_EXTENSION);
$name= pathinfo(parse_url($file, PHP_URL_PATH), PATHINFO_FILENAME);
$filename= "{$name}.{$ext}";
if(preg_match($show, $file)){
array_push($final, "<a href=\"{$file}\">{$filename}</a>"); //ECHO
}
}
$final= implode("\n", $final);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="theme-color" content="black"/>
<meta name="msapplication-TileColor" content="#da532c"/>
<meta name="msapplication-navbutton-color" content="black"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>All links on this site</title>
<style>
*{
box-sizing: border-box;
margin:0; padding:0;
outline: none;
}
body{
background: rgb(251,244,234) url("");
min-width: 100vw;
max-width: 100vw;
min-height: 100vh;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
#container{
height: auto;
border: 0px solid red;
margin-top: 20px;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
a{
font: 18px "Arial";
text-transform: lowercase;
font-variant: small-caps;
height: 40px; width: 80%;
display:flex;
justify-content: center;
align-items: center;
color: black;
background: rgb(255,255,0,0.5);
padding:10px;
margin-bottom:10px;
border: 1.5px solid red;
border-radius: 10px;
text-decoration:none;
}
@media (orientation:portrait){
#container{width: 95%;}
body{background-size: 35%;}
}
@media (orientation:landscape){
#container{width: 75%;}
body{background-size: 50%;}
}
</style>
</head>
<body data-nosnippet>
<div id="container">
<?= $final ?>
</div>
<script>
let create= (x)=> document.createElement(x),
select= (x,y=document)=> y.querySelector(x),
selectAll= (x,y=document)=> y.querySelectorAll(x);
</script>
</body>
</html>