Oneliner Webserver

0x01 Oneliner Webserver

Python

  • python3
1
python3 -m http.server 8888
  • python2
1
python2 -m SimpleHTTPServer 8888

PHP

1
2
3
4
$ php -S localhost:8888 -t evil/

for PHP >=5.4
$ php -S localhost:8888

Perl

1
perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 +? "./$1 |" : $1) if /^GET \/(.*) / })'

Necat

1
2
3
while true; do nc -l 80 < test.html; done

ncat -k -l -p 1337 -c "printf 'HTTP/1.1 200 OK\r\n\r\n'; cat ~/evil.html"

IIS Express

1
C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000

BusyBox

1
2
Busybox httpd
busybox httpd -f -p 8000

0x02 更多参考

Web server : https://gist.github.com/willurd/5720255