# Portnut Portnut is a port stressing / scanning multithreaded utility. It can handle raw TCP and HTTP. # TODO * Make a distributed version that allows stressing from multiple computers at the same time * Return more stats (low 1%, high 1%) # Install Go to the releases page and download the latest version. Give it execution rights and simply launch it. # Building Prerequisite to building reqwest: > apt install libssl-dev # Usage Portnut is a tcp port scanner / stresser. The scanning function simply tries to connect to the tcp ports given. The stressing function sends a payload every 10 milliseconds, to every ports given at the same time. The payload can be passed via a pipe (optionnal). ## Scan ``` 2347 justine > portnut tcpscan -a 127.0.0.1 -p 8080,8090 ____ ____ ____ _______ ____ ________ / __ \/ __ \/ __ \/_ __/ | / / / / /_ __/ / /_/ / / / / /_/ / / / / |/ / / / / / / / ____/ /_/ / _, _/ / / / /| / /_/ / / / /_/ \____/_/ |_| /_/ /_/ |_/\____/ /_/ Scanning 127.0.0.1 TCP/8080 => ACCEPT TCP/8090 => REJECT 2351 justine > portnut tcpscan -a 127.0.0.1 -p 8080,8090 --range ____ ____ ____ _______ ____ ________ / __ \/ __ \/ __ \/_ __/ | / / / / /_ __/ / /_/ / / / / /_/ / / / / |/ / / / / / / / ____/ /_/ / _, _/ / / / /| / /_/ / / / /_/ \____/_/ |_| /_/ /_/ |_/\____/ /_/ Scanning 127.0.0.1 TCP/8080 => ACCEPT TCP/8081 => REJECT TCP/8082 => REJECT TCP/8083 => REJECT TCP/8084 => REJECT TCP/8085 => REJECT TCP/8086 => REJECT TCP/8087 => REJECT TCP/8088 => REJECT TCP/8089 => REJECT ``` ## TCP Stress TCP Stress can be applied to a port, a list of port, or a range of port. Stressing allows sending a payload (via -p/--payload or via a pipe), sending, and waiting for an answer. ``` 2356 justine > portnut tcpstress -a 127.0.0.1 -p 8080 -d 2 ____ ____ ____ _______ ____ ________ / __ \/ __ \/ __ \/_ __/ | / / / / /_ __/ / /_/ / / / / /_/ / / / / |/ / / / / / / / ____/ /_/ / _, _/ / / / /| / /_/ / / / /_/ \____/_/ |_| /_/ /_/ |_/\____/ /_/ Scanning 127.0.0.1 TCP/8080 => ACCEPT Stressing 127.0.0.1 using 5 concurrent threads per port for 2s TOTAL 20 OK 20 NOK 0 Got 100% of OK Mean answer time : 512ms ``` ## HTTP Stress HTTP stress performs a GET on the given address. ``` 1257 justine > portnut httpstress -a http://localhost:8080 --duration 5 ____ ____ ____ _______ ____ ________ / __ \/ __ \/ __ \/_ __/ | / / / / /_ __/ / /_/ / / / / /_/ / / / / |/ / / / / / / / ____/ /_/ / _, _/ / / / /| / /_/ / / / /_/ \____/_/ |_| /_/ /_/ |_/\____/ /_/ Threads starting their 5s run... over ! TOTAL 809 OK 809 NOK 0 Got 100% of OK Mean answer time : 5ms ``` ## More ? See the help : ``` A simple TCP/HTTP port scanner / stresser. If stressing, you can pass a payload via a pipe Usage: portnut [OPTIONS] --address
--ports ... Arguments: Mode of use : either tcpstress, tcpscan or httpstress Options: -a, --address
IP address or hostname to scan - or url if using http -t, --timeout Timeout for each connection in seconds [default: 1] -w, --wait Number of milliseconds to wait in between scans or requests [default: 30] -d, --duration Duration of tcp stress test in seconds, default 30 [default: 30] -p, --ports ... Ports to stress / scan, separated by commas (22,80) -r, --range Set this flag to treat the ports as a range rather than a list -s, --stress Set this flag to stress the ports instead of scanning them -c, --cthreads How many threads per port when stressing (Concurrent Threads) [default: 5] -h, --help Print help -V, --version Print version ```