FreeRDS and its X friends
Transcript of FreeRDS and its X friends
![Page 2: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/2.jpg)
XDC2014 - David FORT – [email protected] 2
• A linux and OSS addict since 1994.
• Doing security software most of my career. Now
independent consultant - http://www.hardening-consulting.com/.
• Active FreeRDP and FreeRDS developer.
• The author of the « famous » wayland RDP
compositor.
About the author
![Page 4: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/4.jpg)
XDC2014 - David FORT – [email protected] 4
• FreeRDS architecture overview
• Xrds
• Wayland FreeRDS compositor
Agenda
![Page 6: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/6.jpg)
XDC2014 - David FORT – [email protected] 6
• Quite old and 90s tainted protocol
– slow/fast path
– weird ROP
– funny bits saving
• Almost all specs are « public »
FreeRDS > RDP protocol (1/2)
![Page 7: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/7.jpg)
XDC2014 - David FORT – [email protected] 7
• Security used to be an option
• Vector operations in the past, codecs now
• Channels : printing, bi-directionnal sound, serial port redirection, drive sharing, remote coffee ?
FreeRDS > RDP protocol (2/2)
![Page 8: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/8.jpg)
XDC2014 - David FORT – [email protected] 8
• An OSS RDP server (Apache2 licence)
• To be (fully) published soon
• Inspired by Xrdp but based on FreeRDP
• Young (2013)
FreeRDS > the project
![Page 9: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/9.jpg)
XDC2014 - David FORT – [email protected] 9
• Security : RDP4, TLS, NLA
• Encoding : raw bitmap, planar codec, remoteFx
• External channel handling
• Session reconnection
• Session shadowing
FreeRDS > features
![Page 11: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/11.jpg)
XDC2014 - David FORT – [email protected] 11
• Written in C (FreeRDS) and C++ (sessionManager), CMake
• Based on FreeRDP
• Linux for now but targets multi-platform
• Protobuf, thrift and D-Bus
• A library to help building content providers
FreeRDS > in pratice
![Page 12: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/12.jpg)
XDC2014 - David FORT – [email protected] 12
• Unix socket as a control channel
– Signaling messages
– Mouse moves
– Key presses
• Shared memory
– Framebuffer
– Damaged regions
FreeRDS > under the hood (1/3)
![Page 13: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/13.jpg)
XDC2014 - David FORT – [email protected] 13
• At connection, FreeRDS sends
– Version
– Screen depth / size
– Keyboard layout
• Content provider answers
– Byte / bits per pixel
– Scanline
– Size
FreeRDS > under the hood (2/3)
![Page 15: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/15.jpg)
XDC2014 - David FORT – [email protected] 15
• FreeRDS does RDP
• Content provider creates the visible content
FreeRDS > key points
![Page 17: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/17.jpg)
XDC2014 - David FORT – [email protected] 17
• X11 content provider
• A headless X server like x11vnc
• FreeRDS DDX, (currently) based on Xorg 1.15
• Links against the content provider helper library
Xrds > about
![Page 18: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/18.jpg)
XDC2014 - David FORT – [email protected] 18
• One mouse (client side pointer)
• One keyboard : a xkb layout for the remote RDP keyboard layout
• Functional xrandr
• External program (channel) for clipboard
• Supports reconnection
Xrds > features
![Page 21: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/21.jpg)
XDC2014 - David FORT – [email protected] 21
• Fake modelines, timing, EDID block
• Use the right unit
• Race conditions
• Shut up the Desktop Environment
Xrds > xrandr m'a tuer...
![Page 22: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/22.jpg)
XDC2014 - David FORT – [email protected] 22
• Problem : application updating pointers at a mad rate
• Solution : check pointer changed (pointer cache)
Xrds > crazy pointer update
![Page 23: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/23.jpg)
XDC2014 - David FORT – [email protected] 23
• Problem : old flash player constantly updates the whole screen when the video is paused
• Solution : frame comparison
– Split damage in 32x32 tiles
– Compute the real damage
• Nice gains even with a fullscreen video
Xrds > damage is not damaged
![Page 24: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/24.jpg)
XDC2014 - David FORT – [email protected] 24
• Full X11 environment under FreeRDS
• Gains for other content providers
Xrds > key points
![Page 26: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/26.jpg)
XDC2014 - David FORT – [email protected] 26
• A FreeRDS backend for weston
• An advanced prototype
• Your remote desktop running weston
FreeRDS compositor > about
![Page 27: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/27.jpg)
XDC2014 - David FORT – [email protected] 27
• Uses the pixman renderer
• 1 seat (except with shadowing)
• Maps the RDP layout to a XKB layout
FreeRDS compositor > features
![Page 28: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/28.jpg)
XDC2014 - David FORT – [email protected] 28
• Works
• Give it a try !
FreeRDS compositor > key points
![Page 30: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/30.jpg)
XDC2014 - David FORT – [email protected] 30
• Add support for extended RDP input to weston / Xrds
(multitouch)
• RDP clipboard in weston
• Graphics with the egfx channel
Future work
![Page 31: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/31.jpg)
XDC2014 - David FORT – [email protected] 31
Questions ?
Sponsors: [email protected]
FreeRDP: http://github.com/FreeRDP/FreeRDP
FreeRDS: http://github.com/FreeRDS/FreeRDS
Weston backend: http://github.com/hardening/weston
![Page 33: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/33.jpg)
XDC2014 - David FORT – [email protected] 33
• $ ./rdp-server
• bash: ./rdp-server: No such file or directory
• $
•
•
Steps for an RDP server – should compile ...
![Page 34: FreeRDS and its X friends](https://reader031.fdocuments.us/reader031/viewer/2022012020/6168935bd394e9041f70c1c7/html5/thumbnails/34.jpg)
XDC2014 - David FORT – [email protected] 34
• $ xfreerdp /v:<my host>
• freerdp_set_last_error 0x2000C
• Error: protocol security negotiation or connection failure
• $
•
•
Steps for an RDP server – listener not listening