WannaCry Analysis 🚫

Static and Dynamic Analysis Alt-text

Basics and Concepts

WannaCry broke previous malware records, due to the world-wide coverage. Like Pitbull, everyone was watching.

On May 12th 2017, WannaCry exploited a vulnerability in a protocol of Microsoft’s Operating System. Nearly 200,000 computers in 150 countries found that their files were encrypted and must pay $300 to recover them. One of the most affected users were within the British National Health Service (NHS) which rendered their systems useless, postponing medical appointments for weeks, with only emergencies the only service provided by the thousands of hospitals under the NHS.

Three Major Components

  1. Worm: does not require a primary host which allows it to spread autonomously
    • Took advantage of the SMBv1 protocol
    • Patched by Microsoft 2 months prior MS17-010 Critical
    • Released by the Shadow Brokers who released many other vulnerabilities in common software from the NSA
  2. Kill Switch: Single line of code that dictates behavior
    • Checks to see if the domain is registered
    • If live, stops spread and encryption on host computer
    • Otherwise, encrypts everything and sends to random IP addresses on the network
  3. Ransomware: User must pay to remove malware
    • Must pay $300 to recover the files
    • Users reported that paying the ransom did not resolve the issue (Twitter)

Technical

WannaCry is not a polymorphic worm, in that, the primary executable (malware) does not change over time, nor was designed to. It’s MD5 hash was the same across the world, however many copy-cats (enthusiast) hackers over the last decade have attempted to recreate this world-wide spread by modifying the Kill-Switch which inadvertently modifies the MD5 sum of the malware. Sophos Labs reported another 10 versions have been released to the public compared the original version.

The Server Message Block v1 protocol was vulnerable to the EternalBlue exploit that allows remote execution of arbitrary code on Windows systems. Computers who do not have this security patch are still vulnerable if they were shared this file directly over the network. Once this exploit gains access to the network, floods it with spoofed packets from Microsoft to reach the target machine. This allows attackers to compromised the entire local network and all devices connected to it. Shodan reported that in 2019 there are around 400,000 windows systems with the SMBv1 protocol still active and online. Now some of these may be honeypots, purposefully online to attract attackers to learn more about them, however the only prevention they have are anti-malware software (hopefully).

The final portion of this attack is through a raw shell code payload, DoublePulsar, a memory based kernel that hooks onto x86 and 64-bit systems that allows hackers to execute commands directly on the host computer. It can respond to a single ping request (see if the domain is active), uninstall itself, load shell code, and/or run a DLL on the host. This powerful exploit only resides in the RAM which is a two pronged attack, for the user can restart the computer and the malware is gone. However, random access memory is extremely fast (less than 1ms) to execute all commands.

Now for the fun…

I wanted to re-live this experience on my own computer, but in a contained, sandbox environment with VirtualBox and NO internet connection. So, I performed a static and dynamic analysis of this malware on the computer in a contained environment.

Set-up

  1. Import Virtual Machine: Win 10 w/ SMB v1
  2. NAT Network (EthicalHacking)
  3. Turning off adapter within environment before execution
    • It CAN spread if other machines on the network are not patched, and has access to the network
  4. Snapshot the box prior to each step for redundant backups
  5. Finally, disabling Windows Defender

Static Analysis

During the static analysis (before execution) which allows the analyst to pull information from the malware without running it.

  1. Strings Program
    • MD5 checksum
    • Kill switch domain
    • Packing information of executable
  2. Resource Hacker
    • FileVersion: 1.0
    • Ownership: Shado Brokers
    • Save the /bin as an executable
  3. Dependency Walker
    • Dynamic Linked Libraries included in packing info and use in a malware sample
    • BCRYPT.DLL: in house encryption for windows and re-used by WannaCry

Static Analysis

Dynamic Analysis

  1. Process Monitor
    • An advanced monitoring tool for Windows that shows real-time file system, Registry and process/thread activity. It combines the features of two legacy Sysinternals utilities, Filemon and Regmon, and adds an extensive list of enhancements including rich and non-destructive filtering, comprehensive event properties such as session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and much more. Its uniquely powerful features will make Process Monitor a core utility in your system troubleshooting and malware hunting toolkit.
  2. Process Explorer
    • The unique capabilities of Process Explorer make it useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.

Final Result

哆哆女性网水利公司起名大全水果店起名推广营销收费制作网站商城平台ucl珠宝设计好的seo陈起那些名字好一字起名男宝名字姓翁 起名大型网站性能优化如果给公司起英文名哎呀酋长网站建设选明科靠谱浏阳网站优化公司爱奇艺视频怎么下载梦见着火救火周公解梦重庆网络营销推广外包能听的鬼故事短视频seo关于周易八卦的小说黑蝴蝶观后感瓷都免费取名seo外论坛赵娟艺术签名智能起名字网免费地级市是什么意思周易免费取人名周易算命婚姻生辰八字互联网网站建设价格女人起名用哪个yi字好淀粉肠小王子日销售额涨超10倍罗斯否认插足凯特王妃婚姻不负春光新的一天从800个哈欠开始有个姐真把千机伞做出来了国产伟哥去年销售近13亿充个话费竟沦为间接洗钱工具重庆警方辟谣“男子杀人焚尸”男子给前妻转账 现任妻子起诉要回春分繁花正当时呼北高速交通事故已致14人死亡杨洋拄拐现身医院月嫂回应掌掴婴儿是在赶虫子男孩疑遭霸凌 家长讨说法被踢出群因自嘲式简历走红的教授更新简介网友建议重庆地铁不准乘客携带菜筐清明节放假3天调休1天郑州一火锅店爆改成麻辣烫店19岁小伙救下5人后溺亡 多方发声两大学生合买彩票中奖一人不认账张家界的山上“长”满了韩国人?单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#青海通报栏杆断裂小学生跌落住进ICU代拍被何赛飞拿着魔杖追着打315晚会后胖东来又人满为患了当地回应沈阳致3死车祸车主疑毒驾武汉大学樱花即将进入盛花期张立群任西安交通大学校长为江西彩礼“减负”的“试婚人”网友洛杉矶偶遇贾玲倪萍分享减重40斤方法男孩8年未见母亲被告知被遗忘小米汽车超级工厂正式揭幕周杰伦一审败诉网易特朗普谈“凯特王妃P图照”考生莫言也上北大硕士复试名单了妈妈回应孩子在校撞护栏坠楼恒大被罚41.75亿到底怎么缴男子持台球杆殴打2名女店员被抓校方回应护栏损坏小学生课间坠楼外国人感慨凌晨的中国很安全火箭最近9战8胜1负王树国3次鞠躬告别西交大师生房客欠租失踪 房东直发愁萧美琴窜访捷克 外交部回应山西省委原副书记商黎光被逮捕阿根廷将发行1万与2万面值的纸币英国王室又一合照被质疑P图男子被猫抓伤后确诊“猫抓病”

哆哆女性网 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化