Skip to content

Instantly share code, notes, and snippets.

@stevenswafford
stevenswafford / list_files_in_zip.py
Created June 5, 2015 03:35
Demonstrates how to use zipfile to list the files contained in a zip archive.
import zipfile
myZipFile = zipfile.ZipFile( "test.zip", "r" )
# List all files contained within the zip file
for fileName in myZipFile.namelist():
print fileName
print
# List file information
@stevenswafford
stevenswafford / zipdump.py
Created June 3, 2015 06:39
Zipdump allows you to inspect ZIP files.
#!/usr/bin/env python
import optparse
import zipfile
import hashlib
import signal
import sys
import os
import cStringIO
import textwrap
@stevenswafford
stevenswafford / scan_log.py
Last active February 17, 2022 15:25
This tool helps you to find hack attempts within webserver log files (e.g. Apache2 access logs).
#!/usr/bin/python
# Description:
# This tool helps you to find hack attempts
# within webserver log files (e.g. Apache2 access logs).
# Features:
# - Error handling
# - Scan a log file for four different attack types
# - Display a short scan report
@stevenswafford
stevenswafford / dnsmap.py
Last active May 9, 2022 07:57
Maps DNS from a given domain.
#!/usr/bin/env python
# Description : Maps DNS from a given domain.
import socket
import sys
domain = raw_input("Enter domain: ")
try:
@stevenswafford
stevenswafford / curl_download.sh
Last active May 9, 2022 07:57
Download files using curl.
#!/bin/bash
# Description : Download files using curl.
echo "Enter the name of your flat file: "
read input_variable
echo "You entered: $input_variable"
#create urls variable array
declare urls=( `cat "$input_variable" `)
@superkojiman
superkojiman / namemash.py
Last active March 18, 2026 08:25
Creating a user name list for brute force attacks.
#!/usr/bin/env python3
'''
NameMash by superkojiman
Generate a list of possible usernames from a person's first and last name.
https://blog.techorganic.com/2011/07/17/creating-a-user-name-list-for-brute-force-attacks/
'''

Certain languages like Python use leading indentation to denote blocks. Wouldn't it be nice if a Marpa frontend like the IRIF would have support for this? Well, the problem is that implementing the Off-side Rule is similarly difficult to implementing here-docs: both are non-context free constructs, but are easy to implement by maintaining state in the scanner.

Consider this piece of Python code:

def foo(x, y):
    return x + (2*
y)

foo(1, 2) #=> 5