Skip to content

Instantly share code, notes, and snippets.

@barrriwa
Forked from nucther/get-password-fiberhome.js
Last active March 7, 2026 12:14
Show Gist options
  • Select an option

  • Save barrriwa/80d6433144e93c06ad3a5c361bf6422d to your computer and use it in GitHub Desktop.

Select an option

Save barrriwa/80d6433144e93c06ad3a5c361bf6422d to your computer and use it in GitHub Desktop.
Get Password PPPoE Indihome ( Fiberhome )
// Login to fiberhome modem as Super User
// Go to Network > BroadBand Settings > Internet Settings
// Paste this script inside browser console
(function() {
console.clear();
console.log("%c FiberHome Password Extractor ", "background: #222; color: #bada55; font-size: 16px; padding: 5px;");
// 1. Find the specific iframe that contains the decryption keys
// We scan all frames (windows) on the page to find one that has 'fhdecrypt' exposed
let decryptorFrame = Array.from(window.frames).find(f => {
try {
return f.fhdecrypt && typeof f.fhdecrypt === 'function';
} catch (e) {
return false; // Handle cross-origin restrictions if any
}
});
if (!decryptorFrame) {
console.error("❌ Error: Could not find the decryption function.");
console.warn("πŸ‘‰ Please make sure you are on the 'Network' > 'Broadband Settings' (WAN) page before running this script.");
return;
}
console.log("βœ… Decryption keys found in frame:", decryptorFrame.name || "iframe");
// 2. Fetch the WAN configuration data
// We use the router's internal API to get the raw JSON
$.ajax({
url: '/cgi-bin/ajax?ajaxmethod=get_allwan_info',
success: (response) => {
try {
let data = JSON.parse(response);
console.log("βœ… WAN Data retrieved. Scanning for PPPoE accounts...\n");
console.group("πŸ”“ Extracted Credentials");
let found = false;
// 3. Loop through connections and decrypt
data.wan.forEach((connection, index) => {
if (connection.AddressingType === 'PPPoE') {
found = true;
// We use the decryptorFrame to run the decryption inside the correct context
let plainPassword = "Unknown";
try {
// If the password is empty or stars, ignore it. If it's a hex string, decrypt it.
if (connection.Password && connection.Password.length > 10) {
plainPassword = decryptorFrame.fhdecrypt(connection.Password);
} else {
plainPassword = connection.Password; // It might be plain text already
}
} catch (err) {
plainPassword = "Decryption Failed: " + err.message;
}
console.log(`%c[Connection ${index + 1}] ${connection.Name || 'Internet'}`, "color: #00bcd4; font-weight: bold;");
console.log(` πŸ“‚ VLAN ID: ${connection.vlanid}`);
console.log(` πŸ‘€ Username: %c${connection.Username}`, "color: #ff9800; font-weight: bold;");
console.log(` πŸ”‘ Password: %c${plainPassword}`, "color: #4caf50; font-weight: bold; font-size: 14px;");
console.log("---------------------------------------------------");
}
});
if (!found) {
console.warn("⚠️ No PPPoE connections found in the data.");
}
console.groupEnd();
} catch (e) {
console.error("❌ Failed to parse router data: ", e);
}
},
error: (xhr) => {
console.error(`❌ Request failed: ${xhr.status} ${xhr.statusText}`);
}
});
})();
@barrriwa
Copy link
Author

The previous one fails
The previous script failed because of a "scope" problem: the data was downloaded in the main window (top), but the decryption tools (fhdecrypt and the secret keys) were locked inside the broadband_inter iframe.

Updated Script
This script automatically scans all the frames on the page to find the one that contains the fhdecrypt function. It then acts as a bridge: it fetches the encrypted data and passes it to that specific frame to be unlocked.

@barrriwa
Copy link
Author

FiberHome HG6xxx routers Algerie Telecom Idoomfibre Idoom Fibre PPPoE
HG6145F HG6145F1 HG6145F3 HG6245D HG6145D HG6145D2 HG6143D HG6143D3 HG6243C HG6245N AN5506

@MossabDiae
Copy link

Thank you!

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