Skip to content

Instantly share code, notes, and snippets.

@Asuforce
Created March 8, 2023 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Asuforce/108c2a1b8f2ad58fe6e45abe746cf4b3 to your computer and use it in GitHub Desktop.
Save Asuforce/108c2a1b8f2ad58fe6e45abe746cf4b3 to your computer and use it in GitHub Desktop.

Web security

Web threat models

  • network attacker
    • network attacker は web attacker より協力
  • malware attacker
    • os の配下で操作される

http

url

  • url に含まれるもの
    • protocol
    • hostname
    • port
    • path
      • file や program
    • query
    • fragment
      • page location
  • resource の場所を示している

http request

  • method
    • get, post
  • File
    • 欲しいファイル
  • refer
    • 参照元のページ

http response

  • サーバからのレスポンス
  • status
    • リクエストが同処理されたか
  • cookie

Rendering content

  • 今日のブラウザでは 様々なコンテンツが描画される
  • 1つのサイトの情報も様々なサーバにリクエストすることになる

DOM

  • html の構造を読み込んだり操作できる
  • javascript を利用して、 list を追加する例
  • html image tag を使って image を取得してくる

Image tag security issues

  • query parameter を付与して悪意のあるサーバが不正なデータ操作をする
  • 1 * 1 の画像を設置してユーザに見えないリソースをダウンロードさせる
  • ロゴを使ったりして他のサイトへなりすます

JavaScript onError

  • 読み込み失敗時にエラーを出力する

Port scanning behind firewall

  • internal ip がかかれたリクエストを画像に紛れさせて設置する
  • timer を利用して、結果を 送信する。

Remote scripting

  • 実行したい javascript の関数を埋め込んでおく
  • iframe で別のページのコンテンツをロードする
  • 別のページのコンテンツで先に埋め込んでいたコードを任意のタイミングで呼び出す
  • ユーザが意図しない関数が実行される
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment