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
| # Useful for padding buffers | |
| # Useful in C | |
| Size_Of_Target = 189 | |
| Round_Number = 12 | |
| target = Size_Of_Target + Round_Number - (Size_Of_Target % Round_Number) | |
| print(target) | |
| #189 + 12 = 201 |
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 xmltodict | |
| import json | |
| import re | |
| import sys | |
| def FindShares(filename): | |
| with open(filename ,encoding="utf8") as fd: | |
| doc = xmltodict.parse(fd.read()) | |
| for host in doc['NessusClientData_v2']['Report']['ReportHost']: |
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
| MATCH p=(m:User)-[r:AdminTo]->(n:Computer) RETURN m.name AS User, collect (n.name) as AdminTo |
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
| #http://127.0.0.1:7474/browser/ - NEO4J Browser | |
| MATCH p=(n:Group)<-[:MemberOf*1..]-(m) WHERE n.objectid =~ "(?i).*S-1-5-32-544" RETURN n.name,collect(m.name) UNION MATCH p=(n:Group)<-[:MemberOf*1..]-(m) WHERE n.objectid =~ "(?i)S-1-5-.*-512" RETURN n.name,collect(m.name) UNION MATCH p=(n:Group)<-[:MemberOf*1..]-(m) WHERE n.objectid =~ "(?i)S-1-5-.*-519" RETURN n.name,collect(m.name) |
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
| signalChan := make(chan os.Signal, 1) | |
| signal.Notify(signalChan, os.Interrupt) | |
| defer func() { | |
| signal.Stop(signalChan) | |
| cancel() | |
| }() | |
| go func() { | |
| select { | |
| case <-signalChan: | |
| // caught CTRL+C |
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
| proc xorEncode(key,data: string): seq[uint8] = | |
| # Requires a string key and string data. Returns a seq of xor encoded data. | |
| var finalkey: string = "" | |
| var result: seq[uint8] | |
| #Keep repeating the key until it is equal or greater then the data | |
| while finalkey.len < data.len : | |
| finalkey.add(key) | |
| #If key is bigger then the data, delete excess key values. Do I really need to do this? no. |
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 concurrent.futures | |
| list_variable=[] | |
| with open('list.txt','r') as f: #Import a file into a list | |
| for line in f: | |
| list_variable.append(line.strip()) | |
| def function_name(paramerter1): #Function with a single parameter | |
| print(paramerter1) |
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 readline | |
| def rlinput(prefill): | |
| readline.set_startup_hook(lambda: readline.insert_text(prefill)) | |
| try: | |
| return input() # or raw_input in Python 2 | |
| finally: | |
| readline.set_startup_hook() | |
| query = "" |
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
| #!/bin/bash | |
| if [ ! $# == 3 ]; then | |
| echo "Usage: vpnfix.sh /full/path/to/vpn.ovpn username password" | |
| exit | |
| fi | |
| file_path=$(dirname $1) | |
| echo $file_path |
NewerOlder