Skip to content

Commit

Permalink
Rename to SSH_Server and add .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Wind010 committed Feb 25, 2024
1 parent ba7d0e7 commit ea88f95
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Login_JWT/client/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const cookieDelim = ','

// Update based off the server you are testing against.
//BaseUrl = "http://localhost:3000"
//BaseUrl = "http://172.20.0.2:3000"
BaseUrl = "https://ctf02042023.azurewebsites.net"
BaseUrl = "http://172.20.0.2:3000"
//BaseUrl = "https://ctf02042023.azurewebsites.net"

function setCookie(name, value, options = {}) {
let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
Expand Down
25 changes: 25 additions & 0 deletions SSH_Server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Docker project generated files to ignore
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
.vagrant*
bin
docker/docker
.*.swp
a.out
*.orig
build_src
.flymake*
.idea
.DS_Store
docs/_build
docs/_static
docs/_templates
.gopath/
.dotcloud
*.test
bundles/
.hg/
.git/
vendor/pkg/
pyenv
Vagrantfile
4 changes: 2 additions & 2 deletions FUTURE_1/Dockerfile → SSH_Server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ENV CTF=$CTF

# Install SSH server and any other dependencies.
# If behind corporate firewall, may need --no-check-certificate
RUN apk update && apk upgrade \
&& apk add openssh cmatrix \
RUN apk update --no-check-certificate && apk upgrade --no-check-certificate \
&& apk add openssh cmatrix --no-check-certificate \
&& rm -rf /var/cache/apk/*

# Configure SSH server for password authentication and set MaxAuthTries
Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions SSH_Server/ctf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh


# Prevent ctrl-z (job control)
trap "echo My patience is wearing thin..." SIGTSTP

# Prevent ctrl-c
trap "echo Nice try..." SIGINT

NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[1;92m'
CYAN='\033[0;36m'


timeout 3s cmatrix


# Substring to check for
substring="pass butter"

while true; do
# Prompt user for input
echo -e -n "${GREEN}What is my purpose?: ${NC}"
read -r user_input
#read -r -p "What is my purpose?: " user_input

# Check if the entered string contains the substring
if [[ "$user_input" == *"$substring"* ]]; then
echo "OMG..."
echo -e "${CYAN}nUE0pUZ6Yl9xov5bqP9jnJAeoTIwLKDi${NC}\n\n"

# Don't use exit/break since this will kill the script and leave user in ssh terminal.
pkill -u $(whoami) sshd
else
echo -e "${RED}V3JvbmcgQW5zd2VyIQ==${NC}\n"
fi
done
File renamed without changes.

0 comments on commit ea88f95

Please sign in to comment.