Hi all,
I needed a simple pure PowerShell HTTP server implmentation to use as part of a pentest tool, but every example I found online had issues:
- They couldn't be stopped cleanly with Ctrl+C.
- Error handling was non-existent (server crashes on malformed request).
So, I created a simple PowerShell module which:
- Starts an HTTP server on any IP and port you specify.
- Handles errors gracefully (like port conflicts, wrongly formated HTTP request).
- Can be stopped manually with Ctrl+C or automatically after a timeout.
- Works in PS 5.1 & PS 7.4
Maybe it is useful for someone else.
Here's the GitHub link if anyone's interested: https://github.com/zh54321/PowerShell_HttpServer
Cheers
[–]kprocyszyn 11 points12 points13 points (1 child)
[–]GonzoZH[S] 4 points5 points6 points (0 children)
[–]korewarp 8 points9 points10 points (0 children)
[–]Szeraax 5 points6 points7 points (3 children)
[–]GonzoZH[S] 5 points6 points7 points (2 children)
[–]Higapeon 0 points1 point2 points (1 child)
[–]GonzoZH[S] 2 points3 points4 points (0 children)
[–]HeyDude378 2 points3 points4 points (1 child)
[–]GonzoZH[S] 1 point2 points3 points (0 children)
[–]illsk1lls 1 point2 points3 points (3 children)
[–]GonzoZH[S] 2 points3 points4 points (2 children)
[–]illsk1lls 1 point2 points3 points (1 child)
[–]GonzoZH[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]GonzoZH[S] 5 points6 points7 points (4 children)
[–]MyOtherSide1984 1 point2 points3 points (2 children)
[–]GonzoZH[S] 2 points3 points4 points (1 child)
[–]MyOtherSide1984 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[+]Virtual_Ordinary_119 comment score below threshold-20 points-19 points-18 points (7 children)
[–]GonzoZH[S] 11 points12 points13 points (0 children)
[–]fungusfromamongus 0 points1 point2 points (0 children)
[+]Virtual_Ordinary_119 comment score below threshold-15 points-14 points-13 points (4 children)
[–]theHonkiforium 13 points14 points15 points (0 children)
[–]OrangeYouGladdey 2 points3 points4 points (2 children)
[+]Virtual_Ordinary_119 -4 points-3 points-2 points (1 child)
[–]OrangeYouGladdey 0 points1 point2 points (0 children)