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
from pwn import * | |
context.terminal = "tmux splitw -h -f".split() | |
#p = process("./data_bank") | |
p = remote("35.200.202.92", 1337) | |
DEBUG = 0 | |
cmd = "" | |
libc = ELF('./libc.so.6') | |
if DEBUG: | |
gdb.attach(p, cmd, gdb_args=["--init-eval-command='source /ctf/tools/gef/gef.py'"]) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
void setbff(void) | |
{ | |
setvbuf(stdin,(char *)0x0,2,0); | |
setvbuf(stdout,(char *)0x0,2,0); | |
setvbuf(stderr,(char *)0x0,2,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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
void setbff(void) | |
{ | |
setvbuf(stdin,(char *)0x0,2,0); | |
setvbuf(stdout,(char *)0x0,2,0); | |
setvbuf(stderr,(char *)0x0,2,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
from pwn import * | |
context.terminal = "tmux splitw -h -f".split() | |
#p = process("./secret_of_my_heart", env={"LD_PRELOAD":"./libc_64.so.6"}) | |
p = remote("chall.pwnable.tw", 10302) | |
libc = ELF("./libc_64.so.6") | |
DEBUG = 0 | |
cmd = "" | |
if DEBUG: | |
gdb.attach(p, cmd, gdb_args=["--init-eval-command='source ~/ctf/tools/gef/gef.py'"]) |
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
from z3 import * | |
""" | |
Riddle : | |
Cari nilai [x1, x2, x3] | |
Clue: | |
[6, 8, 2] (satu angka benar dan posisinya benar) | |
[6, 4, 5] (satu angka benar dan posisinya salah) | |
[2, 0, 6] (dua angka benar tetapi posisinya salah) | |
[7, 3, 8] (tidak ada angka yang benar) | |
[7, 8, 0] (satu angka benar tetapi posisinya salah) |
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
#!/usr/bin/env python3 | |
import gmpy2 | |
import binascii | |
key = binascii.unhexlify("85:d6:be:78:57:55:6d:33:7f:44:52:fe:42:d5:06:a8:01:03:80:8a:fb:0d:b2:fd:4a:bf:f6:af:41:49:f5:1b".replace(":", "")) | |
def clamp(r): | |
return r & 0x0ffffffc0ffffffc0ffffffc0fffffff | |
def poly_mac(msg, key): |
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
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14): | |
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap. | |
Arguments | |
--------- | |
confusion_matrix: numpy.ndarray |
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
def mod_inverse(x,y): | |
# See: http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm | |
def eea(a,b): | |
if b==0:return (1,0) | |
(q,r) = (a//b,a%b) | |
(s,t) = eea(b,r) | |
return (t, s-(q*t) ) | |
inv = eea(x,y)[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
from math import * | |
#points = [(2,2),(3,4),(4,2),(5,4)] | |
points = [] | |
def euclid_length(x1,y1,x2,y2): | |
return sqrt((x1-x2)**2 + (y1-y2)**2) | |
def derivx_euclid_length(x1,y1,x2,y2): | |
return (x1-x2)/sqrt((x1-x2)**2 + (y1-y2)**2) |
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
import java.lang.Math; | |
import java.util.ArrayList; | |
class Point { | |
public double x; | |
public double y; | |
public Point(double x, double y) { | |
this.x = x; | |
this.y = y; | |
} |