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
OS: Linux ubuntu 4.10.0-28-generic #32~16.04.2-Ubuntu | |
Instructions: | |
1)Uncomment lines from /etc/apt/sources.list(needs root): | |
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe | |
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe | |
2)Run: | |
sudo apt-get update && sudo apt-get upgrade |
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
from ipaddress import IPv4Network | |
def iprange2range24wildcard(iprange): | |
if(int(str(iprange).split('/')[1])) <= 24 : | |
slash24networks=[] | |
for e in list(IPv4Network(iprange).subnets(new_prefix=24)): | |
slash24networks.append(str(e).replace('0/24', '%')) | |
return slash24networks | |
else: | |
print ('ERROR: The subnetwork MUST be less or equal than /24.') |
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 random | |
def generating_ips(int): | |
ips =[] | |
for x in range(0,int): | |
ip = '{}.{}.{}.{}'.format(*__import__('random').sample(range(0, 255), 4)) | |
ips.append(ip) | |
return ips |
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
python -m memory_profiler json_demo.py |
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 cfscrape | |
from lxml import etree | |
import pandas as pd | |
url="<put_the_url_here>" | |
header = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9', | |
'Accept-Encoding': 'gzip, deflate, sdch', | |
'Accept-Language' : 'nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4', | |
'Cache-Control' : 'max-age=0', |
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
def domain2ipv4(domain): | |
ip = subprocess.Popen(['dig', '+short', domain], | |
stdout=subprocess.PIPE).communicate()[0].decode("utf-8").split('\n')[0] | |
return ip |
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
df_iana = pd.read_csv('https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv') | |
def service_desc2port_iana (df_iana, service_desc): | |
port_iana = df_iana['Port Number'][df_iana['Description'].str.contains(service_desc,case=False)==True].dropna().unique() | |
return port_iana | |
def port_num2service_desc_iana (df_iana, port_num): | |
service_desc_iana = df_iana['Description'][df_iana['Port Number']==port_num].dropna().unique() | |
return service_desc_iana |
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
def domain2ipv6(domain_name): | |
ipv6 = subprocess.Popen(['dig', domain_name, 'AAAA', '+short'], | |
stdout=subprocess.PIPE).communicate()[0].decode("utf-8").replace('\n','') | |
if ipv6=='': | |
ipv6='NaN' | |
return ipv6 |
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
def ipv42rdns(ipv4): | |
rdns = subprocess.Popen(['dig', '-x', ipv4, '+short'], | |
stdout=subprocess.PIPE).communicate()[0].decode("utf-8").replace('\n','') | |
return rdns |
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
## Core latex/pdflatex auxiliary files: | |
*.aux | |
*.lof | |
*.log | |
*.lot | |
*.fls | |
*.out | |
*.toc | |
*.fmt | |
*.fot |