Skip to content
Permalink
Browse files
Docker Vrsion added
  • Loading branch information
aa9863 committed Nov 22, 2022
1 parent bc5fccb commit e92cac757bb6eb88cb3bcf17034132aa518e8861
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
@@ -0,0 +1,13 @@
CC = gcc
FLAGS = -fno-stack-protector -no-pie -g
32FLAG = -m32

classicRop: classicROP.c

$(CC) $(FLAGS) classicROP.c -o classicRop

classicRop32: classicROP.c

$(CC) $(FLAGS) $(32FLAT) classicROP.c -o classicRop32

all: classicRop
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>

int BUFFER=240;

void helper(){
//Screw you compiler optimisation and LibC changes...
__asm__("pop %rdi; ret");
}

int copy(){
char buf[BUFFER];
int r = read(0, buf, 400); //Copy data in the Buffer
printf("%d Bytes Read\n", r);
}

int main(int argc, char* argv[]){
/* Main Function*/
printf("Smash The Stack\n");
//Get the data
int out = copy();
printf("Lose :(\n");
return 0;
}

@@ -0,0 +1,31 @@
FROM debian:buster as vulnbuilder

RUN apt update && apt install --no-install-recommends -y build-essential

WORKDIR /tmp/
ADD Code/ /tmp/
RUN make



FROM debian:buster

#Install SSH Server
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
openssh-server \
&& rm -rf /var/lib/apt/lists/*

#Configure SSH (Cant run as Daemon if this doenst exit)
RUN mkdir /var/run/sshd

RUN useradd -ms /bin/bash editor && echo editor:editor | chpasswd


COPY --from=vulnbuilder /tmp/classicRop /home/editor/ropme
RUN chmod a+s /home/editor/ropme


# PORTS AND BASIC COMMAND
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
@@ -0,0 +1,9 @@
version: "3.0"


services:
ssh:
build:
context: .
ports:
- "22:22"

0 comments on commit e92cac7

Please sign in to comment.