Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am darkoperator on github.
  • I am darkoperator (https://keybase.io/darkoperator) on keybase.
  • I have a public key whose fingerprint is 15B7 F997 6A55 511C 35AC 09BB 0404 C8BC C764 38E3

To claim this, I am signing this object:

@darkoperator
darkoperator / posh-sysmoninstall.ps1
Last active August 4, 2017 19:17
PowerShell Script to Install Posh-Sysmon
# Make sure the module is not loaded
Remove-Module posh-secmod -ErrorAction SilentlyContinue
# Download latest version
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-Sysmon/archive/master.zip"
Write-Host "Downloading latest version of Posh-Sysmon from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-Sysmon.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Net;
namespace IPHelper
{
function Confirm-IsAdmin
{
(whoami /all | Select-String S-1-16-12288) -ne $null
}
if (Confirm-IsAdmin)
{
Write-Host "Modifying interfaces with public Profile"
$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
# Make sure the module is not loaded
Remove-Module Posh-Metasploit -ErrorAction SilentlyContinue
# Download latest version
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-Metasploit/archive/master.zip"
Write-Host "Downloading latest version of Posh-Metasploit from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-Metasploit.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
# Make sure the module is not loaded
Remove-Module Posh-Shodan -ErrorAction SilentlyContinue
# Download latest version
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-Shodan/archive/master.zip"
Write-Host "Downloading latest version of Posh-Shodan from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-Shodan.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
function Import-ShodanAPIKey
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=1)]
[securestring]$MasterPassword
@darkoperator
darkoperator / PoshVTInstall.ps1
Last active January 11, 2020 14:21
Install Script for Posh-VirusTotal
# Make sure the module is not loaded
Remove-Module Posh-VirusTotal -ErrorAction SilentlyContinue
# Download latest version
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-VirusTotal/archive/master.zip"
Write-Host "Downloading latest version of Posh-VirusTotal from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-VirusTotal.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
@darkoperator
darkoperator / JSON .Net
Created February 4, 2014 11:32
Use .Net 4 to deserialize a complex JSON response
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$Serializer = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$json = $server_reply.Content
$Deserialized = $Serializer.DeserializeObject($json)
@darkoperator
darkoperator / gist:8448615
Created January 16, 2014 02:06
PVS Repor Gist
{"reply":{"status":"OK", "contents":{"reports":{"report":[{"id":3, "name":"Pcap Vulnerability Scanning Report - Jan 14 2014 07:19:00", "status":"completed", "last_upd
ated_time":"2014-01-14 07:19:00", "snapshot_id":0}, {"id":4, "name":"Monitoring Snapshot - Jan 15 2014 20:06:52", "status":"completed", "last_updated_time":"2014-01-1
5 20:06:52", "snapshot_id":1}, {"id":5, "name":"Monitoring Snapshot - Jan 15 2014 20:21:52", "status":"completed", "last_updated_time":"2014-01-15 20:21:52", "snapsho
t_id":2}, {"id":6, "name":"Monitoring Snapshot - Jan 15 2014 20:36:52", "status":"completed", "last_updated_time":"2014-01-15 20:36:52", "snapshot_id":3}, {"id":7, "n
ame":"Monitoring Snapshot - Jan 15 2014 21:02:23", "status":"completed", "last_updated_time":"2014-01-15 21:02:23", "snapshot_id":4}, {"id":8, "name":"Monitoring Snap
shot - Jan 15 2014 21:17:23", "status":"completed", "last_updated_time":"2014-01-15 21:17:23", "snapshot_id":5}, {"id":9, "name":"Monitoring Snapshot - Jan 15 2014 21
:32:23", "status":"com