Skip to content

Instantly share code, notes, and snippets.

@Cyuubi Cyuubi/CustomRules.js
Last active Nov 16, 2019

Embed
What would you like to do?
Fortnite 1.8 custom rules for Fiddler
import System;
import System.Web;
import System.Windows.Forms;
import Fiddler;
class Handlers
{
static var SquadPlayground = false;
static var RegionOverride = "NAE";
static function OnBeforeRequest(oSession: Session) {
// Apparently, Epic updated the authorization token, so let's change that.
if (oSession.HostnameIs("account-public-service-prod03.ol.epicgames.com")) {
if (oSession.PathAndQuery.Contains("/account/api/oauth/token")) {
oSession.oRequest.headers["Authorization"] = "basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=";
}
}
if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
// A fix for profile0 error, etc...
if (oSession.PathAndQuery.Contains("/QueryProfile?profileId=profile0")) {
oSession.url = oSession.url.Replace("profileId=profile0","profileId=athena");
}
else if (oSession.PathAndQuery.StartsWith("/fortnite/api/game/v2/matchmakingservice/ticket/player/")) {
// TODO: Clean up this code
var uriSplit = (oSession.url + "?").split("?");
var queryString = HttpUtility.ParseQueryString(uriSplit[1]);
var bucketSplit = queryString.Get("bucketId").split(":");
bucketSplit[0] = "REPLACE_BUILDID";
bucketSplit[2] = RegionOverride; // Set region override
// 2 = Solo
// 10 = Duo
// 9 = Squad
switch (bucketSplit[3]) {
case "2": bucketSplit[3] = "playlist_defaultsolo"; queryString.Remove("player.option.fillTeam"); break;
case "10": bucketSplit[3] = "playlist_defaultduo"; break;
case "9":
if (SquadPlayground)
bucketSplit[3] = "playlist_playground";
else
bucketSplit[3] = "playlist_defaultsquad";
break;
default: FiddlerObject.alert("Unknown Match Type (" + bucketSplit[3] + ")"); // Cannot handle this match type
}
var bucketString = bucketSplit.join(":");
queryString.Set("bucketId", bucketString);
// TODO: Handle subregions?
switch (bucketSplit[2]) {
case "NAE":
queryString.Set("player.subregions", "OH,VA");
break;
}
queryString.Set("player.option.crossplayOptOut", "false"); // I guess to opt out of crossplay?
queryString.Set("party.WIN", "true"); // Windows platform
// Input style is Keyboard & Mouse
queryString.Set("input.KBM", "true");
queryString.Set("player.input", "KBM");
queryString.Set("player.playerGroups", queryString["partyPlayerIds"]); // TODO: Support this?
oSession.url = uriSplit[0] + "?" + queryString.ToString(); // Hackjob
}
}
}
static function OnBeforeResponse(oSession: Session) {
oSession.utilDecodeResponse(); // Decode response before handling anything
if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
// VersionCheck bypass
if (oSession.PathAndQuery.StartsWith("/fortnite/api/versioncheck?version=")) {
oSession.oResponse.headers.HTTPResponseCode = 200;
oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
oSession.oResponse.headers.Remove("X-Epic-Error-Code");
oSession.oResponse.headers.Remove("X-Epic-Error-Name");
oSession.utilSetResponseBody("{\"type\":\"NO_UPDATE\"}");
}
// Empty JSON request to bypass some errors
else if (oSession.PathAndQuery.Contains("/RefreshExpeditions") ||
oSession.PathAndQuery.Contains("/IncrementNamedCounterStat") ||
oSession.PathAndQuery.Contains("/GetMcpTimeForLogin")) {
oSession.oResponse.headers.HTTPResponseCode = 200;
oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
oSession.oResponse.headers.Remove("X-Epic-Error-Code");
oSession.oResponse.headers.Remove("X-Epic-Error-Name");
oSession.utilSetResponseBody("{}");
}
}
}
}
@EshayLad

This comment has been minimized.

Copy link

EshayLad commented Feb 15, 2019

how do i install

@SpecificRaptor

This comment has been minimized.

Copy link

SpecificRaptor commented Mar 19, 2019

Does this bypass the fortnite "unable to login to fortnite servers" error? If so, it still gives me the error when I put it into fiddler scripts.

@Cyuubi

This comment has been minimized.

Copy link
Owner Author

Cyuubi commented May 14, 2019

Changed some things to make Authorization more reliable, have fun!

@SpecificRaptor

This comment has been minimized.

Copy link

SpecificRaptor commented May 22, 2019

Thank you so much for the script!!!

@Cyuubi

This comment has been minimized.

Copy link
Owner Author

Cyuubi commented May 31, 2019

Updated and cleaned up some things, have fun!

@minecrafthackerman

This comment has been minimized.

Copy link

minecrafthackerman commented Jun 1, 2019

Updated and cleaned up some things, have fun!

Thanks so much for providing these scripts and programs for people in the community who want to toy around. You have been so helpful for helping me troll some friends haha xD

@ovikiller

This comment has been minimized.

Copy link

ovikiller commented Jul 20, 2019

please can you tell me how I can use this?

@Cyuubi

This comment has been minimized.

Copy link
Owner Author

Cyuubi commented Jul 29, 2019

Updated it a bit more with proper versioncheck response.

@pivotman319-new

This comment has been minimized.

Copy link

pivotman319-new commented Nov 16, 2019

@Cyuubi, how do I get past the unauthorised client error that accounts-public-service is giving me?

[2019.11.16-14.57.47:326][676]LogOnline:Warning: OSS: Invalid response. CorrId=blargh code=400 errorcode=errors.com.epicgames.common.oauth.unauthorized_client errormessage=Sorry your client is not allowed to use the grant type password errorraw={
  "errorCode" : "errors.com.epicgames.common.oauth.unauthorized_client",
  "errorMessage" : "Sorry your client is not allowed to use the grant type password",
  "messageVars" : [ ],
  "numericErrorCode" : 1015,
  "originatingService" : "com.epicgames.account.public",
  "intent" : "prod",
  "error_description" : "Sorry your client is not allowed to use the grant type password",
  "error" : "unauthorized_client"
}

Running on 18th July 2017 Fortnite build (Day One, pre-BR)

@Cyuubi

This comment has been minimized.

Copy link
Owner Author

Cyuubi commented Nov 16, 2019

Unfortunately, I'll have to upgrade this script to support the new authentication. You will also need another program along side Fiddler to make authentication work. :/

@pivotman319-new

This comment has been minimized.

Copy link

pivotman319-new commented Nov 16, 2019

now that's just disappointing :(

I looked forward to exploiting MCP now that I have my hands on a tool that can literally enable the ue4 console on engine builds starting from the year 2016 onwards but apparenlty not

@Cyuubi

This comment has been minimized.

Copy link
Owner Author

Cyuubi commented Nov 16, 2019

If you want to talk to me, you can DM me: https://discord.gg/axpBTBH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.