Xbox One Code Release: 'Gaining win32 code execution in UWP DevMode'

garyopa

Staff member
Top TX Brass
Mar 25, 2005
27
28
Tropical Island
www.O-P-A.biz
Xbox One Dev Mode - Shell and Win32 code execution

Earlier today, @XVMM posted up some key info on 'getting started' on your path of enlightenment when using the 'dev mode' that is available on all Xbox One consoles, now normally this UWP is sandboxed, but thanks to the anonymous creators if this unique exploit you can now get a shell (cmd.exe) and win32 code execution on Xbox One in UWP Devkit mode.

Normally you can only deploy "sandboxed" UWP containers with very limited access rights, hence this write-up, which is very technical, but its aim at those that want to explore more of inner workings and power of XB1 console itself, and hopefully now with this information out to public, more developers will get on-board and help expand the scene of greatness in the Xbox landscape.
Preamble

This is not an exploit or breakthrough of any sort. It's simply taking advantage of provided debugging features in developer mode! This is for any one who may be curious and want to reverse engineer the Xbox One. This is also mainly provided for anyone who wants to just have a go at reversing the system. There's a lot to utilize with the public features anyway.

Prerequisites
  • Must be in developer-mode (obviously)
  • Have some form of SSH/telnet client. (PuTTy, etc)
  • At least have Visual Studio 2015 or 2017
To get started without putting up with developing UWP applications we can instead utilize the open SSH connection provided by the console. This is only available in developer mode, just in case you get any ideas. If you're using Windows and will be using standard command prompt for telnet then make sure you enable it first!
  • Control Panel -> Programs -> Turn Windows features on or off"
  • Tick "Telnet client"
  • Done
Howto
  • First open up whatever client you have for SSH, in this instance PuTTy, and connect using your console IP and default port. There will be a pop-up. Just hit yes.
  • Now it will ask for login details. Make sure you have Dev Home opened and hit __Show Visual Studio Pin__. Keep note of this pin but also remember it will change after a small period of time!

    Use the following credentials:
    ```
    Username: DevToolsUser
    Password: The Visual Studio pin provided in Dev Home.
    ```​
  • If all goes successfully then you can either stick with it or initialize telnet. Run the following command in order to do so:

    ```
    devtoolslauncher LaunchForProfiling telnetd "cmd.exe 24"
    ```​
  • Open command prompt on Windows and run:

    ```
    telnet [consoleip] 24
    # (Example: telnet 192.168.1.5 24)
    ```​
The telnet session will be running under the VSProfilingAccount privileges which is the same as what the VS debugger runs under when building UWP apps.

Keep in mind that there is not too much of a difference at this stage. It just allows a tiny bit more flexibility.

Basic file system exploration:

You can do this by accessing the Xbox Device Portal on your computer and going to File Explorer tab. There will be an option near the top right that is called Browse. Using this will show you credentials that can be used to access the developer scratch. We can use the developer scratch to store our junctions to navigate throughout the mounted drives.
Code:
Using telnet or SSH, go to `D:\DevelopmentFiles`.
```
>D:
>cd DevelopmentFiles
>mkdir Links

# And run the following:
>mklink /J "Links\System" C:\

# If the result is successful then double check:
>cd links\system
>dir
```
If it gives you a directory listing then there you go!

You can get easier access by opening File Explorer on Windows and typing the following into the file path bar: `\\<console ip>`

It will prompt for login details. If you open the device portal and go to File Explorer tab then on right side hit browse; you will be given details to use. Once in then you can access most but not all volumes.

(Refer to "Mount points" to find out more)

Next steps

So what now? Well, I'm going to provide a small "template" which you can use in order to write a standard "Win32" application. The only difference is that it will run on the Xbox One.

(Requires Windows 10 SDK compatible with Xbox One and probably Visual Studio 2017, at least 2015.)

XRF: Attached below.

Place anywhere on the console and run `xrf cinfo` for a basic spit of console info.

Additional information:

Basic introduction:

The Xbox One currently runs 3 separate operating systems with each prioritized with their own purpose.

These are known as:
  • Host OS
  • System OS
  • Game OS
System and Game OS both reside in their own partition:
  • Shared Resource Access - Runs apps and renders the UI experience.
  • Exclusive Resource Access - Runs games and has more priority with resources.
These operations are stored in an Xbox Virtual Disk (XVD) with a small bootloader, currently assumed based on previous data dumps, that contains the kernel, HAL and other important system files. These get stored in the
User Data section of each.
  • host.xvd | ExtHost.xvd
  • System.xvd
  • era.xvd
System and Host are stored in both the flash and on the console hard drive. The Game OS XVD is stored with each packaged game that is released for the Xbox One. Although this requires another look; it appears that when a user launches a game, System then initiates a call that mounts the package to the ERA partition which then boots into the Game OS before finally mounting and starting the game.

Mount points:

Within the SRA Partition, the following are mounted to each drive letter
Code:
\\.\C:\ -> System.xvd
\\.\D:\ -> USB (typically for retail) (Development scratch for dev-mode)
\\.\J:\ -> SystemTools.xvd (dev-mode only)
\\.\L:\ -> en-%s (languages)
\\.\M:\ -> SystemMisc.xvd
\\.\P:\ -> Page file
\\.\S:\ -> Settings.xvd | Settings-devkit.xvd
\\.\T:\ -> Temp.xvd (or whatever)
\\.\U:\ -> user.xvd / user-devkit.xvd
\\.\X:\ -> SystemAux.xvd
\\.\Y:\ -> SystemAuxF.xvd
Attached below, is a sample template, source, binary to get your started on your path of enlightenment on your Xbox One console! :)

DISCORD SERVER Discussion Invite: --> https://discord.gg/gr4cHXN

NEWS SOURCE: Xbox One - Getting somewhat started (via) GBATemp
 

Attachments

Last edited by a moderator:

iCEQB

Noob Account
Dec 26, 2010
44
0
I wonder if this is indeed an exploit or not, because it looks like the author just used the given Microsoft tools ?

Is the XBOX One still gonna get some TX love ? :)
 

jetuaime81

Noob Account
Dec 22, 2013
1
0
I hope we will hear news from TX finally :)

Nope. Nobody is daring to touch the xbox one because "it is just so hard" as claimed by multiple hackers. im not complaning alright; maybe once its lifecycle ends then someone will touch it; which is like 2 years from now as xbox 2 is already in design phase.
 

salah.rgh2

Noob Account
Jan 4, 2018
6
1
New News 😃...Xbox One Dev Mode - XRF Tool

Emoose, gligli, tuxuser and xvmm give us a new tool for Xbox One Dev gambling. This new small utility allows you to get some infos from your Xbox One console. As a special feature you can dump your nand. In the first place, its a tool for researches on Xbox One OS.



Please read the following release post to get all important infos:




XRF
XRF is a small utility written for the Xbox One System OS. It's written to allow the retrieval of console information, experimentation and to take advantage of Win32 functionality.

Prerequisites
Visual Studio 2015/2017
Windows 10 SDK (Preferably latest)
Xbox One Devkit
Deployment
After compiling, you can utilize a post-build event to transfer the executable via Network Share. Executable is required to be on the console before execution, obviously.

Usage
Printing basic console information


XRF cinfo
Printing current user of process


XRF whoami
Display contents of flash


XRF dispflash
Reading a specified filename from flash (Requires Administrator)


XRF readflash [filename] [destination]
Dumping flash raw (Requires Administrator)


XRF dumpflash [dumpname]
Credit:
emoose
tuxuser
gligli


Source: https://github.com/xboxoneresearch/XRF
 

Support Our Sponsors