Compare commits

...

2 Commits

Author SHA1 Message Date
localhost_frssoft bcf33de7e1 random port selection 2023-07-24 01:11:02 +03:00
localhost_frssoft fad4fbc7f9 add simple dumb blocks 2023-07-24 01:08:09 +03:00
4 changed files with 14 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
access_granted
access_denied
config

View File

@ -11,4 +11,4 @@ $EDITOR config
```run server (socat required)
./bss.sh <PORT>
```
run it without argument -> random port selected

10
bbs.sh
View File

@ -1,7 +1,13 @@
#!/bin/sh
echo "listening for commands on 0.0.0.0:$1"
if [ ! -n "$1" ]; then
port=$(shuf -i 1024-65000 -n 1)
else
port=$1
fi
socat -v -v TCP-LISTEN:$1,reuseaddr,pktinfo,fork SYSTEM:"./executor.sh"
echo "listening for commands on 0.0.0.0:$port"
socat -v -v TCP-LISTEN:$port,reuseaddr,pktinfo,fork SYSTEM:"./executor.sh"

View File

@ -23,6 +23,10 @@ die(){
}
mkdir -p -m 700 access_granted
mkdir -p -m 700 access_denied
if [ -f access_denied/"$remote_ip" ]; then exit 0; fi
generator_session=$(zcat -f $system_dict | shuf -n 2 | tr -d "\n'")
randpadding=$(head -c 8 /dev/urandom | base64)
printf "$randpadding\t$generator_session\n"