Shoutbox

Port Listening - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Port Listening (/showthread.php?tid=78531)

Port Listening by ArkaneArkade on 10-30-2007 at 03:28 AM

Hey guys, I'm needing a little bit of help with a minor script. Well, maybe a lot of help, because I honestly dont have a clue, but maybe I can find out if this is at least possible.

I have an xbox, which runs xbmc on my network, and I'm looking to detect a few of the functions froom this. The xbox runs a broadcast function in the background, which sends a UDP datagram whenever an error occurs (among other things).
Basically, I'm looking for a way to listen for this broadcast, and take the information from it, to store in a variable.

I've looked on the xbmc website, and found this information about the function.

The Broadcast facility uses the UDP broadcast protocol with a default port setting of 8278.
XBMC broadcasts on the IP address 255.255.255.255 which is the limited broadcast address.
The actual broadcasts are delimited by <b></b> and may consist of a numerical or textual description of the event (depening on the event)

I've used a small util which lets me see these on Windows, and one of the messages appears as "<b>OnPlayBackStarted;1</b>"
I know how to remove the <b>s etc, but I dont have a clue about the actual listening, or reading information.
Can anyone give me a clue as to whether this is possible, and how it would be done?
Thanks
Stefan Leroux


RE: Port Listening by -dt- on 10-30-2007 at 05:27 AM

Ill make a .net COM object to listen for the broadcasts later :)


RE: Port Listening by Deco on 10-30-2007 at 12:52 PM

You're better off making this stuff outside WLM and Plus... you can easily download a network monitor application and watch all the ports and packets..

But if you want to do this and use the information in a script, search for Xniff and read those threads and download some scripts people made (examples).

Have fun!


RE: Port Listening by ArkaneArkade on 10-30-2007 at 07:14 PM

Thats great cheers.  I'll give Xniff a try, I'm just slightly dubious because I'm on a wireless network, but I'll try, maybe cable it too for testing.

Thanks guys


RE: Port Listening by Deco on 10-30-2007 at 09:13 PM

It works with wireless too!
Have fun!


RE: Port Listening by ArkaneArkade on 10-31-2007 at 01:12 AM

OK, I've downloaded and registered Xniff.ocx, but I can't get it to detect the packet I'm listening for.  I've used a couple of other programs so I know I'm receiving the infomation to my computer, but theres nothing showing in the debug wheres its meant to show.

I just copied the script from Pai's suggestion, to listen for msn events, and changed the srcport to my desired one, so I'm pretty positive that I have it right, unless I need to do something else because of it being a UDP port.

Anyone have any suggestions for me?
Thanks all


RE: Port Listening by Deco on 10-31-2007 at 03:20 AM

Post your code and we'll see...
Other than that maybe the app isn't actually using the port you think it is... so in that case I'd recommend you either catch all the incoming packets (remove the port == x if clause in your script) or you download a network analyzer to catch all the packets and then you can figure out in which port your stuff is coming in.
Have fun!


RE: Port Listening by ArkaneArkade on 10-31-2007 at 03:17 PM

OK, I was going to post the code, but I tried listening for all traffic first, and adding srcport into the debug, so now I have it being detected, but it's on port 1028. 
Thing is though, I have the same script running on mIRC, and it definitlely detects on 8278.  I have also run "attacker" (port listener) which says "port 1028 to port 8278".

I'm happy enough with it working, but can anyone explain why its different, or more importantly, if its listening to port 1028, will that stop anything using port 1028 from detecting, or does Xniff allow ports to be reused.
Thanks for all the help anyways Deco.


RE: Port Listening by Deco on 10-31-2007 at 05:45 PM

Well you have both srcport and destport.. which means there's a port from which the packet is sent (from the other end such as the server) and the port in which the packet comes to your computer. So maybe the port you receive the packets is 1028 and the port in which the packet is sent from the server is 8278.

Just guessing what could be happening but it seems to me you have what you wanted.

If you still want something else to happen in your script just keep sending your doubts and we'll see about them.

Have fun!


RE: Port Listening by ArkaneArkade on 10-31-2007 at 06:03 PM

Nope.  Just finished playing about with my script, and I think thats everything I need the port-sniffing for, so thank you very very much for all the help.:D


RE: Port Listening by ArkaneArkade on 11-01-2007 at 10:28 PM

OK, maybe some extra thoughts, although I'm not entirely sure if any of this is possible.  I must stress highly that I do not know what I'm talking about, but I have an idea.  If I'm wrong... I wont take offence.

I realised that I could possibly use the packet detecting to make an XBox 360 script.  I have mines with the ability to sign into another account, but lets be honest, the 360 messenger is trash.
I quickly wrote a script to change my PSM to say what game I'm playing, and it worked.  Until I realised that my script clause wasnt right, and it was actaully changing my message to the same as the other account, when it updates on messenger.

However, after a brief bit of thinking, I thought that I could fix this, if I was to enable promiscuous mode and listen for the packets from my 360.
Now, as said, newbie, but can anyone tell me if this idea is (theoretically) possible, or even how to enable promiscuous mode, or am I barking up the wrong tree completely.
Cheers guys
Leroux


RE: Port Listening by prashker on 11-01-2007 at 10:34 PM

I don't know if it's possible but for the promiscuous mode. It is very rare for a NIC to have it. I've looked :( (I could be wrong :p).

But sometimes depending on a few factors you can force it on.

quote:
To work around this behavior, force the adapter into Compatibility mode:
1.    At a command prompt, type netsh bridge show adapter.
2.    Locate the identification number of the NIC that is not responding.
3.    If the NIC is not in Compatibility mode, you can change it manually if you type the following command, where 1 is the number of the NIC that is displayed in the first step:
netsh bridge set adapter 1 forcecompatmode=enable
4.    Run the netsh bridge show adapter command again to verify that the ForceCompatabilityMode field for the NIC is displayed as Enabled.

RE: Port Listening by Deco on 11-02-2007 at 01:10 PM

Leroux,

I don't have an XBox so I don't really know how it works...but if you care to explain to me how it works (if the xbox is connected to your computer in any way and whatnot)... I can try to help again.

Have fun!


RE: Port Listening by ArkaneArkade on 11-02-2007 at 07:00 PM

It's not really anything important Deco, just a couple of minor thoughts.

Basically, the 360 auto signs in, and lets everyone on your "Friends List" see what game your playing, where you are in it, and what your total GamerScore is.

I'd only considered that if I was to enter promiscuous mode I could listen for all the informations sent to and from the XBox, so I could change the PSM to show what game I'm playing, when it updates to the server.

But, as I said, it was a minor thought, and since I don't know anything about it, or whether it's even possible to do with a wireless network/router, so obviously don't put yourself out.  I'll look into it slightly, but I don't expect others to go outta their way for me.  Thanks for all the help though :D


RE: Port Listening by Deco on 11-02-2007 at 09:57 PM

Hey we're here to help (if we can)...It's fun for me I like this type of thing that's why I read the forums.

So the XBox is connected to your router is that it?


RE: Port Listening by ArkaneArkade on 11-03-2007 at 12:55 AM

Fair enough.  Glad its fun, I guess thats pretty much the reason everyones here.  Definitly is for me, at least to some extent (errors annoy me).

Basic just is I have a home network, with a wireless laptop, and an XBox 360 cabled to a switch, connected to the ethernet port of the wireless router which the laptop connects to.

I've done a script before for my XBox, also connected via the switch, which is currently using a packet sniffing method to change data.  The major difference though is that this script listened to the broadcast area, while the idea I'm proposing now would have to intercept packets sent specifically to another computer.


RE: Port Listening by Deco on 11-03-2007 at 11:46 AM

Sounds like this is doable.. just a mtter of finding the right packets with the info you want.


RE: Port Listening by ArkaneArkade on 11-03-2007 at 01:04 PM

I think it's doable too, just need to figure out how to enter promiscuous, or if its possible on the wlan/router setup (there's no bridge on computer, so I dont think that SonicSams method works for me).

I've ran into another problem with my other script though.  I've discovered that it only works if mirc is running (3 days constant helping someone, and thats the issue :@).  Basically, on startup, mirc performs the following function:
"sockudp -k XBMC.Listener 8278 $ip 8278"
As soon as this got done, my script started working.  So, basically, I need to do the same in MSN.  Can anyone tell me how this would be done, because it's been killing me, and an msn script is pretty pointless if I need to use mirc for it.

Cheers


RE: Port Listening by C-Quel on 11-03-2007 at 07:42 PM

:S