NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

ECChuck's avatar
ECChuck
Follower
Jul 02, 2021

LB1120 Data monitor

I know you can monitor the data use by the web ui but I would like to collect that data and generate a historical usage report. I have figured out how to login to the modem with powershell (below) but where the browser refreshes with the data every so often the method i used below does not seem to be able to do that. It seems there is another "hidden" value besides the token that a web browser is somehow aware of or generates to pull the data. Is there anyone at netgear that can help determine the missing parameter to get the data?

 

#Powershell 5.1

$cellmodemauth=invoke-webrequest -uri http://192.168.5.1 -sessionvariable session
$cellmodemauth.forms["form_login"].fields
$cellmodemauth.forms["form_login"].fields["session_password"] = '***MODEM PASSWORD***'
$tokenvalue= $cellmodemauth.Content | Select-String -pattern '(?<="secToken": ").+?(?=")'
$tokenvalue=$tokenvalue.Matches[0]
$bodypost="token=" + $tokenvalue + "&ok_redirect=%2Findex.html&err_redirect=%2Findex.html&session.password=" + $cellmodemauth.forms["form_login"].fields["session_password"]
$bodypost
$Log = Invoke-WebRequest -method POST -URI ("http://192.168.5.1" + $cellmodemauth.Forms["form_login"].Action) -Body $bodypost -WebSession $session
$cellmodemdata=invoke-webrequest -uri http://192.168.5.1/js/SierraStrings.js -sessionvariable session
$cellmodemdata=invoke-webrequest -uri http://192.168.5.1/api/model.json?internalapi=1"&"x= -sessionvariable session

$cellmodemdata.content

 

No RepliesBe the first to reply