Skip to content

Instantly share code, notes, and snippets.

@ak1t0
ak1t0 / regkey.sh
Last active September 6, 2018 09:00
add GitHub SSH key to authorize_keys
#!/bin/bash
users=("spring-raining" "myr523" "ak1t0")
i=0
mkdir ~/.ssh
for user in ${users[@]}; do
curl -s -S https://github.com/${users[i]}.keys >> ~/.ssh/authorized_keys
let i++
done
@ak1t0
ak1t0 / stretch-ssl.md
Last active July 3, 2018 12:58
Debian(stretch) / Ubuntu 18.04 で起こる EVP_CIPHER_CTX incomplete type errorの解決法
@ak1t0
ak1t0 / install.sh
Created June 11, 2018 12:57
Tor official deb auto-install
echo "deb https://deb.torproject.org/torproject.org xenial main" | sudo tee -a /etc/apt/sources.list.d/tor.list
echo "deb-src https://deb.torproject.org/torproject.org xenial main" | sudo tee -a /etc/apt/sources.list.d/tor.list
gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt update
sudo apt install tor
@ak1t0
ak1t0 / keybase.md
Created June 10, 2018 08:06
keybase.md

Keybase proof

I hereby claim:

  • I am ak1t0 on github.
  • I am ak1t0 (https://keybase.io/ak1t0) on keybase.
  • I have a public key whose fingerprint is 2A6F D2AC 1EDB 0268 667F F95A 9061 CCC6 FE3E 8B08

To claim this, I am signing this object:

@ak1t0
ak1t0 / server-go.md
Last active December 7, 2024 12:15
サーバサイド Go 入門資料 まとめ

サーバについて

How I write Go HTTP services after seven years
https://medium.com/@matryer/how-i-write-go-http-services-after-seven-years-37c208122831
GoでとあるAPIサーバを実装し直した話
http://tech.mercari.com/entry/2016/12/19/180000
golangのHTTPサーバを構成しているもの
https://reiki4040.hatenablog.com/entry/2017/03/01/212647
GoでJSON APIを書く
http://sgykfjsm.github.io/blog/2016/03/13/golang-json-api-tutorial/
Go 言語の http パッケージにある Handle とか Handler とか HandleFunc とか HandlerFunc とかよくわからないままとりあえずイディオムとして使ってたのでちゃんと理解したメモ

@ak1t0
ak1t0 / wwy.md
Last active February 11, 2018 07:58
WE'RE WATCHING YOU! solution

WE'RE WATCHING YOU!

Harekaze CTF 2018

This problem is based on real world incident.

real IP address

Most frequent onion service misconfigurtion is opening server's port 80 and IPv4 whole scanner like Censys, shodan always scan all IPv4 addresses. So, search http://jbwocj4f64dkfiwv.onion on Censys. There is a readl IP address of onion services.

SSH fingerprint

Censys also save SSH key fingerprint. If admin is lazy, admin reuse these SSH key. So search fingerprint on Censys.

@ak1t0
ak1t0 / joomla_killer.py
Created July 3, 2016 13:05
Black Hat Python 5.4
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# サイバーセキュリティプログラミング 5.4
# Joomla 3.5.1
# HTTPErrorでループが止まるので例外を握りつぶすように変更
import urllib2
import urllib
import cookielib

Clover

概要

CloverはClojureライクな文法をもつコンパイラ型の言語処理系です。

動機

ClojureはJVM(JavaVirtualMachine)上で動くLispの一種で、JVM上で動くことは既存のライブラリが使えるなど利点もあるのですが、REPLの起動にJVMの起動が必要だったり実行ファイルがjar形式だったりと制約も多く、Clojureの文法を持つコンパイラ型の処理系が欲しいと思ったので作りました。また、ClojureのJVM以外への移植はClojureScript(altJS)やCLR(.NET)などがあります。

技術的概要

Parsecによって抽象構文木を生成し、その構文木をGoに変換して、内部からGoコンパイラを呼んでコンパイルする形になっています。

@ak1t0
ak1t0 / ghad.clj
Created January 16, 2016 14:16
GitHub auto-downloader
(ns gh.core
(:require [clj-http.client :as client])
(:use [clojure.tools.namespace.repl :only [refresh]]
[hickory.core]
[clojure.string :only [trim]]))
;; download all repo as zip
(def target-url "https://github.com/[user-name]/")
@ak1t0
ak1t0 / gist:e6c635752b68b8d2b1d3
Last active August 29, 2015 14:08
ReducersをCriteriumで
(ns reduce-sample.core
  (:require
   [clojure.core.reducers :as r]
   [criterium.core :as crite]))
(crite/bench (do (into [] (r/filter even? (range 100000))) nil))