For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

andrescolo's avatar
andrescolo
Icon for Nimbostratus rankNimbostratus
Jun 02, 2020

Change expired default root/admin password with RESTAPI

Hi,

Im setting a new F5 VE 15.1 big ip, and first i want to change expired passwords. ACtually i can only do it from the brownser.

Im have been testing the REST API like, but i cant make it work.

 

$secpasswd = ConvertTo-SecureString 'default' -AsPlainText -Force

$mycreds = New-Object System.Management.Automation.PSCredential 'root', $secpasswd

 

$Props = @{

    Uri                     = "https://10.21.65.11/mgmt/tm/auth/root "

    Credential              = $mycreds

    ContentType             = "application/json"

    Body                    = $payload

    Method                  = "Patch"

    SkipCertificateCheck    = $True

    Verbose                 = $True

}

invoke-restmethod @Props

 

 

VERBOSE: PATCH https://10.21.65.11/mgmt/tm/auth/root with 64-byte payload

payload is:

{

  "oldpassword": "default",

  "newpassword": "example1234"

}

 

VERBOSE: received 165-byte response of content type application/json

invoke-restmethod : {"code":401,"message":"Authentication failed: Password expired. Update password via /mgmt/shared/authz/users.","restOperationId":6489074,"kind":":resterrorresponse"

 

So then i try: (with same credentials an payload)

 

VERBOSE: PATCH https://10.21.65.11/mgmt/shared/authz/users/admin with 64-byte payload

VERBOSE: received 381-byte response of content type text/html

invoke-restmethod :

401 Unauthorized

Unauthorized

 

 

3 Replies

  • Try changing the admin password first by sending a PATCH request with "oldpassword" and "password" (not "newpassword") properties: e.g.,

    curl -sku admin:admin https://<mgmtIP>/mgmt/shared/authz/users/admin \
      -X PATCH -H "Content-type: application/json" \
      -d '{"oldPassword":"admin", "password":"superuser1000"}'

    This action changes the admin password to "superuser1000". It also changes the root password to "superuser1000". See also K10612010.

    • jibarri's avatar
      jibarri
      Icon for Nimbostratus rankNimbostratus

      I see it changes the admin password but not root's. Am I missing something ? 

      • Nishanth_MS's avatar
        Nishanth_MS
        Ret. Employee

        From this I understand, the change to both admin and root happens only when the passwords expire.