184 lines
6.4 KiB
HTML
184 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
|
|
<meta http-equiv="X-Content-Type-Options" content="nosniff">
|
|
<link rel="stylesheet" href="../assets/css/style.css">
|
|
<link rel="icon" type="image/x-icon" href="../favicon.ico">
|
|
<script>
|
|
// Apply theme immediately to prevent flash
|
|
(function() {
|
|
const theme = localStorage.getItem('theme') ||
|
|
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
})();
|
|
</script>
|
|
<title>arpwatch Cheatsheet - Cheatsheets - Launch Pad</title>
|
|
</head>
|
|
<body>
|
|
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
|
|
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
|
|
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
|
|
</button>
|
|
<br/><br/>
|
|
<div class="name">
|
|
__ _______________________ _________._________________________
|
|
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
|
|
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
|
|
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
|
|
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
|
|
\/ \/ \/ \/ \/ \/ \/
|
|
</div>
|
|
<div class="blog-page-header">
|
|
<div class="blog-header-content">
|
|
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
|
|
</a>
|
|
<h1 class="blog-page-title">arpwatch Cheatsheet</h1>
|
|
</div>
|
|
</div>
|
|
<div class="blog-post-container">
|
|
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
|
|
<div class="blog-post">
|
|
<div class="blog-post-content">
|
|
<p><a href="index.html">← Back to cheatsheets</a></p>
|
|
<p><a href="../index.html">← Home</a></p>
|
|
<hr>
|
|
<p>arpwatch monitors ARP (Address Resolution Protocol) traffic on a network and logs changes to the Ethernet/IP address pairings. Detects ARP spoofing, MAC address changes, and network anomalies.</p>
|
|
<hr>
|
|
<h2>Basic Usage</h2>
|
|
<ul>
|
|
<li>arpwatch -i eth0 - Monitor interface</li>
|
|
</ul>
|
|
<ul>
|
|
<li>arpwatch -d -i eth0 - Run in foreground (debug)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>arpwatch -f arp.dat -i eth0 - Use database file</li>
|
|
</ul>
|
|
<ul>
|
|
<li>arpwatch -u arpwatch -i eth0 - Run as user</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Options</h2>
|
|
<ul>
|
|
<li>-i interface - Network interface to monitor</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-d - Debug mode (foreground)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-f file - Database file (default: /var/lib/arpwatch/arp.dat)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-u user - Run as user</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-n net/mask - Network specification</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-r file - Read from pcap file</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-m addr - Ignore MAC address</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-N - Suppress reporting of station flip flops</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Database Files</h2>
|
|
<ul>
|
|
<li>/var/lib/arpwatch/arp.dat - ARP database</li>
|
|
</ul>
|
|
<ul>
|
|
<li>/var/lib/arpwatch/ethercodes.dat - Ethernet vendor codes</li>
|
|
</ul>
|
|
<ul>
|
|
<li>arpwatch -f custom.dat -i eth0 - Custom database</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Log Files</h2>
|
|
<ul>
|
|
<li>/var/log/arpwatch.log - Activity log</li>
|
|
</ul>
|
|
<ul>
|
|
<li>/var/log/syslog - System log (if configured)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>tail -f /var/log/arpwatch.log - Watch live</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Common Examples</h2>
|
|
<h3>Monitor Interface</h3>
|
|
<pre><code>arpwatch -i eth0</code></pre>
|
|
<p>Start monitoring on interface.</p>
|
|
<h3>Debug Mode</h3>
|
|
<pre><code>arpwatch -d -i eth0</code></pre>
|
|
<p>Run in foreground for debugging.</p>
|
|
<h3>Custom Database</h3>
|
|
<pre><code>arpwatch -f /path/to/arp.dat -i eth0</code></pre>
|
|
<p>Use custom database file.</p>
|
|
<h3>Read from PCAP</h3>
|
|
<pre><code>arpwatch -r capture.pcap</code></pre>
|
|
<p>Analyze captured traffic.</p>
|
|
<h3>Ignore MAC</h3>
|
|
<pre><code>arpwatch -m 00:11:22:33:44:55 -i eth0</code></pre>
|
|
<p>Ignore specific MAC address.</p>
|
|
<h3>View Logs</h3>
|
|
<pre><code>tail -f /var/log/arpwatch.log</code></pre>
|
|
<p>Monitor activity in real-time.</p>
|
|
<hr>
|
|
<h2>Detection Events</h2>
|
|
<ul>
|
|
<li>New station - New MAC/IP pair detected</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Changed ethernet address - MAC changed for IP</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Flip flop - MAC address alternating</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Bogon - Invalid IP address</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Reused old ethernet address - MAC reappeared</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Tips</h2>
|
|
<ul>
|
|
<li>Run as daemon for continuous monitoring</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Check logs regularly for anomalies</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use -d for initial setup and testing</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Monitor for MAC address changes (possible ARP spoofing)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Essential for network security monitoring</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Detects ARP cache poisoning attacks</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use with email alerts for critical changes</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Review database periodically</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script async type="text/javascript" src="../blog/analytics.js"></script>
|
|
<script src="../theme.js"></script>
|
|
</body>
|
|
</html>
|
|
|