Skip to content

Instantly share code, notes, and snippets.

@g1ibby
Created August 2, 2026 05:24
Show Gist options
  • Select an option

  • Save g1ibby/9982ba02e0e151f797662b5b4dd2c82f to your computer and use it in GitHub Desktop.

Select an option

Save g1ibby/9982ba02e0e151f797662b5b4dd2c82f to your computer and use it in GitHub Desktop.
Extracting PPPoE Credentials from FiberHome HG6145F Router

This guide explains how to extract your PPPoE username and password from a FiberHome HG6145F router (commonly used by 3BB ISP in Thailand).

Why You Might Need This

  • Setting up your own router in bridge mode
  • Replacing ISP router with your own hardware
  • Backing up your ISP credentials

Prerequisites

  • Access to the router's admin web interface (usually http://192.168.1.1)
  • Admin login credentials for the router
  • A modern web browser (Chrome, Firefox, Edge)

Steps

1. Log into the Router

Open your browser and navigate to http://192.168.1.1 (or your router's IP address). Log in with your admin credentials.

2. Navigate to Broadband Settings

Go to Network > Broadband Settings > Internet Settings

This step is important because the decryption function (fhdecrypt) is only loaded when this page is open.

3. Open Browser Developer Tools

  • Chrome/Edge: Press F12 or Ctrl+Shift+J (Windows) / Cmd+Option+J (Mac)
  • Firefox: Press F12 or Ctrl+Shift+K (Windows) / Cmd+Option+K (Mac)

Go to the Console tab.

4. Run the Extraction Script

Paste the following script into the console and press Enter:

fetch('/cgi-bin/ajax?ajaxmethod=get_allwan_info')
  .then(r => r.text())
  .then(text => {
    // Extract username and password with regex
    let username = text.match(/"Username":\s*"([^"]+)"/)?.[1];
    let encPass = text.match(/"Password":\s*"([^"]+)"/)?.[1];

    // Get decrypt function from iframe
    let iframe = document.querySelector('iframe[name="broadband_inter"]') ||
                 document.querySelector('iframe[src*="broadband"]');
    let decrypt = iframe?.contentWindow?.fhdecrypt;

    console.log("=== PPPoE Credentials ===");
    console.log("Username:", username);
    console.log("Password:", decrypt ? decrypt(encPass) : encPass);
  });

5. Copy Your Credentials

The console will display your PPPoE username and decrypted password:

=== PPPoE Credentials ===
Username: youruser@3bb
Password: yourpassword

Troubleshooting

Password shows as hex string (not decrypted)

If the password appears as a long hex string like FADC3B97108B781826E297B1B8C1E60C, the decryption function wasn't found. Make sure you're on the Broadband Settings page before running the script.

Script returns undefined

  • Ensure you're logged into the router admin panel
  • Try refreshing the Broadband Settings page and running the script again

Cannot find iframe

Some firmware versions may have different iframe names. Try this alternative:

// List all iframes to find the correct one
document.querySelectorAll('iframe').forEach((f, i) => {
  console.log(i, f.name, f.src);
  try {
    if (f.contentWindow.fhdecrypt) console.log("  ^ Has fhdecrypt!");
  } catch(e) {}
});

Applicable Router Models

This method may work on other FiberHome routers with similar firmware:

  • HG6145F / HG6145F1 / HG6145F3
  • HG6245D
  • HG6145D / HG6145D2
  • HG6143D / HG6143D3
  • HG6243C
  • HG6245N
  • AN5506 series

Security Notes

  • These are YOUR credentials for YOUR internet connection
  • Store them securely (password manager recommended)
  • This method only works with physical/network access to the router
  • The PPPoE password is stored encrypted on the router and decrypted client-side

References

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