Solved

Intercept internet traffic C++

Posted on 2010-11-23
10
772 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 opening and reading files 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.

746 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

14 Experts available now in Live!

Get 1:1 Help Now