Dr. Greg Bernstein
April 1st, 2021
Social Engineering: methods for collecting information to deceive a person or convincing him/her to behave in a desired manner.
Internet Intelligence: methods taking advantage of information publicly available in the Internet including databases accessible via the Web.
Network Information Gathering: methods for mapping the network (or computing) infrastructure of the victim.
Side-Channels: It groups methods exploiting unintended information leaked by the victim.
Derived from Wikipedia: OSINT
Open-source intelligence (OSINT) is the collection and analysis of information that is gathered from public, or open, sources. In the intelligence community, the term “open” refers to overt, publicly available sources (as opposed to covert or clandestine sources).
Derived from Wikipedia: OSINT
OSINT under one name or another has been around for hundreds of years. With the advent of instant communications and rapid information transfer, a great deal of actionable and predictive intelligence can now be obtained from public, unclassified sources. It is not related to open-source software.
Derived from Wikipedia: OSINT
Media, print newspapers, magazines, radio, and television from across and between countries.
Internet, online publications, blogs, discussion groups, citizen media, YouTube, and other social media websites.
Public Government Data, public government reports, budgets, hearings, telephone directories, press conferences, websites, and speeches.
Derived from Wikipedia: OSINT
Professional and Academic Publications, information acquired from journals, conferences, symposia, academic papers, dissertations, and theses.
Commercial Data, commercial imagery, financial and industrial assessments, and databases. Notes: this includes all types of fee based credit reporting and background check services.
Grey literature, technical reports, preprints, patents, working papers, business documents, unpublished works, and newsletters.
Domains and IP addresses: www.arin.net, whois.icann.org
Internet scanners/databases: censys.io, www.shodan.io, www.zoomeye.org
General Repository of OSINT tools: OSINT Framework
Censys started as an open source scanning and data processing tool called ZMAP, founded at the University of Michigan, with the mission of creating a public searchable database for the internet. Our team consists of industry veterans with expert Internet telemetry experience, delivering the most comprehensive internet scan data product and internet asset inventory in the market.
From ZoomEye About
ZoomEye is the leader of global cyberspace mapping, China’s first and world-renowned cyberspace search engine driven by 404 Laboratory of Knownsec, and also a world-famous cyberspace search engine. Through a large number of global surveying and mapping nodes, according to the global IPv4, IPv6 address and website domain name databases,it can continuously scan and identify multiple service port and protocols 24 hours a day, and finally map the whole or local cyberspace.
All Web servers known to be running Express.js
From What is Shodan
Shodan is a search engine for Internet-connected devices. Web search engines, such as Google and Bing, are great for finding websites. But what if you’re interested in measuring which countries are becoming more connected? Or if you want to know which version of Microsoft IIS is the most popular? Or you want to find the control servers for malware? Maybe a new vulnerability came out and you want to see how many hosts it could affect? Traditional web search engines don’t let you answer those questions.
From What is Shodan
Shodan gathers information about all devices directly connected to the Internet. If a device is directly hooked up to the Internet then Shodan queries it for various publicly-available information. The types of devices that are indexed can vary tremendously: ranging from small desktops up to nuclear power plants and everything in between.
From What is Shodan
So what does Shodan index then? The bulk of the data is taken from banners, which are metadata about a software that’s running on a device. This can be information about the server software, what options the service supports, a welcome message or anything else that the client would like to know before interacting with the server.
I tried a search for software that runs on small Linux devices…
Nmap (“Network Mapper”) is a free and open source utility for network exploration and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services those hosts are offering, what operating systems they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts.
From NMAP Phases
From NMAP Phases
From NMap Book: host-discovery
One of the very first steps in any network reconnaissance mission is to reduce a (sometimes huge) set of IP ranges into a list of active or interesting hosts. Scanning every port of every single IP address is slow and usually unnecessary. Network administrators may only be interested in hosts running a certain service, while security auditors may care about every single device with an IP address. An administrator may be comfortable using just an ICMP ping to locate hosts on his internal network, while an external penetration tester may use a diverse set of dozens of probes in an attempt to evade firewall restrictions.
From NMap Book: host-discovery
There was a day when finding whether an IP address was registered to an active host was easy. Simply send an ICMP echo request (ping) packet and wait for a response. Firewalls rarely blocked these requests, and the vast majority of hosts obediently responded. Such a response has been required since 1989 by RFC 1122, which clearly states that “Every host MUST implement an ICMP Echo server function that receives Echo Requests and sends corresponding Echo Replies”.
Unfortunately for network explorers, many administrators have decided that security concerns trump RFC requirements and have blocked ICMP ping messages.
From Wikipedia: ICMP
The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address, for example, an error is indicated when a requested service is not available or that a host or router could not be reached.
General format of ICMP packet (carried in IP packet)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TYPE | CODE | CHKSUM |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Content |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+
From Wikipedia: ICMP
TCP SYN Ping (-PS
TCP ACK Ping (-PA
The reason for offering both SYN and ACK ping probes is to maximize the chances of bypassing firewalls. Many administrators configure routers and other simple firewalls to block incoming SYN packets except for those destined for public services like the company web site or mail server. This prevents other incoming connections to the organization, while allowing users to make unobstructed outgoing connections to the Internet. This non-stateful approach takes up few resources on the firewall/router and is widely supported by hardware and software filters.
ICMP Ping Types (-PE, -PP, and -PM): In addition to the unusual TCP and UDP host discovery types discussed previously, Nmap can send the standard packets sent by the ubiquitous ping program.
IP Protocol Ping (-PO
ARP Scan (-PR): One of the most common Nmap usage scenarios is to scan an ethernet LAN. On most LANs, especially those using private address ranges granted by RFC 1918, the vast majority of IP addresses are unused at any given time. When Nmap tries to send a raw IP packet such as an ICMP echo request, the operating system must determine the destination hardware (ARP) address corresponding to the target IP so that it can address the ethernet frame properly.
The User Datagram Protocol (UDP) is carried in IP packets
The Transport Control Protocol (TCP) is carried in IP packets
From NMAP book – ports
These are reserved ports (within the range of 1 to 1,023, as discussed above) which have been registered with the IANA for a certain service. Familiar examples are ports 22, 25, and 80 for the services SSH, SMTP, and HTTP, respectively.
These ports fall within the range 1,024 to 49,151 and have been registered with the IANA in the same way the well known ports have. Most of these are not as commonly used as the well-known ports. The key difference is that unprivileged users can bind to these ports and thus run the services on their registered port. Users cannot do so on most platforms for well-known ports, since they reside in the reserved port range.
From NMAP book – ports
The IANA reserves the port numbers from 49152 through 65535 for dynamic uses such as those discussed in the ephemeral ports section. Proprietary services that are only used within a company may also use these ports.
There are numerous practical benefits to regularly scanning your networks. Foremost among these is security. One of the central tenets of network security is that reducing the number and complexity of services offered reduces the opportunity for attackers to break in. Most remote network compromises come from exploiting a server application listening on a TCP or UDP port. In many cases, the exploited application is not even used by the targeted organization, but was enabled by default when the machine was set up. Had that service been disabled, or protected by a firewall, the attack would have been thwarted.
A selection of NMAP port scanning techniques
TCP SYN Scan: Only sends the TCP SYN segment and does not complete the TCP handshake. Only port status is revealed.
TCP Connect Scan: Tries to make a full TCP connection.
UDP Scan: Scans UDP ports
TCP Idle Scan: See idle scan This is a very stealthy scan that involves an intermediate system to avoid revealing scanning machine to target.
From Version and Service Detection
Once the TCP connection is made, Nmap listens for roughly five seconds. Many common services, including most FTP, SSH, SMTP, Telnet, POP3, and IMAP servers, identify themselves in an initial welcome banner. Nmap refers to this as the “NULL probe” because Nmap just listens for responses without sending any probe data.
From Version and Service Detection
From Version and Service Detection
(Otherwise) Nmap sequentially (in the order they appear in the file) executes the probe(s) that match the port number being scanned. Each probe includes a probe string (which can be arbitrary ASCII text or escaped binary), which is sent to the port. Responses that come back are compared to a list of signature regular expressions of the same type as discussed in the NULL probe description above.
From Version and Service Detection
As with the NULL probe, these tests can either result in a full match (ends processing for the remote service), a soft match (limits future probes to those which match a certain service), or no match at all. The exact list of regular expressions that Nmap uses to test for a match depends on the probe fallback configuration. For instance, the data returned from the X11Probe is very unlikely to match any regular expressions crafted for the GetRequest probe.
From Cyber recon techniques
Scanning can be also used to recognize the guest OS or the applications available in the target nodes. This is known as fingerprinting. For the case of OS fingerprinting, the main technique exploits the fact that the network stack of each OS exhibits minor differences when replying to well-crafted probe packets (for example, the initial sequence number of the TCP segments, the default TTL value for ICMP packets, among others). Such artifacts can be utilized to remotely determine the type and version of the OS of the inspected device.
From Cyber recon techniques
Application fingerprinting uses a slightly different technique. In this case, the attackers take advantage of a “banner”, which is a sort of preamble information that a server-side application sends before accepting a client. By stimulating a host with connection requests, they can harvest banners to reveal details on the active applications and services (for example, the version of the software can be used to determine the known vulnerabilities).
Probes Sent: Sequence generation (SEQ, OPS, WIN, and T1), ICMP echo (IE), TCP explicit congestion notification (ECN), TCP (T2–T7), UDP (U1)
Response Tests: TCP ISN greatest common divisor (GCD), TCP ISN counter rate (ISR), TCP ISN sequence predictability index (SP), IP ID sequence generation algorithm (TI, CI, II), Shared IP ID sequence Boolean (SS), TCP timestamp option algorithm (TS), TCP options (O, O1–O6), TCP initial window size (W, W1–W6), Responsiveness (R), IP don’t fragment bit (DF), Don’t fragment (ICMP) (DFI), IP initial time-to-live (T), IP initial time-to-live guess (TG), Explicit congestion notification (CC), TCP miscellaneous quirks (Q), TCP sequence number (S), TCP acknowledgment number (A), TCP flags (F), TCP RST data checksum (RD), IP total length (IPL), Unused port unreachable field nonzero (UN), Returned probe IP total length value (RIPL), Returned probe IP ID value (RID), Integrity of returned probe IP checksum value (RIPCK), Integrity of returned probe UDP checksum (RUCK), Integrity of returned UDP data (RUD), ICMP response code (CD)
From Detecting and Subverting Firewalls and Intrusion Detection Systems
Determining Firewall Rules: Standard SYN Scan, Sneaky firewalls that return RST, ACK Scan, IP ID Tricks, UDP Version Scanning
Bypassing Firewall Rules: Exotic Scan Flags, Source Port Manipulation, IPv6 Attacks, IP ID Idle Scanning, Multiple Ping Probes, Fragmentation, Proxies, MAC Address Spoofing, Source Routing, FTP Bounce Scan, Take an Alternative Path
From Detecting and Subverting Firewalls and Intrusion Detection Systems
Intrusion Detection System Detection: Reverse probes, Sudden firewall changes and suspicious packets, Naming conventions, Unexplained TTL jumps
Avoiding Intrusion Detection Systems: Slow down, Scatter probes across networks rather than scanning hosts consecutively, Fragment packets, Evade specific rules, Avoid easily detected Nmap features
Misleading Intrusion Detection Systems: Decoys, Port scan spoofing, Idle scan, DNS proxying
From Wikipedia: DHCP
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) local area networks. A DHCP server must be present on the network. A device connected to the network requests an IP address from the DHCP server using the DHCP protocol; the server assigns a unique address to the device, identifying it for TCP/IP communication, and supplies other network configuration parameters.
From my home router March 2021, 11 devices have addresses
Nmap scan 192.168.1.1-255 March 2021, 9 devices found
Nmap can’t identify the OS/device, can you?
Nmap can’t identify the OS/device, can you?
We’ve seen that scanners like NMap can discover machines on our networks and what services and operating systems are running on them.
We’ve seen vulnerability databases such as NVD and CVE
Vulnerability scanners combine the two concepts
OpenVAS: “OpenVAS is a full-featured vulnerability scanner. Its capabilities include unauthenticated testing, authenticated testing, various high level and low level Internet and industrial protocols, performance tuning for large-scale scans and a powerful internal programming language to implement any type of vulnerability test.”
Subgraph Vega: “Vega is a free and open source web security scanner and web security testing platform to test the security of web applications. Vega can help you find and validate SQL Injection, Cross-Site Scripting (XSS), inadvertently disclosed sensitive information, and other vulnerabilities. It is written in Java, GUI based, and runs on Linux, OS X, and Windows.”
Linux desktop machine, running Ubuntu 20.04, Kernel 5.4
Chromecast device
Chromecast device vulnerability details
Windows Laptop
ExpressIf IoT (OpenSprinkler)
List of alerts
Details of an alert
False positive…