<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Wanderings</title><description>Avantiks&apos;s Blog</description><link>https://iamavu.com/</link><language>en</language><item><title>Weekly Wanderings</title><link>https://iamavu.com/posts/00-weekly-wanderings/</link><guid isPermaLink="true">https://iamavu.com/posts/00-weekly-wanderings/</guid><description>What She Wanders About Every Week (Almost)</description><pubDate>Wed, 11 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;what she explored this week&lt;/h2&gt;
&lt;h3&gt;week 0x17&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed all shellcoding lectures and 2 levels of the same&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x16&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed all lectures of memory corruption and 2 levels of the same&lt;/li&gt;
&lt;li&gt;2 lectures of shellcoding&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x15&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;got &lt;a href=&quot;https://wargames.ret2.systems/&quot;&gt;ret2.systems&apos;s wargame&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;completed chapter 0, 1, 2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x14&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;did 2 challs from pwn.college rev section&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x13&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;did 15 challs from pwn.college rev section&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x12&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed &lt;a href=&quot;https://hackaday.io/course/172292-introduction-to-reverse-engineering-with-ghidra&quot;&gt;hackaday&apos;s ghidra course&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x11&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed C course&lt;/li&gt;
&lt;li&gt;wrote the blog post for making my first crackme -- &lt;a href=&quot;https://iamavu.com/posts/05-making-medusa-my-first-crackme-part-0x01/&quot;&gt;medusa&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x10&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;started orange belt of &lt;a href=&quot;https://pwn.college&quot;&gt;pwn.college&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;completed 25 challenges from the same&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x09&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;working on x86-64 course from OST2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x08&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed 4 challs from rev @ pwn.college&lt;/li&gt;
&lt;li&gt;tried writing C code to XOR a file but failed&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x07&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;ELF files and information about them&lt;/li&gt;
&lt;li&gt;completed GDB course from OST2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x06&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;started back with c from beej&apos;s guide&lt;/li&gt;
&lt;li&gt;did picoCTF rev chall - WinAntiDbg0x100&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x05&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;did few challs of pwn.college, stuck on the shellcoding part&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x05&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;did 10 challs of pwn.college of assembly crash course&lt;/li&gt;
&lt;li&gt;did 3 chapters of C book&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x04&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed &lt;a href=&quot;https://begin.re&quot;&gt;begin.re&lt;/a&gt; except the minesweeper challenge&lt;/li&gt;
&lt;li&gt;did 7 levels of pwn.college asm crash course&lt;/li&gt;
&lt;li&gt;solved 5 challenges from picoCTF in reversing section&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x03&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;completed basic static analysis from PMA book and all of it&apos;s labs&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x02&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;itsy bitsy of HTB CTF, couldn&apos;t play much&lt;/li&gt;
&lt;li&gt;PMA book as usual&lt;/li&gt;
&lt;li&gt;brought back my &lt;a href=&quot;https://iamavu.gitbook.io&quot;&gt;gitbook&lt;/a&gt; to life&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;week 0x01&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;pwn.college - program misuse 10 levels&lt;/li&gt;
&lt;li&gt;practical malware analysis book - 50 pages - some windows API calls, understanding and identifying what makes a malware, a malware&lt;/li&gt;
&lt;li&gt;developing with astro theme and some tailwind CSS&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Making Medusa : My First CrackMe - Part 0x01</title><link>https://iamavu.com/posts/05-making-medusa-my-first-crackme-part-0x01/</link><guid isPermaLink="true">https://iamavu.com/posts/05-making-medusa-my-first-crackme-part-0x01/</guid><description>Making my first crackme challenge in C</description><pubDate>Sat, 19 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Table Of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mainc&quot;&gt;MAIN.C&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#pseudo-c&quot;&gt;PSEUDO-C&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#disassembly&quot;&gt;DISASSEMBLY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#layering&quot;&gt;LAYERING&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#problemo&quot;&gt;PROBLEMO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#what-we-learnt&quot;&gt;WHAT WE LEARNT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I had just started learning C and after completing few basics, I was looking for my first project to make. After thinking around, I landed on making a CrackMe challenge in C.
Goal would be to start small, compile the binary, view the disassembly, view the pseudo-C code in IDA-Free and co-relate everything and move to adding more complexities.&lt;/p&gt;
&lt;p&gt;GGs, that sounds fun!
Lets code, shall we?&lt;/p&gt;
&lt;h3&gt;MAIN.C&lt;/h3&gt;
&lt;p&gt;First I wrote a simple &lt;code&gt;main.c&lt;/code&gt; program--&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include  &amp;lt;stdint.h&amp;gt;
#include  &amp;lt;sys/mman.h&amp;gt;
#include  &amp;lt;string.h&amp;gt;

int  main()
{
	uint8_t  code  []  =  {0xB8,  0x42,  0x00,  0x00, 0x00,  0xC3}; // mov eax, 0x42; ret

	void  *mem  =  mmap(NULL,  1024,  PROT_READ  |  PROT_WRITE  |  PROT_EXEC,  MAP_ANON  |  MAP_PRIVATE,  -1,  0); // create a protected executable anonymous private memory region

	memcpy(mem,  code,  sizeof(code)); // copy the code to that region

	int  (*func)()  =  mem; // cast a function pointer and point it to mem

	int  result  =  func(); // execute the func() function and store the result in result variable

	return  result; // return the result which should be 66
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Lets compile the program and view its pseudo-C code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gcc -m32 -fno-stack-protector -z execstack -no-pie -fno-pic main.c -o main
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-m32&lt;/strong&gt; : Produces a 32-bit binary&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-fno-stack-protector&lt;/strong&gt; : Disables canary-based stack protection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-z execstack&lt;/strong&gt; : Marks the stack as executable&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-no-pie&lt;/strong&gt; : Generates a binary with a fixed base address instead of randomized addresses (ASLR for PIE)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-fno-pic&lt;/strong&gt; : Disables generation of position-independent code. Relevant mostly for shared libraries or PIEs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;main.c&lt;/strong&gt; : Source file to compile.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;-o main&lt;/strong&gt; : Names the output binary &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;PSEUDO-C&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;int __cdecl main(int argc, const char **argv, const char **envp)
{
  int (*v3)(void); // function pointer that takes no argument

  v3 = (int (*)(void))mmap(0, 1024u, 7, 0x22, -1, 0); // calls mmap to allocate 1024 bytes of memory with read, write, and execute permissions
  *(_DWORD *)v3 = 0x42B8; // store 0x42B8 in memory
  *((_WORD *)v3 + 2) = 0xC300; // store next bytes (0xC300) with offset of 4 (2 WORDs)
  return v3(); // calls the function executing the code
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;DISASSEMBLY&lt;/h3&gt;
&lt;p&gt;and now its disassembly&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; int __cdecl main(int argc, const char **argv, const char **envp)
public main
main proc near

; variables
var_1A= dword ptr -1Ah
var_16= word ptr -16h
var_14= dword ptr -14h
var_10= dword ptr -10h
var_C= dword ptr -0Ch
var_4= dword ptr -4
argc= dword ptr  8
argv= dword ptr  0Ch
envp= dword ptr  10h

; __unwind {
; stack frame setup
lea     ecx, [esp+4]
and     esp, 0FFFFFFF0h
push    dword ptr [ecx-4]
push    ebp
mov     ebp, esp
push    ecx
sub     esp, 24h

; call mmap to allocate executable memory and storing return pointer in var_C
mov     [ebp+var_1A], 42B8h
mov     [ebp+var_16], 0C300h
sub     esp, 8
push    0               ; offset
push    0FFFFFFFFh      ; fd
push    22h ; &apos;&quot;&apos;       ; flags
push    7               ; prot
push    400h            ; len
push    0               ; addr
call    _mmap
add     esp, 20h
mov     [ebp+var_C], eax

; copy machine code to allocated memory
mov     eax, [ebp+var_C]
mov     edx, [ebp+var_1A]
mov     [eax], edx
movzx   edx, [ebp+var_16]
mov     [eax+4], dx

; prepare and call the function
mov     eax, [ebp+var_C]
mov     [ebp+var_10], eax
mov     eax, [ebp+var_10]
call    eax

; return the result and clean the stack
mov     [ebp+var_14], eax
mov     eax, [ebp+var_14]
mov     ecx, [ebp+var_4]
leave
lea     esp, [ecx-4]
retn
; } // starts at 8049166
main endp

_text ends
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;LAYERING&lt;/h3&gt;
&lt;p&gt;Now that we have seen code in all three forms, let&apos;s add some layers. I wrote another file &lt;code&gt;validate.c&lt;/code&gt;--&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include  &amp;lt;stdio.h&amp;gt;
#include  &amp;lt;string.h&amp;gt;
int  validate(const  char  *input);  
int  main()
{
	char  input[64];
	scanf(&quot;%63s&quot;,  input);
	if  (validate(input))
	{
	printf(&quot;Correct!\n&quot;);
	}
	else
	{
	printf(&quot;Wrong!\n&quot;);
	}
	return  0;
}  

int  validate(const  char  *input)
{
	const  char  *flag  =  &quot;pwning-since-1337&quot;;
	int  i  =  0;
	for  ( ; ;  i++)
	{
		unsigned  char  a  =  (unsigned  char)input[i];
		unsigned  char  b  =  (unsigned  char)flag[i];
		if  (a  !=  b)
		{
			return  0;
		}
		if  (a  ==  0)
		{
			return  1;
		}
	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I compiled it again and this time we extract just the raw instruction bytes of validate part of the code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;objdump -M intel -d validate | awk &apos;/&amp;lt;validate&amp;gt;:/,/^$/&apos; | awk &apos;/^[[:space:]]*[0-9a-f]+:/ {for(i=2;i&amp;lt;=10;i++) if($i ~ /^[0-9a-f][0-9a-f]$/) printf &quot;0x%s, &quot;, $i} END {print &quot;&quot;}&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(thanks chatGPT).&lt;/p&gt;
&lt;p&gt;which now we will be XORing with a key (&lt;code&gt;0x1337&lt;/code&gt;) using python--&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def  xor_encrypt(buf:  bytearray,  key:  int)  -&amp;gt;  None:
	key_bytes =  [key &amp;amp;  0xFF,  (key &amp;gt;&amp;gt;  8)  &amp;amp;  0xFF]
	for i in  range(len(buf)):
	buf[i]  ^=  key_bytes[i %  2]

validate_bytes =  [
0x55,  0x89,  0xe5,  0x83,  0xec,  0x10,  0xc7,  0x45,  0xf8,  0x1d,  0xa0,  0x04,
0x08,  0xc7,  0x45,  0xfc,  0x00,  0x00,  0x00,  0x00,  0x8b,  0x55,  0xfc,  0x8b,
0x45,  0x08,  0x01,  0xd0,  0x0f,  0xb6,  0x00,  0x88,  0x45,  0xf7,  0x8b,  0x55,
0xfc,  0x8b,  0x45,  0xf8,  0x01,  0xd0,  0x0f,  0xb6,  0x00,  0x88,  0x45,  0xf6,
0x0f,  0xb6,  0x45,  0xf7,  0x3a,  0x45,  0xf6,  0x74,  0x07,  0xb8,  0x00,  0x00,
0x00,  0x00,  0xeb,  0x13,  0x80,  0x7d,  0xf7,  0x00,  0x75,  0x07,  0xb8,  0x01,
0x00,  0x00,  0x00,  0xeb,  0x06,  0x83,  0x45,  0xfc,  0x01,  0xeb,  0xc1, 0xc9,
0xc3

]

data =  bytearray(validate_bytes)

xor_encrypt(data,  0x1337)

print(&quot;Encrypted:&quot;,  &apos;, &apos;.join(f&apos;0x{b:02x}&apos;  for b in data))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we update our C code to look something like this--&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include  &amp;lt;stdint.h&amp;gt;
#include  &amp;lt;sys/mman.h&amp;gt;
#include  &amp;lt;string.h&amp;gt;
#include  &amp;lt;stdio.h&amp;gt;

void  xor_decrypt(uint8_t  *buf,  size_t  len,  uint16_t  key);

int  main()
{
	char  input[64];
	printf(&quot;WELCOME TRAVELLER, SPEAK THY SHAN&apos;T BE STONED: &quot;);
	fflush(stdout);
	if  (scanf(&quot;%63s&quot;,  input)  !=  1)
	{
		return  1;
	}
	
	uint8_t  code[]  =  {0x62,  0x9a,  0xd2,  0x90,  0xdb,  0x03,  0xf0,  0x56,  0xcf,  0x0e,  0x97,  0x17,  0x3f,  0xd4,  0x72,  0xef,  0x37,  0x13,  0x37,  0x13,  0xbc,  0x46,  0xcb,  0x98,  0x72,  0x1b,  0x36,  0xc3,  0x38,  0xa5,  0x37,  0x9b,  0x72,  0xe4,  0xbc,  0x46,  0xcb,  0x98,  0x72,  0xeb,  0x36,  0xc3,  0x38,  0xa5,  0x37,  0x9b,  0x72,  0xe5,  0x38,  0xa5,  0x72,  0xe4,  0x0d,  0x56,  0xc1,  0x67,  0x30,  0xab,  0x37,  0x13,  0x37,  0x13,  0xdc,  0x00,  0xb7,  0x6e,  0xc0,  0x13,  0x42,  0x14,  0x8f,  0x12,  0x37,  0x13,  0x37,  0xf8,  0x31,  0x90,  0x72,  0xef,  0x36,  0xf8,  0xf6,  0xda,  0xf4}; // encrypted xor
	
	void  *mem  =  mmap(NULL,  1024,  PROT_READ  |  PROT_WRITE  |  PROT_EXEC,  MAP_ANON  |  MAP_PRIVATE,  -1,  0); // create a protected executable anonymous private memory region
	
	memcpy(mem,  code,  sizeof(code)); // copy the code to that region
	
	xor_decrypt((uint8_t  *)mem,  sizeof(code),  0x1337); // decrypt mem in runtime (use sizeof code as we only need to decrypt that many bytes)
	int  (*validate_func)(const  char  *)  =  mem; // cast a function pointer and point it to mem
	
	int  ok  =  validate_func(input);
	
	puts(ok  ?  &quot;YOU ARE SAVED TRAVELLER, YOU MAY PROCEED!&quot;  :  &quot;YOU GOT STONED BY THE MEDUSA!&quot;);
}

void  xor_decrypt(uint8_t  *buf,  size_t  len,  uint16_t  key)
{
	uint8_t  key_bytes[2];
	key_bytes[0]  =  key  &amp;amp;  0xFF; // lower byte
	key_bytes[1]  =  (key  &amp;gt;&amp;gt;  8)  &amp;amp;  0xFF; // upper byte
	for  (size_t  i  =  0;  i  &amp;lt;  len;  i++)
	{
		buf[i]  ^=  key_bytes[i  %  2]; // alternate between lower and upper byte
	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;PROBLEMO&lt;/h3&gt;
&lt;p&gt;But there comes a problem, no matter what I entered, wrong flag or right flag, It would always give me &lt;code&gt;&quot;YOU GOT STONED BY THE MEDUSA!&quot;&lt;/code&gt;
What went wrong, after pondering and tinkering I realised that the flag &lt;code&gt;pwning-since-1337&lt;/code&gt; would be stored in &lt;code&gt;.rodata&lt;/code&gt; and there would be no way to access it in &lt;code&gt;validate&lt;/code&gt;&apos;s function.&lt;/p&gt;
&lt;p&gt;We need to write self contained function which has the &lt;code&gt;pwning-since-1337&lt;/code&gt; itself.
So we just make an local array, easy-peasy-lemon-squeezy!&lt;/p&gt;
&lt;p&gt;Here is our updated &lt;code&gt;validate-self-contained.c&lt;/code&gt;--&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include  &amp;lt;stdio.h&amp;gt;
#include  &amp;lt;string.h&amp;gt;

int  validate(const  char  *input);

int  main()
{
	char  input[64];
	scanf(&quot;%63s&quot;,  input);
	
	if  (validate(input))
	{
		printf(&quot;Correct!\n&quot;);
	}
	else
	{
		printf(&quot;Wrong!\n&quot;);
	}
	
	return  0;
}
  
int  validate(const  char  *input)
{
// Store the flag as a local array, not as a pointer to a string literal
const  unsigned  char  flag[]  =  {
&apos;p&apos;,  &apos;w&apos;,  &apos;n&apos;,  &apos;i&apos;,  &apos;n&apos;,  &apos;g&apos;,  &apos;-&apos;,  &apos;s&apos;,  &apos;i&apos;,  &apos;n&apos;,  &apos;c&apos;,  &apos;e&apos;,  &apos;-&apos;,  &apos;1&apos;,  &apos;3&apos;,  &apos;3&apos;,  &apos;7&apos;,  0};

int  i  =  0;
while  (1)
{
	unsigned  char  a  =  (unsigned  char)input[i];
	unsigned  char  b  =  flag[i];
	if  (a  !=  b)
	{
		return  0;
	}
		
	if  (a  ==  0)
	{
		return  1;
	}		
	i++;
}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Compile. Extract. XOR. Same yadda yadda process
and lets hit run!
&lt;img src=&quot;public/05-Making-Medusa-My-First-CrackMe-Part-0x01/pwning.png&quot; alt=&quot;working-image&quot; /&gt;
yipeee, it is working!&lt;/p&gt;
&lt;p&gt;We now have a simple working &lt;a href=&quot;https://github.com/iamavu/Medusa&quot;&gt;CrackMe&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;WHAT WE LEARNT&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;we can create a executable region in memory from which we can execute code&lt;/li&gt;
&lt;li&gt;how to alternatively use key&apos;s both bytes to XOR&lt;/li&gt;
&lt;li&gt;the data or our flag was stored in &lt;code&gt;.rodata&lt;/code&gt; hence we needed to make it local&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In next post, we will be adding more layers to this, see you soon pwners : D&lt;/p&gt;
</content:encoded></item><item><title>PMA - 0x02 - Basic Techniques</title><link>https://iamavu.com/posts/04-pma-basic-techniques/</link><guid isPermaLink="true">https://iamavu.com/posts/04-pma-basic-techniques/</guid><description>Notes from Practical Malware Analysis Section 0x02</description><pubDate>Sat, 01 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#static-analysis&quot;&gt;Static Analysis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#antivirus-scanning&quot;&gt;Antivirus Scanning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#hashing--fingerprinting-a-malware&quot;&gt;Hashing : Fingerprinting a malware&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#finding-strings&quot;&gt;Finding Strings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#packed-and-obfuscated-malware&quot;&gt;Packed and Obfuscated Malware&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#portable-executable-file-format&quot;&gt;Portable Executable File Format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#linked-library-and-functions&quot;&gt;Linked Library and Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#pe-file-headers-and-sections&quot;&gt;PE File Headers and Sections&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#some-tips-and-trivia&quot;&gt;Some Tips and Trivia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#malware-analysis-in-virtual-machines&quot;&gt;Malware Analysis in Virtual Machines&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#structure-of-virtual-machine&quot;&gt;Structure of Virtual Machine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#basic-dynamic-analysis&quot;&gt;Basic Dynamic Analysis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction-1&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#monitoring-with-process-monitor&quot;&gt;Monitoring With Process Monitor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#viewing-process-with-process-explorer&quot;&gt;Viewing Process With Process Explorer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#comparing-registry-snapshots-with-regshot&quot;&gt;Comparing Registry Snapshots with RegShot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#faking-a-network&quot;&gt;Faking a Network&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h1&gt;Static Analysis&lt;/h1&gt;
&lt;h2&gt;Antivirus Scanning&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Running it through multiple antivirus which may have already identified the malware, although they are not perfect&lt;/li&gt;
&lt;li&gt;They rely on identifiable pieces of suspicious code (file signatures) and behavior/pattern matching analysis (heuristics)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.virustotal.com/&quot;&gt;Virustotal&lt;/a&gt; is great help here as it runs the malware through multiple antivirus systems&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Hashing : Fingerprinting a malware&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Hashing is common method where you run the malware through hashing programs&lt;/li&gt;
&lt;li&gt;They use algorithms such as MD5 or SHA-1 to produce unique hash (fingerprint)&lt;/li&gt;
&lt;li&gt;Hash then can be used as label or sharing it to other analyst to identify the malware or see if it has been already identified&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Finding Strings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Strings can be great method to find texts within the malware&lt;/li&gt;
&lt;li&gt;ASCII and Unicode format are used to store strings&lt;/li&gt;
&lt;li&gt;They store by characters in sequence and ending with a NULL terminator to indicate that string is complete&lt;/li&gt;
&lt;li&gt;ASCII uses 1byte per character while Unicode uses 2bytes per character&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/ascii.png&quot; alt=&quot;ascii&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/unicode.png&quot; alt=&quot;unicode&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sometimes if strings program identifies a sequence of characters which end with null terminator, it might think of it as string while it could be just some CPU instruction or memory address&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Packed and Obfuscated Malware&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Obfuscated malware are the one whose execution are hidden&lt;/li&gt;
&lt;li&gt;Packed malware is subset of obfuscated malware where the program is compressed making it harder to analyze&lt;/li&gt;
&lt;li&gt;When packed program is ran, a small wrapper program, it de-compresses the packed program and then executes unpacked program&lt;/li&gt;
&lt;li&gt;When packed program is analyzed statically, only wrapper program can be dissected&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/obfuscated.png&quot; alt=&quot;obfuscated&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Packers can be detected using software such as PEiD&lt;/li&gt;
&lt;li&gt;Packed program must be unpack so that we can analyze it&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Portable Executable File Format&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PE format is used by windows executables, object code and DLLs&lt;/li&gt;
&lt;li&gt;It contains necessary information for the Windows OS loader to manage the wrapped executable code&lt;/li&gt;
&lt;li&gt;PE files begin with a header that includes information about the code, type of the application, required library functions and space requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Linked Library and Functions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Imports are function that are used by program whilst they are stored in another program, such as code libraries that contain common functionality which are connected by linking&lt;/li&gt;
&lt;li&gt;Code libraries can be linked statically, at runtime or dynamically&lt;/li&gt;
&lt;li&gt;Static linking is not used often although it’s common in UNIX programs&lt;/li&gt;
&lt;li&gt;When code is statically linked, all the code from the library are copied to our main executable making it grow in size which makes analyzing code harder&lt;/li&gt;
&lt;li&gt;Runtime linking is commonly used in malwares especially when it’s obfuscated or packed&lt;/li&gt;
&lt;li&gt;Some linked functions can be imported without being listed in program headers like &lt;code&gt;LoadLibrary&lt;/code&gt;, &lt;code&gt;LdrGetProcAddress&lt;/code&gt; , &lt;code&gt;LdrLoadDll&lt;/code&gt;and &lt;code&gt;GetProcAddress&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Dynamic linking is the most common method of linking, where OS searches for all necessary linked libraries when the program is loaded&lt;/li&gt;
&lt;li&gt;Libraries used and called are very important for us to understand what the program does&lt;/li&gt;
&lt;li&gt;Functions can also be imported by ordinals making it harder for us to analyze&lt;/li&gt;
&lt;li&gt;Below are some common DLLs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/dll.png&quot; alt=&quot;dll&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Ex&lt;/code&gt; is a suffix used when the function is updated by Microsoft&lt;/li&gt;
&lt;li&gt;&lt;code&gt;A&lt;/code&gt; and &lt;code&gt;W&lt;/code&gt; appearing at the end is extra information about suffix which doesn’t appear in actual documentation and is just there to tell us that function accepts ASCII string and word respectively&lt;/li&gt;
&lt;li&gt;Like imports, there are also exports, which are functions exported by programs so that other programs can import and utilize them, these are most common in DLLs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;PE File Headers and Sections&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.text&lt;/code&gt; section contains instructions code that CPU will execute&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.rdata&lt;/code&gt; section contains information about imports and exports, storing read only data&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.data&lt;/code&gt; contains global data accessible from anywhere in the program&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.idata&lt;/code&gt; stores data about import functions, usually not present&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.edata&lt;/code&gt; stores data about export functions, usually not present&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.pdata&lt;/code&gt; present only in 64bit applications storing exception-handling information&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.rsrc&lt;/code&gt; contains other data such as icons, images, menus and strings&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.reloc&lt;/code&gt; contains information about relocation of library files&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Some Tips and Trivia&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;All Delphi programs use compile time of June 19, 1992&lt;/li&gt;
&lt;li&gt;Virtual size (space allocated for section during loading) and raw data (how big section is on disk) should be equal (small differences are fine), if they aren’t that means it’s a packed program&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h1&gt;Malware Analysis in Virtual Machines&lt;/h1&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;One can analyze malware in either physical machine or virtual machine.&lt;/li&gt;
&lt;li&gt;Physical machine gives advantage of malware behaving the same was as intended though as it is on air-gapped network malware communications with internet might be hampered&lt;/li&gt;
&lt;li&gt;Virtual machine solves this but there is possibility that malware might behave differently on virtual machine than physical one making analysis hard&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Structure of Virtual Machine&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A virtual machine is computer within a computer, allowing complete isolation of virtual machine from host machine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/physical-machine.png&quot; alt=&quot;physical-machine&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using host-only network is common practice in VMs for malware analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/host-only.png&quot; alt=&quot;host-only&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Taking snapshots is important before you analyze any malware so you can return back to original state once you are done with your work&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/snapshot.png&quot; alt=&quot;snapshot&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;Basic Dynamic Analysis&lt;/h1&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Dynamic analysis is performed after we have exhausted our static analysis&lt;/li&gt;
&lt;li&gt;It allows us to observe actual behavior of the malware&lt;/li&gt;
&lt;li&gt;It is important to know how to run a malware if you want to perform dynamic analysis. Quite often it can be simple as double clicking the exe&lt;/li&gt;
&lt;li&gt;DLLs might be hard to run, there is tool called &lt;code&gt;rundll32.exe&lt;/code&gt; which comes with all modern version of windows which has following syntax &lt;code&gt;rundll32.exe DLLname, Export Arguments&lt;/code&gt;. Where &lt;code&gt;Export&lt;/code&gt; value must be a function name or ordinal selected from exported function table in DLL which can be viewed using tools such as PEBear etc. Example syntax for both would be &lt;code&gt;rundll32.exe mal.dll, install&lt;/code&gt; or &lt;code&gt;rundll32.exe mal.dll, #5&lt;/code&gt; where &lt;code&gt;install&lt;/code&gt; is the export function name and &lt;code&gt;#5&lt;/code&gt; is the ordinal number prepended with &lt;code&gt;#&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Malicious DLL quite often run their code in &lt;code&gt;DLLMain&lt;/code&gt; (called from the DLL entry point) and as &lt;code&gt;DLLMain&lt;/code&gt;  is executed when DLL is loaded, we can force DLL to load via &lt;code&gt;rundll32.exe&lt;/code&gt; to get information out of it&lt;/li&gt;
&lt;li&gt;One can also modify the PE header of DLL and change the extension and force windows to load DLL as EXE. To modify that, wipe the &lt;code&gt;IMAGE_FILE_DLL (0x2000)&lt;/code&gt; flag from the characteristics field in the &lt;code&gt;IMAGE_FILE_HEADER&lt;/code&gt; , thought it might cause malware to crash  or terminate but as long as the changes cause malware to execute it’s payload, we are good to go.&lt;/li&gt;
&lt;li&gt;DLL malware may also be needed to install as service with following syntax &lt;code&gt;rundll32.exe mal.dll, InstallService *ServiceName&lt;/code&gt;* and then to start the service &lt;code&gt;net start *ServiceName&lt;/code&gt;*&lt;/li&gt;
&lt;li&gt;When there isn’t a export function such as &lt;code&gt;Install&lt;/code&gt; or &lt;code&gt;InstallService&lt;/code&gt;  in the DLL, we may need to manually install the DLL as service via either Windows &lt;code&gt;sc&lt;/code&gt; command or modifying the register for unused service and then using &lt;code&gt;net start&lt;/code&gt; on that service. The service entries are located in &lt;code&gt;HKLM\SYSTEM\CurrentControlSet\Services&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Monitoring With Process Monitor&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Process monitor or procmon is powerful tool to monitor certain registry, file system, network, process and thread activity although it should not be usually use to log network activity as it is inconsistent throughout windows versions.&lt;/li&gt;
&lt;li&gt;Procmon can monitor all system calls as soon as it is ran making it impossible to look through all of them as they are over in thousands and it may crash our virtual machine, so it is advised to load it up, stop capturing, clear the events and capture for few minutes once you load the malware.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Promon Display&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lets have a look at example where malware &lt;code&gt;mm32.exe&lt;/code&gt; creates a file called &lt;code&gt;mw2mmgr.txt&lt;/code&gt; at sequence number &lt;code&gt;212&lt;/code&gt; using &lt;code&gt;CreateFile&lt;/code&gt; . The word success in result column tells that operation was successful.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/procmon-display.png&quot; alt=&quot;procmon-display&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Filtering in Procmon&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;One can also filter on individual system calls such as &lt;code&gt;RegSetValue&lt;/code&gt;, &lt;code&gt;CreateFile&lt;/code&gt;, &lt;code&gt;WriteFile&lt;/code&gt;, or other suspicious or destructive calls.&lt;/li&gt;
&lt;li&gt;Filtering is only for visual purposes, all data is still being recorded&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/filter.png&quot; alt=&quot;filter&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some of the important filters
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Registry :&lt;/strong&gt; By examining registry operations, you can tell how a piece of
malware installs itself in the registry.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File system :&lt;/strong&gt; Exploring file system interaction can show all files that the
malware creates or configuration files it uses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Process activity :&lt;/strong&gt; Investigating process activity can tell you whether the
malware spawned additional processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network :&lt;/strong&gt; Identifying network connections can show you any ports on
which the malware is listening.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If your malware runs at boot time, use procmon’s boot logging options to install procmon as a startup driver to capture startup events&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Viewing Process With Process Explorer&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/process-explorer.png&quot; alt=&quot;process-explorer&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Process Explorer shows process in tree format listing child and its parent process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/properties.png&quot; alt=&quot;properties&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Using the verify option&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify button on image tab checks if the image on disk is microsoft signed binary or not&lt;/li&gt;
&lt;li&gt;This process happens on disk rather than in memory, so it is rendered useless if attacker uses process replacement which involves running a process on the system and overwriting its memory space with malicious executable providing same privileges as the process it is replacing&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Comparing Strings&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/compare.png&quot; alt=&quot;compare&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One way to recognize process replacement is to compare strings between the memory and disk version of executable&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Using Dependency Walker&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Process Explorer allows launching of &lt;code&gt;depends.exe&lt;/code&gt; (Dependency Walker) by right clicking a process&lt;/li&gt;
&lt;li&gt;It also allows you to search for Find Handle or DLL which is useful when you want to know if a particular malicious DLL is being used by any running process or not&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Analyzing Malicious Documents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;One can also open malicious PDF or word documents and see if any process are being created when opening them to see if they are malicious or not&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Comparing Registry Snapshots with RegShot&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/regshot.png&quot; alt=&quot;regshot&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To use regshot, first take 1st shot, run the malware and then take 2nd shot and then we can compare what changes had been done&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Faking a Network&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Malware often communicates back to their C2 server, to get this data we need to setup our VM appropriately and not make it realize that its in virtual environment&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Using ApateDNS&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;ApateDNS spoofs DNS response to user specified IP address by listening on UDP 53&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Monitoring with netcat&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lets use ApateDNS to get malware to send its request our localhost, we can then use nc for listening to connections before cutting off the malware&lt;/li&gt;
&lt;li&gt;Malware often use port 80 and 443 for communication as they aren’t blocked or monitored for outbound connections&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Packet Sniffing with Wireshark&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/wireshark.png&quot; alt=&quot;wireshark&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To use wireshark to view contents, right click any TCP packet and click “Follow TCP stream”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;public/04-PMA-Basic-Techniques/follow.png&quot; alt=&quot;follow&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To capture packets, just click Capture→ Interfaces and select the interface&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Using InetSim&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;InetSim provides fake services, allowing you to analyze the network behavior of malware&lt;/li&gt;
&lt;li&gt;It also handles all requests given to it appropriately without throwing a 404&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>PMA - 0x01 - Malware Analysis Primer</title><link>https://iamavu.com/posts/03-pma-malware-analysis-primer/</link><guid isPermaLink="true">https://iamavu.com/posts/03-pma-malware-analysis-primer/</guid><description>Notes from Practical Malware Analysis Section 0x01</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Malware Analysis Primer&lt;/h1&gt;
&lt;h2&gt;Goals of Malware Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To determine what exactly has happened to ensure that you’ve located all infected machines and files and then develop signatures (host and network)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Types of signatures&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Host based are used to detect malicious code on victim computers by identifying created or modified files by malware&lt;/li&gt;
&lt;li&gt;Network based are used to detect malicious code by monitoring network traffic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Finally we figure out how the malware works&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Malware Analysis Techniques&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Types of techniques
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Static Analysis&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Examining the executable&lt;/li&gt;
&lt;li&gt;Reverse engineering the malware’s internals by disassembling it and looking at it’s instructions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic Analysis&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Running the malware and examining its behavior in order to remove it’s infection and create signatures&lt;/li&gt;
&lt;li&gt;Quite often we use debugger to understand how malware is being&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Types of Malware
&lt;ul&gt;
&lt;li&gt;Backdoor —&amp;gt; Malicious code that is installed and allows attacker to gain access to local system with little or no authentication&lt;/li&gt;
&lt;li&gt;Botnet —&amp;gt; Similar to backdoor but it allows attacker to send command from a central command-and-control (C2) server&lt;/li&gt;
&lt;li&gt;Downloader —&amp;gt; Malicious code which downloads additional malicious code&lt;/li&gt;
&lt;li&gt;Information stealing malware —&amp;gt; Malware which steals sensitive data from victim’s computer and sends it to attacker&lt;/li&gt;
&lt;li&gt;Launcher —&amp;gt; Used to launch other malicious programs&lt;/li&gt;
&lt;li&gt;Rootkit —&amp;gt; Code designed to hide other malicious programs&lt;/li&gt;
&lt;li&gt;Scareware —&amp;gt; Designed to frighten the user into buying “software”&lt;/li&gt;
&lt;li&gt;Span-Sending Malware —&amp;gt; Sends spam allowing attackers to generate income by that process&lt;/li&gt;
&lt;li&gt;Worm or Virus —&amp;gt; Code that can copy itself and infect additional computers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Tips and Tricks
&lt;ul&gt;
&lt;li&gt;Focus on key features rather than dissecting every details as malware is a complex piece of software&lt;/li&gt;
&lt;li&gt;Try analyzing malware with different approaches and angles using different tools, don’t get stuck on one&lt;/li&gt;
&lt;li&gt;Recognize, understand and defeat the new and approaching techniques written by malware authors on the fly&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Init How to Hack</title><link>https://iamavu.com/posts/01-init-how-to-hack/</link><guid isPermaLink="true">https://iamavu.com/posts/01-init-how-to-hack/</guid><description>Learn Hacking the Hacker Way</description><pubDate>Tue, 01 Sep 2020 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;#init how to hack&lt;/h2&gt;
&lt;p&gt;We all saw this, black hoodie, green text on the screen, and what not and after a second the person says &lt;em&gt;“i’m in”&lt;/em&gt;.
Well, hold your horses and your computers, that is not actual hacking.
well in a sense, you could wear a black hoodie and have a black and green terminal and sit in dark and wear a mask and stare at your screen, but you might hurt your eyes and your mum might yell at you.
mine did, so just a warning!&lt;/p&gt;
&lt;p&gt;Well enough of that
Let’s have a look into what the hacking means;
hacking is the process of finding a vulnerability in a system, and then exploiting that vulnerability to gain something you wouldn’t otherwise have.
a vulnerability can be a mis-configuration, an error, or improper use of existing functionality. the exploitation is the method you use to access that vulnerability. you then get something in return — say, more access, or a list of passwords, or simply a crash in the system.&lt;/p&gt;
&lt;p&gt;Whoa, wait, wait, what’s this?&lt;/p&gt;
&lt;p&gt;Well, that’s just a technical definition, to put it in simple terms — to make things work they are not supposed to!
Did you find a way to open coca-cola without the opener? congrats, you *hacked *it! yay!
p.s — i am not sponsored by coca-cola :D
or am i?
&lt;em&gt;(vsause theme plays)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hacking is generally assumed to be hitting keys on your keyboard but it’s not just that, it’s reading code, documentation, researching, and well lots of reading!
It’s thinking out of the box.&lt;/p&gt;
&lt;p&gt;Now that we know what actual hacking is, let’s dive deeper into it!
hacking is a really broad term.
numerous things come under it, like really a lot of stuff, you can get lost in it, if you just go here and there and look and try out things without knowing what to do and what to learn, it can be overwhelming and you might get disheartened.
have a look at this image which briefly covers the network of cyber security.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;public/01-init-how-to-hack/roadmap.png&quot; alt=&quot;roadmap&quot; /&gt;
image courtesy : &lt;a href=&quot;https://www.linkedin.com/pulse/cybersecurity-domain-map-ver-30-henry-jiang/&quot;&gt;linkedin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;whoa whoa, that’s a lot and it’s not green text :p&lt;/p&gt;
&lt;p&gt;well, it’s okay if you don’t know any of these terms, trust me you will learn, just be curious and ask the right questions!
well, how do i ask the right questions?
ask questions first, don’t be afraid to ask, you will realize which questions are wrong and which are right, but the important part is to ask.&lt;/p&gt;
&lt;blockquote&gt;
&lt;h1&gt;there are only two things you need to be good hacker; will to learn and curiosity&lt;/h1&gt;
&lt;/blockquote&gt;
&lt;p&gt;okay, i got that much! now what?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;warning : you might read some terms now which you never heard before, don’t stress out, google about them, see if it vibes with what you love, and learn googling, it’s a really important skill!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;no one knows everything and in cyber-security where the amount of data is being increased every day, you won’t know everything. so don’t be ashamed to google stuff if you don’t know stuff or if you just forgot something.&lt;/p&gt;
&lt;p&gt;well now let’s have a look at what are major domains there in information security&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;security engineer&lt;/strong&gt;. — this includes network designing, security architecture design, and review, cloud security, secure application development. so basically making secure stuff&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; &lt;strong&gt;security operations&lt;/strong&gt; — this domain mainly includes all the operations right from the prevention of cyber attack to dealing with as well as eradicating it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. threat intelligence&lt;/strong&gt; — the people in this domain are cyber threat analysts and they have immense knowledge of information security as well as knowledge in networking administration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. risk assessment&lt;/strong&gt; — here is the spicy part which you mostly see, the red teaming(attacking) and blue teaming(defense)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. governance&lt;/strong&gt; — it’s basically like the government which sets and controls laws, administration, auditing, etc, it comprises of auditing, laws, policies and procedures, compliance, etc&lt;/p&gt;
&lt;p&gt;well okay, i understand who are hackers and what roles they have, but why do we need them?
well, we are humans, we progress and we make mistakes, no one or nothing is perfect. there will be flaws and imperfections. that’s where hackers come into the picture, we protect systems, we test systems to know where the flaws are, we govern the networks, we architect them, we find information, we use it. we are anon…um we are hackers.&lt;/p&gt;
&lt;p&gt;this is why we need people who will secure the device or browser which you are reading this article on.
but wait, i heard there are bad people too, who use the knowledge of hacking for their benefits, those are called unethical hackers, who do things without anyone’s permissions and then there is a nice part which is ethical hacking, people who do ethical hacking are called ethical hackers and they prevent and test systems so that unethical ones won’t be able to bring your systems down.
there is also a spectrum which might help you understand a bit better&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;public/01-init-how-to-hack/threat-spectrum.png&quot; alt=&quot;threat-spectrum&quot; /&gt;image courtesy: &lt;a href=&quot;https://www.digitalshadows.com/uploads/2019/09/the-cyber-threat-spectrum-source-fbi-cyber-division.png&quot;&gt;spectrum&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;so i got that much, but how do i proceed?
where are the resources? how do i do this and that? how do i learn
is there like a road-map?
&lt;em&gt;well yes but no!&lt;/em&gt;
there is no definitive road-map here, as i said the industry is constantly evolving and growing and moving, so things change.
&lt;strong&gt;but!&lt;/strong&gt;
yes, there is a but!
but, you can start in this way, which i found helpful and easy to grab things onto.
let’s have a look at what you might need to get started.&lt;/p&gt;
&lt;h2&gt;networking:&lt;/h2&gt;
&lt;p&gt;everything is connected, so you must know how things work and how data is being transferred from one place to another, what is ip and mac, and what is that and this. it will show you a new perspective to look at the world and the internet. you can pick up any good resource love, i found professor messer’s network+ to be a good start, you don’t have to give the exam if you don’t want to but learn and always keep on learning. some people did find it too long or over the top for learning security, so i have linked one more small youtube playlist which will work decently good.&lt;/p&gt;
&lt;p&gt;link: &lt;a href=&quot;https://www.professormesser.com/network-plus/n10-007/n10-007-training-course/&quot;&gt;network+&lt;/a&gt;
&amp;amp; link: &lt;a href=&quot;https://www.youtube.com/watch?v=bj-Yfakjllc&amp;amp;list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&quot;&gt;playlist&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;linux:&lt;/h2&gt;
&lt;p&gt;now, wait, what is linux again? that penguin? well, it’s technically a kernel but let’s not get into technicality. if you are going to hack, you will eventually end up at a terminal, a window with nothing but text, and getting familiar with it helps, master it! linux journey takes you from basics to good enough understanding of linux fairly well. so install a virtual machine and get set go! wait after completing the article maybe.&lt;/p&gt;
&lt;p&gt;link: &lt;a href=&quot;https://linuxjourney.com/&quot;&gt;linux journey&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;a programming language:&lt;/h2&gt;
&lt;p&gt;now, i know i said we were hacking, so why do we even need to learn to program? well to break something you must understand how it is built. don’t be scared we don’t need to learn every language out there, just learn one and you can move the concepts and knowledge from there to another. so which one should i start with? i found python to be a real good start. it’s easy to get hold of and you can make fun tools and projects with it (maybe i am making one, just maybe). i found the book automate boring stuff with python a real good resource to learn. it takes you from no knowledge about programming to good enough that is needed.
i also suggest learning bash for good automation, why? because automation is fun and it reduces the time needed for our tasks&lt;/p&gt;
&lt;p&gt;link: &lt;a href=&quot;https://automatetheboringstuff.com/&quot;&gt;automate boring stuff with python&lt;/a&gt;, &lt;a href=&quot;https://guide.bash.academy/&quot;&gt;bash guide (basics)&lt;/a&gt;, &lt;a href=&quot;https://shellscript.sh/&quot;&gt;shell script (little advance)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;practical:&lt;/h2&gt;
&lt;p&gt;now that you know the basics and fair enough, it’s time to play and gamify your hacking. there are resources like hack the box(htb) and try hack me(thm) which let you test your skill and much more! what and how they work? well, i’ll leave the introduction of them to themselves!
thm and htb feels a little overwhelming to me to directly dive into, so i suggest to try out overthewire first and then picoctf, again you will know what they are when you visit their respective websites
i suggest the order as otw and parallelly picoctf then thm then htb.&lt;/p&gt;
&lt;p&gt;once you feel comfortable sprinkle in &lt;a href=&quot;https://www.youtube.com/watch?v=8ev9ZX9J45A&quot;&gt;ctfs&lt;/a&gt; in between from ctftime&lt;/p&gt;
&lt;p&gt;link: &lt;a href=&quot;https://overthewire.org/&quot;&gt;overthewire&lt;/a&gt;, &lt;a href=&quot;https://tryhackme.com/&quot;&gt;tryhackme&lt;/a&gt;, &lt;a href=&quot;https://www.hackthebox.eu/&quot;&gt;hackthebox&lt;/a&gt;, &lt;a href=&quot;https://picoctf.org/&quot;&gt;picoctf&lt;/a&gt;, &lt;a href=&quot;https://ctftime.org/&quot;&gt;ctftime&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;phew, that was a lot!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;wait, wait i forgot &lt;em&gt;(not actually)&lt;/em&gt; a really important thing!
&lt;strong&gt;communities!!&lt;/strong&gt;
yes, get into a community, a discord server, or a telegram group or irc or whatever you love!
even if you don’t understand anything, in the beginning, you will! you will learn and improve and you will fail too, but that’s the proof that you are trying. so start getting active into communities!
and don’t get into rabbit holes of certification. the important part is to keep learning and growing and asking questions!
also a tip, that you don&apos;t have to learn this one by one, you can learn parallely too, which in my opinion is better as you don&apos;t get a burn out
i have mashed up all resources and much more interesting stuff into a sweet github repository called &lt;a href=&quot;https://github.com/hckpls/pandora&quot;&gt;pandora&lt;/a&gt; and along with that a supplementary gitbook — &lt;a href=&quot;https://iamavu.gitbook.io/the-texts-of-athena/&quot;&gt;texts of athena&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;have a look ^^&lt;/p&gt;
&lt;p&gt;special thanks to my fellow friends for encouraging and helping me with the article-&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/thewhiteh4t&quot;&gt;thewhiteh4t&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/sincerasl&quot;&gt;shane&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/jiab77&quot;&gt;jiab77&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/starryl0rd&quot;&gt;starry-lord&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/aditya12anand&quot;&gt;aditya&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and oh, if you want to reach out to me, feel free to do so at
&lt;a href=&quot;https://twitter.com/iamavu&quot;&gt;avantika(@iamavu)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;get set and pwn and happy hacking :D&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;public/01-init-how-to-hack/hack.gif&quot; alt=&quot;hack&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;references :&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://netsec.ws/?p=468#more-468&quot;&gt;https://netsec.ws/?p=468#more-468
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://netsec.ws/?p=536#more-536&quot;&gt;https://netsec.ws/?p=536#more-536
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://docfate111.github.io/cybersecclub/roadmap.html&quot;&gt;https://docfate111.github.io/cybersecclub/roadmap.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://medium.com/@rana.miet/information-security-what-why-how-462a1ae8fa61&quot;&gt;https://medium.com/@rana.miet/information-security-what-why-how-462a1ae8fa61&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://computersciencems.com/resources/cyber-security/cybersecurity-for-beginners-50-resources-to-get-you-started&quot;&gt;https://computersciencems.com/resources/cyber-security/cybersecurity-for-beginners-50-resources-to-get-you-started&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://medium.com/@tarun.n/cyber-security-for-beginners-5936020f91d6&quot;&gt;https://medium.com/@tarun.n/cyber-security-for-beginners-5936020f91d6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://google.com&quot;&gt;google&lt;/a&gt;&lt;/p&gt;
</content:encoded></item></channel></rss>