Skip to content

Instantly share code, notes, and snippets.

View Murthysagi's full-sized avatar
Pro

MurthyCode Murthysagi

Pro
  • Sr. Security Consultant
  • India
View GitHub Profile
@mgraeber-rc
mgraeber-rc / SimulateInternetZoneTest.ps1
Created May 28, 2021 16:57
Example highlighting why attackers likely choose ISO/IMG as a delivery mechanism - it evades SmartScreen because Mark-of-the-Web (MOTW) cannot be applied to non NTFS volumes
Add-Type -OutputAssembly hello.exe -TypeDefinition @'
using System;
public class Hello {
public static void Main(string[] Args) {
System.Console.WriteLine("Hello, world!");
System.Console.Read();
}
}
'@
@ssstonebraker
ssstonebraker / Active Directory Attacks.md
Last active May 16, 2024 14:33
Active Directory Attacks #oscp
@royshil
royshil / downloadPDFs.py
Last active March 22, 2020 01:27
Download All PDFs in a URL using Python mechanize
# This is kind-of based off of this: http://stackoverflow.com/questions/5974595/download-all-the-linksrelated-documents-on-a-webpage-using-python
import cookielib
import urllib2
import mechanize
from time import sleep
import os
import cgi
# A routine to download a file from a link, by simulating a click on it
@artttj
artttj / Python_Urllib_Basic_Auth_Query.py
Created September 22, 2016 17:34
Python 3.4 Urllib Basic Auth: the script sends JSON data via POST request using HTTP Basic authentication and urllib.
import urllib.request
import urllib.response
userName = "user"
passWord = "password"
top_level_url = "http://127.0.0.1/api/update"
# create an authorization handler
p = urllib.request.HTTPPasswordMgrWithDefaultRealm()
p.add_password(None, top_level_url, userName, passWord);

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.

@skulltech
skulltech / apk-embed-payload.rb
Last active April 1, 2023 04:50
POC for injecting Metasploit payloads on arbitrary APKs
#!/usr/bin/env ruby
# apk_backdoor.rb
# This script is a POC for injecting metasploit payloads on
# arbitrary APKs.
# Authored by timwr, Jack64
#
require 'nokogiri'
require 'fileutils'
@tikolakin
tikolakin / fish_alias.md
Last active May 2, 2024 14:21
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

@kaito834
kaito834 / urllib-request_basicAuth.py
Last active October 26, 2022 17:52
Python 3.x snippet code for Basic Authentication HTTP request by urllib.request
#!/usr/bin/env python
#
# I tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
import urllib.request
import getpass
# If you access to url below via Proxy,
# set environment variable 'http_proxy' before execute this.
public static void addTests(ClassLoader loader, TestSuite suite) {
try {
Class[] classes = getClasses("ru.mail.mailbox.cmd.server", loader);
System.out.println("class size " + classes.length);
for(Class clazz : classes) {
for(Method method : clazz.getDeclaredMethods()) {
for(Annotation annotation : method.getAnnotations()) {
if(annotation instanceof MockMethod) {
// suite.addTest(TestSuite.createTest(clazz, method.getName()));
System.out.println("add method " + method.getName() + " for class " + clazz.getName());
@kaito834
kaito834 / urllib-request-Request.py
Last active May 29, 2024 20:27
Python 3: urllib.request and json sample
#!/usr/bin/env python
#
# tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
# If you need to access web site/service via proxy, set http_proxy or https_proxy.
# https://docs.python.org/3/library/urllib.request.html#urllib.request.ProxyHandler
# set http_proxy=http://127.0.0.1:8888/
# set https_proxy=https://127.0.0.1:8888/