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 example_test | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "hex" | |
| "io" | |
| ) | |
| // AES-GCM should be used because the operation is an authenticated encryption |
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
| cat ~/.ssh/id_rsa.pub | ssh <username>@<ip_address> "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" |
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
| # Brewfile | |
| # Relies on: brew tap Homebrew/bundle | |
| # https://github.com/Homebrew/homebrew-bundle | |
| cask_args appdir: '/Applications' | |
| # Taps | |
| tap "caskroom/cask" | |
| # Brews | |
| brew "ansible" | |
| brew "ansible-cmdb" | |
| brew "cask" |
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
| { | |
| "Badge Text" : "", | |
| "Working Directory" : "\/Users\/<username>", | |
| "Prompt Before Closing 2" : 0, | |
| "Selected Text Color" : { | |
| "Green Component" : 0.8900123, | |
| "Blue Component" : 0.7978109, | |
| "Red Component" : 0.9161106 | |
| }, | |
| "Rows" : 25, |
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 nessusProcessor | |
| import ( | |
| "encoding/hex" | |
| "math/big" | |
| "net" | |
| ) | |
| // Inet_Aton converts an IPv4 net.IP object to a 64 bit integer. | |
| func Inet_Aton(ip net.IP) int64 { |
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 ( | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| // TransportWrapper wraps the http.Transport structure to allow us to record the | |
| // URLs which we are redirected through |
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 sys, os, socket | |
| s = socket.socket() | |
| s.bind((sys.argv[1], int(sys.argv[2]))) | |
| s.listen(5) | |
| try: | |
| while True: | |
| conn, addr = s.accept() | |
| path = os.path.join(os.getcwd(), "./"+conn.recv(4096).split("\n")[0].split(" ")[1]) | |
| conn.send((open(path).read() if os.path.isfile(path) else reduce(lambda x,s:x+"\n"+s+("/" if os.path.isdir(s) else ""),sorted(os.listdir(path)),"Directory "+path+" ls")) if os.path.exists(path) else '404: '+path) | |
| conn.close() |
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 "fmt" | |
| func main() { | |
| red := int(0xFF0000FF) | |
| green := int(0x00FF00FF) | |
| blue := int(0x0000FFFF) | |
| redHex, greenHex, blueHex, alphaHex := calcColor(red) |
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
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
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 socket; | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| openPort = False | |
| while openPort == False: | |
| result = sock.connect_ex(('10.10.10.136', 20)) | |
| if result == 0: | |
| openPort = True | |