Summery

lookupsid.py is a tool from Impacket toolkit to perform SID brute forcing to find the SID of the users, groups or domains.

User SID lookup
lookupsid.py logistics.inlanefreight.local/htb-student_adm@172.16.5.240 Administrator
Here we authenticate in a given domain and we look for a SID of a specific user.

Host SID lookup
lookupsid.py logistics.inlanefreight.local/htb-student_adm@172.16.5.240
Here we authenticate in a given domain and try to get all SIDs from the given host by specifying their IP.

This script is also used with other ones like secretsdump.py, ticketer.py and psexec.py to try to get access to a parent domain. This process is well described in Attacking Domain Trusts - Child & Parent Trusts - from Linux