iamnoxtras Posted August 16, 2013 Share Posted August 16, 2013 (edited) Recently came across a bash only web server (using netcat) at http://paulbuchheit.blogspot.ro/2007/04/webserver-in-bash.html I fiddled a little with it and turned it into a decent web server, with server logs and all. (no IP captured, just the query string and timestamp) It supports file downloads, it servers static html, PHP, Python and binary files with arguments (GET). It checks for 404 errors and it keeps a server log. Fun facts: 5 times slower then nginx (for a single user) executes binary faster then displays static content php is the slowest :) php files need to be .php python files .py binaries .cb (C binary:) ) It's great if you just need a server for a short period of time and don't need security... It only works on Linux. (I've tested it under ubuntu) I had great fun working on it. I hope you'll have as much fun with it as had. If you find an use for it, drop me a line. server.zip Edited August 16, 2013 by iamnoxtras Quote Link to comment Share on other sites More sharing options...
Sitwon Posted August 16, 2013 Share Posted August 16, 2013 (edited) It's hard to imagine any use case in which having a web server written in Bash could be helpful, but it's a cool novelty.Reminds me of the time I wrote a wiki in about 64 lines of Bash.Rather than a zip file on a forum, you should post it to Github. Edited August 16, 2013 by Sitwon Quote Link to comment Share on other sites More sharing options...
iamnoxtras Posted August 16, 2013 Author Share Posted August 16, 2013 Hi. Good idea, I'm uploading the code to github to: https://github.com/noxtras/bashserver It doesn't have any real uses. I just thought it's cool to write a webserver:) I will now create a simple one in C:) Quote Link to comment Share on other sites More sharing options...
Sitwon Posted August 17, 2013 Share Posted August 17, 2013 Make sure you look up the relevant standards and that your implementations are conformant. It's cool to have something that acts like a web server, but it's even cooler to have something that actually satisfies the requirements set forth in the relevant standards for a web server. Quote Link to comment Share on other sites More sharing options...
iamnoxtras Posted August 17, 2013 Author Share Posted August 17, 2013 wel,, it's just a novelty thing... proof of concept. It adheres to standards to the extent that it send the browser correct mime type and connection type and content length...that is all browsers need. Quote Link to comment Share on other sites More sharing options...
iamnoxtras Posted August 23, 2013 Author Share Posted August 23, 2013 watching today's episode, I found a utility for this? I could change the code a little, add it to a ducky, run it with &, and voila.. an almost invisible web server waiting for all my commands:) I could then just call up the IP, ask for any file, and execute any command directly from a browser... Granted. The logged in user does need to be root.... maybe someone can find a way to circumvent this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.