Skip to content

Instantly share code, notes, and snippets.

View garyconstable's full-sized avatar
🏠
Working from home

Gary Constable garyconstable

🏠
Working from home
View GitHub Profile
@garyconstable
garyconstable / Scanner.py
Created March 16, 2015 23:19
Python network penetration test - scan ssh and ftp ports for a range of IP Addresses
'''
.-') _ .-') _ ('-. _ .-') .-') _ ('-. .-') _ .-') ('-. .-') _
( OO ) ( OO) ) _( OO( \( -O ) ( OO ) _( OO)( OO) ) ( OO ). ( OO ).-. ( OO ) )
,-.-'),--./ ,--,'/ '.(,------,------.,--./ ,--,(,------/ '._ (_)---\_) .-----. / . --. ,--./ ,--,'
| |OO| \ | |\|'--...__| .---| /`. | \ | |\| .---|'--...__) / _ | ' .--./ | \-. \| \ | |\
| | | \| | '--. .--| | | / | | \| | | | '--. .--' \ :` `. | |('-.-'-' | | \| | )
| |(_| . |/ | | (| '--.| |_.' | . |(| '--. | | '..`''.)/_) |OO \| |_.' | . |/
,| |_.| |\ | | | | .--'| . '.| |\ | | .--' | | .-._) \|| |`-'| | .-. | |\ |
(_| | | | \ | | | | `---| |\ \| | \ | | `---. | | \ (_' '--'\ | | | | | \ |
@garyconstable
garyconstable / brute_force.py
Created March 24, 2015 22:33
Python Brute Force SSH
import pxssh
import optparse
import time
from threading import *
max_connections = 5
connection_lock = BoundedSemaphore(value=max_connections)
Found = False
Fails = 0
@garyconstable
garyconstable / ftp-scanner-GUI.py
Last active February 12, 2018 05:17
Python Anonymous FTP Scanner
'''
Anonymous FTP Scanner - with GUI
'''
try:
from Tkinter import *
except ImportError:
from tkinter import *
@garyconstable
garyconstable / geoip.py
Created March 26, 2015 00:31
Geo Code IP Address
import pygeoip
import optparse
def printRecord(tgt):
gi = pygeoip.GeoIP('GeoLiteCity.dat')
try:
rec = gi.record_by_addr(tgt)
except:
rec = gi.record_by_name(tgt)
@garyconstable
garyconstable / wifi-sniffer.py
Last active October 13, 2023 20:30
Python Wifi Channel Hopping Sniffer
"""
Wifi Sniffer
"""
import os
from scapy.all import *
if len(sys.argv) == 2:
iface = str(sys.argv[1])
else:
@garyconstable
garyconstable / deauth.py
Last active August 26, 2024 17:57
Python Networking Wifi Deauth Attack
import argparse
from multiprocessing import Process
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import signal
import threading
from sys import platform
@garyconstable
garyconstable / TestPlugin.php
Last active December 29, 2016 11:11
Craft CMS Loop through categories and children from within a plugin
<?php
namespace Craft;
class TestPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Test Plugin');
}
@garyconstable
garyconstable / relatedCategory.twig
Created May 28, 2015 23:03
Craft CMS - Select Categories related to user
{% set categories = craft.categories({
relatedTo: { sourceElement: currentUser, field: "preference" },
limit: null
}) %}
{% for x in categories %}
<pre>
{{x.title}}
@garyconstable
garyconstable / TestVariable.php
Created May 31, 2015 23:54
Save a craft CMS Relationship
<?php
namespace Craft;
class TestVariable
{
public function p($data = array() ){
echo '<pre>'.print_r($data, true).'</pre>';
}
@garyconstable
garyconstable / gulpfile.js
Created June 4, 2015 23:13
Using Gulp to Concat and minify Javascript files.
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
return gulp.src([
'assets/bower_components/jquery/dist/jquery.js',
'assets/bower_components/bootstrap/dist/js/bootstrap.js',
'assets/bower_components/headhesive/dist/headhesive.js',
'assets/js/lib/particle-system.js',