Saturday, May 25, 2019

Android security testing


Android security testing requires the reverse engineering analysis using APK files, permission analysis using Manifest, and internal components analysis using intents, services, broadcast, and content providers. Generally, the following are considered common testing tools when it comes to Android security testing:

Tools

Description

ApkTool

ApkTool is used to perform reverse engineering for Android APK files.

ByteCode View

ByteCode View is a Java Bytecode viewer and GUI Java decompiler.

Dex2JAR

Dex2JAR converts the DEX to a CLASS file.

JADX

JADX converts the DEX to a Java decompiler.

JD-GUI

JD-GUI is a GUI viewer that is used to read the source code of CLASS files.

Drozer

Drozer is an interactive security and attacks framework for the Android app.

Baksmali

Baksmali is an assembler/disassembler for the DEX format.

AndroBugs

AndroBugs takes an APK file as input and performs an APK security vulnerabilities scan.

AndroGuard

AndroGuard is a Python framework that can perform reverse engineering and malware analysis of the APK.

QARK

Quick Android Review Kit (QARK) works similarly to AndroBugs. It detects security vulnerabilities for APK files.

AppMon

AppMon can monitor API calls for both iOS and Android apps.

https://distrowatch.com/ - Penetration Testing–Focused Linux Distributions


Penetration Testing–Focused Linux Distributions
Several Linux distributions package numerous penetration testing tools. The purpose of these Linux distributions is to make it easier for individuals to get started with penetration testing, without having to worry about software dependencies and compatibility issues that could be introduced when installing and deploying such tools. The following are the most popular penetration testing Linux distributions:

Kali Linux

Parrot

BlackArch Linux

Kali Linux
Kali Linux is one of the most popular penetration testing distributions in the industry. It is based on Debian GNU/Linux, and it evolved from previous penetration testing Linux distributions (WHoppiX, WHAX, and BackTrack). Kali can be run as a live CD or installed in bare metal, as virtual machines, and even on IoT devices such as the Raspberry Pi. You can download Kali Linux from https://www.kali.org.

Tip

Offensive Security released a free open source book and course about how to install, customize, and use Kali Linux. The book and the course can be accessed at https://kali.training.

Kali Linux comes with hundreds of tools, and the community is constantly creating new ones and adding them to Kali. For the most up-to-date list of penetration testing tools included in Kali Linux, visit https://tools.kali.org.

Figure 9-1 shows the Applications menu of Kali Linux, listing all the major categories of the tools included in the distribution.

A screenshot of the Kali Linux Applications menu.
FIGURE 9-1 Kali Linux Applications Menu
Parrot
Parrot is a Linux distribution that is based on Debian and focused on penetration testing, digital forensics, and privacy protection. You can download Parrot from https://www.parrotsec.org and access the documentation at https://docs.parrotsec.org.

Figure 9-2 shows a screenshot of the Parrot applications menu and ecosystem.

A screenshot of the Parrot applications menu and ecosystem.
FIGURE 9-2 Parrot Linux
BlackArch Linux
BlackArch Linux is a Linux distribution that comes with more than 1900 security penetration testing tools. You can download BlackArch Linux from https://blackarch.org and access the documentation at https://blackarch.org/guide.html. BlackArch Linux source code can be accessed at https://github.com/BlackArch/blackarch.

Figure 9-3 shows a screenshot of the BlackArch applications menu and ecosystem.

A screenshot of the BlackArch Applications menu.
FIGURE 9-3 BlackArch Applications Menu
Figure 9-4 shows a screenshot of a terminal window in BlackArch, with the Linux Standard Base (LSB) and distribution information.

LSB information displayed on a Blackarch terminal window.
FIGURE 9-4 BlackArch LSB Information
CAINE
The Computer Aided Investigative Environment (CAINE) GNU/Linux live distribution was created for digital forensics, but it also has several tools that can be used for penetration testing. You can download CAINE from https://www.caine-live.net. Figure 9-5 shows a screenshot of the CAINE applications menu and ecosystem.

A screenshot of the CAINE Applications menu.
FIGURE 9-5 CAINE Applications Menu
Security Onion
Security Onion is a Linux distribution that was created for intrusion detection, enterprise security monitoring, and log management. However, it also includes several tools that can be used for penetration testing or at least for reconnaissance. You can download the Security Onion Linux distribution from https://securityonion.net and access the documentation at https://github.com/Security-Onion-Solutions/security-onion/wiki. Figure 9-6 shows a screenshot of the Security Onion applications menu and ecosystem.

A screenshot of the Applications menu of Security Onion UI.
FIGURE 9-6 Security Onion Applications Menu
Common Tools for Reconnaissance and Enu


https://distrowatch.com/

Alphabetical list of BSoD errors


There are a whole bunch of possible BSoD messages; probably more than a hundred. However, only about 20 happen frequently enough that they might imply that an actual problem exists. More than likely, you’ve seen at least one of the following stop messages on your own system:

Attempted Write To Readonly Memory (stop code 0X000000BE)
A faulty driver or service is typically responsible for this error, as is outdated firmware. If the name of a file or service is specified, try uninstalling the software (or rolling back the driver if it’s an upgrade). Check with the manufacturer for firmware and driver updates.

Bad Pool Caller (stop code 0X000000C2)
Causes and remedies are similar to “Attempted Write To Readonly Memory.” Additionally, this error might also be the result of a defective hardware device.

If you encounter this message while upgrading to Windows 7 (see Chapter 1), it may mean that one or more devices in your system are not compatible with the new OS. Try disconnecting unnecessary devices, or at least look for updated drivers and firmware. Also, disable any antivirus software you may have running.

Data Bus Error (stop code 0X0000002E)
This can be caused by defective memory (see Test for Bad Memory (RAM)), including system RAM, the Level 2 cache, or even the memory on your video card. Other causes of this error include serious hard disk corruption, buggy hardware drivers, or physical damage to the motherboard. See What to Do When Windows Won’t Start for one way to test your PC’s memory.

Driver IRQL Not Less Or Equal (stop code 0X000000D1)
Drivers programmed to access improper hardware addresses typically cause this error. Causes and remedies are similar to “Attempted Write To Readonly Memory (stop code 0X000000BE),” earlier in this list.

Driver Power State Failure (stop code 0X0000009F)
This error is caused by an incompatibility between your computer’s power management and one or more installed drivers or services, typically when the computer enters the Hibernate state (discussed at length in Chapter 5). If the name of a file or service is specified, try uninstalling the software (or rolling back the driver if it’s an upgrade). Or, try disabling Windows’ support for Hibernation altogether. See Appendix A for BIOS settings that may affect your PC’s support for power management features.

Driver Unloaded Without Cancelling Pending Operations (stop code 0X000000CE)
Causes and remedies are similar to “Attempted Write To Readonly Memory (stop code 0X000000BE),” earlier in this section.

Driver Used Excessive PTEs (stop code 0X000000D8)
Causes and remedies are similar to “No More System PTEs (stop code 0X0000003F),” later in this section.

Hardware Interrupt Storm (stop code 0X000000F2)
This error occurs when a hardware device (such as a USB or SCSI controller) fails to release an IRQ, a condition typically caused by a buggy driver or firmware. This error can also appear if two devices are incorrectly assigned the same IRQ (discussed later in this chapter). Sometimes just moving an expansion card (desktop PCs only) from one slot to another can fix this problem.

Inaccessible Boot Device (stop code 0X0000007B)
You may see this error during Windows startup if Windows cannot read data from the system or boot partitions (described in Chapter 1). Faulty disk controller drivers are often to blame, but this problem can also be caused by hard disk errors.

If you have a multiboot system, a corrupt Boot Manager configuration may cause this problem; see Modify the Boot Manager configuration for details. If all is well with your drivers and your drive, and you haven’t been messing with the Boot Manager, check your system BIOS settings (described in Appendix A).

If you encounter this message while upgrading to Windows 7 (see Chapter 1), it may mean that one or more devices in your system are not compatible with the new OS. Try disconnecting unnecessary devices, or at least look for updated drivers and firmware. Also, disable or update any antivirus software you may have running.

Kernel Data Inpage Error (stop code 0X0000007A)
This error implies a problem with virtual memory (discussed in Chapter 5), most often in the case that Windows wasn’t able to read data from—or write data to—the swap file. Possible causes include bad sectors, a virus, bad memory, or physical damage to the motherboard or disk controller.

Kernel Stack Inpage Error (stop code 0X00000077)
Causes and remedies are similar to the previous entry, “Kernel Data Inpage Error (stop code 0X0000007A).”

Kmode Exception Not Handled (stop code 0X0000001E)
A faulty driver or service is sometimes responsible for this error, as are memory and IRQ conflicts, and faulty firmware. If the name of a file or service is specified, try uninstalling the software (or rolling back the driver if it’s an upgrade).

If the Win32k.sys file is mentioned in the message, the cause may be third-party remote control software (discussed in Chapter 7).

This error can also be caused if you run out of disk space while installing an application or if you run out of memory while using a buggy application with a memory leak.

No More System PTEs (stop code 0X0000003F)
Page Table Entries (PTEs) are used to map RAM as it is divided into page frames by the Virtual Memory Manager (VMM). This error usually means that Windows has run out of PTEs.

Aside from the usual assortment of faulty drivers and services that can cause all sorts of problems, this error can also occur if you’re using multiple monitors.

NTFS File System (stop code 0X00000024)
This is caused by a problem with Ntfs.sys, the driver responsible for reading and writing NTFS volumes (see Chapter 5). If you’re using the FAT32 filesystem, you may see a similar message (with stop code 0X00000023).

Causes include a faulty IDE or SCSI controller, improper SCSI termination, an overly aggressive virus scanner, or errors on the disk; try testing your drive with Chkdsk, as described earlier in this chapter.

To investigate further, open the Event Viewer (eventvwr.msc), and look for error messages related to SCSI or FASTFAT (in the System category), or Autochk (in the Application category).

Page Fault In Nonpaged Area (stop code 0X00000050)
Causes and remedies are similar to “Attempted Write To Readonly Memory (stop code 0X000000BE),” earlier in this list.

Status Image Checksum Mismatch (stop code 0Xc0000221)
Possible causes for this error include a damaged swap file (see the discussion of virtual memory in Optimize Virtual Memory and Cache Settings), or a corrupted driver. See “Attempted Write To Readonly Memory (stop code 0X000000BE),” earlier in this section, for additional causes and remedies.

Status System Process Terminated (stop code 0Xc000021A)
This error indicates a problem with either Winlogon.exe or the Client Server Runtime Subsystem (CSRSS). It can also be caused if a user with administrator privileges has modified the permissions (see Chapter 8) of certain system files such that Windows cannot read them. To fix the problem, you’ll have to install a second copy of Windows 7 (see Set Up a Dual-Boot System), and then repair the file permissions from there.

Thread Stuck In Device Driver (stop code 0X000000EA)
Also known as the infamous “infinite loop” problem, this nasty bug has about a hundred different causes. What’s actually happening is that your video driver has essentially entered an infinite loop because your video adapter has locked up. Microsoft has posted a solution on its website that involves disabling certain aspects of video acceleration, but I’ve never encountered an instance where this worked. Instead, try the following:

If you’re using a desktop PC, try upgrading your computer’s power supply. A power supply of poor quality or insufficient wattage will be unable to provide adequate power to all your computer’s components, and may result in a “brown out” of sorts in your system. Note that newer, more power-hungry video adapters are more susceptible to this problem. See Don’t Overlook the Power Supply.

Make sure you have the latest driver for your video card. If you older driver to see whether that solves the problem.

Make sure you have the latest driver for your sound card, if applicable. Also, make sure your sound card is not in a slot immediately adjacent to your video card (desktop PCs only), lest the resulting interference or heat disrupt the operation of either card.

Inspect your video card and motherboard for physical damage.

For desktop PCs only: make sure your video card is properly seated in its PCI-E, AGP, or PCI slot. If applicable, try moving it to a different slot. Next, try messing with some of your system’s BIOS settings, especially those concerning your video card slot or video subsystem, as described in Appendix A. For example, if your AGP slot is set to 8x mode, and your video adapter only supports 1x AGP mode, then you’ll want to change the setting accordingly.

Make sure your computer and your video card are adequately cooled. Overheating can cause your video card’s chipset to lock up.

Check with the manufacturer of your motherboard for newer drivers for your motherboard chipset.

For example, the “infinite loop” problem is common among motherboards with VIA chipsets and nVidia-based video cards. Visit the VIA website (http://www.viaarena.com/?pageid=64) for updated drivers and additional solutions.

Try replacing your system’s driver for the Processor-to-AGP Controller. Open Device Manager (devmgmt.msc), expand the System devices branch, and double-click the entry corresponding to your Processor-to-AGP Controller. Choose the Driver tab, and click Update Driver to choose a new driver. Unless you can get a newer driver from the manufacturer of your motherboard chipset, try installing the generic “PCI standard PCI-to-PCI bridge” driver shown in the Hardware Update Wizard.

If your motherboard has an on-board Ethernet adapter, try disabling the PXE Resume/Remote Wake Up option in your system BIOS (see Appendix A).

Unexpected Kernel Mode Trap (stop code 0X0000007F)
Typical causes of this error include defective memory, physical damage to the motherboard, and excessive processor heat due to overclocking (running the CPU faster than its specified clock speed).

Unmountable Boot Volume (stop code 0X000000ED)
This means that Windows was unable to mount the boot volume, which, if you have more than one drive, is the drive containing Windows (see Chapter 1 for more information on the boot and system volumes). This can be caused by using the wrong cable with a high-throughput IDE controller (more than 33 MB/second); try an 80-pin cable instead of the standard 40-pin cable. See also “Inaccessible Boot Device (stop code 0X0000007B),” earlier in this list.

Stop code 0x0000008E
This error, which typically has no title, is often caused by bad memory. But it could also be the result of a rootkit infestation, described in Viruses, Malware, and Spyware.

If you get repeated BSoD errors, and the previous remedies don’t work, try installing a second copy of Windows on your PC, as described in Set Up a Dual-Boot System. If the second copy of Windows exhibits the same problem, then the cause is your hardware. But if the second copy runs well, then your best bet is to copy your data over to the new installation, and abandon the old OS.


[6] The term worm is said to have its roots in the writings of J.R.R. Tolkien, who described dragons in Middle Earth that were powerful enough to lay waste to entire regions. Two such dragons (Scatha and Glaurung) were known as “the Great Worms.” The Great Worm, a virus written by Robert T. Morris in 1988, was particularly devastating, mostly because of a bug in its own code. (Source: Jargon File 4.2.0.)

Network Access Control: 802.1X, 802.1AE, EAP, and PANA




Network Access Control (NAC) refers to methods used to authorize or deny network communications to particular systems or users. Defined by the IEEE, the 802.1X Port-Based Network Access Control (PNAC) standard is commonly used with TCP/IP networks to support LAN security in enterprises, for both wired and wireless networks. The purpose of PNAC is to provide access to a network (e.g., intranet or the Internet) only if a system and/or its user has been authenticated based on the system’s network attachment point. Used in conjunction with the IETF standard Extensible Authentication Protocol (EAP) [RFC3748], 802.1X is sometimes called EAP over LAN (EAPoL), although the 802.1X standard covers more than just the EAPoL packet format.

The most common variant of 802.1X is based on the standard as published in 2004, however, [802.1X-2010] includes compatibility with 802.1AE (IEEE standard LAN encryption called MACSec) and 802.1AR (X.509 certificates for secure device identities). It also includes a somewhat complex MACSec key agreement protocol called MKA that we do not discuss further. In 802.1X, a system being authenticated implements a function known as a supplicant. The supplicant interacts with an authenticator and a backend authentication server to perform authentication and gain network access. VLANs (see Chapter 3) are often used in helping to enforce the access control decisions made by 802.1X.

EAP can be used with multiple link-layer technologies and supports multiple methods for implementing authentication, authorization, and accounting (AAA). EAP does not perform encryption itself, so it must be used in conjunction with some other cryptographically strong protocol to be secure. When used with link-layer encryption such as WPA2 on wireless networks or 802.1AE on wired networks, 802.1X is relatively secure. EAP uses the same concepts of supplicant and authentication server as does 802.1X, but with different terminology (EAP uses the terms peer, authenticator, and AAA server although even in EAP-related literature backend authentication server is sometimes used). An example setup is shown in Figure 18-5.

Figure 18-5. EAP, supported by 802.11i and 802.1X, allows for a peer (supplicant) to be authenticated by an authenticator that is separate from an AAA server. The authenticator can operate in “passthrough” mode in which it does little more than forwarding EAP packets. It can also participate more directly in the EAP protocol. The pass-through mode allows authenticators to avoid having to implement a large number of authentication methods.

We see a hypothetical enterprise network including wired and wireless peers, a protected network that includes the AAA server and another intranet server on a particular VLAN, and an unauthenticated or “remediation” VLAN. The authenticator’s job is to interact with unauthenticated peers and the AAA server (via AAA protocols such as RADIUS [RFC2865][RFC3162] or Diameter [RFC3588]) to determine if each peer should be granted access to the protected network. If so, this can be accomplished in several ways. The most common approach is to make a VLAN mapping adjustment so that the authenticated peer is assigned to the protected VLAN or to another VLAN that provides connectivity to the protected VLAN using a router (layer 3). An authenticator may use VLAN trunking (IEEE 802.1AX link aggregation; see Chapter 3) and may be capable of assigning VLAN tags based on port number or forwarding VLAN tagged frames sent by the peer.

Note

In some EAP deployments, the authenticator is used without an AAA server, and the authenticator must evaluate the peer’s credentials on its own. When referring to the location where authentication is determined, the term EAP server is used in the EAP literature. Generally, the EAP server is the AAA server (backend authentication server) when the authenticator acts in pass-through mode and is the authenticator otherwise.


In 802.1X, the protocol between the supplicant and the authenticator is divided into a lower and upper sublayer. The lower layer is called the port access control protocol (PACP). The higher layer is ordinarily some variant of EAP. For use with 802.1AR, the variant is called EAP-TLS [RFC5216]. PACP uses EAPoL frames for communication, even if EAP authentication is not used (e.g., when MKA is used). EAPoL frames use an Ethertype field value of 0x888E (see Chapter 3).

Moving to IETF standards, EAP is not a single protocol but rather a framework for achieving authentication using a combination of other protocols, some of which we discuss throughout the chapter, including TLS and IKEv2. The baseline EAP packet format is shown in Figure 18-6.

Figure 18-6. The EAP header includes a Code field for demultiplexing packet types (Request, Response, Success, Failure, Initiate, Finish). The Identifier helps match requests to responses. For request and response messages, the first data byte is a Type field.



The EAP packet format is simple. In Figure 18-6, the Code field contains one of six EAP packet types: Request (1), Response (2), Success (3), Failure (4), Initiate (5), and Finish (6). The last two are defined by the EAP Re-authentication Protocol (see Section 18.7.2); the official field values are maintained by the IANA [IEAP]. The Identifier field contains a number chosen by the sender and is used to match requests with replies. The Length field gives the number of bytes in the EAP message, including the Code, Identifier, and Length fields. Requests and responses are used to perform identification and authentication with the peer, ultimately resulting in a Success or Failure indication. The protocol is capable of carrying an informative message so that human users can be given some instructions about what to do if their system is unable to authenticate. It is a reliable protocol that runs on a lower-layer protocol that is assumed to preserve order but is not assumed to be reliable. EAP itself does not implement other features such as congestion or flow control but may use protocols that do.

The typical EAP exchange starts with the authenticator sending a Request message to the peer. The peer responds with a Response message. Both messages use the same format, as shown in Figure 18-6. An overview of the exchange is shown in Figure 18-7.

Figure 18-7. The baseline EAP messages carry authentication material between the peer and the authenticator. In many deployments, the authenticator is a relatively simple device that acts in a “pass-through” mode. In such cases, most of the protocol processing takes place on the peer and AAA server. IETF standard AAA-specific protocols such as RADIUS or Diameter may be used to encapsulate EAP messages carried between the AAA server and authenticator.
[View full size image]


The primary purpose of the Request and Response messages is to exchange whatever information is required to allow an authentication method to succeed. Numerous methods are defined within [RFC3748], and several are defined in other standards. The particular method being used is encoded in the Type field of Request and Response messages using values of 4 or greater. Other special Type field values include Identity (1), Notification (2), Nak (“Legacy Nak”) (3), and an Expanded Type extension (254). The Identity type is used by an authenticator to ask the peer its identifying information and provide a method for the peer to respond. The Notification type is used to display a message or notification to a user or log file (not for errors, but for notifications). When a peer does not support a method requested by the authenticator, it replies with a negative ACK (either a Legacy Nak or an Extended Nak). Extended Naks include a vector of implemented authentication methods not present in Legacy Naks.

EAP is a layered architecture that supports its own multiplexing and demultiplexing. Conceptually, it consists of four layers: the lower layer (for which there are multiple protocols), EAP layer, EAP peer/authenticator layer, and EAP methods layer (for which there are many methods). The lower layer is responsible for transporting EAP frames in order. Perhaps ironically, some of the protocols used to transport EAP are actually higher-layer protocols, many of which we have discussed already. Examples of EAP “lower-layer” protocols include 802.1X, 802.11 (802.11i) (see Chapter 3), UDP with L2TP (see Chapter 3), UDP with IKEv2 (see Section 18.8.1), and TCP (see Chapters 12–17). Figure 18-8 shows how the layers are implemented in conjunction with a pass-through authenticator. A pass-through server would be the opposite but is not supported by RADIUS or Diameter.

Figure 18-8. The EAP stack and implementation model. In the pass-through mode, the peer and AAA server are responsible for implementing the EAP authentication methods. The authenticator need only implement EAP message processing, the authenticator processing, and enough of an AAA protocol (e.g., RADIUS, Diameter) to exchange information with the AAA server.
[View full size image]


In the “EAP stack” depicted in Figure 18-8, the EAP layer implements reliability and duplicate elimination. It also performs demultiplexing based on the code value in EAP packets. The peer/authenticator layer is responsible for implementing the peer and/or authenticator protocol messages, based on demultiplexing of the Code field. The EAP methods layer consists of all the specific methods to be used for authentication, including any required protocol operations to handle large messages. This is necessary because the rest of the EAP protocol does not implement fragmentation and some methods may require large messages (e.g., containing certificates or certificate chains).

18.7.1. EAP Methods and Key Derivation
Given its architecture, many EAP authentication and encapsulation methods are available for use (more than 50). Some are specified by IETF standards, and others have evolved separately (e.g., from Cisco or Microsoft). Some of the more common methods include TTLS [RFC5281], TLS [RFC5216], FAST [RFC4851], LEAP (Cisco proprietary), PEAP (EAP over TLS, Cisco proprietary), IKEv2 (experimental) [RFC5106], and MD5. Of these, only MD5 is specified in [RFC3748], but it is no longer recommended for use. Unfortunately, the complexity does not end when specifying one of these methods alone. Within each method there are sometimes different options for cryptographic suites or identity verification. With PEAP, for example, some versions of Microsoft Windows support MSCHAPv2 and TLS.

The reasons for having so many options are partly historical. As security and operational experience have evolved over time, some methods were found to be too insecure or insufficiently flexible. Some authentication methods require an operating PKI that can provide client certificates (e.g., EAP-TLS), while others (e.g., PEAP, TTLS) do not require such infrastructure. Older protocols (e.g., LEAP) were designed at a time when other standards such as 802.11 (incorporating 802.11i) were not yet mature. Consequently, depending on the particular environment, various combinations of smart cards or tokens, passwords, or certificates may be required to use EAP.

The purpose of the EAP methods is to establish authentication, and possibly authorization for network access. In some cases (e.g., EAP-TLS), the methods provide bidirectional authentication, whereby each end acts as both an authenticator and a peer. The type of authentication provided by a method is often a consequence of the cryptographic primitives it employs.

Some methods provide more than authentication. Those that provide key derivation are able to agree upon and export keys in a key hierarchy [RFC5247] and must provide for mutual authentication between the EAP peer and EAP server. The master session key (MSK, also called AAA-key) is used in deriving other keys using a KDF, either at an EAP peer or authenticator. MSKs are at least 64 bytes in length and are typically used to derive transient session keys (TSKs) that are used to enforce access control between a peer and an authenticator, often at lower layers. Extended MSKs (EMSKs) are also provided along with MSKs but are made available only to the EAP server or peer, not to pass-through authenticators, and are used in deriving root keys [RFC5295]. Root keys are keys associated with particular usages or domains. A usage-specific root key (USRK) is a key derived from an EMSK in the context with a particular usage. A domain-specific root key (DSRK) is a key derived from an EMSK for use in a particular domain (i.e., collection of systems). Child keys derived from a DSRK are known as domain-specific usage-specific root keys (DSUSRKs).

During an EAP exchange, multiple peer and server identities may be used, and a session identifier is allocated. On completion of an EAP-based authentication where key derivation is supported, the MSK, EMSK, peer identifier(s), server identifier(s), and a session ID are made available to lower layers. (A now-deprecated initialization vector might also be provided.) Keys generally have an associated lifetime (8 hours is recommended), after which EAP re-authentication is required. For an in-depth discussion of EAP’s key management framework and an accompanying detailed security analysis, please see [RFC5247].

18.7.2. The EAP Re-authentication Protocol (ERP)
In cases where EAP authentication has completed successfully, it is often desirable to reduce latency if a subsequent authentication exchange is required (e.g., a mobile node moves from one access point to another). The EAP Re-authentication Protocol (ERP) [RFC5296] provides the ability to do this independent of any particular EAP method. EAP peers and servers that support ERP are called ER peers and servers, respectively. ERP uses a re-authentication root key (rRK) derived from a DSRK (or the EMSK, but [RFC5295] suggests avoiding this) along with a re-authentication integrity key (rIK) derived from the rRK used to prove knowledge of the rRK.

ERP operates in a single round-trip time, which is consistent with its goal of reducing re-authentication latency. ERP begins with a full conventional EAP exchange, assumed to be in the “home” domain. The MSK generated is distributed to the authenticator and peer as usual. However, the rIK and rRK values are also determined at this time and shared only between the peer and EAP server. These values can be used in the home domain, along with rMSKs generated for each authenticator. When the ER peer moves to a different domain, different values (DS-rIK and DS-rRK, which are DSUSRKs) are used. The domain of the ER server is contained in a TLV area in ERP messages, allowing peers to determine the domain of the server with which they are communicating. Details of the protocol are given in [RFC5296].

18.7.3. Protocol for Carrying Authentication for Network Access (PANA)
While combinations of EAP, 802.1X, and PPP have all been used to support authentication of the client (and network, in some cases), they are not entirely link-independent. EAP tends to be implemented for particular links, 802.1X applies to IEEE 802 networks, and PPP uses a point-to-point network model. To address this concern, the Protocol for Carrying Authentication for Network Access (PANA) has been defined in [RFC5191], [RFC5193], and [RFC6345] based on requirements set out in [RFC4058] and [RFC4016]. It acts as an EAP lower layer, meaning it acts as a “carrier” for EAP information. It uses UDP/IP (port 716) and is therefore applicable to more than a single type of link, and it is not limited to a point-to-point network model. In effect, PANA allows EAP authentication methods to be used on any link-layer technology for determining network access.

The PANA framework includes three main functional entities: the PANA Client (PaC), PANA Authentication Agent (PAA), and the PANA Relay Element (PRE). Normal usage also involves an Authentication Server (AS) and Enforcement Point (EP). The AS may be a conventional AAA server accessed using access protocols such as RADIUS or Diameter. The PAA is responsible for conveying authentication material from a PaC to the AS, and for configuration of the EP when network access is approved or revoked. Some of these entities may be colocated. The PaC and associated EAP peer are always colocated, as are the EAP authenticator and PAA. A PRE can be used to relay communications between a PaC and PAA when direct communication is not otherwise possible.

The PANA protocol consists of a set of request/response messages including an extensible set of attribute-value pairs managed by the IANA [IPANA]. The primary payloads are EAP messages, sent in UDP/IP datagrams as part of a PANA session. There are four phases in a PANA session: authentication/authorization, access, re-authentication, and termination. The re-authentication phase is really a portion of the access phase wherein the session lifetime is extended by re-executing EAP-based authentication. The termination phase is entered either explicitly or as the result of the session timing out (either because of lifetime exhaustion or failure of liveness detection). PANA sessions are identified by a 32-bit session identifier included in each PANA message.

PANA also provides a form of reliable transport protocol. Each message contains a 32-bit sequence number. The sender keeps track of the next sequence number to send, and receivers keep track of the next expected sequence number. Answers contain the same sequence number as the corresponding request. Initial sequence numbers are randomly selected by the sender of the message (i.e., PaC or PAA). PANA also implements time-based retransmission. PANA is a weak transport protocol—it operates in a stop-and-wait fashion, does not use an adaptive retransmission timer, and cannot perform repacketization. It does, however, perform exponential backoff on its retransmission timer when faced with multiple packet losses.




We’ll use the Telnet service for our example. Since Telnet is an insecure protocol that must sometimes be supported due to legacy applications and systems, using inline authentication here is an additional layer of security that we can apply to our connection.

juniper@SRX5800# edit access firewall-authentication pass-through
[edit access firewall-authentication pass-through]
juniper@SRX5800# set default-profile web-allow-group
[edit access firewall-authentication pass-through]
juniper@SRX5800# set telnet banner success "PLEASE ENTER IN YOUR ACCOUNT INFO.
FOR SUPPORT PLEASE CALL THE NOC AT 1-800-555-1212"
[edit access firewall-authentication pass-through]
juniper@SRX5800# top
[edit]
juniper@SRX5800# edit security policies from-zone trust to-zone web-dmz
[edit security policies from-zone trust to-zone web-dmz]
juniper@SRX5800# set policy permit-telnet match source-address any
destination-address any
[edit security policies from-zone trust to-zone web-dmz]
juniper@SRX5800# set policy permit-telnet match application junos-telnet
[edit security policies from-zone trust to-zone web-dmz]
juniper@SRX5800# set policy permit-telnet then permit firewall-authentication
pass-through access-profile web-allow-group
And here is what that configuration looks like all together:

juniper@SRX5800# show | compare
[edit security policies from-zone trust to-zone web-dmz]
      policy web_deny { ... }
+     policy permit-telnet {
+         match {
+             source-address any;
+             destination-address any;
+             application junos-telnet;
+         }
+         then {
+             permit {
+                 firewall-authentication {
+                     pass-through {
+                         access-profile web-allow-group;
+                     }
+                 }
+             }
+         }
+     }
We can view active authenticated information about the SRX’s authentications using the following output:

juniper@SRX5800# show security firewall-authentication users
Firewall authentication data:
  Total users in table: 1
          Id Source Ip       Src zone Dst zone Profile    Age Status   User
           4 10.3.0.12     Trust   Internet      webauth-     4 Success  Tim
The show security firewall-authentication history command shows all active and authenticated users currently passing through the SRX:

juniper@SRX5800> show security firewall-authentication history
History of firewall authentication data: Authentications: 2 Id Source Ip
Date Time Duration Status User
1 10.1.0.120 2010-01-12 18:20:02 0: 00:22 Failed bob
2 10.1.0.125 2010-01-13 12:22:48 0: 00:21 Success bill
Firewall authentication provides an additional layer of security as well as logs. It can be used to enforce company access policies or better protect network boundaries and access. It is a very simple way to improve the overall security strategy of anything from the smallest home office to a large corporate network.

















What is the difference between DMZ and IP Pass-through?
Question asked by colton_w24 on Feb 5, 2017
Latest reply on Oct 15, 2018 by emmawatsun 
Like • Show 1 Like1 Comment • 6
I have a PS4 and Xbox One, I'm looking to avoid all NAT issues and possibly improve performance. Would it be better to use a DMZ or use IP Pass-through?

corbin
corbin
Feb 7, 2017 11:37 AM
Correct Answer
DMZ
DMZ is a Router NAT function. When you put a device in the DMZ then all packets received by your router, that don't match an existing NAT connection, are forwarded to the DMZ device. So any unsolicited traffic sent to your router is no longer dropped by NAT if it doesn't match a port forwarding rule, but instead is forwarded to the DMZed device. You'll want a firewall installed on this device unless it is a game console (and maybe even then?), as it will now be subjected to all kinds of scans and probes from the internet.



IP Passthrough

IP Passthrough removes the device (by switch port, or MAC address depending on device and configuration) from any routing or NAT functions. All traffic from that device is switched/bridged through the router right to the ISP. The IP Passthrough-ed device will have to pull its own public IP address from the ISP DHCP server. This device is no longer on a private network behind a Router/Firewall/NAT, it now lives directly on the public internet (I suggest you should have a firewall installed on it).

RACI Models for Stakeholders and Supporters

Many organizations use a model known as RACI to organize their decision-making. To summarize it briefly, RACI is an acronym that encapsulates each of these key roles:

Responsible
The person who fully understands the challenge and desired outcome, and who is accountable for the success of the effort. Without adequate incentive to make “winning” decisions or be accountable, this person serves more of a facilitative role. As the person who arguably is closest to the problem and the possibilities, they benefit from having the risk/reward of making the right decisions, or more likely, learning from decisions to get to the right decision.

Accountable (or the advisor)
The person (or people) who are positioned to understand the risk implications of different decisions, who have veto authority, and who are aware of how outcomes affect the company. I have found that while the CEO might be ultimately accountable for a decision, assigning them the explicit accountability role means they rarely have enough information to question the ideas of the driver. To this end, making them instead an advisor who can veto or challenge ideas sets them up as a contractive foil to the driver, and makes them less likely to blindly accept their recommendations or argue for argument’s sake.

Consulted (or contributors)
These are people who are responsible for actually developing solutions to challenges and seeing them implemented. They will certainly include the close collaborators we looked at previously. This category may also include those who are responsible for aspects of the solution that are dependent on, or highly related but adjacent to, the core solution (such as platform engineering or members of the legal team). Often contributors are actually those who inhabit the creation-oriented roles described earlier, such as drivers or navigators or critics.

Informed
This group tends to be overlooked and dismissed in the (mistaken) assumption that they are less important that the others. However, as we will see, and you likely have experienced, if those who should be informed don’t feel adequately prepared, they are likely to become bottlenecks or adversaries who need to be won over after the fact.

NOTE
You may have seen or read about this model as DACI instead of RACI. In a DACI model, the R becomes a D, for the decider or driver of the effort. Given the previous discussion of pairing or close collaboration, I use RACI’s “Responsible” category to avoid confusion about this role. In my experience, and in the experience of those I spoke with, the differences are negligible between the two sets of acronyms. The key is to assign different focuses to those who have a great deal of accountability for a solution, but little hands-on time or experience, and those who work on a problem directly. Having seen this model employed in many different settings, I have seen it provide healthy clarity around decisions and help teams work in smaller groups, with less friction with those who are interested and perhaps want to be more than informed.

Things to consider when assigning roles and putting the group together:

Expertise and skills
You need a variety but also need to cover what’s required to get the job done. Even if you can’t get full participation from someone with critical knowledge or abilities, see what time and attention you can get rather than trying to make do.
Ability to think on their feet versus “offline” and on their own
If the entire group loves to debate verbally and intensely, you may find that ideas are being chosen based on that public performance, without careful analysis. See who might be able to work offline or in writing to bring a different lens.
Language proficiency
If not everyone shares the same native language, see if you can get the group to use simple words and syntax, avoiding acronyms or abbreviations that won’t be well known.
By being thoughtful about how you place people in a team, and being prepared ahead of time, you can channel people’s energy more productively.

Am I a SysAdmin?

I have created this short list to help you determine whether you are a SysAdmin. You know you are a SysAdmin if…
1.You think this book might be a fun read.
© David Both 2018
David BothThe Linux Philosophy for SysAdminshttps://doi-org.eztncc.vccs.edu:2443/10.1007/978-1-4842-3730-4_1

2. People frequently ask you to help them with their computers.


3.You check the servers every morning before you do anything else.


4.You write shell scripts to automate even simple tasks.


5.You share your shell scripts.


6.Your shell scripts are licensed with an Open Source license.


7.You know what Open Source means.


8.You document everything you do.


9.You have hacked the wireless router to install Linux software.


10.You find computers easier to interact with than most humans.


11.You understand :(){ :|: & } ;:


12.You think the command line is fun.


13.You like to be in complete control.


14.You are root.


15.You understand the difference between “free as in beer,” and “free as in speech,” when applied to software.


16.You have installed a computer in a rack enclosure.


17.You have replaced the standard CPU cooling fan with one that dissipates more heat.


18.You purchase the parts and build your own computers.


19.
You use liquid cooling for your CPU.


20.
You install Linux on everything you can.


21.
You have a Raspberry Pi connected to your television.


22.
You use a Raspberry Pi as a firewall for your home network.


23.
You run your own Email, DHCP, NTP, NFS, DNS, and/or SSH servers.


24.
You have hacked your home computer to replace the processor with a faster one.


25.
You have upgraded the BIOS in a computer.


26.
You leave the covers off your computer because you replace components frequently.


27.
The router provided by your ISP is in “pass through” mode.


28.
You use a Linux computer as a router.


29.
…etc…

IEEE 802.11 standards


Safe mode


Safe boot sequence - A+











https://support.microsoft.com/en-us/help/17419/windows-7-advanced-startup-options-safe-mode

The Advanced Boot Options screen lets you start Windows in advanced troubleshooting modes. You can access the menu by turning on your computer and pressing the F8 key before Windows starts.

Some options, such as safe mode, start Windows in a limited state, where only the bare essentials are started. If a problem doesn't reappear when you start in safe mode, you can eliminate the default settings and basic device drivers and services as possible causes. Other options start Windows with advanced features intended for use by system administrators and IT professionals. For more information, go to the Microsoft website for IT professionals.

Repair Your Computer

Shows a list of system recovery tools you can use to repair startup problems, run diagnostics, or restore your system. This option is available only if the tools are installed on your computer's hard disk. If you have a Windows installation disc, the system recovery tools are located on that disc.

Safe Mode 

Starts Windows with a minimal set of drivers and services.
To start in safe mode:
  1. Remove all floppy disks, CDs, and DVDs from your computer, and then restart your computer. Click the Start button , click the arrow next to the Shut Down button (or the arrow next to the Lock button), and then click Restart.
  2. Do one of the following:
    • If your computer has a single operating system installed, press and hold the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, you'll need to try again by waiting until the Windows logon prompt appears, and then shutting down and restarting your computer.
    • If your computer has more than one operating system, use the arrow keys to highlight the operating system you want to start in safe mode, and then press F8.
  3. On the Advanced Boot Options screen, use the arrow keys to highlight the safe mode option you want, and then press Enter.
  4. Log on to your computer with a user account that has administrator rights.

  • Safe Mode with Networking. Starts Windows in safe mode and includes the network drivers and services needed to access the Internet or other computers on your network.
  • Safe Mode with Command Prompt. Starts Windows in safe mode with a command prompt window instead of the usual Windows interface. This option is intended for IT professionals and administrators.
  • Enable Boot Logging. Creates a file, ntbtlog.txt, that lists all the drivers that are installed during startup and that might be useful for advanced troubleshooting.
  • Enable low-resolution video (640×480). Starts Windows using your current video driver and using low resolution and refresh rate settings. You can use this mode to reset your display settings. For more information, see Change your screen resolution.
  • Last Known Good Configuration (advanced). Starts Windows with the last registry and driver configuration that worked successfully. 
  • Directory Services Restore Mode. Starts Windows domain controller running Active Directory so that the directory service can be restored. This option is intended for IT professionals and administrators.
  • Debugging Mode. Starts Windows in an advanced troubleshooting mode intended for IT professionals and system administrators.
  • Disable automatic restart on system failure. Prevents Windows from automatically restarting if an error causes Windows to fail. Choose this option only if Windows is stuck in a loop where Windows fails, attempts to restart, and fails again repeatedly.
  • Disable Driver Signature Enforcement. Allows drivers containing improper signatures to be installed.
  • Start Windows Normally. Starts Windows in its normal mode.

Processes, functions and roles


System images,


Strategy Processes


Thursday, May 23, 2019

DFS Terminology

DFS namespace

DFS namespace is a collection of DFS shared folders. It uses the same UNC pathname structure, except instead of \\ServerName\FileShareName with DFS, it is \\domainname with all DFS shared folders located under this DFS root. For example, instead of:
\\FS-1\Engineering

\\FS-2\Accounting

\\FS-3\Documents
You can have:
\\Contoso.com\Engineering

\\Contoso.com\Accounting

\\Contoso.com\Documents
In this scenario, the Engineering, Accounting, and Documents folders can all be hosted on separate file servers and you can use a single namespace to locate those shared folders, instead of needing to know the identity of the file server that hosts them.

DFS Terminology
A number of technical terms are used when referring to deploying, configuring, and referencing DFS. The DFS namespace and DFSR have already been described, but the remaining terms should also be understood before reading the remainder of this chapter or deploying a new DFS infrastructure:

Image DFS namespace—A unified namespace that presents a centralized view of shared folder data in an organization.

Image DFS namespace server—A Windows server that hosts a DFS namespace.

Image DFS namespace root—The top level of the DFS tree that defines the namespace for DFS and the functionality available. The namespace root is also the name of the DFS namespace. A domain-based root adds fault-tolerant capabilities to DFS by allowing several servers to host the same DFS namespace root.

Image DFS folder—A folder that is presented under the root when a DFS client connects. When a root is created, folders can be created within the file system, but DFS folders allow the system to redirect clients to different systems other than the namespace server hosting the root.

Image Folder target—A share hosted on a Windows server. The DFS folder name and the share name do not need to be the same, but for troubleshooting purposes, it is highly recommended. Multiple folder targets can be assigned to a single DFS folder to provide fault tolerance. If a single folder target is unavailable, clients will be connected to another available target. When DFS folders are created with multiple folder targets, replication can also be configured using DFSR groups to keep the data across the targets in sync. Folder targets can be a share name or a folder beneath a share. For example, \\server1\userdata or \\server1\userdata\Finance are both valid folder targets.

Image DFS tree—The hierarchy of the namespace. For example, the DFS tree begins with the DFS root namespace and contains all the defined folders below the root.

Image Referrals—A configuration setting of a DFS namespace/folder that defines how DFS clients connect to the namespace server, a folder in the namespace, or a particular folder target server. Referral properties include limiting client connections to servers in the local Active Directory site and how often to check the availability of a DFS server. Disabling a target’s referral keeps it from being used by clients. Target referral can be disabled when maintenance is performed on a server.


partition table (GPT)

A partition type that is not shown is GPT, which is available with 64-bit Windows operating systems. GUID, or globally unique identifier, partition table (GPT) allows up to 128 partitions and volumes up to 9.4 ZB. GPTpartitioning is accomplished using the Disk Management tool or using the diskpart command-line utility. GPTmakes it possible to have a backup partition table in case the primary partition becomes corrupt. A GPT disk can also have more than the MBR-based disk limit of four primary partitions.

Tech Tip
You lose data when converting to GPT
MBR-based partitions can be converted to GPTand vice versa, but data is not preserved. This is seen only with systems that have a UEFI BIOS. Back up data if you convert!

Special products can be used to partition a hard driveand also repartition without any data loss. Examples include Acronis’s Disk Director, EaseUS’s Partition Master, and Avanquest’s Partition Commander.

Resiliency for ReFS -Resilient File System

Resiliency

ReFS is able to detect corruptions in a filesystem and repair the corruptions without taking storage offline or making the data unavailable, providing increased reliability and data integrity.
When used in Storage Spaces integration scenarios, ReFSdetects and repairs data corruption automatically, with no downtime. Moreover, if a volume is corrupted and there is no alternative copy of the corrupted data, ReFS removes the corrupted data from the namespace.
During read and write operations, a process named scrubber occasionally scans the volume and automatically corrects the errors if the corrupt data is found. 

ReFS

ReFS (Resilient File System) is a new file system that is available in Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016. ReFS is appropriate for very large workloads where you need to maximize data availability and integrity and ensure that the file system is resilient to corruption.
The ReFS file system is suitable for hosting specific types of workloads such as virtual machines and SQL Server data, because it includes the following features that improve upon NTFS:
• Integrity. ReFS uses checksums for both metadata and file data. This means that ReFS can detect data corruption.
• Storage space integration. When integrated with storage spaces that are configured with mirror or parity options, ReFS has the ability to automatically detect and repair corruption using a secondary or tertiary copy of data stored by Storage Spaces. Repair occurs without downtime.
• Proactive error correction. ReFS includes a data integrity scanner that scans the volume to identify latent corruption and proactively repair corrupt data.
• Scalability. ReFS is specifically designed to support data sets in the millions of terabytes range.
• Advanced VM operations. ReFS includes functionality specifically to support virtual machine operations. Block cloning accelerates copy operations, which accelerate VM checkpoint merges. Sparse VDL allows ReFS to substantially reduce the amount of time required to create very large fixed sized virtual hard disks.

Remote Hybrid and Office work