2015-01-01から1年間の記事一覧

cowrieのセットアップメモ

cowrieはkippoを改良したSSHハニーポットである. ログをMySQL(mariaDB)に保存するまでのメモ. 基本的にINSTALL.mdを読んでいけばいい. cowrieはroot権限を持たないユーザーで動かすことを推奨されている. まずはユーザーの作成から. $ sudo adduser --disabl…

アセンブリメモ -スタック-

関数呼び出し時のスタックの動きなどのメモ. #include <stdio.h> int func(int a, int b, int c, int d){ int y = 20; char buf[10] = "ABCD"; return a+b+c+d; } int main(){ int x = 10; func(1, 2, 3, 4); } main()の逆アセンブル結果 0x08048400 <+0>: push %ebp </stdio.h>…

アセンブリメモ -ループ-

前回に続いてループ処理を見ていく. #include <stdio.h> int main(){ int i; for (i=0; i<10; i++){ printf("%d\n", i); } return 0; } 0x080483fb <+0>: lea 0x4(%esp),%ecx 0x080483ff <+4>: and $0xfffffff0,%esp 0x08048402 <+7>: pushl -0x4(%ecx) 0x08048405 <+</stdio.h>…

アセンブリメモ -if文-

Cを逆アセンブルした結果どのようになるかのメモ. まずはif文 if文 #include <stdio.h> int main(){ int x = 1; if(x > 5){ printf("x > 5\n"); } return 0; } 0x080483fb <+0>: lea 0x4(%esp),%ecx 0x080483ff <+4>: and $0xfffffff0,%esp 0x08048402 <+7>: pushl -0</stdio.h>…