markdownサンプル文章です。ここは地の文です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| # Report summary of login attempt by Kippo SSH-HoneyPot. | |
| # | |
| use strict; | |
| use warnings; | |
| use Geo::IP; | |
| my $geoip_country = Geo::IP->open("/usr/local/share/GeoIP/GeoIP.dat", GEOIP_MEMORY_CACHE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 共通 | |
| "+%s"でepoch秒を出力する | |
| # Linuxでは-dで日付を指定して+%sでepoch秒を出力 | |
| $ date -d '2006/01/01 00:00:00' '+%s' | |
| # FreeBSDでは、日付設定しない-jオプションと、日付フォーマット指定の-fオプションを使う | |
| $ date -j -f "%Y%m%d%H%M.%S" "200601010000.00" "+%s" | |
| # なおFreeBSDではフォーマットを省略するとYYYYMMDDHHMM.ssとみなすので、-fは省略可能 | |
| $ date -j "200601010000.00" "+%s" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Linux | |
| ## 2013年3月の前の月を取得したい。 | |
| # date -s "2013/03/30" | |
| 2013年 3月 30日 土曜日 00:00:00 JST | |
| # date "+%Y/%m/%d %H:%M:%S" -d "1 month ago" | |
| 2013/03/02 00:00:06 | |
| → "1 month ago"は本当に先月を返すわけではない。2月30日が無いために繰り上がってしまう。 | |
| → だから、先月を単純に取りたいときは前月に必ずある日……たとえば15日を指定しよう。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ diff -u base.py.orig base.py | |
| --- base.py.orig 2013-11-20 22:34:35.706403705 +0900 | |
| +++ base.py 2013-11-20 22:41:22.650394679 +0900 | |
| @@ -25,14 +25,25 @@ | |
| commands['/usr/bin/uptime'] = command_uptime | |
| class command_w(HoneyPotCommand): | |
| - def call(self): | |
| - self.writeln(' %s up %s, 1 user, load average: 0.00, 0.00, 0.00' % \ | |
| - (time.strftime('%H:%M:%S'), utils.uptime(self.honeypot.uptime()))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| # 再起(recursion)による階乗表現 | |
| sub factorial | |
| { | |
| my $n = shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| acl blacklist_regex url_regex "/usr/local/squid/etc/blacklist.txt" | |
| http_access deny blacklist_regex | |
| ... | |
| ... | |
| access_log /var/log/squid/access.log squid | |
| access_log /var/log/squid/deny.log squid blacklist_regex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # coding: UTF-8 | |
| # OpenSSH User Enumeration Time-Based Attack | |
| # https://cureblog.de/2013/07/openssh-user-enumeration-time-based-attack/ | |
| # 存在するユーザの場合は数十秒、存在しないユーザならば数秒で終わるため判定可能 | |
| import sys | |
| import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| openssl pkcs12 -export -inkey localhost.key -certfile ca-bundle.crt < localhost.crt > server.p12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ModemManager-glib-1.1.0-6.git20130913.el7.x86_64 | |
| NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| NetworkManager-glib-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| NetworkManager-tui-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| acl-2.2.51-12.el7.x86_64 | |
| aic94xx-firmware-30-6.el7.noarch | |
| alsa-firmware-1.0.27-2.el7.noarch | |
| alsa-lib-1.0.27.2-3.el7.x86_64 | |
| alsa-tools-firmware-1.0.27-4.el7.x86_64 | |
| audit-2.3.3-4.el7.x86_64 |