GithubHelp home page GithubHelp logo

huangshumin / www.sh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from francesco149/www.sh

0.0 0.0 0.0 6 KB

http server in sh using busybox netcat with groff support

License: The Unlicense

Shell 85.60% Roff 14.40%

www.sh's Introduction

http server in sh using busybox netcat

why?

for the lulz

is this secure?

I have no idea lmao

usage

make sure you have busybox installed

./www.sh

the server should now be reachable at http://127.0.0.1:8080

to use a different port, you can run

./www.sh 8081

files to be served are in the ./www directory

I included a sample index.ms and a date.sh cgi script

features

basic cgi

if a requested file is executable, it will be called with the query string as a parameter and its output will be sent back to the client. http headers are automatically generated

for example, if /scripts/foo.sh?bar=xxx&baz=yyy is requested and foo.sh is executable it will be called like so

/scripts/foo.sh bar=xxx&baz=yyy

groff support

any .ms file will be automatically converted on the fly to html. the -ms macro set is used, which also implicitly adds www macros. see man groff_www or google it, also see man grohtml

you need to have groff installed for this to work, it should come with the base-devel tools on most linux distros

custom error pages

you can customize error pages for 403 and 404 by editing the 403.sh and 404.sh files

gotchas

all executable files are considered cgi and will be executed! make sure to chmod -x everything you don't want to run

this server doesn't send any mime type info. this means that it's up to the browser to figure out what file type you're sending. chromium seems to handle this well, I haven't tested on more obscure browsers

www.sh's People

Contributors

francesco149 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.