Skip to content

Commit 845d124

Browse files
authored
Update 2024-03-31-Malware-Analysis.md
1 parent 60d6e82 commit 845d124

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_posts/2024-03-31-Malware-Analysis.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ render_with_liquid: false
1616
![image](https://github.com/sachinoliver/blog/assets/63084488/68595ca5-857c-4dd8-9069-bd6b03df63c8)
1717

1818
Extracted the sample from [`Malwarebazar`](https://bazaar.abuse.ch/sample/48abb729c4dd3419bbadd04d974a668d216d5513556d455bbd70dd3e2b723573/) with the password "infected".
19-
The sample is having a extenstion of .vbs, so dont run it, instead open with `notepad++`.
19+
The sample has an extention of .vbs, so dont run it, instead open with `notepad++`.
2020

2121
![notepad](https://github.com/sachinoliver/blog/assets/63084488/72f1f334-0195-4792-94fb-b3a54c266e6b)
2222

@@ -25,14 +25,14 @@ Its a starigtforward obfuscation. The function Tightness which takes the decimal
2525
![note](https://github.com/sachinoliver/blog/assets/63084488/673c51f3-2e7d-42f7-814d-fb2ad66c12aa)
2626

2727

28-
The code is trying to download and execute the content of the resourse at the URL.
28+
The code is trying to download and execute the content of the resource at the URL.
2929

30-
So lets curl the URL and get the file content downloaded... and it says 404 as of now the resourse is not available at the URL
30+
So lets curl the URL and get the file content downloaded... and it says 404 as of now the resource is not available at the URL
3131
![image](https://github.com/sachinoliver/blog/assets/63084488/eaef3524-aa5c-4d0d-8051-32efe3f69e74)
3232

3333
So we have a problem here, while I am analysing the sample the content or the payload which need to get downloaded during the execution of the above `vbs` script is no more available in the pastebin.... so how are we going to analyse it....!!!!
3434

35-
After seraching alot on internet, I was not getting the same file from any sandbox or from any Malware sample stores, So while I discussed the situation with my friend "[`Binary Panda`](https://binarypanda.me/)" who does similiar stunts with malware, so we both where trying to find the sample in different `sandboxes`. Meanwhile we saw in one of the popular sandbox we saw there is way to download pcap files for the sample which it has analyzed. That triggered a good idea!! Why cant we recreate the sample back from the pcap file!!!!
35+
After searching alot on internet, I was not getting the same file from any sandbox or from any Malware sample stores, So while I discussed the situation with my friend "[`Binary Panda`](https://binarypanda.me/)" who does similiar stunts with malware, so we both where trying to find the sample in different `sandboxes`. Meanwhile we saw in one of the popular sandbox we saw there is way to download pcap files for the sample which it has analyzed. That triggered a good idea!! Why cant we recreate the sample back from the pcap file!!!!
3636

3737
![image](https://github.com/sachinoliver/blog/assets/63084488/614384e7-3039-44f9-9d6d-5d9b9d08ec72)
3838
Building the sample from the response header.
@@ -77,7 +77,7 @@ So here we have two Urls that need to be downloaded for further analysis.
7777
But the file content is no more available in the location!!
7878

7979
![planet](https://github.com/sachinoliver/blog/assets/63084488/3d893871-23ad-4ffd-91e7-cb3db6e0a86b)
80-
Same thing happnens here too the file is not present in the localtion, so we recreate it with PCAP file which we downloaded before.
80+
Same thing happens here too the file is not present in the location, so we recreate it with PCAP file which we downloaded before.
8181

8282
After building the jpeg file, opened it in a `HxD`
8383

@@ -89,7 +89,7 @@ Seems like we need some cleaning to bring a real jpg file.
8989

9090
![steagno](https://github.com/sachinoliver/blog/assets/63084488/b6f6658c-c8fc-42aa-9792-67235a7da10c)
9191
Nice isnt it...
92-
Will Keep as a Desktop Banckground xD
92+
Will Keep as a Desktop Background xD
9393

9494

9595
Now as per the powershell script there are Flags `<<BASE64_START>>` and `<<BASE64_END>>` which we need to find from the file.
@@ -100,7 +100,7 @@ Lets find it in HxD
100100
![image](https://github.com/sachinoliver/blog/assets/63084488/941fe0e4-fbbb-4e29-b650-a056b1138efb)
101101
![image](https://github.com/sachinoliver/blog/assets/63084488/80528826-d3dc-4d05-9d92-678d94b432bd)
102102

103-
Scrolling throught the `HxD` we saw `<<BASE64_START>>` and `<<BASE64_END>>` flags.
103+
Scrolling through the `HxD` we saw `<<BASE64_START>>` and `<<BASE64_END>>` flags.
104104

105105
So lets decode the base64 string in `Cyberchef`
106106
![image](https://github.com/sachinoliver/blog/assets/63084488/4c581c2b-18bf-43cf-8e24-98abbda62d87)
@@ -115,7 +115,7 @@ Let open it in `dnSpy`
115115
![image](https://github.com/sachinoliver/blog/assets/63084488/08b1d7ae-23d5-499b-b1b4-dc5c2450314a)
116116

117117
## Persistence Technique
118-
After searching throught the .NET code, a method of ensuring persistence can be seen. This involves the program inserting itself into a registry key, enabling it to launch automatically upon each system startup. This persistence tactic help the malware to maintain a foothold within the compromised system.
118+
After searching through the .NET code, a method of ensuring persistence can be seen. This involves the program inserting itself into a registry key, enabling it to launch automatically upon each system startup. This persistence tactic help the malware to maintain a foothold within the compromised system.
119119

120120
![image (5)](https://github.com/sachinoliver/blog/assets/63084488/fc45cf3b-b29f-4740-be87-84959f89599b)
121121

0 commit comments

Comments
 (0)