Prometheus Exporter for the Vodafone Station (CGA4233DE)
Usage of ./vodafone-station-exporter:
-log.level string
Logging level (default "info")
-show-metrics
Show available metrics and exit
-version
Print version and exit
-vodafone.station-password string
Password for logging into the Vodafone station (default "How is the default password calculated? mhmm")
-vodafone.station-url string
Vodafone station URL. For bridge mode this is 192.168.100.1 (note: Configure a route if using bridge mode) (default "http://192.168.0.1")
-web.listen-address string
Address to listen on (default "[::]:9420")
-web.telemetry-path string
Path under which to expose metrics (default "/metrics")
vodafone_station_login_success_bool: 1 if the login was successfullvodafone_station_login_message_info: Login message returned by the web interfacemessagevodafone_station_user_info: User name as returned by the web interfaceusernamevodafone_station_uid_info: User id as returned by the web interfaceuidvodafone_station_default_password_bool: 1 if the default password is in usevodafone_station_downstream_central_frequency_hertz: Central frequency in hertzid, channel_id, fft, channel_typevodafone_station_downstream_power_dBmV: Power in dBmVid, channel_id, fft, channel_typevodafone_station_downstream_snr_dB: SNR in dBid, channel_id, fft, channel_typevodafone_station_downstream_snr_dB: SNR in dBid, channel_id, fft, channel_typevodafone_station_ofdm_downstream_start_frequency_hertz: Start frequencyid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_end_frequency_hertz: End frequencyid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_central_frequency_hertz: Central frequencyid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_bandwidth_hertz: Bandwidthid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_power_dBmV: Powerid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_snr_dB: SNRid, channel_id_ofdm, fft, channel_typevodafone_station_ofdm_downstream_locked_bool: Locking statusid, channel_id_ofdm, fft, channel_typevodafone_station_upstream_central_frequency_hertz: Central frequencyid, channel_id_up, fft, channel_typevodafone_station_upstream_power_dBmV: Powerid, channel_id_up, fft, channel_typevodafone_station_upstream_ranging_status_info: Ranging statusid, channel_id_up, fft, channel_type, statusvodafone_station_firewall_status_info: Firewall statusfirewall_statusvodafone_station_lan_ip4_info: LAN IPv4 infolan_ip4vodafone_station_lan_mode_info: LAN mode infomodevodafone_station_lan_gateway_info: LAN gateway infolan_gatewayvodafone_station_lan_dhcp_enabled_bool: LAN DHCP enabled infovodafone_station_lan_mac_address_info: LAN MAC addressmac_addressvodafone_station_lan_port_up_bool: LAN port statusportvodafone_station_lan_port_speed_bits_per_second: LAN port speed in bits/secondportvodafone_station_wlan_enabled_bool: WLAN enabled infofrequencyvodafone_station_wlan_channel: WLAN channelfrequencyvodafone_station_wlan_bandwidth_hertz: WLAN bandwidth in Hertzfrequencyvodafone_station_wlan_max_speed_bits_per_second: Max WLAN speed in bits/secondsfrequencyvodafone_station_wlan_ssid_info: SSID informationfrequency, ssidvodafone_station_wlan_mac_address_info: WLAN MAC addressfrequency, mac_addressvodafone_station_wlan_security_info: WLAN securityfrequency, security_infovodafone_station_dns_entries_count: DNS Entries countvodafone_station_aftr_info: AFTR gateway informationaftrvodafone_station_serialnumber_info: Serial number informationserial_numbervodafone_station_firmwareversion_info: Firmware vresion informationfirmware_versionvodafone_station_hardware_type_info: Hardware type informationhardware_typevodafone_station_uptime_seconds: Uptime in secondsvodafone_station_internet_ip4_info: Internet IPv4ip4vodafone_station_delegated_prefix_info: Delegated prefix informationprefixvodafone_station_ip_address_rt_info: IP address RTipvodafone_station_ip_prefix_class_info: IP prefix class infoprefix_classvodafone_station_call_end_time_epoch: Call endtime as unix epochport, id, external_number, direction, typevodafone_station_call_start_time_epoch: Call starttime as unix epochport, id, external_number, direction, typevodafone_station_status_led_enabled_bool: Status LEDsvodafone_station_software_component_info: Information about software componentsname, version, licsensevodafone_station_sip_line_status_info: Information about SIP registration statusport, statusvodafone_station_sip_line_numbers_info: Information about phone numbers associated with SIP registrationport, numbervodafone_station_logout_success_bool: 1 if the logout was successfullvodafone_station_logout_message_info: Logout message returned by the web interfacemessageI am not a Javascript engineer, but it works :man_shrugging:
Logging into the PHP application running on the CGA4233DE is made as complicated as possible.
From the console we see:
curl 'http://192.168.100.1/api/v1/session/login' \
-H 'Connection: keep-alive' \
-H 'Accept: */*' \
-H 'X-CSRF-TOKEN: ' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data-raw 'username=admin&password=seeksalthash' \
--compressed \
--insecure
CSRF seems broken, lol. Whatever - we don't care.
reply is
{"error":"ok","salt":"<something>","saltwebui":"<something_else>"}
For the actual login a derived token derived from the actual password is used:
curl 'http://192.168.100.1/api/v1/session/login' \
-H 'Connection: keep-alive' \
-H 'Accept: */*' \
-H 'X-CSRF-TOKEN: ' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Cookie: <some PHP session cookie>' \
--data-raw 'username=admin&password=<something that is not my password>' \
--compressed \
--insecure
Looking at the obfuscated JavaShit (login.js), we see something like follows:
doPbkdf2NotCoded(doPbkdf2NotCoded("<password>", "<salt>"), "<saltwebui>")
quick check reveals: Yes, that returns the token used for the login. :heavy_check_mark:
Ok, so what does doPbkdf2NotCoded do?
function doPbkdf2NotCoded(_0x365ad6, _0x470596) {
var _0x51b261 = sjcl[_0x5bfa('0x10')][_0x5bfa('0x11')](_0x365ad6, _0x470596, 0x3e8, 0x80);
var _0x279f24 = sjcl[_0x5bfa('0xc')][_0x5bfa('0x12')]['fromBits'](_0x51b261);
return _0x279f24;
}
easy, isn't it? %)
Turns out, sjcl is not yet another obfuscated JS function, but this thingie.
Translated to something slightly more human readable (using the JS console)
function whatTheFuck(param1, param2) {
// a, b, c, d
var temp = sjcl["misc"]["pbkdf2"](param1, param2, 0x3e8, 0x80)
return sjcl["codec"]["hex"]["fromBits"](temp)
}
From here, I started the GoLang implementation, which looks as follows:
// GetLoginPassword derives the password using the given salts
func GetLoginPassword(password, salt, saltWebUI string) string {
return DoPbkdf2NotCoded(DoPbkdf2NotCoded(password, salt), saltWebUI)
}
// Equivalent to the JS doPbkdf2NotCoded (see README.md)
func DoPbkdf2NotCoded(key, salt string) string {
temp := pbkdf2.Key([]byte(key), []byte(salt), 0x3e8, 0x80, sha256.New)
return hex.EncodeToString(temp[:16])
}
Oh BTW, Vodafone: Performing pbkdf2 twice won't secure an HTTP (non TLS) login.
$ claude mcp add vodafone-station-exporter \
-- python -m otcore.mcp_server <graph>