{"id":7382,"date":"2018-04-30T11:39:39","date_gmt":"2018-04-30T09:39:39","guid":{"rendered":"https:\/\/hansesecure.de\/2018\/04\/howto-msf-email\/"},"modified":"2018-04-30T11:39:39","modified_gmt":"2018-04-30T09:39:39","slug":"howto-msf-email","status":"publish","type":"post","link":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/","title":{"rendered":"HowTo: MSF email"},"content":{"rendered":"<p>This is just another very short usage guide for one of my little helper for pentesters and the like. During some assessments with social engineering i want to get informed by my server, if a session is opened. After some time of research i didn&#8217;t find any good solution in the internet, so i decided to write my own one \ud83d\ude09&nbsp;Unfortunately ruby needs a GEM for TLS connections which is not in the MSF repo.&nbsp;  My solution is a post explotation modul, which only calls my python script to send an email. You can find the code <a href=\"https:\/\/github.com\/HanseSecure\/metasploit-modules\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<h2>0x01 Download Files<\/h2>\n<p>At first you should copy my repo to your favourit location via<\/p>\n<p><code>git clone https:\/\/github.com\/HanseSecure\/metasploit-modules<\/code><\/p>\n<h2>0x02 Age Files<\/h2>\n<p>Afterwards you find two files named&nbsp;<em>email-notify.rb<\/em> &amp;&amp;&nbsp;<em>msf-email.py<\/em>.<\/p>\n<p>At first we have to configure our email settings for our server in the <em>msf-email.py<\/em> file.<\/p>\n<p><a href=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/msf-email.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-946\" src=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/msf-email-268x300.png\" alt=\"\" width=\"400\" height=\"448\"><\/a><\/p>\n<p>Now you have to change one line in the <em>email-notify.rb<\/em> file which should point to your altered msf-email.py file.<\/p>\n<p><a href=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/email-notify.png\"><img decoding=\"async\" class=\"aligncenter wp-image-944\" src=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/email-notify-300x257.png\" alt=\"\" width=\"400\" height=\"343\"><\/a><\/p>\n<h2>0x03 Copy to Position<\/h2>\n<p>The last step is to copy the <em>mail-notify.rb<\/em> file into your metasploit directory<\/p>\n<p><code>cp email-notify.rb \/usr\/share\/metasploit-framework\/modules\/post\/multi\/manage\/.<\/code><\/p>\n<h2>0x04 Have Fun<\/h2>\n<p>Start metasploit and look at your new post explotation tool \ud83d\ude09 Now you can use the <code>set autorunscript<\/code> option of your <em>mutli\/handler<\/em> and the email will be send for every new session.<\/p>\n<p><a href=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/modul.png\"><img decoding=\"async\" class=\"aligncenter wp-image-945\" src=\"https:\/\/hansesecure.de\/wp-banane\/uploads\/2018\/04\/modul-300x186.png\" alt=\"\" width=\"400\" height=\"247\"><\/a><\/p>\n<p>Cheers<br \/>\nFlo&nbsp;<a href=\"https:\/\/twitter.com\/HanseSecure\" target=\"_blank\" rel=\"noopener\">@HanseSecure<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just another very short usage guide for one of my little helper for pentesters and the like. During some assessments with social engineering i want to get informed by my server, if a session is opened. After some time of research i didn&#8217;t find any good solution in the internet, so i decided [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":7035,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[257],"tags":[275,266,281,282,283],"class_list":["post-7382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deep-dive-techniques","tag-metasploit-en","tag-migration-en","tag-penetration-test-en","tag-post-explotation-en-2","tag-redteaming-en-2"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HowTo: MSF email &#8211; HanseSecure GmbH<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HowTo: MSF email &#8211; HanseSecure GmbH\" \/>\n<meta property=\"og:description\" content=\"This is just another very short usage guide for one of my little helper for pentesters and the like. During some assessments with social engineering i want to get informed by my server, if a session is opened. After some time of research i didn&#8217;t find any good solution in the internet, so i decided [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/\" \/>\n<meta property=\"og:site_name\" content=\"HanseSecure GmbH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/hansesecure\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-30T09:39:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"HanseSecure\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CyberWarship\" \/>\n<meta name=\"twitter:site\" content=\"@CyberWarship\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"HanseSecure\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/\"},\"author\":{\"name\":\"HanseSecure\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#\\\/schema\\\/person\\\/6ec6ef4887ff2fc97a14f1a7f390f593\"},\"headline\":\"HowTo: MSF email\",\"datePublished\":\"2018-04-30T09:39:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/\"},\"wordCount\":231,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/blog-msf.jpg\",\"keywords\":[\"Metasploit\",\"Migration\",\"Penetration test\",\"Post-Explotation\",\"Redteaming\"],\"articleSection\":[\"Deep Dive Techniques\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/\",\"url\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/\",\"name\":\"HowTo: MSF email &#8211; HanseSecure GmbH\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/blog-msf.jpg\",\"datePublished\":\"2018-04-30T09:39:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/blog-msf.jpg\",\"contentUrl\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/blog-msf.jpg\",\"width\":400,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/2018\\\/04\\\/howto-msf-email\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HowTo: MSF email\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/\",\"name\":\"HanseSecure GmbH\",\"description\":\"Choose the Intruder\",\"publisher\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#organization\",\"name\":\"HanseSecure GmbH\",\"url\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-000-LOGO-intensiv-schwarz-rot-HanseSecure_LOGO_CTI_Vektor_rotes_H11806.png\",\"contentUrl\":\"https:\\\/\\\/hansesecure.de\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-000-LOGO-intensiv-schwarz-rot-HanseSecure_LOGO_CTI_Vektor_rotes_H11806.png\",\"width\":512,\"height\":512,\"caption\":\"HanseSecure GmbH\"},\"image\":{\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/hansesecure\",\"https:\\\/\\\/x.com\\\/CyberWarship\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/hansesecure\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCAABbKOA_stDFkEKS3MSF7Q\",\"https:\\\/\\\/www.instagram.com\\\/hansesecure\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hansesecure.de\\\/en\\\/#\\\/schema\\\/person\\\/6ec6ef4887ff2fc97a14f1a7f390f593\",\"name\":\"HanseSecure\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g\",\"caption\":\"HanseSecure\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HowTo: MSF email &#8211; HanseSecure GmbH","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/","og_locale":"en_US","og_type":"article","og_title":"HowTo: MSF email &#8211; HanseSecure GmbH","og_description":"This is just another very short usage guide for one of my little helper for pentesters and the like. During some assessments with social engineering i want to get informed by my server, if a session is opened. After some time of research i didn&#8217;t find any good solution in the internet, so i decided [&hellip;]","og_url":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/","og_site_name":"HanseSecure GmbH","article_publisher":"https:\/\/facebook.com\/hansesecure","article_published_time":"2018-04-30T09:39:39+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg","type":"image\/jpeg"}],"author":"HanseSecure","twitter_card":"summary_large_image","twitter_creator":"@CyberWarship","twitter_site":"@CyberWarship","twitter_misc":{"Written by":"HanseSecure","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#article","isPartOf":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/"},"author":{"name":"HanseSecure","@id":"https:\/\/hansesecure.de\/en\/#\/schema\/person\/6ec6ef4887ff2fc97a14f1a7f390f593"},"headline":"HowTo: MSF email","datePublished":"2018-04-30T09:39:39+00:00","mainEntityOfPage":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/"},"wordCount":231,"commentCount":0,"publisher":{"@id":"https:\/\/hansesecure.de\/en\/#organization"},"image":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#primaryimage"},"thumbnailUrl":"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg","keywords":["Metasploit","Migration","Penetration test","Post-Explotation","Redteaming"],"articleSection":["Deep Dive Techniques"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/","url":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/","name":"HowTo: MSF email &#8211; HanseSecure GmbH","isPartOf":{"@id":"https:\/\/hansesecure.de\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#primaryimage"},"image":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#primaryimage"},"thumbnailUrl":"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg","datePublished":"2018-04-30T09:39:39+00:00","breadcrumb":{"@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#primaryimage","url":"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg","contentUrl":"https:\/\/hansesecure.de\/wp-content\/uploads\/2018\/04\/blog-msf.jpg","width":400,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/hansesecure.de\/en\/2018\/04\/howto-msf-email\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/hansesecure.de\/en\/"},{"@type":"ListItem","position":2,"name":"HowTo: MSF email"}]},{"@type":"WebSite","@id":"https:\/\/hansesecure.de\/en\/#website","url":"https:\/\/hansesecure.de\/en\/","name":"HanseSecure GmbH","description":"Choose the Intruder","publisher":{"@id":"https:\/\/hansesecure.de\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hansesecure.de\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hansesecure.de\/en\/#organization","name":"HanseSecure GmbH","url":"https:\/\/hansesecure.de\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hansesecure.de\/en\/#\/schema\/logo\/image\/","url":"https:\/\/hansesecure.de\/wp-content\/uploads\/2023\/05\/cropped-000-LOGO-intensiv-schwarz-rot-HanseSecure_LOGO_CTI_Vektor_rotes_H11806.png","contentUrl":"https:\/\/hansesecure.de\/wp-content\/uploads\/2023\/05\/cropped-000-LOGO-intensiv-schwarz-rot-HanseSecure_LOGO_CTI_Vektor_rotes_H11806.png","width":512,"height":512,"caption":"HanseSecure GmbH"},"image":{"@id":"https:\/\/hansesecure.de\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/hansesecure","https:\/\/x.com\/CyberWarship","https:\/\/www.linkedin.com\/company\/hansesecure","https:\/\/www.youtube.com\/channel\/UCAABbKOA_stDFkEKS3MSF7Q","https:\/\/www.instagram.com\/hansesecure\/"]},{"@type":"Person","@id":"https:\/\/hansesecure.de\/en\/#\/schema\/person\/6ec6ef4887ff2fc97a14f1a7f390f593","name":"HanseSecure","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/58fe26b2270315f2ab1268b229465b72c497c86aac3696aaaf2e629ae4e4f0af?s=96&d=mm&r=g","caption":"HanseSecure"}}]}},"_links":{"self":[{"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/posts\/7382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/comments?post=7382"}],"version-history":[{"count":0,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/posts\/7382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/media\/7035"}],"wp:attachment":[{"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/media?parent=7382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/categories?post=7382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hansesecure.de\/en\/wp-json\/wp\/v2\/tags?post=7382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}