# Bug in Malware “TSCookie” - Fails to Read Configuration **blogs.jpcert.or.jp/en/2018/11/tscookie2.html** 朝長 [秀誠 (Shusei Tomonaga)](https://blogs.jpcert.or.jp/en/shu_tom/) November 12, 2018 [BlackTech](https://blogs.jpcert.or.jp/en/tags/blacktech/) [Email](http://10.10.0.46/mailto:?subject=Bug%20in%20Malware%20%E2%80%9CTSCookie%E2%80%9D%20-%20Fails%20to%20Read%20Configuration%20-&body=https%3A%2F%2Fblogs.jpcert.or.jp%2Fen%2F2018%2F11%2Ftscookie2.html) In [a previous article we have introduced malware ‘TSCookie’, which is assumedly used by an](https://blogs.jpcert.or.jp/en/2018/03/malware-tscooki-7aa0.html) attacker group BlackTech. We have been observing continuous attack activities using the malware until now. In the investigation of an attack observed around August 2018, we have confirmed that there was an update in the malware. There are two points meriting attention in this update: Communication with C&C server Decoding configuration information This article will introduce the details of the update. ## Communication with C&C server In the previous version, TSCookie included encrypted contents in the Cookie header to communicate to a C&C server. ``` GET /Default.aspx HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Date: Thu, 18 Jan 2018 10:20:55 GMT Pragma: no-cache Accept: */* Cookie: 1405D7CD01C6978E54E86DA9525E1395C4DD2F276DD28EABCC3F6201ADAA66F55C15352D29D0FFE51BC9D4 User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32) Host:[host name]:443 ``` In the new version, Cookie header is no longer used. Instead, encrypted contents are placed within the URL parameter as below: ----- ``` GET /t3328483620.aspx?m 4132641264&i 44D6CF457ADC27B2AFAAEAA&p EF4D5069C30D6CAC9 HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Pragma: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32) Host: [host name]:443 ``` If received an ack from the server to this HTTP GET request, an HTTP POST request will be sent as a next step. The communication feature is the same as the previous TSCookie. For encryption, RC4 is still used, but the key is generated differently. Here is an example code for decoding HTTP GET request parameter. ``` data = "&" + sys.argv[1] # sys.argv[1] = URL path conf_key = sys.argv[2].decode("hex") # sys.argv[2] = Configuration key field = data.split("&") url_key = field[1] i=2 encdata = "" while i