Solved

Intercept internet traffic C++

Posted on 2010-11-23
10
785 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

749 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