Raised This Month: $ Target: $400
 0% 

[Sockets] Server - Client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-11-2010 , 11:53   [Sockets] Server - Client
Reply With Quote #1

Is there a way to detect the data that a server transmits to a client through sockets?
I mean reading every damn byte that the server sends to a client. The identification of what is being send, is another problem that I will try to solve alone.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-11-2010 , 21:40   Re: [Sockets] Server - Client
Reply With Quote #2

Quote:
Originally Posted by ot_207 View Post
Is there a way to detect the data that a server transmits to a client through sockets?
I mean reading every damn byte that the server sends to a client. The identification of what is being send, is another problem that I will try to solve alone.
You mean to "see" the traffic between HLDS server and clients?

Under linux can be done outside the hlds architecture. There's a way to modify packets too.
I don't know if sockets module can do it but if you have ioctl access and can bind RAW socket I think can be done.

Check this example for windows:

PHP Code:
import socket

# the public network interface
HOST socket.gethostbyname(socket.gethostname())

# create a raw socket and bind it to the public interface
socket.socket(socket.AF_INETsocket.SOCK_RAWsocket.IPPROTO_IP)
s.bind((HOST0))

# Include IP headers
s.setsockopt(socket.IPPROTO_IPsocket.IP_HDRINCL1)

# receive all packages
s.ioctl(socket.SIO_RCVALLsocket.RCVALL_ON)

# receive a package
print s.recvfrom(65565)

# disabled promiscuous mode
s.ioctl(socket.SIO_RCVALLsocket.RCVALL_OFF
For HL you must know about the packet format used.
Search in google for packet sniffing.
Here's a tutorial http://www.binarytides.com/blog/pack...using-winsock/


A metamod/amxx pcap module will be awesome (win + linux of course)

For linux you can read about pcap library
http://www.tcpdump.org/pcap.htm
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-13-2010 , 03:30   Re: [Sockets] Server - Client
Reply With Quote #3

Quote:
Originally Posted by joropito View Post
You mean to "see" the traffic between HLDS server and clients?

Under linux can be done outside the hlds architecture. There's a way to modify packets too.
I don't know if sockets module can do it but if you have ioctl access and can bind RAW socket I think can be done.

Check this example for windows:

PHP Code:
import socket

# the public network interface
HOST socket.gethostbyname(socket.gethostname())

# create a raw socket and bind it to the public interface
socket.socket(socket.AF_INETsocket.SOCK_RAWsocket.IPPROTO_IP)
s.bind((HOST0))

# Include IP headers
s.setsockopt(socket.IPPROTO_IPsocket.IP_HDRINCL1)

# receive all packages
s.ioctl(socket.SIO_RCVALLsocket.RCVALL_ON)

# receive a package
print s.recvfrom(65565)

# disabled promiscuous mode
s.ioctl(socket.SIO_RCVALLsocket.RCVALL_OFF
For HL you must know about the packet format used.
Search in google for packet sniffing.
Here's a tutorial http://www.binarytides.com/blog/pack...using-winsock/


A metamod/amxx pcap module will be awesome (win + linux of course)

For linux you can read about pcap library
http://www.tcpdump.org/pcap.htm
Yes. Something like you have done here.
I want to see all the info that the server transmits to a client. If it was made for linux where can I find the package that shows the traffic?
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-13-2010 , 09:18   Re: [Sockets] Server - Client
Reply With Quote #4

Quote:
Originally Posted by ot_207 View Post
If it was made for linux where can I find the package that shows the traffic?
Don't understand what package you're looking for.

In linux you alway have pcap libraries. Try man tcpdump (use it to capture/read traffic on an interface)


I think porting pcap to a metamod/amxx module should be easy, but it should be threaded to avoid process blocking.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 07-13-2010 , 09:36   Re: [Sockets] Server - Client
Reply With Quote #5

Too bad RAW socket requires root privileges.
Seta00 is offline
Reply



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode