Jump to content
Tuts 4 You

VMProtect v3.5.0.1213


whoknows

Recommended Posts

whoknows

VMProtect v3.5.0.1213


Try to unpack or alternatively provide a serial. If there is no solution provided by Saturday 11am (GMT+0) I will attach the same without debugger detection.

Protections used:

Debugger detection (User-mode + Kernel-mode)

Ultra (Mutation + Virtualization)


 

Edited by whoknows (see edit history)
  • Like 1
Link to post
  • 3 weeks later...

Here is one of the solutions:

Spoiler

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsbHDTcxIP0LWYgmPM663d4ylbijmKAs0o0gXodxQEb

It uses cryptography to decrypt a string provided withing the key,key also contains RV and salt,which I both set to all \0,if it succeeds then it prints hi <DecrytpedString> thanks for registering,if it fails it prints invalid serial

 

Edit:

Decrypted Validate function:

Spoiler

ValidateFunc.png.81d689de80e36125f19de28f995784fd.png

 

Edited by BataBo (see edit history)
Link to post

Fun challenge. I went for finding just the key algorithm rather than fully devirtualizing, but the code is pretty clear. Here some sample keys:

Spoiler

whoknows: DkkLJ5UOI5DizM/Z7UhGQRt3dsR+OeyHlNNcQgmgFERdCXocbP6A3pMWWkhwqxLSMKEBN90qktRdhJPCsuCHQtm6M1GdlMtcFhkW5L+YTeaT3JAeZ+GTofwXKiD9ATdd

washi: t4t7484q1B32mDFo36MW6MCKEWef3WYzd6W/6Gq9K7OPGJDkMC8DBs3jQEX5KfW5basCKM4fo9klSGwoauyyOL4FCXtz5hcdTYLPVRpWIWi+CIgPv/36P9iEuU5l0Nnu

tuts4you: bX3YxhIyuJGGC5q7nCA5Ta8Ger+7AuRwdLe+58Pam+AwB9h8US6mO/NwosOE6DwEDx55ZHHzfGqZaFJbc9DNq3ZZv+pkwKhd5Vt3j3WpVFxTyhBxIflEAaymH08V5FqD

Approach:

Spoiler
  • Notice Validate is virtualized using VMP, and returns a string which is later displayed. => returned value is probably the name.
  • Notice that VM reads code using method  0x06000046. Also notice that field  0x04000048 is the virtual program counter and field 0x0400004A contains the stack.
  • Use this harmony script to perform a VM trace that dumps the program counter, stack contents and calls.
  • First run with garbage data reveals it requires a base64 string.
  • Second run, with a random base64 string reveals the key consists of three parts: first and second part are both 32 bytes, the rest is of arbitrary length.
  • Third run with hex data 00010203...4b4c4d4e4f reveals all that is necessary to create a keygen (full trace https://pastebin.com/Qcc2ULc6)
  • Notice it creates a new instance of Rfc2898DeriveBytes using 'tetris' as password, the first 32 bytes of the serial as salt, and 1000 iterations
  • Notice it creates a new instance of RijndaelManaged with blocksize = 256, mode = CBC, padding = PKCS7, and IV = the second part of the serial.
  • Notice it attempts to decrypt the remaining part of the serial using this instance of RijndaelManaged.
  • Keygen is simply doing the reverse of all operations in the trace.
  • Notice the decrypted data is returned and displayed => encrypted data is username encrypted using the same algorithm.

Keygen.7z

Edited by Washi (see edit history)
  • Like 1
  • Thanks 6
Link to post
16 hours ago, Washi said:

Fun challenge. I went for finding just the key algorithm rather than fully devirtualizing, but the code is pretty clear. Here some sample keys:

  Hide contents

whoknows: DkkLJ5UOI5DizM/Z7UhGQRt3dsR+OeyHlNNcQgmgFERdCXocbP6A3pMWWkhwqxLSMKEBN90qktRdhJPCsuCHQtm6M1GdlMtcFhkW5L+YTeaT3JAeZ+GTofwXKiD9ATdd

washi: t4t7484q1B32mDFo36MW6MCKEWef3WYzd6W/6Gq9K7OPGJDkMC8DBs3jQEX5KfW5basCKM4fo9klSGwoauyyOL4FCXtz5hcdTYLPVRpWIWi+CIgPv/36P9iEuU5l0Nnu

tuts4you: bX3YxhIyuJGGC5q7nCA5Ta8Ger+7AuRwdLe+58Pam+AwB9h8US6mO/NwosOE6DwEDx55ZHHzfGqZaFJbc9DNq3ZZv+pkwKhd5Vt3j3WpVFxTyhBxIflEAaymH08V5FqD

Approach:

  Reveal hidden contents
  • Notice Validate is virtualized using VMP, and returns a string which is later displayed. => returned value is probably the name.
  • Notice that VM reads code using method  0x06000046. Also notice that field  0x04000048 is the virtual program counter and field 0x0400004A contains the stack.
  • Use this harmony script to perform a VM trace that dumps the program counter, stack contents and calls.
  • First run with garbage data reveals it requires a base64 string.
  • Second run, with a random base64 string reveals the key consists of three parts: first and second part are both 32 bytes, the rest is of arbitrary length.
  • Third run with hex data 00010203...4b4c4d4e4f reveals all that is necessary to create a keygen (full trace https://pastebin.com/Qcc2ULc6)
  • Notice it creates a new instance of Rfc2898DeriveBytes using 'tetris' as password, the first 32 bytes of the serial as salt, and 1000 iterations
  • Notice it creates a new instance of RijndaelManaged with blocksize = 256, mode = CBC, padding = PKCS7, and IV = the second part of the serial.
  • Notice it attempts to decrypt the remaining part of the serial using this instance of RijndaelManaged.
  • Keygen is simply doing the reverse of all operations in the trace.
  • Notice the decrypted data is returned and displayed => encrypted data is username encrypted using the same algorithm.

Keygen.7z 7.15 kB · 7 downloads

Are you sure it's correct,the key isn't 'tetris' the key is 'duck',keys provided above don't work.

Link to post
3 hours ago, BataBo said:

Are you sure it's correct,the key isn't 'tetris' the key is 'duck',keys provided above don't work.

Whoops you are completely right, I posted my reply to the wrong vmp crackme/unpackme challenge thread. @whoknows has made two threads :D

This one is actually easier, since code is pretty much readable (after you dumped it from memory that is). And yea, the password for this one is indeed "duck" rather than tetris. :)

 

Edited by Washi (see edit history)
  • Like 2
Link to post
  • 3 weeks later...
  • 4 weeks later...
  • 2 weeks later...
  • 3 months later...
Leopar36
Spoiler

 





using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace awesome
{
	// Token: 0x02000002 RID: 2
	public class Form1 : Form
	{
		// Token: 0x06000002 RID: 2 RVA: 0x00002097 File Offset: 0x00000297
		public Form1()
		{
			this.InitializeComponent();
		}

		// Token: 0x06000003 RID: 3 RVA: 0x00002888 File Offset: 0x00000A88
		private void button1_Click(object sender, EventArgs e)
		{
			string text = null;
			try
			{
				text = Form1.Validate(this.textBox1.Text);
			}
			catch
			{
                this.label2.ForeColor = Color.Red;
				this.label2.Text = "invalid serial";
			}
			finally
			{
				if (text != null)
				{
                    this.label2.ForeColor = Color.DarkGreen;
					this.label2.Text = string.Format("hi {0} thanks for registering", text);
				}
			}
		}

		// Token: 0x06000004 RID: 4 RVA: 0x000028F8 File Offset: 0x00000AF8
		public static string Validate(string ikari)
		{
			byte[] array = Convert.FromBase64String(ikari);
			byte[] salt = array.Take(32).ToArray<byte>();
			byte[] rgbIV = array.Skip(32).Take(32).ToArray<byte>();
			byte[] array2 = array.Skip(64).Take(array.Length - 64).ToArray<byte>();
			string @string;
			using (Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes("duck", salt, 1000))
			{
				byte[] bytes = rfc2898DeriveBytes.GetBytes(32);
				using (RijndaelManaged rijndaelManaged = new RijndaelManaged())
				{
					rijndaelManaged.BlockSize = 256;
					rijndaelManaged.Mode = CipherMode.CBC;
					rijndaelManaged.Padding = PaddingMode.PKCS7;
					using (ICryptoTransform cryptoTransform = rijndaelManaged.CreateDecryptor(bytes, rgbIV))
					{
						using (MemoryStream memoryStream = new MemoryStream(array2))
						{
							using (CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptoTransform, CryptoStreamMode.Read))
							{
								byte[] array3 = new byte[array2.Length];
								int count = cryptoStream.Read(array3, 0, array3.Length);
								memoryStream.Close();
								cryptoStream.Close();
								@string = Encoding.UTF8.GetString(array3, 0, count);
							}
						}
					}
				}
			}
			return @string;
		}

		// Token: 0x06000005 RID: 5 RVA: 0x00002A64 File Offset: 0x00000C64
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}

		// Token: 0x06000006 RID: 6 RVA: 0x00002AEC File Offset: 0x00000CEC
		private void InitializeComponent()
		{
			this.textBox1 = new TextBox();
			this.button1 = new Button();
			this.label2 = new Label();
			base.SuspendLayout();
			this.textBox1.BorderStyle = BorderStyle.FixedSingle;
			this.textBox1.Font = new Font("Consolas", 9.75f);
			this.textBox1.Location = new Point(13, 45);
			this.textBox1.Multiline = true;
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new Size(348, 66);
			this.textBox1.TabIndex = 1;
			this.button1.Font = new Font("Consolas", 9.75f);
			this.button1.Location = new Point(12, 117);
			this.button1.Name = "button1";
			this.button1.Size = new Size(349, 35);
			this.button1.TabIndex = 2;
			this.button1.Text = "validate";
			this.button1.UseVisualStyleBackColor = true;
			this.button1.Click += this.button1_Click;
			this.label2.Font = new Font("Consolas", 9.75f);
			this.label2.Location = new Point(12, 9);
			this.label2.Name = "label2";
			this.label2.Size = new Size(349, 23);
			this.label2.TabIndex = 4;
			this.label2.Text = "welcome!";
			this.label2.TextAlign = ContentAlignment.MiddleCenter;
			base.AutoScaleDimensions = new SizeF(6f, 13f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(373, 160);
			base.Controls.Add(this.label2);
			base.Controls.Add(this.button1);
			base.Controls.Add(this.textBox1);
			base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
			base.MaximizeBox = false;
			base.Name = "Form1";
			base.StartPosition = FormStartPosition.CenterScreen;
			base.Text = "VMYarrak v3.5.0.1213";
			base.ResumeLayout(false);
			base.PerformLayout();
		}

		// Token: 0x04000001 RID: 1
		private IContainer components;

		// Token: 0x04000002 RID: 2
		private TextBox textBox1;

		// Token: 0x04000003 RID: 3
		private Button button1;

		// Token: 0x04000004 RID: 4
		private Label label2;
	}
}

 

Download: https://s4.dosya.tc/server13/tkpa2e/awesome.vmp_clean.exe.html

Key: HlgoynfyxFiMv94XScOTlJA65DTJrPd9pRY0zI3mKyO+IOunYkFdYWn6lGCufjKvVLrzZ94ivnJgqyVgvfjKpSyN4ImrVY/Bl5XU7+ne859RySqgyX919rcgIs6mk6OK

SS

rlXVEi.png

 

Edited by Leopar36 (see edit history)
  • Thanks 1
  • Haha 1
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...