NetBIOS can provide when querying a computer following info:
Host name.
NetBIOS name. (via UDP)
Domain.
Network Shares.
[pre WinXP] NetBIOS is a non-routable OSI Session Layer 5 Protocol and a service that allows applications on computers to communicate with one another over a local area network (LAN).
- Today we have NBT (NetBIOS over TCP/IP) now we can route.
Structure of NetBIOS.
Review SMB vs NetBIOS/NBT here.
Hint: SMBdoes rely on NetBIOS for communication with devices that do not support direct hosting of SMB over TCP/IP.
NetBIOS is completely independent from SMB. It is an API that SMB, and other technologies can use, so NetBIOS has no dependency to SMB.
test your own PC shares:
type it in path input in the File explorer.
UNC paths
Admin shares
Null Sessions
Null session attack: exploit a vulnerability within Windows Administrative Share (which can't be deleted but can have auth.) this allows an attacker to connect to a local/remote share without authentication.
steps to attack:
Enumerate Windows Shares.
Check for Null Sessions.
Exploit Null Session.
1- To Enumerate we have the following tools:
NBTStat (Win command tool display info about target).
To know if file sharing is Up and runing:
<20> means file sharing service is up/runing.
NET VIEW:(Win enum) after knowing it's running time to enum the shares.
Nmblookup: (Linux Enum) provided by the Samba suite.
we get the same result as NET VIEW
Smbclient: (Linux Enum) also available with Samba Suite to Enum Shares and other things.
-L: lookup, -N don't ask for password.
Notice SMBclient shows more results, Admin$ shares that were not shown by the other prev. tools.
2- Checking for Null Session:
We will exploit the IPC$ Administrative share by trying to connect without valid credentials.
this tells Windowds to conn. to IPC$ with empty Username/Password.
\\<IP>\IPC$ following the UNC path standard.
same thing with SMBclient:
3- Exploiting Null Sessions:
can be done also the same NET command but we will use Win/Linux tools to Automate.
ENUM: (Win tool, must download it) enumerate Admin shares as well.
Checking password policy before running Auth Attack lets you fine-tune tools to:
- Prevent accounts locking.
- prevents false positives.
- choose your Dict/BruteForce config. (knowing min/max length of pass)
happen when: AttackerSend gratuitous ARP relies (ARP replies without actually asking) to the target thus changing the ARP cache for all victims so they forward the packet to the attacker.
Then attacker can alter/forward the packet which means attacker now got Man-In-The-Middle Attack.
Dsniff: collection of tools for network auditing and Pen Testing.
it includes arpspoof. install it:
Before running must transfer, Linux box into a router by enabling Linux Kernal IP Forwarding:
Then you can run arpspoof:
-i: NIC to use eth0 or tap0..etc
taget/host are victim IP (you want to be in middle of these two)
Then on the running Wireshark Analyze the traffic.
Egress filtering (aka outbound filtering): controls the traffic that is attempting to leave the network. Before an outbound connection is allowed, it has to pass the filter's rules (i.e. policies).
PacketWhisper:
to use the tool:
you have to run it inside the Target machine providing the file you would like to stealthy steal/exif. (this generates DNS queries).
In your machine capture the DNS queries with Wireshark/tcpdump (better)
run the tool in your machine this time againts the captured pcap file to get the stolen file.
EgressCheck:
To use:
run the tool in your machine with appropriate commands and generate the command for the target shell [ex: powershell-cmd] it will give you a file to run on the target [ex: .batch for windows].
capture traffic:
Run the generated file in the target machine. (or use the outputted command).
enum4linux -n <IP> //check for open shares with <20> flag
enum4linux -P <IP> //enum pass policy
enum4linux -S <IP> //what target machine is sharing(Dir,files..etc).
enum4linux -s /usr/share/enum4linux/share-list.txt <IP> //bruteforce to check shares
enum4linux -a <IP> //do all the prev. command at once+ extra info
cd /Desktop/Tools_from_eJPT/Impacket/impacket-master/examples
python3 samrdump.py <IP>
smbclient -L WORKGROUP -I <IP> -N -U "" //get list of shares
smbclient \\\\<IP>\\<share> -N //access a share
get <file> <location_in_your_PC> //download a certian file while inside smb: \>