Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions nettacker/core/lib/smb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from impacket.smbconnection import SMBConnection

from nettacker.core.lib.base import BaseEngine, BaseLibrary


def create_connection(host, port):
return SMBConnection(host, remoteHost=host, sess_port=port)


class SmbLibrary(BaseLibrary):
def brute_force(self, *args, **kwargs):
host = kwargs["host"]
port = kwargs["port"]
username = kwargs["username"]

response = {
"host": host,
"port": port,
"username": username,
}

domain = "."
if "domain" in kwargs:
domain = kwargs["domain"]
response.update({"domain": domain})

password = ""
if "password" in kwargs:
password = kwargs["password"]
response.update({"password": password})

lm = ""
if "lm" in kwargs:
lm = kwargs["lm"]
response.update({"lm": lm})

nt = ""
if "nt" in kwargs:
nt = kwargs["nt"]
response.update({"nt": nt})

connection = create_connection(host, port)
connection.login(username, password, domain, lm, nt)

return response


class SmbEngine(BaseEngine):
library = SmbLibrary
41 changes: 41 additions & 0 deletions nettacker/modules/brute/smb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
info:
name: smb_brute
author: OWASP Nettacker Team
severity: 3
description: SMB Bruteforcer
reference:
profiles:
- brute
- brute_force
- smb

payloads:
- library: smb
steps:
- method: brute_force
timeout: 3
host: '{target}'
ports:
- 445
usernames:
- administrator
- admin
- root
- user
- test
- guest
passwords:
nettacker_fuzzer:
input_format: '{{passwords}}'
prefix:
suffix:
interceptors:
data:
passwords:
read_from_file: passwords/top_1000_common_passwords.txt
response:
condition_type: or
conditions:
successful_login:
regex: ''
reverse: false
Loading