One Hat Cyber Team
Your IP :
216.73.216.216
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
sam
/
public_html
/
go
/
news
/
plugins
/
View File Name :
check_chmod.php
<?php /* ||========================================================== || Fusion News 3.x ||---------------------------------------------------------- || File Version : $Id: check_chmod.php 205 2008-02-15 20:02:29Z xycaleth $ || Contact : xycaleth@gmail.com || Copyright: : (c) 2006 - 2008, FusionNews.net || License Info : http://www.gnu.org/copyleft/gpl.html ||========================================================== */ $plugin_link = "<a href=\"./plugins/check_chmod.php\">Check CHMOD plugin</a>"; $plugin_version = 'v0.0.0.3'; $plugin_description = "This plugin allows you to add the capability for the script to check if the critical files can be accessed for reading and writing. It's a test script to show the capabilities of the plugin feature. <br /> Update: Now it also shows the statistics.<br />This plugin is activated by default."; $plugin_name = "Check CHMOD"; if (!function_exists('add_magic_quotes')) { function add_magic_quotes($array) { foreach ($array as $k => $v) { if (is_array($v)) { $array[$k] = add_magic_quotes($v); } else { $array[$k] = addslashes($v); } } return $array; } } if(!get_magic_quotes_gpc()) { $_GET = add_magic_quotes($_GET); $_POST = add_magic_quotes($_POST); if ( isset ($_SESSION) && is_array ($_SESSION) ) { $_SESSION = add_magic_quotes($_SESSION); } } $id = ( isset ($VARS['id']) ) ? $VARS['id'] : ''; function check_file_access($folder){ global $cookies, $userdata; $data = '<div style="text-align:center">'; $files = array ( 'news', 'news/toc.php', 'badwords.php', 'banned.php', 'categories.php', 'config.php', 'flood.php', 'logins.php', 'sessions.php', 'smillies.php', 'users.php', ); if ( has_access (1) ) { $data .= '<p>Welcome, <b>' . $userdata['nick'] . '</b>!'; } $array = array(); foreach ( $files as $value ) { if ( !file_exists ($folder . $value) ) { $array[] = '<tr><td>' . $value . ' does not exist.</td><td>Please re-upload the file.</td></tr>'; } else if ( !is_writeable ($folder.$value) ) { $array[] = '<tr><td>Can not read/write to ' . $value . '</td><td><span style="color:red">please CHMOD to 666</span></td></tr>'; } } if ( sizeof ($array) <= 0 ) { $data .= '<br /><span style="color:green">Congratulations, all files are accessible!</span></p>'; } else { $data .= '</p><table class="adminpanel" style="width:85%; margin-left:auto; margin-right:auto">' . "\n"; $data .= implode ('', $array); $data .= '</table><p></p>'; } $count = 0; $count_today = 0; $count_user = 0; if (has_access( 1 )) { if( file_exists('./news/toc.php') ) { $file = file('./news/toc.php'); array_shift($file); $today = strtotime(date('m/d/Y', strtotime('now'))); foreach( $file as $value){ if ( $value != '' ){ $count++; list($news_id,$news_date,$news_writer,$news_subject) = explode('|<|', $value); if ( $news_date > $today && $news_date < $today+86400 ) $count_today++; if ( $news_writer == $userdata['user'] ) $count_user++; } } } $all_to_be = ( $count === 1 ) ? 'is' : 'are'; $today_to_be = ( $count_today === 1 ) ? 'has' : 'have'; $all_items = ( $count === 1 ) ? 'item' : 'items'; $today_items = ( $count_today === 1 ) ? 'item' : 'items'; $data .= '<p>There ' . $all_to_be . ' <b>' . $count . '</b> news ' . $all_items . ' in your database. You wrote <b>' . $count_user . '</b> of them.<br />' . "\n"; $data .= 'There ' . $today_to_be . ' been <b>' . $count_today . '</b> news ' . $today_items . ' posted today.</p>'; return $data . '<p><b>What do you want to do today:</b></p></div>'; } } if ( $id == '' ){ global $plugin_active; if ( ! $plugin_active ){ $example = ''; //$example = "<p><br /><b>Example</b>:".check_file_access("../")."</p>"; echo <<<html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Fusion News - Check if critical files are accessible</title> <style> <!-- body, td { color: #000000; font: 10pt verdana; font-weight: none; text-decoration: none; } --> </style> </head> <body style="font-family: Verdana; font-size: 10pt"> This plugin adds the capability to check if your files and folders have been given the right access rights and shows you it's findings on the main Fusion News page.<p><br /> <br /><b>To activate this plugin, you need to add some code to the index page.</b><br /> <br /><b>File to edit</b>: index.php (in main installation folder of Fusion News)<br /> <br /><b>Code that needs to be added</b>:<br /> </p> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#DCDCDC" width="100%"> <tr> <td width="100%"><font color="#000080">$plugin_active</font> = <font color="#008000">TRUE</font>;<br /> include (<font color="#000080">$fpath</font>.<font color="#FF0000">"plugins/check_chmod.php"</font>);<br /> <font color="#000080">$content</font> = check_file_access(<font color="#FF0000">"./"</font>);<br /> <font color="#000080">$content</font> .= <font color="#000080">$ind13</font>;</td> </tr> </table> <br />On a clean installation the insertion of the above code should be on linenumber <b>47 </b>of "<b>index.php</b>".<br /> <br /><b>right after</b>:<br /> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#DCDCDC" width="100%" id="AutoNumber1"> <tr> <td width="100%"> <font size="2"><font color="#008000">if</font>(<font color="#000080">$first</font> == <font color="#FF0000">"yes"</font>){<br /> <font color="#000080">$title</font> = <font color="#000080">$ind2</font>;<br /> <font color="#000080">$content</font> = <font color="#000080">$ind1</font>;<br /> }<font color="#008000">elseif</font>(has_access( 1 )){<br /> <font color="#000080">$title</font> = <font color="#000080">$ind9</font>;<br /><td> </tr> </table> <br /><b>and right before</b>:<br /> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#DCDCDC" width="100%" id="AutoNumber2"> <tr> <td width="100%"><font color="#008000">if</font>(has_access( 3 )){<br /> <font color="#000080">$content</font> .= <font color="#000080">$ind11</font>;<br /> }<br /> i<font color="#008000">f</font>(has_access( 2 )&&(! has_access( 3 ))){<br /> <font color="#000080">$content</font> .= <font color="#000080">$ind12</font>;<br /> }</td> </tr> </table> <br /><b>this means that you have to delete 1 line between the "right before" and "right after" part.</b> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#DCDCDC" width="100%" id="AutoNumber2"> <tr> <td width="100%" style="color: #000000; font-style: normal; font-variant: normal; font-weight: none; font-size: 10pt; font-family: verdana; text-decoration: none"> <font color="#000080">$content</font> = <font color="#000080">$ind13</font>;</td> </tr> </table> $example </body> </html> html; } } ?>