Skip to content

Instantly share code, notes, and snippets.

@darkoperator
darkoperator / scan_not_nmaped.rb
Created September 10, 2011 00:30
Metasploit RC file for scanning hosts not previously not scanned by nmap
<ruby>
if Process.uid == 0
# Set Variables
scanned_hosts = []
# Collect host already scanned with nmap
print_status("Collecting hosts already scanned by nmap.")
framework.db.notes.each do |n|
if n.ntype =~ /host.nmap/
scanned_hosts << n.host_id
<ruby>
if Process.uid == 0
# Set Variables
scanned_hosts = []
# Collect host already scanned with nmap
print_status("Collecting hosts already scanned by nmap.")
framework.db.notes.each do |n|
if n.ntype =~ /host.nmap/
scanned_hosts << n.host_id
@darkoperator
darkoperator / gist:5504726
Created May 2, 2013 19:28
KB Parse function test
PS C:\Users\Carlos\Desktop> Import-NessusKB -KBFile .\lab.txt -InfoType Successful
PluginID Stated
-------- ------
11011 Successful
10736 Successful
10150 Successful
10785 Successful
@darkoperator
darkoperator / instposhsshdev
Last active November 12, 2024 15:59
Install Posh-SSH Dev
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-SSH/archive/master.zip"
Write-Host "Downloading latest version of Posh-SSH from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-SSH.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
$targetondisk = "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules"
New-Item -ItemType Directory -Force -Path $targetondisk | out-null
$shell_app=new-object -com shell.application
$zip_file = $shell_app.namespace($file)
@darkoperator
darkoperator / gist:6404266
Created September 1, 2013 12:51
InstallPoshSecmod
# 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-SecMod/archive/master.zip"
Write-Host "Downloading latest version of Posh-SecMod from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-SecMod.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
@darkoperator
darkoperator / send_sms.py
Created December 8, 2013 14:42
sends using gmail an email to the ATT SMS gateway.
import subprocess
import smtplib
import socket
from email.mime.text import MIMEText
import datetime
# Change to your own account information
to = '<your number>@txt.att.net '
gmail_user = ''
gmail_password = ''
smtpserver = smtplib.SMTP('smtp.gmail.com', 587)
@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
@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 / 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
function Import-ShodanAPIKey
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=1)]
[securestring]$MasterPassword