Skip to Main Content
Hands-On Penetration Testing on Windows
book

Hands-On Penetration Testing on Windows

by Phil Bramwell
July 2018
Intermediate to advanced content levelIntermediate to advanced
452 pages
11h 51m
English
Packt Publishing
Content preview from Hands-On Penetration Testing on Windows

Killing connections with Ettercap filters

Now, let's try to construct a filter to kill SSH and SMTP connections while allowing all other traffic. This will give us hands-on experience with setting up a basic service filtering mechanism on our Kali box. Pay attention: my first shot at this short filter will have a troublemaking function in it. We'll review the results and see if we can't fix the problem.

First, I fire up nano and create a file with this filter:

if (ip.proto == TCP) {  if (tcp.src == 22 || tcp.dst == 22 || tcp.src == 25 || tcp.dst == 25) {    msg("SSH or SMTP communication detected. Killing connection.\n");    drop();    kill();  }}

Let's review this line by line:

  • if (ip.proto == TCP) { is our parent if statement, checking if the packet ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Web Penetration Testing with Metasploit

Hands-On Web Penetration Testing with Metasploit

Harpreet Singh, Himanshu Sharma
Metasploit Penetration Testing Cookbook - Third Edition

Metasploit Penetration Testing Cookbook - Third Edition

Nipun Jaswal, Daniel Teixeira, Abhinav Singh, Monika Agarwal
Web Penetration Testing with Kali Linux - Third Edition

Web Penetration Testing with Kali Linux - Third Edition

Gilberto Najera-Gutierrez, Juned Ahmed Ansari

Publisher Resources

ISBN: 9781788295666Supplemental Content