This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* filename: ghdb | |
* | |
* usage: ghdb [info|list|update] | |
* | |
* Crude example of PHP HTML DOM and SQLite combination to archive | |
* data from a website. Posted as reference. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"fmt" | |
"flag" | |
) | |
func main() { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
postData = { | |
'name': 'username', | |
'pass': 'secret!', | |
'form_id': 'user_login', | |
'op': 'Log in' | |
} | |
loginUrl = 'http://www.some-drupal-site.com/user' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Analyze word frequency in subreddit post titles | |
Outputs the number of times a word is seen and orders them | |
by the most used words. | |
Quick and dirty script that is not optimized | |
[email protected] | |
www.devdungeon.com | |
""" | |
min_word_length = 5 # Ignore words shorter than this length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract_pngs.py | |
# Extract PNGs from a file and put them in a pngs/ directory | |
import sys | |
with open(sys.argv[1], "rb") as binary_file: | |
binary_file.seek(0, 2) # Seek the end | |
num_bytes = binary_file.tell() # Get the file size | |
count = 0 | |
for i in range(num_bytes): | |
binary_file.seek(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create_stego_zip_jpg.py - Hide a zip file inside a JPEG | |
import sys | |
# Start with a jpeg file | |
jpg_file = open(sys.argv[1], 'rb') # Path to JPEG | |
jpg_data = jpg_file.read() | |
jpg_file.close() | |
# And the zip file to embed in the jpeg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find_ascii_in_binary.py - Identify ASCII characters in binary files | |
import sys | |
from functools import partial | |
chunk_size = 1 | |
with open(sys.argv[1], 'rb') as in_file: | |
for data in iter(partial(in_file.read, chunk_size), b''): | |
x = int.from_bytes(data, byteorder='big') | |
if (x > 64 and x < 91) or (x > 96 and x < 123) : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#is_jpeg.py - Does the file have a JPEG binary signature? | |
import sys | |
import binascii | |
jpeg_signatures = [ | |
binascii.unhexlify(b'FFD8FFD8'), | |
binascii.unhexlify(b'FFD8FFE0'), | |
binascii.unhexlify(b'FFD8FFE1') | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
browser = Selenium::WebDriver.for :firefox | |
# Load a page | |
begin | |
browser.navigate.to 'http://www.devdungeon.com' | |
rescue | |
puts 'Error loading page.' | |
end |
OlderNewer