{"id":698,"date":"2025-07-15T02:51:05","date_gmt":"2025-07-15T02:51:05","guid":{"rendered":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=698"},"modified":"2025-07-15T02:51:05","modified_gmt":"2025-07-15T02:51:05","slug":"artificial-intelligence","status":"publish","type":"post","link":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=698","title":{"rendered":"Artificial intelligence"},"content":{"rendered":"\n<p><strong>Objectives<\/strong><br><strong>This exercise introduces you to a machine learning\/AI pipeline solution that pushes data from Zeek through an AI model to produce alerts about network activity.<\/strong><\/p>\n\n\n\n<p><strong>Details<\/strong><br><strong>This lab will require us to start several SSH connections to the virtual machine. One of these will run Zeek, monitoring the loopback interface. Another will run a Python script that will load a trained AI model and use it to generate alerts regarding network protocols that are present. The last connection will be used to replay packets over loopback so that Zeek has something to look at.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Exercise 1<\/strong><\/h3>\n\n\n\n<p>To begin with, we need to get three separate command lines established to the VM.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Please either open three separate SSH connections to the VM or, alternatively, use <code>tmux<\/code> to split your current connection into at least three panes. Use the <code>cd<\/code> command to change into the <code>\/sec503\/Exercises\/Day5\/ai<\/code> directory in each session.<\/li>\n\n\n\n<li>Now that we have three command lines available, we can start setting up the various pieces required to make this work. One of the sessions will be running Zeek and using the <code>classify.zeek<\/code> script. This script will push the first bytes in every network stream into a Broker channel named <code>\/sec503\/content<\/code>. To use it, we need to start Zeek, ask it to listen on the <code>lo<\/code> or loopback interface, and configure it to run this script. When we run Zeek on loopback, we will also see warnings related to checksums. While we would never do so in production, we will tell Zeek to ignore checksums while running in this lab. Please execute the following command as <strong>root<\/strong> in one of the sessions:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"85\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-113.png\" alt=\"\" class=\"wp-image-703\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-113.png 665w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-113-300x38.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p>3. Now that Zeek is running, we can use another one of our sessions to connect the AI classifier to the Broker channel. We will do this using the <code>classify.py<\/code> script in the lab directory. Please run it as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-114-1024x554.png\" alt=\"\" class=\"wp-image-705\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-114-1024x554.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-114-300x162.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-114-768x415.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-114.png 1115w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>4.<\/strong> Our final task is to send data over the loopback interface so that Zeek can see it, relay the sessions to the classifier, and the classifier can report what it is seeing. To do this, you will use your third session. This session <strong>must be running as root<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"999\" height=\"163\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-115.png\" alt=\"\" class=\"wp-image-707\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-115.png 999w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-115-300x49.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-115-768x125.png 768w\" sizes=\"auto, (max-width: 999px) 100vw, 999px\" \/><\/figure>\n\n\n\n<p><strong>5.<\/strong> Observe the output in the session that is running the classification script:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"683\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-116.png\" alt=\"\" class=\"wp-image-709\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-116.png 732w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/07\/image-116-300x280.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/figure>\n\n\n\n<p>While there are some protocols being misclassified, overall this tool is doing an excellent job identifying known protocols.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ObjectivesThis exercise introduces you to a machine learning\/AI pipeline solution that pushes data from Zeek through an AI model to produce alerts about network activity. DetailsThis lab will require us to start several SSH connections to the virtual machine. One of these will run Zeek, monitoring the loopback interface. Another will run a Python script [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=698"}],"version-history":[{"count":5,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":711,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/698\/revisions\/711"}],"wp:attachment":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}