Skip to content

Instantly share code, notes, and snippets.

View aryan9600's full-sized avatar
debugging

Sanskar Jaiswal aryan9600

debugging
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aryan9600 on github.
  • I am aryan9600 (https://keybase.io/aryan9600) on keybase.
  • I have a public key ASCPad3zXHc8Gl5TLJS3niP3gy5oIfFnTuYO3OaF6DVJ4wo

To claim this, I am signing this object:

FROM nikolaik/python-nodejs:python3.7-nodejs12-slim
WORKDIR /app
COPY . /app
RUN npm install
# Make the script executable
RUN chmod +x run.sh
CMD ./run.sh
EXPOSE 2640
#!/bin/bash
# Use the inbuit http module in python to serve the contents inside /app/flag dir
python3 -m http.server 3301 --bind 127.0.0.1 --directory /app/flag &
# Get the PID
P1=$!
# Run the node server
node app.js
P2=$!
# Wait forever for both processes to finish.
wait $P1 $P2
FROM node:alpine
WORKDIR '/app'
COPY ./package.json ./
RUN npm install
COPY . .
# Add a user group with a group ID of 1001
RUN addgroup -g 1001 ctf
# Add a user with a user ID of 1001 and to the ctf user group
RUN adduser -u 1001 ctf -G ctf
# Set permissions to revoke write access
FROM disconnect3d/nsjail
WORKDIR /jail
COPY ./jail .
RUN chmod -R 755 .
CMD nsjail -Ml --port 9002 --disable_proc --chroot /jail -- /bin/bash
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN useradd -M jailer # Add a user for ssh
RUN echo 'jailer:keyissecret' | chpasswd # Assign a password to the user for ssh
# Prohibit someone to ssh as root
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
spec:
template:
spec:
containers:
- name: controller
ports:
- containerPort: 9000
hostPort: 9000
- containerPort: 9002
hostPort: 9002
spec:
ports:
- nodePort: 31100 # This value must be between 30000-32767.
port: 9000
name: pwn
- nodePort: 31102
port: 9002
name: jail
- nodePort: 31103
port: 9003
{
"data":
{
"9000": "default/pwn-cluster-ip-service:9000",
"9002": "default/jail-cluster-ip-service:9002",
"9003": "default/jailed-cluster-ip-service:9003",
"6969": "default/pyjail-cluster-ip-service:6969"
}
}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$2 # We need this to route requests to appropiate ClusterIP service
nginx.ingress.kubernetes.io/limit-connections: "7" # Limit the number of connections from a specific IP
nginx.ingress.kubernetes.io/limit-rpm: "8" # Limit the number of requests/min from a specific IP