Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2006, 06:03
aldente aldente is offline
VIP
 
Join Date: Jul 2003
Posts: 266
Rept. Given: 27
Rept. Rcvd 7 Times in 5 Posts
Thanks Given: 35
Thanks Rcvd at 10 Times in 9 Posts
aldente Reputation: 7
Capturing Another Application's Network Traffic

Hi!

I am currently looking for an easy way to capture another application's network traffic in my program.

One way I found is the following: Create a local proxy, starting the other application and set it to use the proxy, like described on the following page: http://portswigger.net/misc/

But maybe someone knows a better method. It would be great if capturing the network traffic (incoming only), WITHOUT administrator priviliges, and even if the other application is ALREADY RUNNING.

Thank you for any advice!
Reply With Quote
  #2  
Old 10-23-2006, 14:22
Archer's Avatar
Archer Archer is offline
retired
 
Join Date: Aug 2005
Posts: 239
Rept. Given: 1
Rept. Rcvd 46 Times in 19 Posts
Thanks Given: 3
Thanks Rcvd at 387 Times in 57 Posts
Archer Reputation: 46
If application is running and you don't have administer rights I don't think it's possible to sniff it's traffic. In the other way if application is running, you can use raw sockets (in win 2000, XP, if I'm right) and sniff all the traffic, you can inject dll in the process and reroute procedure, that handles traffic. There is article by Kris Kaspersky about bypassing firewalls in exploits and where are some ways for worm to capture traffic from exploited application. I think it may help, but it's in russian. hxxp://www.sendspace.com/file/uhvxma
Reply With Quote
  #3  
Old 10-24-2006, 02:11
D-Jester's Avatar
D-Jester D-Jester is offline
VIP
 
Join Date: Nov 2003
Location: Ohio, USA
Posts: 269
Rept. Given: 39
Rept. Rcvd 61 Times in 41 Posts
Thanks Given: 0
Thanks Rcvd at 4 Times in 4 Posts
D-Jester Reputation: 61
I would suggest looking into WinPcap (http://www.winpcap.com) which is a Packet Capture Library for windows, and is open source.

Tools like Ethereal, Wireshark, Nmap, Snort, ntop use WinPcap.

Whether or not you can use it without Admin priv is a good question.

(From FAQs):
-------------------------------------------------------------------------
Q-7: Do I need to be Administrator in order to execute programs based on WinPcap on Windows NT/2000/XP?

A: Yes/no. The security model of WinPcap is quite poor, and we plan to work on it in the future. At the moment, if you execute a WinPcap-based application for the first time since the last reboot, you must be administrator. At the first execution, the driver will be dynamically installed in the system, and from that moment every user will be able to use WinPcap to sniff the packets.

-------------------------------------------------------------------------

I suppose it is possible to bypass windows security measures and install the driver, but thats not my speciality ;-)
__________________
Even as darkness envelops and consumes us, wrapping around our personal worlds like the hand that grips around our necks and suffocates us, we must realize that life really is beautiful and the shadows of despair will scurry away like the fleeting roaches before the light.
Reply With Quote
  #4  
Old 10-24-2006, 05:28
Mkz Mkz is offline
Friend
 
Join Date: Jan 2002
Posts: 98
Rept. Given: 0
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 5
Thanks Rcvd at 25 Times in 17 Posts
Mkz Reputation: 2
If you're looking for a ready-to-use tool and not develop your own code, another one you can look at - also WinPcap-based - is YATT (http://www.pocketsoap.com/yatt/).
It's pretty straightforward for seeing HTTP traffic, and doesn't require any changes in the target app. In the same site there are also a couple more tools for slightly different needs (SOAP, XML, ...)

As for the admin rights, after installing you can configure the WinPcap driver to start on boot, that way the user doesn't have to be admin to start it on-demand. Check here: http://www.winpcap.org/misc/faq.htm#Q-18

Last edited by Mkz; 10-24-2006 at 05:36. Reason: Comment on admin
Reply With Quote
  #5  
Old 10-24-2006, 08:06
piccolo piccolo is offline
Friend
 
Join Date: Jul 2006
Posts: 28
Rept. Given: 4
Rept. Rcvd 3 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
piccolo Reputation: 3
Apart from winpcap where you need to install a lib you can find various other tools. For example analogx has some simple capture utility that can capture traffic (it is called packetmon). But if you look around. anyway using ethereal you got an awesome package too as already mentioned.
Another cool one that runs without a driver is BasicNetworkSniffer from planet-source-code I just compiled it.
There is a thing called ethernetspy with source code, which is interesting to read (use google).
There is also netcat which is a basic sniffer which uses hooking so also no drivers are needed.
One I really liked is poorsniff which also doesnt need drivers. Be aware tho that using raw packets can only be done under sp2 when you are not crafting packets (normally, although with hooking you might get it done anyway). Have fun.
Attached Files
File Type: zip Sniffer.zip (183.8 KB, 10 views)
File Type: zip PoorSniffNetworkSniffer.zip (8.9 KB, 9 views)
Reply With Quote
  #6  
Old 10-24-2006, 15:22
MarkusO
 
Posts: n/a
@Big_or_what:
The question is what exactly you are trying to do:
- Do you have general admin access?
- Are you interested in the packets' data or in the packets themself?
- How will the program you're capturing data from access the network?
- Will the program run at Ring-3 or Ring-0?
- Will the data be encrypted?
- How much traffic do you expect to be captured?
- What transport and communication protocol will be used?

If you can't answer these questions, nobody can help you.

(for example: the sniffers posted here mostly capture all network traffic, not only one application; if SSL is used, all capturing will be useless; if you like to capture IGMP, most sniffers won't even know it; ...)
Reply With Quote
  #7  
Old 11-07-2006, 04:28
aldente aldente is offline
VIP
 
Join Date: Jul 2003
Posts: 266
Rept. Given: 27
Rept. Rcvd 7 Times in 5 Posts
Thanks Given: 35
Thanks Rcvd at 10 Times in 9 Posts
aldente Reputation: 7
I could not log in to my account for quite a long time, so that's why it took me so long to answer.

Here are the answers to your questions:

Quote:
- Do you have general admin access?
Sure. But I wanted to design my tool so it works without administrator rights. That seems to be impossibile though...

Quote:
- Are you interested in the packets' data or in the packets themself?
I want to access the packets content.

Quote:
- How will the program you're capturing data from access the network?
WinSocks.

Quote:
- Will the program run at Ring-3 or Ring-0?
It's a normal usermode-application.

Quote:
- Will the data be encrypted?
No, just unencrypted TCP-data.

Quote:
- How much traffic do you expect to be captured?
Very little.

Quote:
- What transport and communication protocol will be used?
Only TCP.


In the meantime I tried a network sniffer based on raw sockets and filtered out just the traffic of the target application. Anyway, the CPU-load of this sniffer is quite high when there are other applications which produce network traffic (a 250 kb/s download makes a 3-4% CPU load in the sniffer tool).
Installing a driver for the sniffing application is NOT an option, so WinPCap can't be used.

Any other ideas of howto get the traffic besides from raw sockets?
How about some winsock-tricks?
Reply With Quote
  #8  
Old 11-07-2006, 19:36
MarkusO
 
Posts: n/a
In this case you might want to try "Ultra Network Sniffer" (http://www.gjpsoft.com/UltraNetSniffer/).

It only needs admin rights once to install the driver and it captures traffic based on applications.

And if you don't intend to buy the application ( ), you might want to skip the strong RSA-1024 registration system and find the implementation error.
Reply With Quote
  #9  
Old 11-07-2006, 20:46
aldente aldente is offline
VIP
 
Join Date: Jul 2003
Posts: 266
Rept. Given: 27
Rept. Rcvd 7 Times in 5 Posts
Thanks Given: 35
Thanks Rcvd at 10 Times in 9 Posts
aldente Reputation: 7
As I said, I don't want any solution which requires a driver!

To ensure you got me right: I don't want any network sniffer for myself, CommView is just perfect for that purpose and I don't need anything else.

I wan't a solution which I can easily integrate into my own tool, and I don't want to distribute any drivers with my tool!

But I already wrote that in the first sentence of the first post of this thread!

Last edited by aldente; 11-07-2006 at 20:56.
Reply With Quote
  #10  
Old 11-09-2006, 06:48
optimus_prime
 
Posts: n/a
well you already said in that same post proxy would be easiest method if you can set proxy for target app.

you opted out winpcap, that was another easy way. there was app called "http analyzer", it seemed pretty basic to me and did what you wanted, you could take a peek and reverse it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Monitor by M$ wps8848 x64 OS 7 08-17-2014 17:05


All times are GMT +8. The time now is 20:21.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )