Skip to content

Instantly share code, notes, and snippets.

@hakatashi
hakatashi / gist:9c76bc400911f71c4fac
Last active August 29, 2015 14:23
セキュキャン2015 応募用紙 問題9

セキュキャン2015 応募用紙 問題9

以下のコードは、与えられたテキスト内からURLらしき文字列を探して、それらを<a>要素でリンクにしたHTMLを生成するJavaScriptの関数であるとします。攻撃者が引数 text の中身を自由に制御可能な場合、このコードにはどのような問題点があるか、またこのコードを修正するとすればどのようにすればよいか、自分なりに考察して書いてください。

function makeUrlLinks( text ){
 var html = text.replace( /[\w]+:\/\/[\w\.\-]+\/[^\r\n \t<>"']*/g, function( url ){
   return "<a href=" + url + ">" + url + "</a>";
   } );
 document.getElementById( "output" ).innerHTML = html;
}
@hakatashi
hakatashi / inject-to-pixiv.css
Created June 25, 2015 13:14
Unidentified Scripts
._image-items {
text-align: center;
}
.image-item {
display: inline-block;
height: 350px;
width: auto;
padding: 0;
margin: 2px;
request = require 'C:\\Users\\hakatashi\\node_modules\\request'
cheerio = require 'C:\\Users\\hakatashi\\node_modules\\cheerio'
async = require 'C:\\Users\\hakatashi\\node_modules\\async'
file = require 'C:\\Users\\hakatashi\\node_modules\\file'
sanitize = require 'C:\\Users\\hakatashi\\node_modules\\sanitize-filename'
mkdirp = require 'C:\\Users\\hakatashi\\node_modules\\mkdirp'
colors = require 'C:\\Users\\hakatashi\\node_modules\\colors'
fs = require 'fs'
path = require 'path'
@hakatashi
hakatashi / specs-that-depend-on-unicode.md
Created October 24, 2015 06:29
Unicodeに依存している仕様まとめ

Unicodeに依存している仕様まとめ

Sclipting (Kanji Only)
丟虛根講拾止半貳負并
貶跟平重增上終并首貳
加鈉叁硼壹貶貶鎂銀壹
加氦首跟加磷柒增氧蟜
首加鋁銅各字終 135 hakatashi
@hakatashi
hakatashi / choco-list-lo.txt
Last active February 13, 2018 05:06
choco list -lo
$ choco list -lo
Chocolatey v0.10.8
7zip.commandline 16.02.0.20170209
7zip.install 16.4.0.20170403
7zip.portable 16.04
AdobeAIR 24.0.0.180
adobereader 2015.007.20033.01
android-sdk 25.2.3.1
arduino 1.6.7
arduinoide 1.6.1
[1633274, 12002730, 164623, 2230359, 122372, 755129, 4642657, 6332005, 13007040, 11435832, 390455, 16186511, 236328, 3212084, 2393746, 14201186, 6350104, 7116575, 2008822, 2005161, 881764, 655960, 6037154, 14590806, 660269, 586045, 6208938, 1614697, 22783, 9518973, 346, 190377, 170464, 1994637, 1798613, 145719, 237196, 226794, 283275, 167837, 184123, 36501, 2666814, 8253, 215082, 316309, 5804082, 109923, 6017752, 29984, 851453, 3499635, 4427149, 4545, 1197616, 3066730, 451367, 274698, 1729715, 741807, 1102733, 543075, 1054550, 83235, 29524]
require! {fs, async, request, cheerio, \csv-stringify}
stringifier = csv-stringify!
writer = fs.create-write-stream \erogamescape-dump.csv
stringifier.pipe writer
var records-got
record-from = 0
@hakatashi
hakatashi / sig-web-01.md
Last active March 15, 2018 10:40
Web分科会第1回 環境構築

Macは詳しくないので不正確なところがあると思います。自力で頑張れ。

XAMPP

Windows, OS X, Linux

https://www.apachefriends.org/jp/download.html からダウンロードできる。

現在 PHP 5.6, 7.0, 7.1, 7.2 が用意されている。なるべく最新版を使いたいので7.2を選択しダウンロード。

@hakatashi
hakatashi / sig-web-02.md
Last active May 18, 2016 16:45
TSG 第2回Web分科会

TSG 第2回Web分科会 カンペ

PHPによるサーバーサイドWebプログラミングを体験する。

Hello, World!

XAMPPを使用する場合

インストールしたディレクトリ(ふつうはC:\xampp)の下にhtdocsというフォルダがある。