├── 2023 ├── PatriotCTF │ └── Elbonia │ │ ├── README.md │ │ └── message.pcapng ├── buckeye │ └── dist ├── cybersecurityrumble2023 │ ├── backup │ │ └── csr-2023 │ │ │ └── traffic.pcap │ └── exposed │ │ └── csr-2023 │ │ └── exposed ├── google2023 │ └── misc_mine-the-gap │ │ ├── bfbf384b9e63d4d7748c7dc98aeb077e1c3d66e009ede0313ebf568464cb9b5c8002b34c36621a1aa7767b596eae00609929dad15ab31f77dacb57e8c03df921.zip │ │ ├── gameboard.txt │ │ ├── gameboard_mine.txt │ │ ├── img │ │ ├── cell0.png │ │ ├── cell1.png │ │ ├── cell2.png │ │ ├── cell3.png │ │ ├── cell4.png │ │ ├── cell5.png │ │ ├── cell6.png │ │ ├── cell7.png │ │ ├── cell8.png │ │ ├── cell_close.png │ │ └── flag.png │ │ └── minesweeper.py ├── maple │ └── actual_baby.zip └── uiuc │ └── vmwhere1 │ ├── chal │ └── program ├── .gitignore ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | # For a library or package, you might want to ignore these files since the code is 88 | # intended to run in multiple environments; otherwise, check them in: 89 | # .python-version 90 | 91 | # pipenv 92 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 93 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 94 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 95 | # install all needed dependencies. 96 | #Pipfile.lock 97 | 98 | # poetry 99 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 100 | # This is especially recommended for binary packages to ensure reproducibility, and is more 101 | # commonly ignored for libraries. 102 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 103 | #poetry.lock 104 | 105 | # pdm 106 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 107 | #pdm.lock 108 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 109 | # in version control. 110 | # https://pdm.fming.dev/#use-with-ide 111 | .pdm.toml 112 | 113 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 114 | __pypackages__/ 115 | 116 | # Celery stuff 117 | celerybeat-schedule 118 | celerybeat.pid 119 | 120 | # SageMath parsed files 121 | *.sage.py 122 | 123 | # Environments 124 | .env 125 | .venv 126 | env/ 127 | venv/ 128 | ENV/ 129 | env.bak/ 130 | venv.bak/ 131 | 132 | # Spyder project settings 133 | .spyderproject 134 | .spyproject 135 | 136 | # Rope project settings 137 | .ropeproject 138 | 139 | # mkdocs documentation 140 | /site 141 | 142 | # mypy 143 | .mypy_cache/ 144 | .dmypy.json 145 | dmypy.json 146 | 147 | # Pyre type checker 148 | .pyre/ 149 | 150 | # pytype static type analyzer 151 | .pytype/ 152 | 153 | # Cython debug symbols 154 | cython_debug/ 155 | 156 | # PyCharm 157 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 158 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 159 | # and can be added to the global gitignore or merged into this file. For a more nuclear 160 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 161 | #.idea/ 162 | -------------------------------------------------------------------------------- /2023/PatriotCTF/Elbonia/README.md: -------------------------------------------------------------------------------- 1 | Video Link: 2 | https://youtu.be/XewwjB0AWVA 3 | -------------------------------------------------------------------------------- /2023/PatriotCTF/Elbonia/message.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/PatriotCTF/Elbonia/message.pcapng -------------------------------------------------------------------------------- /2023/buckeye/dist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/buckeye/dist -------------------------------------------------------------------------------- /2023/cybersecurityrumble2023/backup/csr-2023/traffic.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/cybersecurityrumble2023/backup/csr-2023/traffic.pcap -------------------------------------------------------------------------------- /2023/cybersecurityrumble2023/exposed/csr-2023/exposed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/cybersecurityrumble2023/exposed/csr-2023/exposed -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/bfbf384b9e63d4d7748c7dc98aeb077e1c3d66e009ede0313ebf568464cb9b5c8002b34c36621a1aa7767b596eae00609929dad15ab31f77dacb57e8c03df921.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/bfbf384b9e63d4d7748c7dc98aeb077e1c3d66e009ede0313ebf568464cb9b5c8002b34c36621a1aa7767b596eae00609929dad15ab31f77dacb57e8c03df921.zip -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/gameboard_mine.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 12321 12321 12321 12321 23 | 1BBB1 1BBB1 1BBB1 1BBB1 24 | 13931 13931 13931 13931 25 | 191 191 191 1392 1221 26 | 111 111 111 1BB4212BB31 27 | 191 191 191 25BB9929BB2 28 | 191 191 191 1BB421129B2 29 | 111 111 111 1392 1221 30 | 191 191 191 191 191 31 | 191 191 191 12321 191 32 | 111 111 111 1B9B1 12321 33 | 191 191 191 23532 1B9B1 34 | 191 191 191 1B9B1 12321 35 | 111 111 111 23532 191 36 | -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell0.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell1.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell2.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell3.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell4.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell5.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell6.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell7.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell8.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/cell_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/cell_close.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/img/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/google2023/misc_mine-the-gap/img/flag.png -------------------------------------------------------------------------------- /2023/google2023/misc_mine-the-gap/minesweeper.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import itertools 3 | import hashlib 4 | from typing import List, Tuple 5 | 6 | # pip install pygame 7 | import pygame 8 | from pygame.locals import * 9 | 10 | pygame.init() 11 | 12 | FPS = 60 13 | FramePerSec = pygame.time.Clock() 14 | 15 | WHITE = (255, 255, 255) 16 | BLACK = (0, 0, 0) 17 | 18 | SCREEN_WIDTH = 1280 19 | SCREEN_HEIGHT = 720 20 | 21 | DISPLAYSURF = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) 22 | DISPLAYSURF.fill(WHITE) 23 | pygame.display.set_caption("Game") 24 | 25 | CELL_SIZE = 18 26 | 27 | # Images taken from https://hu.wikipedia.org/wiki/Aknakeres%C5%91_(vide%C3%B3j%C3%A1t%C3%A9k) 28 | # Images created by Kazukiokumura and distributed under CC BY-SA 4.0 License 29 | textures = { 30 | 'flag': pygame.transform.scale(pygame.image.load("img/flag.png"), (CELL_SIZE, CELL_SIZE)), 31 | 'cell0': pygame.transform.scale(pygame.image.load("img/cell0.png"), (CELL_SIZE, CELL_SIZE)), 32 | 'cell1': pygame.transform.scale(pygame.image.load("img/cell1.png"), (CELL_SIZE, CELL_SIZE)), 33 | 'cell2': pygame.transform.scale(pygame.image.load("img/cell2.png"), (CELL_SIZE, CELL_SIZE)), 34 | 'cell3': pygame.transform.scale(pygame.image.load("img/cell3.png"), (CELL_SIZE, CELL_SIZE)), 35 | 'cell4': pygame.transform.scale(pygame.image.load("img/cell4.png"), (CELL_SIZE, CELL_SIZE)), 36 | 'cell5': pygame.transform.scale(pygame.image.load("img/cell5.png"), (CELL_SIZE, CELL_SIZE)), 37 | 'cell6': pygame.transform.scale(pygame.image.load("img/cell6.png"), (CELL_SIZE, CELL_SIZE)), 38 | 'cell7': pygame.transform.scale(pygame.image.load("img/cell7.png"), (CELL_SIZE, CELL_SIZE)), 39 | 'cell8': pygame.transform.scale(pygame.image.load("img/cell8.png"), (CELL_SIZE, CELL_SIZE)), 40 | 'closed': pygame.transform.scale(pygame.image.load("img/cell_close.png"), (CELL_SIZE, CELL_SIZE)), 41 | } 42 | 43 | class QuadTree(object): 44 | CAPACITY = 100 45 | 46 | def __init__(self, rect: pygame.Rect): 47 | self.rect = rect 48 | self.quads = None 49 | self.items = [] 50 | 51 | def add(self, item) -> bool: 52 | if not item.rect.colliderect(self.rect): 53 | return False 54 | 55 | if len(self.items) < QuadTree.CAPACITY: 56 | self.items.append(item) 57 | return True 58 | 59 | if not self.quads: 60 | left = self.rect.left 61 | top = self.rect.top 62 | new_width = self.rect.width/2 63 | new_height = self.rect.height/2 64 | 65 | self.quads = [ 66 | QuadTree(pygame.Rect(left, top, new_width, new_height)), 67 | QuadTree(pygame.Rect(left+new_width, top, new_width, new_height)), 68 | QuadTree(pygame.Rect(left, top+new_height, new_width, new_height)), 69 | QuadTree(pygame.Rect(left+new_width, top+new_height, new_width, new_height)), 70 | ] 71 | 72 | if self.quads[0].add(item): return True 73 | if self.quads[1].add(item): return True 74 | if self.quads[2].add(item): return True 75 | if self.quads[3].add(item): return True 76 | 77 | return False 78 | 79 | def intersect(self, rect: pygame.Rect) -> List[pygame.sprite.Sprite]: 80 | res = [] 81 | if not self.rect.colliderect(rect): 82 | return res 83 | 84 | for item in self.items: 85 | if item.rect.colliderect(rect): 86 | res.append(item) 87 | 88 | if not self.quads: 89 | return res 90 | 91 | for quad in self.quads: 92 | res += quad.intersect(rect) 93 | 94 | return res 95 | 96 | def intersectpoint(self, p: Tuple[int, int]) -> List[pygame.sprite.Sprite]: 97 | res = [] 98 | if not self.rect.collidepoint(p): 99 | return res 100 | 101 | for item in self.items: 102 | if item.rect.collidepoint(p): 103 | res.append(item) 104 | 105 | if not self.quads: 106 | return res 107 | 108 | for quad in self.quads: 109 | res += quad.intersectpoint(p) 110 | 111 | return res 112 | 113 | class Cell(pygame.sprite.Sprite): 114 | def __init__(self, textures, state, x, y): 115 | super().__init__() 116 | self.textrues = textures 117 | self.rect = textures['cell0'].get_rect() 118 | self.rect.center = (CELL_SIZE*x, CELL_SIZE*y) 119 | self.state = state 120 | self.safe = False 121 | self.update_texture() 122 | 123 | def update(self, dx, dy): 124 | self.rect = self.rect.move(dx, dy) 125 | 126 | def draw(self, surface, offset): 127 | dest = self.rect.move(-offset.left, -offset.top) 128 | surface.blit(self.image, dest) 129 | 130 | def update_texture(self): 131 | if self.state in range(0, 9): 132 | self.image = self.textrues[f'cell{self.state}'] 133 | elif self.state == 9: 134 | self.image = self.textrues[f'closed'] 135 | elif self.state == 10: # Chosen mine 136 | self.image = self.textrues[f'flag'] 137 | elif self.state == 11: # Fixed mine 138 | self.image = self.textrues[f'flag'] 139 | else: 140 | print(f'Invalid state {self.state}') 141 | 142 | def click(self): 143 | if self.state == 9: 144 | self.state = 10 145 | elif self.state == 10: 146 | self.state = 9 147 | else: 148 | return 149 | self.update_texture() 150 | 151 | font = pygame.font.SysFont(None, 24) 152 | 153 | cells = [] 154 | 155 | with open('gameboard.txt', 'r') as fin: 156 | circuit = fin.read() 157 | circuit = circuit.replace(' ', '0') 158 | circuit = [list(line) for line in circuit.split('\n') if len(line) > 0] 159 | 160 | 161 | GRID_WIDTH = len(circuit[0]) 162 | GRID_HEIGHT = len(circuit) 163 | 164 | grid = QuadTree(pygame.Rect(-100, -100, CELL_SIZE*GRID_WIDTH + 100, CELL_SIZE*GRID_HEIGHT + 100)) 165 | validate_grid = [[None for x in range(GRID_WIDTH)] for y in range(GRID_HEIGHT)] 166 | 167 | for i, (x, y) in enumerate(itertools.product(range(GRID_WIDTH), range(GRID_HEIGHT))): 168 | 169 | for event in pygame.event.get(): 170 | if event.type == QUIT: 171 | pygame.quit() 172 | sys.exit() 173 | 174 | if i % 1000 == 0: 175 | DISPLAYSURF.fill(WHITE) 176 | progress = (i / (GRID_WIDTH*GRID_HEIGHT))*100 177 | img = font.render(f'Loading {progress:.0f}%', True, BLACK) 178 | DISPLAYSURF.blit(img, (20, 20)) 179 | img2 = font.render('Solve the board and press "m" to validate', True, BLACK) 180 | DISPLAYSURF.blit(img2, (20, 50)) 181 | img4 = font.render('Click cells to toggle mine location', True, BLACK) 182 | DISPLAYSURF.blit(img4, (20, 80)) 183 | img5 = font.render('Arrow keys to navigate board', True, BLACK) 184 | DISPLAYSURF.blit(img5, (20, 110)) 185 | img3 = font.render('Flag will be in console', True, BLACK) 186 | DISPLAYSURF.blit(img3, (20, 140)) 187 | pygame.display.update() 188 | 189 | tex = f'cell{(x*y)%10}' 190 | cell = Cell(textures, int(circuit[y][x], 16), x, y) 191 | validate_grid[y][x] = cell 192 | if not grid.add(cell): 193 | print(f'Failed to add ({x}, {y})') 194 | 195 | offset_x = 10 196 | offset_y = 20 197 | 198 | travel_x = 0 199 | travel_y = 0 200 | 201 | while True: 202 | offset_x += 10 * travel_x 203 | offset_y += 10 * travel_y 204 | for event in pygame.event.get(): 205 | if event.type == QUIT: 206 | pygame.quit() 207 | sys.exit() 208 | 209 | if event.type == pygame.MOUSEBUTTONUP: 210 | pos_x, pos_y = pygame.mouse.get_pos() 211 | cells_clicked = grid.intersectpoint((pos_x + offset_x, pos_y + offset_y)) 212 | for c in cells_clicked: 213 | c.click() 214 | #print(c) 215 | 216 | if event.type == pygame.KEYUP: 217 | if event.key == pygame.K_LEFT: 218 | travel_x = 0 219 | if event.key == pygame.K_RIGHT: 220 | travel_x = 0 221 | if event.key == pygame.K_UP: 222 | travel_y = 0 223 | if event.key == pygame.K_DOWN: 224 | travel_y = 0 225 | 226 | if event.type == pygame.KEYDOWN: 227 | if event.key == pygame.K_LEFT: 228 | travel_x = -1 229 | if event.key == pygame.K_RIGHT: 230 | travel_x = 1 231 | if event.key == pygame.K_UP: 232 | travel_y = -1 233 | if event.key == pygame.K_DOWN: 234 | travel_y = 1 235 | if event.key == pygame.K_d: 236 | breakpoint() 237 | if event.key == pygame.K_s: 238 | CONT = True 239 | while CONT: 240 | CONT = False 241 | print("tyring to solve") 242 | for i in range(GRID_HEIGHT): 243 | for j in range(GRID_WIDTH): 244 | if validate_grid[i][j].state not in [11, 10, 0]: #not a mine or not in game 245 | num = validate_grid[i][j].state 246 | empty = [] 247 | for x in [-1, 0, 1]: 248 | for y in [-1, 0, 1]: 249 | if not (x == y == 0): 250 | try: 251 | t = validate_grid[i+x][j+y].state 252 | except: 253 | t = 'N' 254 | if t == 10 or t == 11: # mine 255 | num -= 1 256 | elif t == 9 and not validate_grid[i+x][j+y].safe: 257 | empty.append((i+x, j+y)) 258 | if num == len(empty) and num != 0 : 259 | for this_one in empty: 260 | validate_grid[this_one[0]][this_one[1]].state = 10 261 | validate_grid[this_one[0]][this_one[1]].update_texture() 262 | print (f"checked {empty} as mine") 263 | CONT = True 264 | if num == 0 and len(empty)>0: 265 | CONT = True 266 | for this_one in empty: 267 | validate_grid[this_one[0]][this_one[1]].safe = True 268 | print (f"checked {empty} as safe") 269 | print('done solving') 270 | 271 | if event.key == pygame.K_m: 272 | violations = [] 273 | for y in range(GRID_HEIGHT): 274 | for x in range(GRID_WIDTH): 275 | test_cell = validate_grid[y][x] 276 | if test_cell.state not in range(0, 9): 277 | continue 278 | 279 | neighbours = 0 280 | if y > 0 and x > 0: neighbours += validate_grid[y-1][x-1].state in [10, 11] 281 | if y > 0: neighbours += validate_grid[y-1][x].state in [10, 11] 282 | if y > 0 and x+1 < GRID_WIDTH: neighbours += validate_grid[y-1][x+1].state in [10, 11] 283 | 284 | if x > 0: neighbours += validate_grid[y][x-1].state in [10, 11] 285 | if x+1 < GRID_WIDTH: neighbours += validate_grid[y][x+1].state in [10, 11] 286 | 287 | if y+1 < GRID_HEIGHT and x > 0: neighbours += validate_grid[y+1][x-1].state in [10, 11] 288 | if y+1 < GRID_HEIGHT: neighbours += validate_grid[y+1][x].state in [10, 11] 289 | if y+1 < GRID_HEIGHT and x+1 < GRID_WIDTH: neighbours += validate_grid[y+1][x+1].state in [10, 11] 290 | 291 | if test_cell.state != neighbours: 292 | violations.append((x,y)) 293 | 294 | if len(violations) == 0: 295 | bits = [] 296 | for x in range(GRID_WIDTH): 297 | bit = 1 if validate_grid[23][x].state in [10, 11] else 0 298 | bits.append(bit) 299 | flag = hashlib.sha256(bytes(bits)).hexdigest() 300 | print(f'Flag: CTF{{{flag}}}') 301 | 302 | else: 303 | print(violations) 304 | print(len(violations)) 305 | 306 | DISPLAYSURF.fill(WHITE) 307 | 308 | bound = DISPLAYSURF.get_bounding_rect() 309 | viewport = bound.move(offset_x, offset_y) 310 | 311 | for sprite in grid.intersect(viewport): 312 | sprite.draw(DISPLAYSURF, viewport) 313 | 314 | pygame.display.update() 315 | FramePerSec.tick(FPS) 316 | -------------------------------------------------------------------------------- /2023/maple/actual_baby.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/maple/actual_baby.zip -------------------------------------------------------------------------------- /2023/uiuc/vmwhere1/chal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/uiuc/vmwhere1/chal -------------------------------------------------------------------------------- /2023/uiuc/vmwhere1/program: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jadijadi/ctf/a53640377e2643b3d15facb880a05027bf1b617d/2023/uiuc/vmwhere1/program -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Jadi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ctf 2 | A source for CTFs I play and my writeups 3 | --------------------------------------------------------------------------------