This website uses cookies essential to its operation, for analytics, and for personalized content. By continuing to browse this site, you acknowledge the use of cookies. For details on cookie usage on our site, read our Privacy Policy
Looking for the payload data to update the '/config/shared/local-user-database/user' via the PA 5.0.10 API #! /usr/bin/python import urllib import urllib2 import sys # PaloAulto Firewall Managment IP Address mypafw = '10.10.10.1'; # PA API key mykey =mykey'; # Guest User Account 1 through 10 # PA API for User-ID mycmd = "&type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/local-user-database"; # PA API url = user-id url_user = ' https:// ' + mypafw + '/api/?KEY=' + mykey + mycmd; # Sets Content type headers = { 'Content-Type': 'application/xml', 'User-Agent' : 'python-pa-fw-wifi-guest-user 1.0' } userdata = "[@name='guest1']@element=< phash>new password </phash >" # URL encodes the data userdata = urllib.quote(userdata,'') # Sets request req = urllib2.Request(url_user + userdata) # Sets header information req.headers = headers # Issues the URL API request u = urllib2.urlopen(req) # Close connection u.close() print u.code
... View more