Course Noteh
Course Noteh
- Introduction:
www.bilgem.tubitak.gov.tr
ZAP:The OWASP Zed Attack Proxy (ZAP) is one of the world’s most popular free security tools and is
actively maintained by hundreds of international volunteers*. It can help you automatically find security
vulnerabilities in your web applications while you are developing and testing your applications. Its also a
great tool for experienced pentesters to use for manual security testing.
- Web Apps security: dvwa (admin/password and low level): Virtual Web application for testing web sites.
- Burpsuite(local proxy)
Grey box testing:compiles the two previous approaches: they test both the functionality and functioning of
a website.
- Automated
- hybrid
OWASP
CWE™ is a community-developed list of common software security weaknesses. It serves as a
common language, a measuring stick for software security tools, and as a baseline for weakness
identification, mitigation, and prevention efforts
* Google Operator:
Inurl: ...
Filetype: ...
Intext: ...
- Scan site:
Nikto -h ‘’ http://www.defense.tn’’
Input/Output Validation
- SOP: Same origin policy is an important concept in the web security model
* Reflected XSS:
Example:
<script> alert(document.cookie)</script>
Python -m simpleHTTPServer 8888 : start web server listening in that port locally
The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the
page so that programs can change the document structure, style, and content. The DOM represents the document as
nodes and objects. That way, programming languages can connect to the page.
HTTP Methods:
‘or 1=1
Netcat -v -e ‘/bin’bash’ -l 31337 : open connection on that port and execute a bash
Steps
2- Call/execute it
4- Open listener
*Details:
- Use of Meterpreter:
Prepare the script
- Use msf:
#Msfconsole
#Use exploit/multi/handler
#Exploit
Then Process 1 to 3
-Authentification:
*Three way:
- Use Burpsuite
- Edit the content and select the input you will use in attack
Log Analysis
- Monitoring/Traffic Analysis
- Incident Response
- Threat Intelligence
- Forensics
- Malware Analysis
HTTP Code:
- 1xx: Information
- 2xx: OK
- 3xx: Redirection
Mitre Project
NIST Pentest
2- find IP address
3- Whois
- ARP Poisoning
- DHCP Starvation Attack
- DOS/DDOS:
* Slowloris-check:
cat error.log | grep -v File | grep "user" | cut -d "" -f 10 | uniq -c | sort -n
* Network Analysis:
* Whireshark (Graphical)
-i : interface
Software/Hardware solution
Types:
* By Location
Host-based IDS
* By Detection method
Signature-based
Anomaly-based
* By Packet processing
Stateful IDS
Static IDS
Snort IDS:
Github hestat: snort rules free (snort community)
Network services:
IPSEC, PPP...
* FW Denied protocol from internet to internal: ICMP, RDP, RLOGIN, FTP, SMB,...
--/--/Brodsky-Darkhovsky
Exercice:
1/ Trend in log_1
RPC scans
Snort-portmap-mountd-request-UDP
cat snort-alerts.txt | cut -d: -f5-7 | grep '^ [0-9]' | uniq -c | sort -n
- Do rules review
- Egress rules
- Geo-location
2/ Trend in log_2
To Check if it’s a botnet or not: if the attacker is using a fixed port to connect (TCP) everytime,
it’s a bot.
Center of Inter Security (CIS) Benchmark: are best practices for the secure configuration of a
target OS system.
cat honeynet-Feb1_FebXX.log | cut -d "=" -f15 | cut -d "" -f 1 | sort | uniq -c | sort -n
- Black Box: The tester has absolutely no knowledge of the system and is functioning in the same manner as an outside attacker.
- White Box: The tester has significant knowledge of the system. This simulates an attack from an insider—a rogue employee.
- Gray Box: This is a middle ground between the first two types of testing. In gray box testing, the tester has some limited
knowledge of the target system.
Day 5: 06 September 2019; Log Analysis (3)
Antivirus Log
- Header Analyse:
Never connect width admin credentials (servers are in DMZ zone and could be hacked)
Get solution to check links in mail (when getting the mail and/or each time a user click on it)
Emkei’s Mailer: fake mailer with attachments, encryption, HTML editor and advanced settings
https://www.fortinet.com/blog/threat-research.html
Files analysis:
Automated(IOC, SIEM),
IOC: Indicator of compromise (Traces that appear to be pointing to an intrusion with high confidence)
Steps:
1 Creating IOC
2 IOC Integration
3 Detection of suspicious
4 Evidence collection
5 Data analysis
6 Go back to Step1
Id 1101: Error
Id 4609: PC shut down time (Doesn’t appear in log because 1100 is closed before it)
Logon Type:
2- Network
3- batch
4- service
5- Unlock
7- New credential
8- Remote interactive
9- Cached interactive
-Linux Log:
*Syslog :
*File Format: Timestamp, Hostname, App-Name, Priority (severity)
- Problem Nature?
- Primary incident response coordinator? (Tech lead, Admin Lead or Legal lead)
- Command or tools!!!,
General Approach:
- Develop theories about what occurred, explore logs to confirm or disprove them
- Applications logs
- Outbound proxy
- Other non-log sources for security events (e.g who visited the sites, ...)
- inbound/outbound activity
SIEM Installation
Day 7: 09 September 2019; SIEM
- Results
- Tactical Intelligence
- Log Shipping:
*Collect Log
*Centralize logs
Log Transport:
- Syslog UDP
- encrypted syslog
- SNMP
OSSIM Hands-on
Exercices
Samples:
-File samples/wrongdissec.pcapng
- decode as
Exercice 3:
We found something abnormal in the Pcap files (IP address, URL and malware)
After that, those coming steps will help us to check our network (using security components).
AV IPS FW
URL
1st Step Nuclear EK malware IP
Sw-Flash
Check for who other Check if other devices
2nd Step Check Anitivirus
visited the URL connected to the IP
* Notification could come from IPS and AV, but no notification from FW
- Vulnerability Management
-Log management
Traffic Analysis
-Phishing test
-Penetration test
-thread Intelligence
Malware Analysis
techniques :basic/Advanced,Static/Advanced
After incident :we Should prepare IOC(Indicator of compromise)to put on the SIEM
static Malware analysis Steps to prepare IOC : (static analyses the malware )
1- Hash
# md5sum file
# sha256 file
2- Virus total
3- Strings (search for Ips/URLs/other) : print the strings of printable characters in files.
# Strings file
4- PEiD : detects most common packers, cryptors and compilers for PE files.
5- Dependency Walker(ldd for linux library):free windows tool used to scan any
windows file(exe,dll…) and build a hierarchical tree diagram of all dependency
module(dll,exe…)
-Accept/connect/ControlService/CheckRemote
-CreateMutex(mutual exclusion : to not run the malware more then one time)
-inet_addr,internetOpen,intenetOpenUrl
-NetScheduelJobAdd,NetShareEnum
6- TCP Viewer
7- Process Explorer
8- Process Monitor
Day 10: 12 September 2019; Malware Analysis
Steps:
2- Analyse:
#use exploit/multi/handler
#set lhost=Kali_Ip
#set lport=7777
# exploit
3- Infect Windows
- Navigate to the Kali Address with the address of Kali And download the malware.exe
4- Behavior Analysis:
Use those tools to follow the behavior for the malware and its actions(connections,exe files, dll files)
*Process-Monitor :
*Malware types:
- Active Cyber defense activity. It is "the process of proactively and iteratively searching through networks to
detect and isolate advanced threats that evade existing security solutions.
- Anatomy of a Cyberattack
* Research
* Penetration
* Expand
* Exploit
- Block Traffic by Country (Russia, Ukraine, Serbia, Bulgaria, Romania, India,I ran, Israel,…)
- Indicators of a Cyberattack:
*Geographical Irregularities
* Initial
*Minimal
*Procedural
*Innovative
*Leading
*searching(IOC+Gateway log)
*……………………..