byt3bl33d3r / DeathStar

Uses Empire's (https://github.com/BC-SECURITY/Empire) RESTful API to automate gaining Domain and/or Enterprise Admin rights in Active Directory environments using some of the most common offensive TTPs.
GNU General Public License v3.0
1.57k stars 331 forks source link

ValueError: not enough values to unpack (expected 4, got 3) #4

Closed bandrel closed 7 years ago

bandrel commented 7 years ago

getting this error constantly while running Deathstar.py

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "./DeathStar.py", line 59, in __run
    self.__run_backup()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "./DeathStar.py", line 533, in pwn_the_shit_out_of_everything
    for user in get_loggedon(agent_name):
  File "./DeathStar.py", line 368, in get_loggedon
    username, domain, logon_server,_= entry.split()
ValueError: not enough values to unpack (expected 4, got 3)
byt3bl33d3r commented 7 years ago

@bandrel can you give me the raw output of Empire's get_loggedon module for the host the agent is running on? this seems to be an error parsing that. Cheers

bandrel commented 7 years ago

sanitized, but the format is the same. It looks like the local accounts that are logged in are showing up so there is not a LOGON_Server. So the method of splitting the output based on spaces wont work.

Job started: 4WFBPN

wkui1_username   wkui1_logon_dom wkui1_oth_domai wkui1_logon_ser ComputerName   
                 ain             ns              ver                            
--------------   --------------- --------------- --------------- ------------   
Administrator    FAKEDOMAIN                                      localhost      
Administrator    COMPUTERNAME                                    localhost      
Administrator    .                                               localhost      
User1            FAKEDOMAIN                      DC1             localhost      
User1            FAKEDOMAIN                      DC1             localhost      
COMPITERNAME$    FAKEDOMAIN                                      localhost      

Get-NetLoggedon completed!
bandrel commented 7 years ago

Using this

        username = entry.split()[0]
        domain = entry.split()[1]

instead of this

        username, domain, logon_server,_= entry.split()

should work since that function doesnt use the logon_server anyway.

After the change I don't see any errors so I think this should work for me. attached PR https://github.com/byt3bl33d3r/DeathStar/pull/5