Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bruteforce] Splunk login #25

Open
nixawk opened this issue Mar 8, 2018 · 1 comment
Open

[bruteforce] Splunk login #25

nixawk opened this issue Mar 8, 2018 · 1 comment

Comments

@nixawk
Copy link
Owner

nixawk commented Mar 8, 2018

#!/usr/bin/python
# -*- coding: utf-8 -*-

# pip2 install --user splunk-sdk

import splunklib.binding as binding
import logging


logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__file__)


def splunk_login(host, port, username, password):
    """Login Splunk based on API.
    """
    login_status = False
    try:
        service = binding.connect(
            host=host, port=port,
            username=username, password=password)

        login_status = True
        log.info("Attempting %s:%d - Login successfully" % (host, port))

    except binding.AuthenticationError as e:
        log.info("Attempting %s:%d - %s" % (host, port, e.message))

    return login_status


if __name__ == '__main__':

    host = "splunklab.example.com"
    port = 8089
    username = "username"
    password = "password"

    splunk_login(host, port, username, password)


"""
$ python2 splunk_login.py
INFO:splunk_login.py:Attempting splunklab.example.com:8089 - Login failed.

$ python2 splunk_login.py
INFO:splunk_login.py:Attempting splunklab.example.com:8089 - Login successfully

"""
@nixawk
Copy link
Owner Author

nixawk commented Mar 8, 2018

$ nmap -Pn -n -sV -p8089 192.168.1.95

Starting Nmap 7.00 ( https://nmap.org ) at 2018-03-08 04:00 EST
Nmap scan report for 192.168.1.95
Host is up (0.0059s latency).
PORT     STATE SERVICE  VERSION
8089/tcp open  ssl/http Splunkd httpd

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 30.41 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant