Skip to content

Instantly share code, notes, and snippets.

View adi928's full-sized avatar

Aditya Nath adi928

View GitHub Profile
@adi928
adi928 / accessPlease.ps1
Created February 19, 2026 08:08
Helping folks with PC problems by giving myself access.
# 1. Configuration - REPLACE THE KEY BELOW
$myPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQB+LaGHTTgSnLpudFXduMqSyYV4Jb+vYMISPPRcApSobOknsvYJv3NQIvtl1H3LxCtLF4mAoKD0AOdX8DgdksKDgyYonfX5hqRz76J35qxNMSZz4vqFVV/WvDPv37nPRgnZeTdCshfmqeie8Svc2ZGgaUt0LTRulYVK+AIfYHKaocQHUVgaCN5Ix1EWNPnOETvMdAnN2kgT1+j6h3fEBROABjQKcVPq8D+dW0o6Z/ut9pqH36Dwvz4P5S3Jx3/RArMpRuDrI87sdm3Y5sWWXbGb2cqoIrhs/aFUK3JYyLyIYQsjGvcro2nVEOE6+tAjecwr1rRjR3ZtJcFVc5zYpog6/4ccmaVTxOXY37e+MoPGksyDlwrncpf+7B6vCUmla6flC0aBsTAqpopJ+U4NS847r8rKxLkBm/nOmIlxk9P9UMXrQVBvbsZVxhhjS9jD0U6Jj8Fiy8fDPDDhApsIFxFQGm2OR65NVXAAdIMNYF51wDZTcldfYBC/IA9prqC4E= adityanath@MacBookPro.home"
# 2. Install OpenSSH Server
Write-Host "Installing OpenSSH Server..." -ForegroundColor Cyan
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | Out-Null
# 3. Start and Configure Service
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
@adi928
adi928 / diagnose.ps1
Created February 19, 2026 07:22
Simple script to determine top processes consuming cpu.
while($true) {
Clear-Host
Write-Host "--- TOP 15 PROCESSES (CPU USAGE) ---" -ForegroundColor Cyan
Get-Process | Sort-Object CPU -Descending | Select-Object -First 15 -Property Name, Id, @{Name="CPU(s)";Expression={$_.CPU}}, @{Name="RAM(MB)";Expression={[math]::Round($_.WorkingSet / 1MB, 2)}} | Format-Table -AutoSize
Write-Host "`n--- ACTIVE NETWORK CONNECTIONS ---" -ForegroundColor Yellow
Get-NetTCPConnection -State Established | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort,
@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).Name}},
@{Name="PID";Expression={$_.OwningProcess}} | Select-Object -First 10 | Format-Table -AutoSize
@adi928
adi928 / gist:37efc135fb630c638f2c102a845becd0
Created January 28, 2026 07:49
prompt-question-failed
/*
Using any language, implement an assembler + simulator for a new assembly language that has the following characteristics:
- Maintains a set of registers (can be thought of as variables) that store integers and can be used to move and process data via instructions
- Instructions are executed sequentially
- Instructions should support constant values for arguments in addition to registers
here are some example instructions:
add 45 5 ra # add 45 + 5, store result in ra
add 10 rb rb # add 10 to rb, store in rb
import logging
import azure.functions as func
from azure.storage.blob import BlobServiceClient, BlobClient
from io import BytesIO
import zipfile
def main(req: func.HttpRequest) -> func.HttpResponse:
def copy_azure_blobs(srcName):
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
@adi928
adi928 / azureRepoApi-Push.py
Created April 10, 2021 21:39
Part of a blog elaborating the confluence to azure app service workflow
import json
commitMsg = "Testing 101"
changesList = []
for f_name in filesInZip:
if f_name.split('.')[-1] in ['html', 'css', 'js', 'aspx', 'scss']:
print("[+] Adding file: "+f_name)
else:
print("[+] Skipping file: "+ f_name)
continue
with open("/tmp/"+filename.split('.')[0]+"/"+f_name, "r") as fileContent:
@adi928
adi928 / config.ini
Last active November 13, 2020 00:48
Amass config for spotify bug bounty
mode = active
output_directory = /Users/name/tools/amass
maximum_dns_queries = 10000
[resolvers]
monitor_resolver_rate = true
resolver = 1.1.1.1 ; Cloudflare
resolver = 8.8.8.8 ; Google
resolver = 64.6.64.6 ; Verisign
resolver = 74.82.42.42 ; Hurricane Electric
@adi928
adi928 / python_practice.py
Created December 15, 2019 22:41
Practicing python. Nothing to see here. Move on!
def per_octal(perm_string):
permStr = ""
res = 0
for i in range(len(perm_string)):
perm = perm_string[i]
if perm == 'r':
res += 4
elif perm == 'w':
res += 2
elif perm == 'x':
@adi928
adi928 / nmapBaseline.py
Last active December 3, 2019 21:07
Includes a function for scanning the network and running comparison on Nmap XML outputs. Needs Sanitizing
import nmap
from datetime import datetime
import difflib
from pathlib import Path
## Run nmap
def runNmap():
scanFileName = 'scan-' + str(datetime.now())
argStr = '-sC -sV'
nmapCmd = nmap.PortScanner()
@adi928
adi928 / pattern.py
Last active January 19, 2020 21:05
#! /usr/local/bin/python
import sys
import string
import re
import argparse
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell