Opening Remarks#

Welcome to the InfoSec Jupyterthon 2022!#

Roberto Rodriguez @Cyb3rWard0g#

../../_images/day1-01_02_Roberto.jpg
  • Microsoft Security Research Organization

  • I ❤️ Dogs and Open Source!

  • Read > Blog > Tweet > Repeat!

  • Founder of the Open Threat Research (OTR) Community!

  • Cooking Recipes: https://infosecwelldone.com/

Industry 2022#

import pandas as pd
import altair as alt
alt.renderers.enable('default')

df = pd.read_csv("data/InfosecJupyterthon2022-Stats.csv")
top_10 = df['Industry'].value_counts()[:10].to_frame().reset_index()

bars = alt.Chart(top_10, title='Industry 2022').mark_bar().encode(
    x=alt.X('Industry', axis=alt.Axis(title='Count')),
    y=alt.Y('index', axis=alt.Axis(title='Industry'), sort='-x'),
    color=alt.Color('index', legend=None)
).properties(height = 350, width=600)

text = bars.mark_text(align='center',baseline='middle',dx=10,dy=0).encode(text='Industry')

bars + text

Jupyter Notebooks Level 2022#

import pandas as pd
from matplotlib import pyplot as plt
import numpy as np

df = pd.read_csv("data/InfosecJupyterthon2022-Stats.csv")
top_10 = df['JupyterNotebookLevel'].value_counts()[:10].to_frame().reset_index()
colors = ['tab:blue', 'tab:cyan', 'tab:gray', 'tab:orange', 'tab:red']

# Creating autocpt arguments 
def func(pct, allvalues): 
    absolute = int(pct / 100.*np.sum(allvalues)) 
    return "{:.1f}% ({:d})".format(pct, absolute)

fig, ax = plt.subplots(figsize =(10, 10))
ax.pie(top_10['JupyterNotebookLevel'],labels = top_10['index'],colors = colors,
       autopct = lambda pct: func(pct, top_10['JupyterNotebookLevel']),
       startangle=180,wedgeprops={'linewidth': 2.0, 'edgecolor': 'white'},textprops={'size': 'x-large'}
)
ax.set_title('Jupyter Notebooks Level 2022', fontsize=20)
plt.show()
../../_images/91bb966446165d013fc94ec1eabdb5f34cc869a715ba6159f021aa2c4f11bca2.png

What do you expect to learn about Jupyter Notebooks in this event?#

import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS

df = pd.read_csv("data/InfosecJupyterthon2022-Stats.csv")
expectations= df['Expectations'].dropna().values

tokens = list()
for line in expectations:
    [tokens.append(token.lower()) for token in str(line).split()]

text = " ".join(i for i in set(tokens))

[STOPWORDS.add(n) for n in ['notebook', 'notebooks', 'jupyter', 'infosec','etc']]
wordcloud = WordCloud(
    width=400,height=400,background_color='white',stopwords=set(STOPWORDS),min_font_size = 10
).generate(text) 
                      
plt.figure(figsize = (10, 8), facecolor = None) 
plt.imshow(wordcloud, interpolation='bilinear') 
plt.axis("off") 
plt.tight_layout(pad = 0)
plt.show()
../../_images/c6ec307aace1d9e3df9f78cc8025670e1a330f87406d9d1928d76cd365bd35b1.png

Housekeeping#

Infosec Community!#

import pandas as pd
from geopy.geocoders import Nominatim
import folium
from folium.plugins import MarkerCluster

# Reference: https://towardsdatascience.com/using-python-to-create-a-world-map-from-a-list-of-country-names-cd7480d03b10

df = pd.read_csv("data/InfosecJupyterthon2022-Stats.csv")
community = pd.DataFrame(df['Location'].dropna().values)
community.rename( columns={0 :'Country'}, inplace=True )
community = community.applymap(lambda x: x.strip())
community = community.groupby(['Country']).size().reset_index(name='Members')

geolocator = Nominatim(user_agent="Jupyterthon")
latitude = []
longitude = []

def geolocate(country):
    try:
        # Geolocate the center of the country
        loc = geolocator.geocode(country)
        #print(f'{country} - Latitude: {loc.latitude} Longitude: {loc.longitude}')
        # And return latitude and longitude
        latitude.append(loc.latitude)
        longitude.append(loc.longitude)
    except:
        # Return missing value
        return np.nan

for index, row in community.iterrows():
    geolocate(row.Country)

community['Latitude'] = latitude
community['Longitude'] = longitude

world_map= folium.Map(tiles="cartodbpositron")
marker_cluster = MarkerCluster().add_to(world_map)

for i in range(len(community)):
        lat = community.iloc[i]['Latitude']
        long = community.iloc[i]['Longitude']
        radius=5
        popup_text = """Country : {}<br>
                    %of Members : {}<br>"""
        popup_text = popup_text.format(community.iloc[i]['Country'],
                                   community.iloc[i]['Members']
                                   )
        folium.CircleMarker(location = [lat, long], radius=radius, popup= popup_text, fill =True).add_to(marker_cluster)
#show the map
world_map
Make this Notebook Trusted to load map: File -> Trust Notebook

https://infosecjupyterthon.com/2022/agenda.html#