Sniffing & Spoofing

BetterCap – A complete, modular, portable and easily extensible MITM framework

BetterCap is an attempt to create a complete, modular, portable and easily extensible MITM framework with every kind of features could be needed while performing a man in the middle attack.
It’s currently able to sniff and print from the network the following informations:

  • URLs being visited.
  • HTTPS host being visited.
  • HTTP POSTed data.
  • FTP credentials.
  • IRC credentials.
  • POP, IMAP and SMTP credentials.
  • NTLMv1/v2 ( HTTP, SMB, LDAP, etc ) credentials.

Examples:
Default sniffer mode, all parsers enabled:

sudo ruby bettercap.rb --proxy

Enable proxy and use a custom port:

sudo ruby bettercap.rb --proxy --proxy-port=8081

Enable proxy and load the module example_proxy_module.rb:

sudo ruby bettercap.rb --proxy --proxy-module=example_proxy_module.rb

Disable spoofer and enable proxy ( stand alone proxy mode ):

sudo ruby bettercap.rb -S NONE --proxy

Modules – You can easily implement a module to inject data into pages or just inspect the requests/responses creating a ruby file and passing it to bettercap with the –proxy-module argument, the following is a sample module that injects some contents into the title tag of each html page.

class HackTitle < Proxy::Module
    def initialize
        # do your initialization stuff here
    end
    # self explainatory
    def is_enabled?
        return true
    end
    def on_request request, response
        # is an html page?
        if response.content_type == "text/html"
            Logger.info "Hacking #{http://#{request.host}#{request.url}} title tag"
            # make sure to use sub! or gsub! to update the instance
            response.body.sub!( "", "<title> !!! HACKED !!! " )
        end
    end
end
</pre>
<p>Depends:</p>
<ul>
<li>colorize (gem install colorize)</li>
<li>packetfu (gem install packetfu)</li>
<li>pcaprub (gem install pcaprub) [sudo apt-get install ruby-dev libpcap-dev]</li>
</ul>
<p>Download BetterCap at Github Repo: <a href="https://github.com/evilsocket/bettercap" target="_blank" rel="noopener noreferrer">EvilSocket</a></p>
	</div>

	<footer class="post-footer">
		<div class="post-tags"><a href="https://www.jameseduard.com/tag/irc/" rel="tag">IRC</a><a href="https://www.jameseduard.com/tag/mitm/" rel="tag">MITM</a><a href="https://www.jameseduard.com/tag/mitm-framework/" rel="tag">MITM framework.</a><a href="https://www.jameseduard.com/tag/ntlmv1/" rel="tag">NTLMv1</a><a href="https://www.jameseduard.com/tag/sniffer/" rel="tag">sniffer</a><a href="https://www.jameseduard.com/tag/sniffing/" rel="tag">sniffing</a></div>	</footer>

	</article>
<!-- Previous -->
<div class="post-navigation-wrap">
<a href="https://www.jameseduard.com/passgen-random-character-generator-crunch-which-attempts-to-solve-cracking-wpawpa2/" title="Passgen - Random character generator Crunch which attempts to solve cracking WPA/WPA2" class="post-navigation previous-post">
<i class="fa fa-angle-left"></i>
</a>

<!-- Next -->
<a href="https://www.jameseduard.com/snitch-a-tool-which-automate-information-gathering/" title="Snitch - A tool which automate Information Gathering" class="post-navigation next-post">
		<i class="fa fa-angle-right"></i>
</a>
</div><!-- Post Navigation Wrap -->				<div class="related-posts">
					<h3>Related Posts</h3>
												<section>
								<a href="https://www.jameseduard.com/massbleed-ssl-vulnerability-scanner/"></a>
								<h4><a href="https://www.jameseduard.com/massbleed-ssl-vulnerability-scanner/">MassBleed SSL Vulnerability Scanner</a></h4>
								<span class="related-post-date">November 27, 2015</span>
							</section>
														<section>
								<a href="https://www.jameseduard.com/dnsteal-dns-exfiltration-tool-for-stealthily-sending-files-over-dns-requests/"></a>
								<h4><a href="https://www.jameseduard.com/dnsteal-dns-exfiltration-tool-for-stealthily-sending-files-over-dns-requests/">DNSteal – DNS Exfiltration tool for stealthily sending files over DNS requests.</a></h4>
								<span class="related-post-date">September 28, 2015</span>
							</section>
														<section>
								<a href="https://www.jameseduard.com/zarp-network-attack-tool/"></a>
								<h4><a href="https://www.jameseduard.com/zarp-network-attack-tool/">Zarp -Network Attack Tool</a></h4>
								<span class="related-post-date">May 28, 2015</span>
							</section>
												<div class="clear-fix"></div>
				</div>
					</div><!-- .content-wrap -->

	
<div class="sidebar-right-wrap">
	<aside class="sidebar-right">
	    	        <section id="media_image-2" class="graceful-widget widget_media_image"><a href="https://affiliate.klook.com/redirect?aid=74408&aff_adid=1310193&k_site=https%3A%2F%2Fwww.klook.com%2Fen-US%2Factivity%2F1659-taipei-101-taipei"><img width="300" height="250" src="https://www.jameseduard.com/wp-content/uploads/2026/06/image-1.2_1.png" class="image wp-image-10799  attachment-full size-full" alt="https://affiliate.klook.com/redirect?aid=74408&aff_adid=1310193&k_site=httpswww.klook.comen-USactivity1659-taipei-101-taipei" style="max-width: 100%; height: auto;" decoding="async" /></a></section><section id="custom_html-4" class="widget_text graceful-widget widget_custom_html"><div class="textwidget custom-html-widget"><ins class="klk-aff-widget" data-wid="74408" data-adid="1169698" data-actids="39,23,45" data-prod="mul_act" data-price="false" data-lang="" data-width="336" data-height="280" data-currency="HKD"><a href="//www.klook.com/">Klook.com</a></ins>
<script type="text/javascript">
  (function (d, sc, u) {
    var s = d.createElement(sc),
      p = d.getElementsByTagName(sc)[0];
    s.type = "text/javascript";
    s.async = true;
    s.src = u;
    p.parentNode.insertBefore(s, p);
  })(
    document,
    "script",
    "https://affiliate.klook.com/widget/fetch-iframe-init.js"
  );
</script>
</div></section><section id="custom_html-3" class="widget_text graceful-widget widget_custom_html"><div class="textwidget custom-html-widget"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3116476424964638"
     crossorigin="anonymous"></script>
<!-- James Eduard - Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-3116476424964638"
     data-ad-slot="9687303817"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script></div></section><section id="categories-2" class="graceful-widget widget_categories"><h2 class="widget-title">Categories</h2><form action="https://www.jameseduard.com" method="get"><label class="screen-reader-text" for="cat">Categories</label><select  name='cat' id='cat' class='postform'>
	<option value='-1'>Select Category</option>
	<option class="level-0" value="2446">Automation</option>
	<option class="level-0" value="995">Blogs</option>
	<option class="level-0" value="2449">Graph API</option>
</select>
</form><script>
( ( dropdownId ) => {
	const dropdown = document.getElementById( dropdownId );
	function onSelectChange() {
		setTimeout( () => {
			if ( 'escape' === dropdown.dataset.lastkey ) {
				return;
			}
			if ( dropdown.value && parseInt( dropdown.value ) > 0 && dropdown instanceof HTMLSelectElement ) {
				dropdown.parentElement.submit();
			}
		}, 250 );
	}
	function onKeyUp( event ) {
		if ( 'Escape' === event.key ) {
			dropdown.dataset.lastkey = 'escape';
		} else {
			delete dropdown.dataset.lastkey;
		}
	}
	function onClick() {
		delete dropdown.dataset.lastkey;
	}
	dropdown.addEventListener( 'keyup', onKeyUp );
	dropdown.addEventListener( 'click', onClick );
	dropdown.addEventListener( 'change', onSelectChange );
})( "cat" );

//# sourceURL=WP_Widget_Categories%3A%3Awidget
</script>
</section><section id="block-3" class="graceful-widget widget_block"><div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow"><h2 class="wp-block-heading">Recent Posts</h2><ul class="wp-block-latest-posts__list wp-block-latest-posts is-layout-flow wp-block-latest-posts-is-layout-flow"><li><a class="wp-block-latest-posts__post-title" href="https://www.jameseduard.com/automating-graph-api-role-assignments-for-logic-app-managed-identity/">Protected: Automating Graph API Role Assignments for Logic App Managed Identity</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.jameseduard.com/aws-summit-hong-kong-2026-what-to-expect-and-why-you-should-attend/">AWS Summit Hong Kong 2026 – What to Expect and Why You Should Attend</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.jameseduard.com/vxcon-2025-where-red-teamers-reverse-engineers-and-car-hackers-meet-in-hong-kong/">VXCON 2025: Where Red Teamers, Reverse Engineers, and Car Hackers Meet in Hong Kong</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.jameseduard.com/how-to-guide-secure-dns-setup-for-windows-macos-and-linux/">How-To Guide: Secure DNS Setup for Windows, macOS, and Linux</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.jameseduard.com/introducing-quick-machine-recovery-microsofts-solution-to-driver-induced-blue-screens/">Introducing Quick Machine Recovery: Microsoft’s Solution to Driver-Induced Blue Screens</a></li>
</ul></div></div></section><section id="block-2" class="graceful-widget widget_block"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3116476424964638"
     crossorigin="anonymous"></script>
<!-- JEA Vertical Ads -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-3116476424964638"
     data-ad-slot="4386656352"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script></section><section id="custom_html-5" class="widget_text graceful-widget widget_custom_html"><div class="textwidget custom-html-widget"><ins class="klk-aff-widget" data-wid="74408" data-bgtype="Shinkansen" data-adid="930765" data-lang="en-US" data-prod="banner" data-width="300" data-height="250"><a href="//www.klook.com/?aid=">Klook.com</a></ins>
<script type="text/javascript">
  (function (d, sc, u) {
    var s = d.createElement(sc),
      p = d.getElementsByTagName(sc)[0];
    s.type = "text/javascript";
    s.async = true;
    s.src = u;
    p.parentNode.insertBefore(s, p);
  })(
    document,
    "script",
    "https://affiliate.klook.com/widget/fetch-iframe-init.js"
  );
</script>
</div></section>	    	</aside>
</div>


		</div><!-- .main-content End -->
		</main><!-- #primary End -->

		<!-- Site Footer -->
		<footer id="site-footer" class=" clear-fix">
			<div class="site-footer-wrap wrapped-content">
				

    <div class="footer-bottom-wrap">
        <!-- Scroll To Top -->
        <span class="scrolltop">
            <i class="fa fa fa-angle-up"></i>
        </span>
        
        <div class="footer-copyright">
            © 2026 James Eduard. Open Source • Technology • Cybersecurity. All rights reserved.        </div>
        
        <div class="footer-credits">
            Graceful Theme by             <a href="http://optimathemes.com/">
                Optima Themes            </a>
        </div>
    </div>			</div><!-- .wrapped-content -->
		</footer><!-- #site-footer -->

				
	</div><!-- #site-container -->

<script type="speculationrules">
{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/graceful-essence-blog/*","/wp-content/themes/graceful/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}
</script>
			<script>
				( () => {
					const lazyloadRunObserver = () => {
						const lazyloadBackgrounds = document.querySelectorAll( `.e-con.e-parent:not(.e-lazyloaded)` );
						const lazyloadBackgroundObserver = new IntersectionObserver( ( entries ) => {
							entries.forEach( ( entry ) => {
								if ( entry.isIntersecting ) {
									let lazyloadBackground = entry.target;
									if( lazyloadBackground ) {
										lazyloadBackground.classList.add( 'e-lazyloaded' );
									}
									lazyloadBackgroundObserver.unobserve( entry.target );
								}
							});
						}, { rootMargin: '200px 0px 200px 0px' } );
						lazyloadBackgrounds.forEach( ( lazyloadBackground ) => {
							lazyloadBackgroundObserver.observe( lazyloadBackground );
						} );
					};
					const events = [
						'DOMContentLoaded',
						'elementor/lazyload/observe',
					];
					events.forEach( ( event ) => {
						document.addEventListener( event, lazyloadRunObserver );
					} );
				} )();
			</script>
				<script type='text/javascript'>
		(function () {
			var c = document.body.className;
			c = c.replace(/woocommerce-no-js/, 'woocommerce-js');
			document.body.className = c;
		})();
	</script>
	<link rel='stylesheet' id='wc-blocks-style-css' href='https://www.jameseduard.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-blocks.css?ver=wc-11.0.1' media='all' />
<script id="nekit-swiper-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/external/swiper/swiper-bundle.min.js?ver=11.2.5"></script>
<script id="slick-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/external/slick/slick.min.js?ver=1.8.0"></script>
<script id="js-marquee-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/external/js-marquee/jquery.marquee.min.js?ver=1.0.0"></script>
<script id="typed-js-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/external/typed-main/typed.umd.js?ver=3"></script>
<script id="jquery-cookie-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/external/jquery-cookie/jquery-cookie.js?ver=1.4.1"></script>
<script id="nekit-main-js-extra">
var frontendData = {"_wpnonce":"470c1a5b7f","ajaxUrl":"https://www.jameseduard.com/wp-admin/admin-ajax.php"};
//# sourceURL=nekit-main-js-extra
</script>
<script id="nekit-main-js" src="https://www.jameseduard.com/wp-content/plugins/news-kit-elementor-addons/includes/assets/js/frontend-script.js?ver=1.0.0"></script>
<script id="wp-hooks-js" src="https://www.jameseduard.com/wp-includes/js/dist/hooks.min.js?ver=f0f188028580e8dc1255"></script>
<script id="wp-i18n-js" src="https://www.jameseduard.com/wp-includes/js/dist/i18n.min.js?ver=1dfe7db3940c23ea9216"></script>
<script id="wp-i18n-js-after">
wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );
//# sourceURL=wp-i18n-js-after
</script>
<script id="swv-js" src="https://www.jameseduard.com/wp-content/plugins/contact-form-7/includes/swv/js/index.js?ver=6.1.7"></script>
<script id="contact-form-7-js-before">
var wpcf7 = {
    "api": {
        "root": "https:\/\/www.jameseduard.com\/wp-json\/",
        "namespace": "contact-form-7\/v1"
    }
};
//# sourceURL=contact-form-7-js-before
</script>
<script id="contact-form-7-js" src="https://www.jameseduard.com/wp-content/plugins/contact-form-7/includes/js/index.js?ver=6.1.7"></script>
<script id="graceful-main-js" src="https://www.jameseduard.com/wp-content/themes/graceful/assets/js/main.js?ver=1.0.4"></script>
<script id="sourcebuster-js-js" src="https://www.jameseduard.com/wp-content/plugins/woocommerce/assets/js/sourcebuster/sourcebuster.min.js?ver=11.0.1"></script>
<script id="wc-order-attribution-js-extra">
var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https://www.jameseduard.com/wp-admin/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}};
//# sourceURL=wc-order-attribution-js-extra
</script>
<script id="wc-order-attribution-js" src="https://www.jameseduard.com/wp-content/plugins/woocommerce/assets/js/frontend/order-attribution.min.js?ver=11.0.1"></script>
<script id="wp-emoji-settings" type="application/json">
{"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://www.jameseduard.com/wp-includes/js/wp-emoji-release.min.js?ver=7.1"}}
</script>
<script type="module">
/*! This file is auto-generated */
var e="script#wp-emoji-settings",t=document.querySelector(e);if(!(t instanceof HTMLScriptElement))throw new Error("Element missing: "+e);const r=JSON.parse(t.text),s=(window._wpemojiSettings=r,"wpEmojiSettingsSupports"),o=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(s,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const r=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===r[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,r){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!r(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,r){let a;const s=(a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),o=(s.textBaseline="top",s.font="600 32px Arial",{});return e.forEach(e=>{o[e]=t(s,e,n,r)}),o}function a(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}r.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(s));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(o),u.toString(),c.toString(),p.toString()].join(",")+"));",r=new Blob([e],{type:"text/javascript"});const a=new Worker(URL.createObjectURL(r),{name:"wpTestEmojiSupports"});return void(a.onmessage=e=>{i(n=e.data),a.terminate(),t(n)})}catch(e){}i(n=f(o,u,c,p))}t(n)}).then(e=>{for(const n in e)r.supports[n]=e[n],r.supports.everything=r.supports.everything&&r.supports[n],"flag"!==n&&(r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&r.supports[n]);var t;r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&!r.supports.flag,r.supports.everything||((t=r.source||{}).concatemoji?a(t.concatemoji):t.wpemoji&&t.twemoji&&(a(t.twemoji),a(t.wpemoji)))});
//# sourceURL=https://www.jameseduard.com/wp-includes/js/wp-emoji-loader.min.js
</script>

</body>
</html>