******************************************************************************** main shortcuts F1 -> help F2 -> take a screenshot F11 -> previous step F12 -> next (reachable) step ******************************************************************************** diskdrake taken directly from diskdrake.pm: "a" => \&Active, "b" => \&Move, "c" => \&Create, "d" => \&Delete, "f" => \&Format, "m" => \&Mount_point, "M" => \&Mount, "n" => \&Create, "o" => \&ReadFromFile, "s" => \&SaveInFile, "q" => \&Exit, "r" => \&Resize, "t" => \&Type, "u" => \&Unmount, "w" => \&WritePartitions, "W" => \&WriteFstab, hopefully it is explicit enough :) ******************************************************************************** list choice - acceleration a la windows (default): enter a letter and the selection will move to the first entry beginning with that letter. If you enter another letter it will try to find the entry beginning with the 2 letters you have given. In case it fails the starting_word is reset. - incremental search a la emacs: searches trough the list Use control-s to use incremental search and then to search next occurence ******************************************************************************** in case of complete mouse sh**t XFree86 provides a way of moving the mouse pointer: - first, press Ctrl-Shift-NumLock - then move the pointer with the keypad arrows - press button is ``0'' (aka Inser) - release button is ``.'' (aka Suppr) t</td></tr></table> <table class='tabs'><tr><td> <a href='/software/msec/about/?h=1.7'>about</a><a href='/software/msec/?h=1.7'>summary</a><a href='/software/msec/refs/?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>refs</a><a href='/software/msec/log/cron-sh/promisc_check.sh?h=1.7'>log</a><a class='active' href='/software/msec/tree/cron-sh/promisc_check.sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>tree</a><a href='/software/msec/commit/cron-sh/promisc_check.sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>commit</a><a href='/software/msec/diff/cron-sh/promisc_check.sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>diff</a><a href='/software/msec/stats/cron-sh/promisc_check.sh?h=1.7'>stats</a></td><td class='form'><form class='right' method='get' action='/software/msec/log/cron-sh/promisc_check.sh'> <input type='hidden' name='h' value='1.7'/><input type='hidden' name='id' value='6de42330d574807cdf421d1aca5bbe43417abf5c'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/software/msec/tree/?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>root</a>/<a href='/software/msec/tree/cron-sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>cron-sh</a>/<a href='/software/msec/tree/cron-sh/promisc_check.sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>promisc_check.sh</a></div><div class='content'>blob: da06f32d50a8aea215e3441978d8b91ecc1d82f3 (<a href='/software/msec/plain/cron-sh/promisc_check.sh?h=1.7&id=6de42330d574807cdf421d1aca5bbe43417abf5c'>plain</a>) <table summary='blob content' class='blob'> <tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a> <a id='n2' href='#n2'>2</a> <a id='n3' href='#n3'>3</a> <a id='n4' href='#n4'>4</a> <a id='n5' href='#n5'>5</a> <a id='n6' href='#n6'>6</a> <a id='n7' href='#n7'>7</a> <a id='n8' href='#n8'>8</a> <a id='n9' href='#n9'>9</a> <a id='n10' href='#n10'>10</a> <a id='n11' href='#n11'>11</a> <a id='n12' href='#n12'>12</a> <a id='n13' href='#n13'>13</a> <a id='n14' href='#n14'>14</a> <a id='n15' href='#n15'>15</a> <a id='n16' href='#n16'>16</a> <a id='n17' href='#n17'>17</a> <a id='n18' href='#n18'>18</a> <a id='n19' href='#n19'>19</a> <a id='n20' href='#n20'>20</a> <a id='n21' href='#n21'>21</a> <a id='n22' href='#n22'>22</a> <a id='n23' href='#n23'>23</a> <a id='n24' href='#n24'>24</a> <a id='n25' href='#n25'>25</a> <a id='n26' href='#n26'>26</a> <a id='n27' href='#n27'>27</a> <a id='n28' href='#n28'>28</a> <a id='n29' href='#n29'>29</a> <a id='n30' href='#n30'>30</a> <a id='n31' href='#n31'>31</a> <a id='n32' href='#n32'>32</a> <a id='n33' href='#n33'>33</a> <a id='n34' href='#n34'>34</a> <a id='n35' href='#n35'>35</a> <a id='n36' href='#n36'>36</a> <a id='n37' href='#n37'>37</a> <a id='n38' href='#n38'>38</a> <a id='n39' href='#n39'>39</a> <a id='n40' href='#n40'>40</a> <a id='n41' href='#n41'>41</a> <a id='n42' href='#n42'>42</a> <a id='n43' href='#n43'>43</a> <a id='n44' href='#n44'>44</a> <a id='n45' href='#n45'>45</a> <a id='n46' href='#n46'>46</a> <a id='n47' href='#n47'>47</a> <a id='n48' href='#n48'>48</a> <a id='n49' href='#n49'>49</a> <a id='n50' href='#n50'>50</a> <a id='n51' href='#n51'>51</a> <a id='n52' href='#n52'>52</a> </pre></td> <td class='lines'><pre><code><span class="hl slc">#!/bin/bash</span> <span class="hl slc"># Writen by Vandoorselaere Yoann</span> Syslog<span class="hl opt">() {</span> <span class="hl kwa">if</span> <span class="hl opt">[[</span> <span class="hl kwd">${SYSLOG_WARN}</span> <span class="hl opt">==</span> <span class="hl kwc">yes</span> <span class="hl opt">]];</span> <span class="hl kwa">then</span> logger <span class="hl kwb">--</span> <span class="hl str">"</span><span class="hl ipl">${1}</span><span class="hl str">"</span> <span class="hl kwa">fi</span> <span class="hl opt">}</span> Ttylog<span class="hl opt">() {</span> <span class="hl kwa">if</span> <span class="hl opt">[[</span> <span class="hl kwd">${TTY_WARN}</span> <span class="hl opt">==</span> <span class="hl kwc">yes</span> <span class="hl opt">]];</span> <span class="hl kwa">then</span> w | <span class="hl kwc">grep</span> <span class="hl kwb">-v</span> <span class="hl str">"load\|TTY"</span> | <span class="hl kwc">grep</span> <span class="hl str">'^root'</span> | <span class="hl kwc">awk</span> <span class="hl str">'{print</span> <span class="hl ipl">$2</span><span class="hl str">}'</span> | <span class="hl kwa">while</span> <span class="hl kwb">read</span> line<span class="hl opt">;</span> <span class="hl kwa">do</span> <span class="hl kwb">echo -e</span> <span class="hl str">"</span><span class="hl ipl">${1}</span><span class="hl str">"</span> <span class="hl opt">> /</span>dev<span class="hl opt">/</span><span class="hl kwd">$line</span> <span class="hl kwa">done</span> <span class="hl kwa">fi</span> <span class="hl opt">}</span> LogPromisc<span class="hl opt">() {</span> <span class="hl kwc">date</span><span class="hl opt">=</span><span class="hl str">`date`</span> Syslog <span class="hl str">"Security warning :</span> <span class="hl ipl">$1</span> <span class="hl str">is in promiscuous mode."</span> Syslog <span class="hl str">" A sniffer is probably running on your system."</span> Ttylog <span class="hl str">"</span><span class="hl esc">\\</span><span class="hl str">033[1;31mSecurity warning :</span> <span class="hl ipl">$1</span> <span class="hl str">is in promiscuous mode.</span><span class="hl esc">\\</span><span class="hl str">033[0;39m"</span> Ttylog <span class="hl str">"</span><span class="hl esc">\\</span><span class="hl str">033[1;31mA sniffer is probably running on your system.</span><span class="hl esc">\\</span><span class="hl str">033[0;39m"</span> <span class="hl kwb">echo -e</span> <span class="hl str">"</span><span class="hl esc">\n</span><span class="hl str"></span><span class="hl ipl">${date}</span> <span class="hl str">Security warning :</span> <span class="hl ipl">$1</span> <span class="hl str">is in promiscuous mode."</span> <span class="hl opt">>> /</span>var<span class="hl opt">/</span>log<span class="hl opt">/</span>security.log <span class="hl kwb">echo</span> <span class="hl str">" A sniffer is probably running on your system."</span> <span class="hl opt">>> /</span>var<span class="hl opt">/</span>log<span class="hl opt">/</span>security.log <span class="hl opt">}</span> <span class="hl kwa">if</span> <span class="hl opt">[[</span> <span class="hl kwb">-f</span> <span class="hl opt">/</span>etc<span class="hl opt">/</span>security<span class="hl opt">/</span>msec<span class="hl opt">/</span>security.conf <span class="hl opt">]];</span> <span class="hl kwa">then</span> . <span class="hl opt">/</span>etc<span class="hl opt">/</span>security<span class="hl opt">/</span>msec<span class="hl opt">/</span>security.conf <span class="hl kwa">else</span> <span class="hl kwb">echo</span> <span class="hl str">"/etc/security/msec/security.conf don't exist."</span> <span class="hl kwb">exit</span> <span class="hl num">1</span> <span class="hl kwa">fi</span> <span class="hl kwa">if</span> <span class="hl kwc">tail</span> <span class="hl opt">/</span>var<span class="hl opt">/</span>log<span class="hl opt">/</span>security.log | <span class="hl kwc">grep</span> <span class="hl kwb">-q</span> <span class="hl str">"promiscuous"</span><span class="hl opt">;</span> <span class="hl kwa">then</span> <span class="hl slc"># Dont flood with warning.</span> <span class="hl kwb">exit</span> <span class="hl num">0</span> <span class="hl kwa">fi</span> <span class="hl slc"># Check if a network interface is in promiscuous mode...</span> <span class="hl kwa">if</span> <span class="hl opt">[[</span> <span class="hl kwd">${CHECK_PROMISC}</span> <span class="hl opt">==</span> no <span class="hl opt">]];</span> <span class="hl kwa">then</span> <span class="hl kwb">exit</span> <span class="hl num">0</span><span class="hl opt">;</span> <span class="hl kwa">fi</span> <span class="hl kwa">for</span> INTERFACE <span class="hl kwa">in</span> <span class="hl str">`/sbin/ip link list | grep PROMISC | cut -f 2 -d ':';/usr/bin/promisc_check -q`</span><span class="hl opt">;</span> <span class="hl kwa">do</span> LogPromisc <span class="hl kwd">${INTERFACE}</span> <span class="hl kwa">done</span> <span class="hl slc"># promisc_check.sh ends here</span> </code></pre></td></tr></table> </div> <!-- class=content --> <div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.1</a> (<a href='https://git-scm.com/'>git 2.21.0</a>) at 2025-03-20 23:41:58 +0000</div> </div> <!-- id=cgit --> </body> </html>