Browse Source

soal pwn fix

master
letmein 5 years ago
parent
commit
c81fb7c639
12 changed files with 63 additions and 32 deletions
  1. BIN
      ku-ingin-lompat-sambil-jumping/ingin_melompat2
  2. +8
    -1
      ku-ingin-lompat-sambil-jumping/ingin_melompat2.c
  3. BIN
      ku-ingin-lompat-sambil-jumping/return
  4. BIN
      ku-ingin-melompat/ingin_melompat
  5. +9
    -0
      ku-ingin-melompat/ingin_melompat.c
  6. BIN
      ku-ingin-melompat/return
  7. BIN
      service-diary/buffer32
  8. BIN
      service-diary/buffer64
  9. BIN
      service-diary/diary32
  10. +22
    -15
      service-diary/diary32.c
  11. BIN
      service-diary/diary64
  12. +24
    -16
      service-diary/diary64.c

BIN
ku-ingin-lompat-sambil-jumping/ingin_melompat2 View File


ku-ingin-lompat-sambil-jumping/return.c → ku-ingin-lompat-sambil-jumping/ingin_melompat2.c View File

@ -1,15 +1,20 @@
//gcc -g -no-pie -fno-stack-protector -fno-pic -fno-builtin -mpreferred-stack-boundary=2 -m32 ingin_melompat2.c -o ingin_melompat2
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
int wallet = 18;
char burung[8];
void secret_message(){
system("/bin/sh");
}
void init(){
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
void buy_flag(){
if(wallet < 999999999999) printf("kamu terlalu lemah dude :)\n");
else secret_message();
@ -18,6 +23,7 @@ void jual_burung(){
char buffer[64];
getchar();
printf("burung apa yang kamu mau jual ?\n");
fflush(stdout);
fgets(buffer, sizeof(buffer), stdin);
printf("yang kamu jual : ");
printf(buffer);
@ -46,6 +52,7 @@ int main()
{
while(1){
char pilihan;
init();
menu();
printf(">>");
fflush(stdout);

BIN
ku-ingin-lompat-sambil-jumping/return View File


BIN
ku-ingin-melompat/ingin_melompat View File


ku-ingin-melompat/return.c → ku-ingin-melompat/ingin_melompat.c View File

@ -1,3 +1,4 @@
//gcc -g -no-pie -fno-stack-protector -fno-pic -fno-builtin -mpreferred-stack-boundary=2 -m32 ingin_melompat.c -o ingin_melompat
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -9,6 +10,13 @@ char burung[8];
void secret_message(){
system("/bin/sh");
}
void init(){
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
void buy_flag(){
if(wallet < 999999999999) printf("kamu terlalu lemah dude :)\n");
else secret_message();
@ -34,6 +42,7 @@ int main()
{
while(1){
char pilihan;
init();
menu();
printf(">>");
fflush(stdout);

BIN
ku-ingin-melompat/return View File


BIN
service-diary/buffer32 View File


BIN
service-diary/buffer64 View File


BIN
service-diary/diary32 View File


service-diary/buffer32.c → service-diary/diary32.c View File

@ -1,3 +1,4 @@
//gcc -g -no-pie -fno-stack-protector -fno-pic -fno-builtin -mpreferred-stack-boundary=2 -m32 diary.c -o diary
#include <stdio.h>
#include <string.h>
#include <limits.h>
@ -6,6 +7,11 @@ void not_even_called(){
puts("\nWelcome Garuda Muda\n");
system("/bin/sh");
}
void init(){
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
void tulisan(){
puts("██████╗ ██╗ █████╗ ██████╗ ██╗ ██╗ ███████╗███████╗██████╗ ██╗ ██╗██╗ ██████╗███████╗");
@ -18,23 +24,24 @@ puts("╚═════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
int main()
{
char a[4];
int b;
char c[16];
init();
char a[4];
int b;
char c[16];
strcpy(a,"KSL");
b = 14045;
strcpy(a,"KSL");
b = 14045;
tulisan();
printf("Welcome to Diary Application \n");
printf("write something : ");
gets(c);
if(strlen(c) > 20){
printf("karakter gak boleh lebih dari 20\n");
} else{
if(b == 0x67616c66) not_even_called();
else printf("isi diary kamu : %s\n",c);
}
tulisan();
printf("Welcome to Diary Application \n");
printf("write something : ");
gets(c);
if(strlen(c) > 20){
printf("karakter gak boleh lebih dari 20\n");
} else{
if(b == 0x67616c66) not_even_called();
else printf("isi diary kamu : %s\n",c);
}
exit(0);
}

BIN
service-diary/diary64 View File


service-diary/buffer64.c → service-diary/diary64.c View File

@ -1,3 +1,4 @@
//gcc -g -no-pie -fno-stack-protector -fno-pic -fno-builtin diary64.c -o diary64
#include <stdio.h>
#include <string.h>
#include <limits.h>
@ -7,6 +8,12 @@ void not_even_called(){
system("/bin/sh");
}
void init(){
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
void tulisan(){
puts("██████╗ ██╗ █████╗ ██████╗ ██╗ ██╗ ███████╗███████╗██████╗ ██╗ ██╗██╗ ██████╗███████╗");
puts("██╔══██╗██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔════╝██╔══██╗██║ ██║██║██╔════╝██╔════╝");
@ -18,23 +25,24 @@ puts("╚═════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
int main()
{
char a[4];
int b;
char c[64];
init();
char a[4];
int b;
char c[64];
strcpy(a,"KSL");
b = 14045;
strcpy(a,"KSL");
b = 14045;
tulisan();
printf("Welcome to Diary Application \n");
printf("write something : ");
gets(c);
if(strlen(c) > 20){
printf("karakter gak boleh lebih dari 20\n");
} else{
if(b == 0x67616c66) not_even_called();
else printf("isi diary kamu : %s\n",c);
}
exit(0);
tulisan();
printf("Welcome to Diary Application \n");
printf("write something : ");
gets(c);
if(strlen(c) > 20){
printf("karakter gak boleh lebih dari 20\n");
} else{
if(b == 0x67616c66) not_even_called();
else printf("isi diary kamu : %s\n",c);
}
exit(0);
}

Loading…
Cancel
Save