Cpsa Crest Revision 1) Core Technical Skills: IGRP - Interior Gateway Routing Protocol
Cpsa Crest Revision 1) Core Technical Skills: IGRP - Interior Gateway Routing Protocol
B1) IP Protocols
IP Protocols
Internet Protocol (IP)
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
Internet Control Message Protocol (ICMP)
Routing Protocols:
RIP - Routing Information Protocol
OSPF - Open Shortest Path First
BGP - Border Gateway Protocol
IGRP - Interior Gateway Routing Protocol
https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
Protocol
Hex Keyword Protocol References/RFC
Number
0x00 0 HOPOPT IPv6 Hop-by-Hop Option RFC 8200
0x01 1 ICMP Internet Control Message Protocol RFC 792
MAC Address:
A media access control address (MAC address) of a computer is a unique identifier assigned to network
interfaces for communications at the data link layer of a network segment.
MAC has a 48-bit address space.
Classful network:
b) L2TP tunnel based VPN uses IPSec: UDP Port 500 (IKE) and 4500 (NAT-T), and IP protocol 50 number (ESP)
. Note: Same comment as above – it is IP protocol 50 and not port number inside TCP or UDP.
List of Ports:
http://packetlife.net/media/library/23/common-ports.pdf
19 UDP CHARGEN
23 TCP/UDP Telnet
What is on Port 7?
Echo
EAP is an authentication framework, not a specific authentication mechanism.[1] It provides some common
functions and negotiation of authentication methods called EAP methods. There are currently about 40
different methods defined.
EICAR is a text file with a signature recognised by all AV vendors to test if a virus is detected by the AV engine.
EICAR is not a virus by itself.
Traceroute works by sending packets with gradually increasing TTL value, starting with TTL value of one. The
first router receives the packet, decrements the TTL value and drops the packet because it then has TTL value
zero. The router sends an ICMP Time Exceeded message back to the source. The next set of packets are given a
TTL value of two, so the first router forwards the packets, but the second router drops them and replies with
ICMP Time Exceeded. Proceeding in this way, traceroute uses the returned ICMP Time Exceeded messages to
build a list of routers that packets traverse, until the destination is reached and returns an ICMP Echo Reply
message.[3]
• ICMP sweeps (ICMP ECHO request) is a basic network scanning technique used to determine which of
a range of IP addresses map to live hosts (computers). Whereas a single ping will tell you whether one
specified host computer exists on the network, a ping sweep consists of ICMP (Internet Control
Message Protocol) ECHO requests sent to multiple hosts. If a given address is live, it will return an
ICMP ECHO reply. Ping sweeps are among the older and slower methods used to scan a network.
o nmap -sn 192.168.1.1 (no port scan, only check if hosts are up)
▪ The default host discovery done with -sn consists of an ICMP echo request, TCP SYN
to port 443, TCP ACK to port 80, and an ICMP timestamp request by default.
o fping 192.168.1.1
▪ http://itswapshop.com/tutorial/fping-tutorial-how-use-fping-examples
• Sending ICMP ECHO request to the network or/and broadcast addresses will produce all
the information you need for mapping a targeted network.
o Some systems will not reply to ICMP ECHO requests via broadcast, therefore not very
reliable
With the TCP Sweep technique, instead of sending ICMP ECHO request packets we send TCP ACK or TCK SYN
packets (depending if we have root access or not) to the target network. The port number can be selected to
meet our needs. Usually a good pick would be one of the following ports – 21 / 22 / 23 / 25 / 80 (especially if a
firewall is protecting the targeted network). Receiving a response is a good indication that something is up
there. The response depends on the target’s operating system, the nature of the packet sent and any firewalls,
routers or packet-filtering devices used. Bear in mind that firewalls can spoof a RESET packet for an IP address,
so TCP Sweeps may not be reliable.
• nmap -sn 192.168.1.1 (no port scan, only check if hosts are up)
o The default host discovery done with -sn consists of an ICMP echo request, TCP SYN to port
443, TCP ACK to port 80, and an ICMP timestamp request by default.
B5) Interpreting Tool Output
Port scanner:
• Port ranges:
o The port numbers in the range from 0 to 1023 are the well-known ports or system ports.
They are used by system processes that provide widely used types of network services. On
Unix-like operating systems, a process must execute with superuser privileges to be able to
bind a network socket to an IP address using one of the well-known ports.
o The range of port numbers from 1024 to 49151 are the registered ports. They are assigned
by IANA for specific service upon application by a requesting entity. On most systems,
registered ports can be used by ordinary users.
o The range 49152–65535 (215+214 to 216−1) contains dynamic or private ports that cannot
be registered with IANA. This range is used for private, or customized services or temporary
purposes and for automatic allocation of ephemeral ports.
• Types of Scanning Method
o -sS (TCP SYN scan)
o -sT (TCP connect scan)
o -sU (UDP scans)
o -sY (SCTP INIT scan)
o -sN; -sF; -sX (TCP NULL, FIN, and Xmas scans)
o -sA (TCP ACK scan)
• tcpdump
o Interpreting tcpdump output, http://packetpushers.net/masterclass-tcpdump-interpreting-
output/
Generic TCP. Here’s a line of output related to an SSH session. Note the -v parameter has been used, without
it, the IP header information and
Generic UDP. Response with -v, as you can see, without it the IP header information and the UDP information
is not displayed;
TTL List
B6) Filtering Avoidance Techniques
Ingress:
Network traffic that originates from outside of the network's routers and proceeds toward a destination inside
of the network.
Egress:
Network traffic that begins inside of a network and proceeds through its routers to a destination somewhere
outside of the network.
As a security-in-depth measure not only ingress should be restricted but also egress traffic. This would make it
harder for an attacker to start a reverse shell on the server, if only the services running on the server are
allowed to connect to the outside world.
B8) OS Fingerprinting
Active fingerprinting:
Active fingerprinting is the process of transmitting packets to a remote host and analysing corresponding
replies.
Passive fingerprinting:
Passive fingerprinting is the process of analysing packets from a host on a network. In this case, fingerprinter
acts as a sniffer and doesn't put any traffic on a network.
Recall that -T4 causes Nmap to go faster (more aggressive timing) and -F tells Nmap to scan only ports
registered in nmap-services.
B11) Cryptography
Encoding is the process of applying a specific code, such as letters, symbols and numbers, to data for
conversion into an equivalent cipher. Only the encoding needs to be known (such as Base64) to decode the
data back into the clear text.
Asymmetric Encryption is a form of Encryption where keys come in pairs. What one key encrypts, only the
other can decrypt. Frequently (but not necessarily), the keys are interchangeable, in the sense that if key A
encrypts a message, then B can decrypt it, and if key B encrypts a message, then key A can decrypt it.
Triple Data Encryption Standard (3DES, or officially the Triple Data Encryption Algorithm TDEA or Triple DEA)
The original DES cipher's key size of 56 bits was generally sufficient when that algorithm was designed, but the
availability of increasing computational power made brute-force attacks feasible. Triple DES provides a
relatively simple method of increasing the key size of DES to protect against such attacks, without the need to
design a completely new block cipher algorithm.
Rounds 1
RC4
In cryptography, RC4 (Rivest Cipher 4 also known as ARC4 or ARCFOUR meaning Alleged RC4, see below) is a
stream cipher. While remarkable for its simplicity and speed in software, multiple vulnerabilities have been
discovered in RC4, rendering it insecure.[3][4] It is especially vulnerable when the beginning of the output
keystream is not discarded, or when nonrandom or related keys are used. Particularly problematic uses of RC4
have led to very insecure protocols such as WEP.[5]
MD5
The MD5 algorithm is a widely used hash function producing a 128-bit hash value. Although MD5 was initially
designed to be used as a cryptographic hash function, it has been found to suffer from extensive
vulnerabilities. It can still be used as a checksum to verify data integrity, but only against unintentional
corruption.
Like most hash functions, MD5 is neither encryption nor encoding. It can be reversed by brute-force attack and
suffers from
extensive vulnerabilities.
Rounds 80
Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL), both frequently referred to as
"SSL", are cryptographic protocols that provide communications security over a computer network.
When secured by TLS, connections between a client (e.g., a web browser) and a server (e.g., wikipedia.org)
have one or more of the following properties:
• The connection is private (or secure) because symmetric cryptography is used to encrypt the data
transmitted. The keys for this symmetric encryption are generated uniquely for each connection and are
based on a shared secret negotiated at the start of the session (see TLS handshake protocol). The server
and client negotiate the details of which encryption algorithm and cryptographic keys to use before the
first byte of data is transmitted (see Algorithm below). The negotiation of a shared secret is both secure
(the negotiated secret is unavailable to eavesdroppers and cannot be obtained, even by an attacker who
places themselves in the middle of the connection) and reliable (no attacker can modify the
communications during the negotiation without being detected).
• The identity of the communicating parties can be authenticated using public-key cryptography. This
authentication can be made optional, but is generally required for at least one of the parties (typically the
server).
• The connection ensures integrity because each message transmitted includes a message integrity check
using a message authentication code to prevent undetected loss or alteration of the data during
transmission.[1]:3
IPSec
Internet Protocol Security (IPsec) is a protocol suite for secure Internet Protocol (IP) communications that
works by authenticating and encrypting each IP packet of a communication session. IPsec includes protocols
for establishing mutual authentication between agents at the beginning of the session and negotiation of
cryptographic keys to be used during the session. IPsec can be used in protecting data flows between a pair of
hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security
gateway and a host (network-to-host).[1] Internet Protocol security (IPsec) uses cryptographic security services
to protect communications over Internet Protocol (IP) networks. IPsec supports network-level peer
authentication, data origin authentication, data integrity, data confidentiality (encryption), and replay
protection.
IPsec is an end-to-end security scheme operating in the Internet Layer of the Internet Protocol Suite, while
some other Internet security systems in widespread use, such as Transport Layer Security (TLS) and Secure
Shell (SSH), operate in the upper layers at the Transport Layer (TLS) and the Application layer (SSH). Hence,
only IPsec protects all application traffic over an IP network. Applications can be automatically secured by
IPsec at the IP layer.
Encapsulating Security Payload (ESP) is a member of the IPsec protocol suite. In IPsec it provides
origin authenticity, integrity and confidentiality protection of packets. ESP also supports encryption-only
and authentication-only configurations, but using encryption without authentication is strongly discouraged
because it is insecure.
SSH provides a secure channel over an unsecured network in a client-server architecture, connecting an SSH
client application with an SSH server.[2] Common applications include remote command-line login and remote
command execution, but any network service can be secured with SSH. The protocol specification
distinguishes between two major versions, referred to as SSH-1 and SSH-2.
SSH was designed as a replacement for Telnet and for unsecured remote shell protocols such as the Berkeley
rlogin, rsh, and rexec protocols. Those protocols send information, notably passwords, in plaintext, rendering
them susceptible to interception and disclosure using packet analysis.
WEP
Wired Equivalent Privacy (WEP) is a security algorithm for IEEE 802.11 wireless networks. Introduced as part of
the original 802.11 standard ratified in 1997, its intention was to provide data confidentiality comparable to
that of a traditional wired network.[1] WEP, recognizable by the key of 10 or 26 hexadecimal digits, was at one
time widely in use and was often the first security choice presented to users by router configuration tools.
In 2003 the Wi-Fi Alliance announced that WEP had been superseded by Wi-Fi Protected Access (WPA). In
2004, with the ratification of the full 802.11i standard (i.e. WPA2), the IEEE declared that both WEP-40 and
WEP-104 have been deprecated.
WEP was included as the privacy component of the original IEEE 802.11 standard ratified in 1997.[5][6] WEP
uses the stream cipher RC4 for confidentiality,[7] and the CRC-32 checksum for integrity.[8]
Standard 64-bit WEP uses a 40 bit key (also known as WEP-40), which is concatenated with a 24-bit
initialization vector (IV) to form the RC4 key. At the time that the original WEP standard was drafted, the U.S.
Government's export restrictions on cryptographic technology limited the key size. Once the restrictions were
lifted, manufacturers of access points implemented an extended 128-bit WEP protocol using a 104-bit key size
(WEP-104).
WPA
Wi-Fi Protected Access (WPA) and Wi-Fi Protected Access II (WPA2) are two security protocols and security
certification programs developed by the Wi-Fi Alliance to secure wireless computer networks. The Alliance
defined these in response to serious weaknesses researchers had found in the previous system, Wired
Equivalent Privacy (WEP).
A flaw in a feature added to Wi-Fi, called Wi-Fi Protected Setup, allows WPA and WPA2 security to be
bypassed and effectively broken in many situations.[2] WPA and WPA2 security implemented without using
the Wi-Fi Protected Setup feature are unaffected by the security vulnerability.
• WPA-Personal. Also referred to as WPA-PSK (pre-shared key) mode, this is designed for home and
small office networks and doesn't require an authentication server.[9] Each wireless network device
encrypts the network traffic using a 256 bit key. This key may be entered either as a string of 64
hexadecimal digits, or as a passphrase of 8 to 63 printable ASCII characters.[10] If ASCII characters are
used, the 256 bit key is calculated by applying the PBKDF2 key derivation function to the passphrase,
using the SSID as the salt and 4096 iterations of HMAC-SHA1.[11] WPA-Personal mode is available
with both WPA and WPA2.
• WPA-Enterprise. Also referred to as WPA-802.1X mode, and sometimes just WPA (as opposed to
WPA-PSK), this is designed for enterprise networks and requires a RADIUS authentication server. This
requires a more complicated setup, but provides additional security (e.g. protection against dictionary
attacks on short passwords). Various kinds of the Extensible Authentication Protocol (EAP) are used
for authentication. WPA-Enterprise mode is available with both WPA and WPA2.
• Wi-Fi Protected Setup (WPS). This is an alternative authentication key distribution method intended
to simplify and strengthen the process, but which, as widely implemented, creates a major security
hole via WPS PIN recovery.
Unix
• https://www.ics.uci.edu/computing/linux/file-security.php
• https://en.wikipedia.org/wiki/File_system_permissions#Notation_of_traditional_Unix_permissions
Set-user Identification (SUID): When a command or script with SUID bit set is run, its effective UID becomes
that of the owner of the file, rather than of the user who is running it (non-root user executes script with UID
root is executed as root).The SUID permission symbol is s for the owner.
Set-group identification (SGID): When a file with SGID is executed, the resulting process will assume the group
ID given to the group class. When SGID permission is set on a directory, files created in the directory belong to
the group of which the directory is a member. The GUID permission symbol is s for the group.
sticky bit: Sticky Bit is used for directories to protect files within them. Files in a directory with the sticky bit set
can only be deleted or renamed by the root user or the owner of the directory. The sticky bit permission
symbol is t.
Examples:
• icacls c:\windows\* /save AclFile /T
- Will save the ACLs for all files under c:\windows and its subdirectories to AclFile.
• Show ACL of a single file. All three users have full access (F)
PS C:\Users\Sven\Desktop> icacls.exe .\README.txt
.\README.txt NT AUTHORITY\SYSTEM:(F)
BUILTIN\Administrators:(F)
WIN8\Sven:(F)
Successfully processed 1 files; Failed processing 0 files
Specific rights:
D (delete)
RC (read control)
WDAC (write DAC), Microsoft Dynamic Access Control (DAC) is a data governance tool in Windows Server 2012
that lets administrators control access settings.
WO (write owner)
S (synchronize)
AS (access system security)
MA (maximum allowed)
GR (generic read)
GW (generic write)
GE (generic execute)
GA (generic all)
RD (read data/list directory)
WD (write data/add file)
AD (append data/add subdirectory)
REA (read extended attributes)
WEA (write extended attributes)
X (execute/traverse)
DC (delete child)
RA (read attributes)
WA (write attributes)
Inheritance rights may precede either Perm form, and they are applied only to directories:
(OI): object inherit
(CI): container inherit
(IO): inherit only
(NP): do not propagate inherit
Registry:
Unix
# netstat -tulpen (Linux)
# lsof (Solaris)
➜ ~ whois vantagepoint.sg
----------------------------------------------------------------------
SGNIC WHOIS Server
----------------------------------------------------------------------
The following data is provided for information purposes only.
Registrar: INSTRA CORPORATION PTY. LTD.
Domain Name: VANTAGEPOINT.SG
Creation Date: 26-Feb-2014 04:43:30
Modified Date: 20-Mar-2014 08:31:04
Expiration Date: 26-Feb-2018 04:43:30
Domain Status: OK
Domain Status: VerifiedID@SG-Mandatory
Domain Status: VerifiedID@SG-OK (VERIFIED BY ADMIN CONTACT)
Registrant:
Name: VANTAGE POINT SECURITY PTE. LTD. (SGNIC-ORG1350730)
Administrative Contact:
Name: JACQUELINE LOW (SGNIC-PER20054416)
Technical Contact:
Name: VANTAGE POINT SECURITY PTE. LTD. (SGNIC-ORG1350731)
Email: [email protected]
Name Servers:
NS1.INSTRADNS.COM
NS2.INSTRADNS.COM
NS3.INSTRADNS.COM
DNSSEC:
unsigned
A basic DNS Zone Transfer Attack isn't very fancy: you just pretend you are a slave and ask the master for a
copy of the zone records. And it sends you them.
• Successful Zone Transfer:
o dig @ns1.sedoparking.comavhackers.com avhackers.com axfr
o dig @server domain axfr
Zone DNS database is a collection of resource records and each of the records provides information about a
specific object. A list of most common records is provided below:
• SRV Record (SRV)
A Service record (SRV record) is a specification of data in the Domain Name System defining the
location, i.e. the hostname and port number, of servers for specified services.
An example SRV record in textual form that might be found in a zone file might be the following:
This can prove convenient when running multiple services (like an FTP server and a webserver; each running
on different ports) from a single IP address. One can, for example, point ftp.example.com and
www.example.com to the DNS entry for example.com, which in turn has an A record which points to the IP
address. Then, if the IP address ever changes, one only has to record the change in one place within the
network: in the DNS A record for example.com.
CNAME records must always point to another domain name, never directly to an IP address.
Example:
msn.com MX preference = 5, mail exchanger = mx2.hotmail.com
msn.com MX preference = 5, mail exchanger = mx3.hotmail.com
msn.com MX preference = 5, mail exchanger = mx4.hotmail.com
msn.com MX preference = 5, mail exchanger = mx1.hotmail.com
3) Networking Equipment
Weaknesses
• Telnet Weaknesses:
o Not encrypted (plaintext communication), this means username and password are also sent
unencrypted during login
o exploits available in metasploit
o Brute force attacks
▪ hydra -l admin -P passlist.txt 192.168.0.7 telnet
• Web based Protocols Weaknesses
o If HTTP is used its plaintext communication, this means username and password are also sent
unencrypted during login
o All weaknesses in OWASP Top 10...
o Brute force attacks by using Burp intruder
• SSH Weaknesses
o Password authentication is prone to brute force attacks
▪ hydra -l admin -P passlist.txt 192.168.0.7 ssh
o exploits available in metasploit
• SNMP Weaknesses
o default values are used for community strings (public/private)
o SNMPv1 and version 2 are not encrypted, only version 3 supports encryption
o tools:
▪ snmpcheck -t 10.16.108.41 -c public
▪ snmpwalk -v1 -c public 10.10.1.224
• TFTP Weaknesses
o TFTP includes no login or access control mechanisms. Care must be taken when using TFTP
for file transfers where authentication, access control, confidentiality, or integrity checking
are needed. Note that those security services could be supplied above or below the layer at
which TFTP runs. Care must also be taken in the rights granted to a TFTP server process so as
not to violate the security of the server's file system. TFTP is often installed with controls
such that only files that have public read access are available via TFTP. Also listing, deleting,
renaming, and writing files via TFTP are typically disallowed. TFTP file transfers are NOT
RECOMMENDED where the inherent protocol limitations could raise insurmountable liability
concerns
Network Sniffer:
In general, for network sniffers there is:
• <capture filter> packet filter in libpcap filter syntax. This is used to filter data that is saved into a pcap
or written to console, e.g.
o port 80 or port 443 and not arp (filter 80, 443 and skip ARP)
o host 192.168.0.1 (filter only for packets that are sent from or to this host)
o dst host 192.168.1.1 and (dst port 80 or dst port 443) (Capture any packets with destination
IP 192.168.1.1 and destination port 80 or 443)
• <read filter> packet Read filter in Wireshark display filter syntax. This is used to filter data that is read
from a pcap, e.g.
o ip.addr==192.168.0.1 // show only packets that are sent from or to this IP
o tcp.port eq 25 or icmp // show only port 25 and ICMP packets
Tools:
• Wireshark
• tshark
o http://www.codealias.info/technotes/the_tshark_capture_and_filter_example_page
o https://hackertarget.com/tshark-tutorial-and-filter-examples/
▪ Write all packets to a file called test.pcap and apply a packet filter for ports 80 and
443 on interface en0. (-P will still show the output on the console even though all is
written to test.pcap)
▪ tshark -w test.pcap -f "port 80 or port 443" -i en0 -P // libpcap filter syntax
▪ Read test.pcap and apply a read filter to only show the IP address 192.168.0.101
▪ tshark -r test.pcap -Y "ip.addr==192.168.0.101" // Wireshark display filter
• Ettercap
o Man in the middle attack
o It is capable of intercepting traffic on a network segment, capturing passwords, and
conducting active eavesdropping against a number of common protocols.
MAC Flooding. Since switches are responsible for setting up the virtual circuits from one node to another, they
must keep a translation table that tracks which addresses (specifically, which MAC addresses) are on which
physical port. The amount of memory for this translation table is limited. This fact sometimes allows the switch
to be exploited by flooding the translation table. Primitive switches, not knowing how to handle the excess
data, will 'fail open'. That is, it will revert to a hub and will broadcast all network frames to all ports. At this
point generic network sniffers will work.
MAC Duplicating. It's not difficult to imagine that, since all frames on the network are routed based on their
MAC address, that the ability to impersonate another host would work to our advantage. That's just what MAC
duplicating does. You reconfigure Node B to have the same MAC address as the machine whose traffic you're
trying to sniff. This differs from ARP Spoofing because, in ARP Spoofing, we are 'confusing' the host by
poisoning it's ARP cache. In a MAC Duplicating attack, we actually confuse the switch itself into thinking two
ports have the same MAC address. Since the data will be forwarded to both ports, no IP forwarding is
necessary.
Unauthorized DHCP Clients: A client could be set up that masquerades as a legitimate DHCP client and thereby
obtain configuration information intended for that client; this could then be used to compromise the network
later on. Alternately, a “bad guy” could use software to generate lots of bogus DHCP client requests to use up
all the IP addresses in a DHCP server's pool. More simply, this could be used by a thief to steal an IP address
from an organization for his own use.
Attacker can easily use Wireshark or other networking analyzer software to sniff information about devices
that CDP is sending across the network in a broadcast messages. The Cisco IOS software version discovered via
CDP, in particular, would allow the attacker to research and determine whether there were any security
vulnerabilities specific to that particular version of code. Also, because CDP is unauthenticated, an attacker
could craft bogus CDP packets and have them received by the attacker’s directly connected Cisco device. If the
attacker can get access to the router either via Telnet or SNMP, they can use the CDP information to discover
the entire topology of your network at Layer 2 and 3, including all IOS levels, router and switch model types,
and IP addressing. If somebody was armed with this information and a Cisco bug list, they could launch a very
effective attack against your network.
According to the HSRP RFC, the protocol is not a secure protocol, and is therefore susceptible to Man in the
Middle (MitM) attacks.
A host within the same subnet could just spoof VRRP packets and disrupt service.
An attack on VRRP is not just theoretical. A tool called Loki allows you to take over the virtual IP-address and
become the master router. This will allow you to create a DoS or sniff all traffic.
D4) IPSec
Tool:
ipsecscan (ipsecscan is a Win32 command-line utility that can identify IPsec enabled devices and hosts; it's
available at http://ntsecurity.nu/toolbox/ipsecscan/.[1])
D5) VOIP
SIPS is the secure SIP protocol that offers also TLS encryption.
SIP is on port 5060
SIPS is on port 5061
D6) Wireless
A client can use two scanning methods: active and passive. During an active scan, the client radio transmits a
probe request and listens for a probe response from an AP. With a passive scan, the client radio listens on each
channel for beacons sent periodically by an AP. A passive scan generally takes more time, since the client must
listen and wait for a beacon versus actively probing to find an AP. Another limitation with a passive scan is that
if the client does not wait long enough on a channel, then the client may miss an AP beacon.
Tools:
Wireshark
Kismet
Cisco LEAP, similar to WEP, has had well-known security weaknesses since 2003 involving offline password
cracking.
802.1X clients and servers developed by specific firms may support other EAP types. This certification is an
attempt for popular EAP types to interoperate; their failure to do so as of 2013 is one of the major issues
preventing rollout of 802.1X on heterogeneous networks.
PEAP was jointly developed by Cisco Systems, Microsoft, and RSA Security.
(Optional) Cisco-proprietary algorithm used to encrypt the password. Currently the only
encryption-
encryption type available is 5. If you specify encryption-type, the next argument you supply
type
must be an encrypted password (a password already encrypted by a Cisco router).
encrypted-
Encrypted password you enter, copied from another router configuration.
password
Enable Secret
To create a new privilege level and associate commands with that privilege level, use the following commands
in beginning in global configuration mode:
Sets the password for the specified privilege level. This is the
password users will enter after entering the enable level command
Router(config)# enable secret
to access the specified level.
level level {0 |5} password-string
• 0 indicates an unencrypted password string follows; 5 indicates
an encrypted password string follows.
Syntax Description
(Optional) Level for which the password applies. You can specify up to sixteen privilege levels,
using numbers 0 through 15. Level 1 is normal EXEC-mode user privileges. If this argument is
level level
not specified in the command or in the no form of the command, the privilege level defaults
to 15 (traditional enable privileges). The same holds true for the no form of the command.
Password for users to enter enable mode. This password should be different from the
password
password created with the enable password command.
(Optional) Cisco-proprietary algorithm used to encrypt the password. Currently the only
encryption- encryption type available for this command is 5. If you specify encryption-type, the next
type argument you supply must be an encrypted password (a password encrypted by a Cisco
router).
encrypted-
Encrypted password you enter, copied from another router configuration.
password
4) Microsoft Windows Security Assessment
E1) Domain Reconnaissance
• The Domain Master Browser is necessary on a routed TCP/IP network, that is, when a Windows
domain spans more than one TCP/IP network. When a Windows domain spans multiple subnets each
of the subnets has an independent browser called the Master Browser. The Master Browser is
responsible for the browse list within its respective subnet and portion of the domain on its subnet.
Locally on Windows:
• Check locally on a Windows Server/Client. This will list both Local and Global groups that user belongs
to.
o net user <userName> /domain
Remote:
• Identify the "Master "Browser" on a Windows Machine
o nbtstat -A COMPUTER-NAME
o The numeric values are called suffixes.For example the <01> and <1D> suffixes indicates the
Master Browser,the <20> that the machine is running File Server service,the <03> that a
messenger service is running and the <00> means that a workstation service is running as
well.The <1E> is the Browser Service Elections.
• Scan with nbtscan on Kali. The nbtscan is a netbios nameserver scanner which has the same functions
as nbtstat but it operates on a range of addresses instead of one.
o nbtscan 192.168.0.1-254
o As we can see from the image above we have discovered the IP addresses,the NetBIOS
names,the users that are logged in and the MAC addresses from the hosts that are running
the NetBIOS service on the network.
o With the verbose option the output format is similar to the nbtstat. Again the <01> indicates
the Master Browser service,the <00> the workstation,the <20> the File Server service and
the <1e> and <1d> the Browser Service Elections and the Master Browser.Also we can see
that the domain that this workstation belongs is London.
MSBROWSE
o
• Mount share:
o mount -t cifs //servername/foldername /localmountpoint -o
username=myusername,password=mypassword
By using Windows:
• To see a list of shares on a remote computer
o NET VIEW \\ComputerName
• To see a list of all shares in the domain:
o NET VIEW /DOMAIN
• To see a list of shares on a different domain
o NET VIEW /DOMAIN:domain name
• Mount share:
o net use z: \\<IP>\share password /user:Domain\user
• net share
NetBIOS
• Enumerates NetBIOS information on host 192.168.1.1 as the null user.
o nbtenum -q 192.168.1.1
• Scan with nbtscan on Kali. The nbtscan is a netbios nameserver scanner which has the same functions
as nbtstat but it operates on a range of addresses instead of one.
o nbtscan 192.168.0.1-254
o As we can see from the image above we have discovered the IP addresses,the NetBIOS
names,the users that are logged in and the MAC addresses from the hosts that are running
the NetBIOS service on the network.
o With the verbose option the output format is similar to the nbtstat. Again the <01> indicates
the Master Browser service,the <00> the workstation,the <20> the File Server service and
the <1e> and <1d> the Browser Service Elections and the Master Browser.Also we can see
that the domain that this workstation belongs is London.
SNMP
• msf > use auxiliary/scanner/snmp/snmp_enumusers
• snmpwalk
o snmpwalk -c public -v 2c <IP>
• snmpcheck
o snmpcheck -t <IP> -c public
LDAP
• ldapsearch can be done by using jxplorer (GUI tool)
• Query ldap by using nmap:
o nmap -p 389 --script ldap-search --script-args
'ldap.username="cn=ldaptest,cn=users,dc=cqure,dc=net",ldap.password=ldaptest,ldap.qfilte
r=users,ldap.attrib=sAMAccountName' <host>
Within a deployment, objects are grouped into domains. The objects for a single domain are stored in a single
database (which can be replicated). Domains are identified by their DNS name structure, the namespace.
A domain is defined as a logical group of network objects (computers, users, devices) that share the same
Active Directory database.
A tree is a collection of one or more domains and domain trees in a contiguous namespace, linked in a
transitive trust hierarchy.
At the top of the structure is the forest. A forest is a collection of trees that share a common global catalog,
directory schema, logical structure, and directory configuration. The forest represents the security boundary
within which users, computers, groups, and other objects are accessible.
Both the hashes produce 16-byte quantities. Five bytes of zeros are appended to obtain 21 bytes. The
21 bytes are separated in three 7-byte (56-bit) quantities. Each of these 56-bit quantities is used as a
key to DES encrypt the 64 bit challenge. The three encryptions of the challenge are reunited to form
the 24-byte response. Both the response using the LM hash and the NT hash are returned as the
response, but this is configurable.
• NTLMv2
NTLMv2, introduced in Windows NT 4.0 SP4,[13] is a challenge-response authentication protocol. It is
intended as a cryptographically strengthened replacement for NTLMv1.
NTLM version 2 (NTLMv2), which was introduced in Windows NT 4.0 SP4 (and natively supported in
Windows 2000), enhances NTLM security by hardening the protocol against many spoofing attacks,
and adding the ability for a server to authenticate to the client.[1][14][15]
NTLMv2 sends two responses to an 8-byte server challenge. Each response contains a 16-byte HMAC-
MD5 hash of the server challenge, a fully/partially randomly generated client challenge, and an
HMAC-MD5 hash of the user's password and other identifying information. The two responses differ
in the format of the client challenge. The shorter response uses an 8-byte random value for this
challenge. In order to verify the response, the server must receive as part of the response the client
challenge. For this shorter response, the 8-byte client challenge appended to the 16-byte response
makes a 24-byte package which is consistent with the 24-byte response format of the previous
NTLMv1 protocol. In certain non-official documentation (e.g. DCE/RPC Over SMB, Leighton) this
response is termed LMv2.
The second response sent by NTLMv2 uses a variable length client challenge which includes (1) the
current time in NT Time format, (2) an 8-byte random value (CC2 in the box below), (3) the domain
name and (4) some standard format stuff. The response must include a copy of this client challenge,
and is therefore variable length. In non-official documentation, this response is termed NTv2.
Both LMv2 and NTv2 hash the client and server challenge with the NT hash of the user's password
and other identifying information. The exact formula is to begin with the NT Hash, which is stored in
the SAM or AD, and continue to hash in, using HMAC-MD5, the username and domain name. In the
box below, X stands for the fixed contents of a formatting field.
NTLM remains vulnerable to the pass the hash attack, which is a variant on the reflection attack which was
addressed by Microsoft security update MS08-068. For example, Metasploit can be used in many cases to
obtain credentials from one machine which can be used to gain control of another machine.[3][25] The
Squirtle toolkit can be used to leverage web site cross-site scripting attacks into attacks on nearby assets via
NTLM.[26]
In February 2010, Amplia Security discovered several flaws in the Windows implementation of the NTLM
authentication mechanism which broke the security of the protocol allowing attackers to gain read/write
access to files and remote code execution. One of the attacks presented included the ability to predict pseudo-
random numbers and challenges/responses generated by the protocol. These flaws had been present in all
versions of Windows for 17 years. The security advisory explaining these issues included fully working proof-of-
concept exploits. All these flaws were fixed by MS10-012.[27][28]
In 2012, it was demonstrated that every possible 8-character NTLM password hash permutation can be
cracked in under 6 hours.[29]
E8) Exchange
rusers
The rusers command produces output similar to who, but for the list of hosts or all machines on the local
network. For each host responding to the rusers query, the hostname logged on is printed on each line. The
rusers command will wait for one minute to catch late responders.
The rusersd daemon is a server that responds to queries from the rusers command by returning a list of users
currently on the network. This daemon is normally started by the inetd daemon.
> rusers -a
rwho
The rwho command produces output similar to who, but for all machines on the local network. If no report has
been received from a machine for 11 minutes then rwho assumes the machine is down, and does not report
users last known to be logged into that machine.
> rwho -a
Rwhod is the server which maintains the database used by the rwho(1) and ruptime(1) programs.
Username guessing tool primarily for use against the default Solaris SMTP service. Can use either EXPN, VRFY
or RCPT.
> smtp-user-enum.pl -M VRFY -U smtp_users.txt -t <IP>
finger
Finger may be used to look up users on a remote machine. The format is to specify a user as “user@host”, or
“@host”
Attempts to retrieve a list of usernames using the finger service.
> nmap -sV -sC <IP>
For understanding how this entire thing works, let's take the case of the previously shown example entry for
root user, from /etc/shadow file.
From the above shown example entry, our topic of interest is the second field(the field with the encoded hash
of the password).
$1$Etg2ExUZ$F9NTP7omafhKIlqaBMqng1
The above shown encoded hash value can be further classified into three different fields as below.
1. The first field is a numerical number that tell's you the hashing algorithm that's being used.
• $1 = MD5 hashing algorithm.
• $2 =Blowfish Algorithm is in use.
• $2a=eksblowfish Algorithm
• $5 =SHA-256 Algorithm
• $6 =SHA-512 Algorithm
2. The second field is the salt value
Salt value is nothing but a random data that's generated to combine with the original password, inorder to
increase the strength of the hash.
3.The last field is the hash value of salt+user password (we will be discussing this shortly).
The above shown encoded password is using MD5 hashing algorithm (because the of $1$)
Salt value is Etg2ExUZ (the content between the second and third $ sign)
And the hash value of "PASSWORD + SALT".
Post Exploitation
Exfiltrate Password Hashes:
• Downloading files (/etc/passwdand /etc/shadow) throughmeterpretershell
• Get files (/etc/passwdand /etc/shadow) through path traversal
• Get hashes through SQL injection
F3) FTP
Also enable a strong password policy and define a threshold for failed login attempts so brute forcing of
accounts is not possible.
Anonymous access to FTP servers
Anonymous access is often enabled by default in FTP servers and should be disabled on production systems if
not needed. Username should be "anonymous" and password the mail address (which can be any random
string also).
% ftp naic.nasa.gov
Connected to naic.nasa.gov.
220 naic.nasa.gov FTP server (Wed May 4 12:15:15 PDT 1994) ready.
Name (naic.nasa.gov:amarine): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230-----------------------------------------------------------------
230-Welcome to the NASA Network Applications and Info Center Archive
230-
Mail relaying
Check with Nmap:
nmap --script smtp-open-relay.nse -p 25,465,587 <host>
Arguments: [--script-args smtp-open-relay.domain=<domain>,smtp-open-relay.ip=<address>,...]
Metasploit:
msf > use auxiliary/scanner/smtp/smtp_relay
msf auxiliary(smtp_relay) > show actions
...actions...
msf auxiliary(smtp_relay) > set ACTION <action-name>
msf auxiliary(smtp_relay) > show options
...show and set options...
msf auxiliary(smtp_relay) > run
Manual open relay test.:
nc <Host> <SMTP Port, e.g. 25>
HELO local.domain.name
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
Subject: your subject line here
Hello world! I am the test email.
.
QUIT
http://www.tldp.org/HOWTO/NFS-HOWTO/security.html
NFS security: host level (exports restricted to particular hosts) and file level (by UID and GID).
Configuration is done in /etc/exports (also /etc/hosts.deny and /etc/hosts.alllow). This file lists the names or IP
addresses for machines that are allowed to access a share point. If the client'sipaddress matches one of the
entries in the access list then it will be allowed to mount.
IMPORTANT: Do not put anything but IP NUMBERS in the portmap lines of these files. Host name lookups can
indirectly cause portmap activity which will trigger host name lookups which can indirectly cause portmap
activity which will trigger...
The second step is file access. This is a function of normal file system access controls on the client and not a
specialized function of NFS. Once the drive is mounted the user and group permissions on the files determine
access control.
On the client we can decide that we don't want to trust the server too much a couple of ways with options to
mount. For example, we can forbid suid programs to work off the NFS file system with the nosuid option.
Some unix programs, such as passwd, are called "suid" programs: They set the id of the person running them
to whomever is the owner of the file. If a file is owned by root and is suid, then the program will execute as
root, so that they can perform operations (such as writing to the password file) that only root is allowed to do.
Using the nosuid option is a good idea and you should consider using this with all NFS mounted disks. It means
that the server's root user cannot make a suid-root program on the file system, log in to the client as a normal
user and then use the suid-root program to become root on the client too. One could also forbid execution of
files on the mounted file system altogether with the no exec option. But this is more likely to be impractical
than nosuid since a file system is likely to at least contain some scripts or programs that need to be executed.
See also File System Permissions - Unix.
F6) R* services
http://manpages.ubuntu.com/manpages/trusty/man5/hosts.equiv.5.html
The hosts.equiv file allows or denies hosts and users to use the r-
commands (e.g., rlogin, rsh or rcp) without supplying a password.
[ + | - ] [hostname] [username]
The .rhosts file is in the user home directory under Unix and contains a list of username and IP address or
machine hostname pairs, such as the following:
# pwd
/home/chris
# cat .rhosts
chris mail.trustmatta.com
+ 192.168.0.55
In this example, I can use any of the r-services (rsh, rlogin, or rexec) to connect to this host from
mail.trustmatta.com if I am logged into the host as chris or from 192.168.0.55 with any username on that host.
When a user connects to the host running rshd(the remote shell daemon running on TCP port 514), the source
IP address is cross-referenced against the .rhosts file, and the username is verified by querying the identd
service running at the source. If these details are valid, direct access is given to the host without even requiring
a password.
Rlogin:
F7) X11
Most Ubuntu Server developers recommend not installing a GUI on a server. There are multiple reasons for
not installing a GUI.
Cookie-based access[edit]
The cookie-based authorization methods are based on choosing a magic cookie (an arbitrary piece of data) and
passing it to the X display server when it is started; every client that can prove having knowledge of this cookie
is then authorized connection to the server.
These cookies are created by a separate program and stored in the file .Xauthority in the user's home
directory, by default. As a result, every program run by the client on the local computer can access this file and
therefore the cookie that is necessary for being authorized by the server. If the user wants to run a program
from another computer on the network, the cookie has to be copied to that other computer. How the cookie is
copied is a system-dependent issue: for example, on Unix-like platforms, scp can be used to copy the cookie.
The two systems using this method are MIT-MAGIC-COOKIE-1 and XDM-AUTHORIZATION-1. In the first
method, the client simply sends the cookie when requested to authenticate. In the second method, a secret
key is also stored in the .Xauthority file. The client creates a string by concatenating the current time, a
transport-dependent identifier, and thecookie, encrypts the resultingstring, and sends it to the server.
User-based access[edit]
The user-based access methods work by authorizing specific users to connect to the server. When a client
establishes a connection to a server, it has to prove being controlled by an authorized user.
The two methods based on authenticating users using networked identity management systems are SUN-DES-
1 andMIT-KERBEROS-5. The first system is based on a secure mechanism of the ONC remote procedure
call system developed in SunOS. The second mechanism is based on both client and server trusting
a Kerberos server.
A third method is limited to local connections, using system calls to ask the kernel what user is on the other
end of a local socket. The xhost program can be used to add or remove localuser and localgroup entries with
this method.[1]
The RPC program identification probes are done in parallel, and retransmissions are handledforUDP ports. This
feature is automatically activated whenever version detection finds any RPC ports. Example 7.6 demonstrates
direct RPC scanning done as part of version detection.
Securing SSH
See http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html
• Only Use SSH Protocol 2
• Limit Users’ SSH Access (AllowUsers directive)
• Configure Idle Log Out Timeout Interval
• Disable .rhosts Files
• Disable Host-Based Authentication
• Disable root Login via SSH
• Enable a Warning Banner
• Use Public Key Based Authentication
• Chroot SSHD (Lock Down Users To Their Home Directories)
• Disable Empty Passwords
• Thwart SSH Crackers (Brute Force Attack) by using tools like fail2ban
• Use Log Analyzer
• Patch OpenSSH and Operating Systems
SSH2 is standardized by IETF, and as such its implementation is widely deployed and accepted in the industry.
Due to SSH2's popularity and cryptographic superiority over SSH1, many products are dropping support for
SSH1. As of this writing, OpenSSH still supports both SSH1 and SSH2, while on all modern Linux distributions,
OpenSSH server comes with SSH1 disabled by default.
3 layers of architecture
• Web Server
• Application Server
• Database Server
https://www.cvedetails.com/vulnerability-list/vendor_id-26/product_id-3436/Microsoft-IIS.html
http://blog.trendmicro.com/trendlabs-security-intelligence/iis-at-risk-the-http-protocol-stack-vulnerability/
Apache
There are still two major branches:
• Apache 2.2
• Apache 2.4
Three-tier architecture:
• Presentation tier This is the topmost level of the application. The presentation tier displays
information related to such services as browsing merchandise, purchasing and shopping cart
contents. It communicates with other tiers by which it puts out the results to the browser/client tier
and all other tiers in the network. In simple terms, it is a layer which users can access directly (such as
a web page, or an operating system's GUI).
• Application tier (business logic, logic tier, or middle tier) The logical tier is pulled out from the
presentation tier and, as its own layer, it controls an application’s functionality by performing detailed
processing.
• Data tier The data tier includes the data persistence mechanisms (database servers, file shares, etc.)
and the data access layer that encapsulates the persistence mechanisms and exposes the data. The
data access layer should provide an API to the application tier that exposes methods of managing the
stored data without exposing or creating dependencies on the data storage mechanisms. Avoiding
dependencies on the storage mechanisms allows for updates or changes without the application tier
clients being affected by or even aware of the change. As with the separation of any tier, there are
costs for implementation and often costs to performance in exchange for improved scalability and
maintainability.
Logical layers are merely a way of organizing your code. Typical layers include Presentation, Business and Data
– the same as the traditional 3-tier model. But when we’re talking about layers, we’re only talking about logical
organization of code. In no way is it implied that these layers might run on different computers or in different
processes on a single computer or even in a single process on a single computer. All we are doing is discussing
a way of organizing a code into a set of layers defined by specific function.
Physical tiers however, are only about where the code runs. Specifically, tiers are places where layers are
deployed and where layers run. In other words, tiers are the physical deployment of layers.
MVC
Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces on
computers. It divides a given software application into three interconnected parts, so as to separate internal
representations of information from the ways that information is presented to or accepted from the
user.[1][2]
Traditionally used for desktop graphical user interfaces (GUIs), this architecture has become popular for
designing web applications.
HTTP
Unencrypted
HTTPS
Encrypted
SOAP
SOAP (Simple Object Access Protocol) is a protocol specification for exchanging structured information in the
implementation of web services in computer networks. SOAP allows processes running on disparate operating
systems (such as Windows and Linux) to communicate using Extensible Markup Language (XML).
SOAP provides the Messaging Protocol layer of a web services protocol stack for web services. It is XML-based
protocol consisting of three parts:
• an envelope, which defines the message structure and how to process it
• a set of encoding rules for expressing instances of application-defined datatypes
• a convention for representing procedure calls and responses
Example:
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetStockPrice xmlns:m="http://www.example.org/stock/Surya">
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
HEAD
The HEAD method asks for a response identical to that of a GET request, but without the response body. This is
useful for retrieving meta-information written in response headers, without having to transport the entire
content.
POST
The POST method requests that the server accept the entity enclosed in the request as a new subordinate of
the web resource identified by the URI. The data POSTed might be, for example, an annotation for existing
resources; a message for a bulletin board, newsgroup, mailing list, or comment thread; a block of data that is
the result of submitting a web form to a data-handling process; or an item to add to a database.[14]
PUT
The PUT method requests that the enclosed entity be stored under the supplied URI. If the URI refers to an
already existing resource, it is modified; if the URI does not point to an existing resource, then the server can
create the resource with that URI.[15]
DELETE
The DELETE method deletes the specified resource.
TRACE
The TRACE method echoes the received request so that a client can see what (if any) changes or additions
have been made by intermediate servers.
OPTIONS
The OPTIONS method returns the HTTP methods that the server supports for the specified URL. This can be
used to check the functionality of a web server by requesting '*' instead of a specific resource.
CONNECT
[16] The CONNECT method converts the request connection to a transparent TCP/IP tunnel, usually to
facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy.[17][18] See HTTP
CONNECT tunneling.
PATCH
The PATCH method applies partial modifications to a resource.[19]
All general-purpose HTTP servers are required to implement at least the GET and HEAD methods,[20] and,
whenever possible, also the OPTIONS method.
Response Codes
1xx Informational
• 100 Continue, The server has received the request headers and the client should proceed to send the
request body
• 101 Switching Protocols, e.g. when switching from HTTP to HTTP2
2xx Success
• 200 OK, Standard response for successful HTTP requests.
3xx Redirection
• 301 Moved Permanently, This and all future requests should be directed to the given URI.
• 302 Found, This is an example of industry practice contradicting the standard. The HTTP/1.0
specification (RFC 1945) required the client to perform a temporary redirect (the original describing
phrase was "Moved Temporarily"),[21] but popular browsers implemented 302 with the functionality
of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the
two behaviours.[22] However, some Web applications and frameworks use the 302 status code as if it
were the 303
• 303 See Other
• 304 Not Modified
White listing allows a certain character set (e.g. only numbers for a parameter called ID) and denies everything
else.
Black listing denies certain character sets (e.g. forbids some special characters like < or >) and allows
everything else.
Data sanitisation is filtering/validating the input/data before it is being used within an application by escaping
special characters (e.g. < is replaced with <). Can for example be achieved in PHP by setting
filter.default="special_chars" in php.ini. When using the function filter_input all data is sanitised and special
characters cannot be rendered by the browser anymore.
Command:
EXEC xp_cmdshell 'dir *.exe';
By default, the xp_cmdshell option is disabled since Microsoft SQL Server 2005. Before it was enabled by
default.
The following useful stored procedures are found in Microsoft SQL Server:
• xp_cmdshell
• sp_makewebtask
• xp_regread
H12) Encryption
Encrypting data in transit:
• Sent data by using an encrypted channel (HTTPS, FTPS, SSH) between client and server.
• Encrypt data before data is being sent (by using Symmetric Encryption like AES, or Asymmetric like
PGP)
Source Code Review is checking for bad practices/known vulnerabilities on the source code level (e.g. using
concatenated strings for SQL queries instead of prepared statements or wrongly implemented encryption)
Automated approach:
• Static application security testing (SAST) is a set of technologies designed to analyze application
source code, byte code and binaries for coding and design conditions that are indicative of security
vulnerabilities. SAST solutions analyze an application from the “inside out” in a nonrunning state.
• Dynamic Application Security Testing (DAST) technologies are designed to detect conditions
indicative of a security vulnerability in an application in its running state. Most DAST solutions test
only the exposed HTTP and HTML interfaces of Web-enabled applications; however, some solutions
are designed specifically for non-Web protocol and data malformation (for example, remote
procedure call, Session Initiation Protocol [SIP] and so on).
8) Database
Attack Vector
Recon with Nmap to identify Service Pack Level and version.
Brute Forcing DB accounts (Hydra)
Privilege Escalation
Credentials are needed and set, then metasploit can check for security issues.
msf> use auxiliary/admin/mssql/mssql_enum
msf> run
Derivation of version and patch information from hosts running Oracle software.
Version information:
SELECT * FROM v$version;
This query would output something like this:
Banner
--------------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
ORD_SERVER ODS
WKADMIN WKADMIN
WKUSER WKUSER
WKSYS WKSYS
SCOTT TIGER
SYSTEM MANAGER
DBSNMP DBSNMP
SYS CHANGE_ON_INSTALL
OUTLN OUTLN
MDSYS MDSYS
CTXSYS CTXSYS
ORDSYS ORDSYS
ANONYMOUS ANONYMOUS
ADO.NET is a data access technology from the Microsoft .NET Framework which provides communication
between relational and non-relational systems through a common set of components.ADO.NET is a set of
computer software components that programmers can use to access data and data services from the
database.
OLE DB (Object Linking and Embedding, Database, sometimes written as OLEDB or OLE-DB)
Is an API designed by Microsoft, allows accessing data from a variety of sources in a uniform manner. The API
provides a set of interfaces implemented using the Component Object Model (COM); it is otherwise unrelated
to OLE.
This vulnerability is very simple to exploit, since it does not require any code to be compiled by an attacker.
The vulnerability only requires the attacker to simply define the environment variable TTYPROMPT to a 6-
character string, inside telnet. Jonathan believes this overflows an integer inside login, which specifies whether
the user has been authenticated (just a guess).
Once connected to the remote host, you must type the username, followed by 64 " c"s, and a literal "\n". You
will then be logged in as the user without any password authentication. This should work with any account
except root (unless remote root login is allowed).
Example:
coma% telnet
telnet> environ define TTYPROMPT abcdef
telnet> o localhost
SunOS 5.8
bin c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c\n
Last login: whenever
$ whoami bin
What tool is used to trace files an executable has accessed to when it is run in Linux?
/usr/bin/strace