Solved

Intercept internet traffic C++

Posted on 2010-11-23
10
778 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now