Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save yrambler2001/fed69ad4cc03a897b39aa508dd9ef250 to your computer and use it in GitHub Desktop.

Select an option

Save yrambler2001/fed69ad4cc03a897b39aa508dd9ef250 to your computer and use it in GitHub Desktop.
Mac OS Proxyman enable Authenticator App TOTP 2FA Facebook
// URL: https://accountscenter.facebook.com/api/graphql/
/// This func is called if the Request Checkbox is Enabled. You can modify the Request Data here before the request hits to the server
/// e.g. Add/Update/Remove: host, scheme, port, path, headers, queries, comment, color and body (json, form, plain-text, base64 encoded string)
///
/// Use global object `sharedState` to share data between Requests/Response from different scripts (e.g. sharedState.data = "My-Data")
///
async function onRequest(context, url, request) {
console.log(url);
return request;
}
/// This func is called if the Response Checkbox is Enabled. You can modify the Response Data here before it goes to the client
/// e.g. Add/Update/Remove: headers, statusCode, comment, color and body (json, plain-text, base64 encoded string)
///
async function onResponse(context, url, request, response) {
var body = response.body;
const aa = JSON.parse(body)
console.log(aa);
if (aa.data?.fxcal_settings?.node?.two_factor_sections_content_v2?.enabled_methods?.methods)
aa.data.fxcal_settings.node.two_factor_sections_content_v2.enabled_methods.methods.push({
"title": "Authentication app",
"subtitle": "You’ll get a login code from your authentication app.",
"type": "TOTP",
"test_id": "TOTP_BUTTON"
})
ab = JSON.stringify(aa);
response.body = ab
return response;
}
@peterpajavera03-cyber

Copy link
Copy Markdown

how to use this

@markjiggermasacupan

Copy link
Copy Markdown

Hello, do you think it’s possible to adapt the same approach for Facebook profile tabs? For example, my account only shows All, About, Friends, Photos… but the Likes tab doesn’t appear. I was wondering if we could inject something similar to how we added "Authentication app" in the methods array, but this time into the profile JSON so the front‑end shows a "Likes" tab.

I know the 2FA page is data‑driven (reads whatever’s in the methods array), but I’m not sure if the profile tabs are coded the same way or if they’re locked behind backend flags. If you’ve looked at the GraphQL response for profile_tabs, do you think adding a "Likes" entry there would actually render it?

Thanks again for the original script, it was really helpful. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment