Solved

Intercept internet traffic C++

Posted on 2010-11-23
10
782 Views
Last Modified: 2016-03-09
hi,

I was wondering on how to approach writing a listener that would "sniff out" all outbound network traffic in Windows on all ports before it actually gets sent and reroute that traffic to a proxy server or modify the requests headers?

What would be the best approach for that?

Using: Windows and C, C++
0
Comment
Question by:xNejX
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 300 total points
ID: 34196092
What you want is WinPcap :

        http://www.winpcap.org/

For development you'll want this page :

        http://www.winpcap.org/devel.htm
0
 
LVL 9

Expert Comment

by:masheik
ID: 34196118

tcpdump, a powerful command-line packet analyzer; and libpcap, a portable C/C++ library for network traffic capture

http://www.tcpdump.org/

0
 
LVL 53

Expert Comment

by:Infinity08
ID: 34196138
tcpdump and libpcap are not for Windows. The Windows equivalents are WinDump and WinPcap (as mentioned above).
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:xNejX
ID: 34196158
Can all of these be implemented in C++ as a library or something from which I can call this redirections on my own without calling an external exe file?
0
 
LVL 9

Expert Comment

by:masheik
ID: 34196183
>>>tcpdump and libpcap are not for Windows. The Windows equivalents are WinDump and WinPcap (as mentioned above
oh..I did not notice it requred for windows..then Windump and WinPcap are the perfect options

0
 
LVL 9

Assisted Solution

by:masheik
masheik earned 200 total points
ID: 34196197
Here is the good guides,

>>Can all of these be implemented in C++ as a library
   yes..

http://www.winpcap.org/docs/docs_41b5/html/group__wpcapsamps.html
http://www.codeproject.com/KB/IP/winpcap_basic.aspx
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 34196208
>>  Can all of these be implemented in C++ as a library or something from which I can call this redirections on my own without calling an external exe file?

That's what WinPcap is :)
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 34196221
>> That's what WinPcap is :)

Or to be more specific : it is a library that provides you an interface to sniff network traffic.
0
 

Author Closing Comment

by:xNejX
ID: 34196709
Thank you guys, I'll look more into it.
0
 

Expert Comment

by:fx23
ID: 41500042
You can also use wrappers to WinPcap that are written in C++ and are easier to use. One that I can recommend is PcapPlusPlus: https://github.com/seladb/PcapPlusPlus
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question