diff --git a/conf/springboot.yml b/conf/springboot.yml index b9a5160..332ef09 100644 --- a/conf/springboot.yml +++ b/conf/springboot.yml @@ -1,5 +1,5 @@ ssh-server: - port: 1022 + port: 22 private-key: location: "conf/private.key" hash-replies: diff --git a/misc/start-jar.sh b/misc/start-jar.sh index 2ff7b54..b6ec133 100644 --- a/misc/start-jar.sh +++ b/misc/start-jar.sh @@ -2,7 +2,7 @@ PID=`ps -ef | grep echo-sshd-server.jar | grep -v grep | awk '{print $2}'` if [ -z "$PID" ] then - sudo nohup /opt/jdk-17/bin/java -jar echo-sshd-server.jar conf > logs/exec.log 2>&1 & + nohup authbind /opt/jdk-17/bin/java -jar echo-sshd-server.jar conf > logs/exec.log 2>&1 & sleep 1 PID=`ps -ef | grep echo-sshd-server.jar | grep -v grep | awk '{print $2}'` echo "started echo-sshd-server.jar pid: $PID" diff --git a/misc/stop.sh b/misc/stop.sh index 9a23235..e792c15 100644 --- a/misc/stop.sh +++ b/misc/stop.sh @@ -4,6 +4,6 @@ if [ -z "$PID" ] then echo "echo-sshd-server is already dead! $PID" else - sudo kill -9 $PID + kill -9 $PID echo "killed echo-sshd-server pid: $PID" fi diff --git a/readme.md b/readme.md index b16a56a..9af18bb 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,53 @@ ## Introduction -This is a dummy SSH server created using MINA SSHD Library and springboot 3. -The point is for me to learn the SSH hacker bots command patterns around the world. +This is a dummy SSH server created using MINA SSHD Library and Springboot 3. +The point is for me to learn all SSH-hacker-bot-command patterns around the world. I share this project so that others can learn this as well. ## How to build + +``` mvn clean package -## How to run -java -jar echo-sshd-server-{version}.jar +``` + +## Auth Bind Setup + +``` +sudo touch /etc/authbind/byport/22 +sudo chmod 777 /etc/authbind/byport/22 +``` + +## Expected OS +Linux + +##Expected Directory Structory + +``` +$ tree echo-ssh-server/ +echo-ssh-server/ +├── conf +│   ├── hash-replies.properties +│   ├── log4j2.xml +│   ├── private.key +│   ├── regex-mapping.properties +│   └── springboot.yml +├── data +│   ├── remote-ip-info-db.mv.db +│   └── remote-ip-info-db.trace.db +├── echo-sshd-server-1.4.1.jar +├── echo-sshd-server.jar -> echo-sshd-server-1.4.1.jar +├── logs +├── start-jar.sh +└── stop.sh + +``` + +## How to start +``` +./start-jar.sh +``` +## How to stop +``` +./stop.sh +``` \ No newline at end of file