This file contains 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/env python3 | |
import json | |
import sys | |
help_text = ''' | |
krrmp - AWS session impersonation tool. | |
usage: krrmp [ -f <file_name> | -i ] | |
-f file_name : File name recorded session data as JSON. | |
alias: --file, f, file |
This file contains 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 | |
import json | |
import re | |
def converter(line): | |
# ref: https://kaminashi-developer.hatenablog.jp/entry/2021/03/26/110000 | |
replace_patterns = [ | |
{'name': 'heading1', 'scrapbox': r'\t*\[#*\*{3,}#* (.+)]', 'markdown': r'# \1'}, | |
{'name': 'heading2', 'scrapbox': r'\t*\[#*\*{2}#* (.+)]', 'markdown': r'## \1'}, |
This file contains 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 re | |
cmd = 'hydra ' | |
# username | |
while True: | |
use_list = input('use username list?[Y/n]: ') | |
if re.match(r'(y|yes|n|no)', use_list, re.I) or use_list == '': | |
break |
This file contains 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/env python3 | |
def translate_ipv4_from_dicimal(d): | |
ip = [] | |
for i in range(0, 31, 8): | |
ip.append(str(int(bin(d).strip('0b')[i:i+8], 2))) | |
return '.'.join(ip) | |
if __name__ == '__main__': |
This file contains 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 re | |
def sort_by_interface_and_number(interface_name): | |
if re.search(r'[0-9]', interface_name): | |
interface_num_start = re.search(r'[0-9]', interface_name).start() | |
interface_type = interface_name[:interface_num_start] | |
interface_raw_number = interface_name[interface_num_start:] | |
interface_numbers = [] | |
for i in range(len(interface_raw_number)): |
This file contains 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 argparse | |
import sys | |
def gott(age, confidence_interval): | |
if confidence_interval >= 100: | |
sys.exit(1) | |
edge = (100 - confidence_interval) / 2 | |
base = (confidence_interval + edge) / edge |
This file contains 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" | |
"reflect" | |
) | |
type Hoge struct { | |
N int | |
} |
This file contains 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 | |
class Netcat: | |
""" Python 'netcat like' module """ | |
def __init__(self, ip, port): | |
self.buff = "" | |
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |