Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3.0" | ||
|
||
|
||
services: | ||
ssh: | ||
build: | ||
context: . | ||
ports: | ||
- "22:22" |