Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / amazon cloud cheat sheet
Last active March 20, 2023 07:11
amazon cloud cheat sheet
------------------------------------------------------------------------------------------
#ChatGPT
When deploying active-passive high availability (HA) FortiGate devices in AWS, you should use the Unicast FGCP feature.
The Unicast FGCP feature is used when deploying active-passive high availability (HA) FortiGate devices in AWS because it provides a simpler and more reliable solution in this scenario. With Unicast FGCP, the active FortiGate unit sends unicast heartbeat packets to the standby unit, which then responds to confirm that it is still alive. This provides a simple and reliable mechanism for the active unit to determine whether the standby unit is available to take over in case of failure. In addition, Unicast FGCP allows for more efficient use of network resources, as it minimizes the number of packets sent between the FortiGate units.
The Multicast FGCP feature is typically preferred over the Unicast FGCP feature when deploying active-active high availability (HA) FortiGate devices in AWS becau
@githubfoam
githubfoam / The MITRE ATT&CK framework cheat sheet
Last active July 25, 2025 13:11
The MITRE ATT&CK framework cheat sheet
------------------------------------------------------------------------------------------
What is the relationship between ATT&CK and the Lockheed Martin Cyber Kill Chain®?
ATT&CK and the Cyber Kill Chain are complementary. ATT&CK sits at a lower level of definition to describe adversary behavior than the Cyber Kill Chain. ATT&CK Tactics are unordered and may not all occur in a single intrusion because adversary tactical goals change throughout an operation, whereas the Cyber Kill Chain uses ordered phases to describe high level adversary objectives.
https://attack.mitre.org/resources/faq/#faq-4-0-header
----------------------------------------------------------------------------------------
What is the relationship between ATT&CK and the Diamond Model?
ATT&CK and the Diamond Model are complementary. ATT&CK documents detailed adversary behavior while the Diamond Model is helpful if you're trying to cluster intrusions. There are cases where they may be used together. For example, ATT&CK-mapped techniques may
@githubfoam
githubfoam / Investigation Path - the Windows Event Log service has been restarted
Last active July 7, 2023 06:11
Investigation Path - the Windows Event Log service has been restarted
------------------------------------------------------------------------------------------
#ChatGPT
#Explain how to investigate an incident as a security engineer where windows events log service restarted. Explain how to find out who restarted windows events log service.
As a security engineer, investigating an incident where the Windows Event Log service has been restarted can involve the following steps:
Collect evidence: The first step is to collect evidence related to the incident. This can involve reviewing logs, examining system configurations, and interviewing relevant personnel.
Review event logs: The Windows Event Log service itself logs events related to its own operation. The logs may contain information about the restart event and who initiated it. Look for Event ID 7036, which indicates that a service has entered the running or stopped state.
@githubfoam
githubfoam / Investigation Path - firewall log destination port 22 source ports 80 433
Last active July 7, 2023 06:10
Investigation Path - firewall log destination port 22 source ports 80 433
#=====================================================================
#ChatGPT
#Explain firewall traffic log which originates from source port 443 and 80 to destination port 22.
A firewall traffic log is a record of network traffic that has been processed by a firewall. It provides information about the source and destination IP addresses, ports, protocol, and other relevant details.
If a firewall traffic log originates from source ports 443 and 80 to destination port 22, it means that the traffic is using the HTTP and HTTPS protocols (which are assigned to ports 80 and 443, respectively) as the source ports to communicate with the SSH protocol (which is assigned to port 22) as the destination port. This type of traffic could indicate that someone is trying to establish a secure shell (SSH) connection to a server using a web browser or other HTTP/HTTPS-based client.
Here's an example of what the firewall traffic log might look like for this type of traffic:
@githubfoam
githubfoam / nagios suspicious network traffic cheat sheet
Last active March 15, 2023 05:19
nagios suspicious network traffic cheat sheet
#===================================================================================================================================
#ChatGPT
Explain how to send email alerts in nagios with gmail.
To send email alerts in Nagios with Gmail, you will need to configure the email settings in the Nagios configuration file. Here are the steps to configure email alerts in Nagios with Gmail:
Login to your Gmail account and go to ‘My Account’.
Enable the ‘Allow less secure apps’ option. This allows third-party applications like Nagios to access your Gmail account.
@githubfoam
githubfoam / librenms suspicious network traffic cheat sheet
Last active October 7, 2025 10:48
librenms suspicious network traffic cheat sheet
------------------------------------------------------------------------------------------
get alerts when something abnormal (like a loop or ARP flood attack)
Go to Navigate: Alerts → Alert Rules → Add Rule
Practical Setup in LibreNMS WebUI
Alerts → Alert Rules → Add Rule.
Choose SQL Rule.
Alert Rule for Huge ARP Table
@githubfoam
githubfoam / fortianalyzer - fortiSoc cheat sheet
Last active January 23, 2025 01:25
fortianalyzer - fortiSoc cheat sheet
#=====================================================================#=====================================================================
make this dataset query on fortianalyzer more structured and readable:select appcat, sum(bandwidth) as bandwidth from ###(select app, appcat, user_src, sum(traffic_in) as traffic_in, sum(traffic_out) as traffic_out, sum(bandwidth) as bandwidth, sum(sessions) as sessions from ###base(/*tag:rpt_base_t_top_app*/select $flex_timestamp as timestamp, dvid, srcip, dstip, epid, euid, coalesce(nullifna(`user`), nullifna(`unauthuser`), ipstr(`srcip`)) as user_src, service, appid, app, appcat, apprisk, hostname, sum(coalesce(rcvddelta, rcvdbyte, 0)) as traffic_in, sum(coalesce(sentdelta, sentbyte, 0)) as traffic_out, sum(coalesce(sentdelta, sentbyte, 0)+coalesce(rcvddelta, rcvdbyte, 0)) as bandwidth, sum(CASE WHEN (logflag&1>0) THEN 1 ELSE 0 END) as sessions from $log-traffic where $filter and (logflag&(1|32)>0) and nullifna(app) is not null group by timestamp, dvid, srcip, dstip,
@githubfoam
githubfoam / Investigation Path - a serverless compute is sending malicious traffic on Amazon Cloud Services
Created March 13, 2023 06:03
Investigation Path - a serverless compute is sending malicious traffic on Amazon Cloud Services
#===================================================================================================================================
#ChatGPT
Explain how to investigate an incident as a cloud security engineer where a serverless compute sends malicious traffic on amazon cloud services.
As a cloud security engineer investigating an incident where a serverless compute is sending malicious traffic on Amazon Cloud Services, here are the steps you should take:
Collect information: Start by collecting information about the incident. This includes the time and date when the incident occurred, the serverless compute function that was involved, the type of malicious traffic that was being sent, the target of the traffic, and any other relevant details. You can collect this information from logs, monitoring tools, and other sources.
Isolate the serverless compute function: Once you have collected the necessary information, isolate the serverless compute function by disabling its access to the internet. This
@githubfoam
githubfoam / Investigation Path - recently created file named 1.wad on a system the attacker accessed
Last active July 7, 2023 06:11
Investigation Path - recently created file named 1.wad on a system the attacker accessed
#===================================================================================================================================
confirm if the file is encrypted first and if so, look for the evidence of another file that decrypts it
if it’s not encrypted static + dynamic analysis
Assuming EDR telemetry is available, figure out which process created the file
there might be a full command line involving that file that explains what it is and how it was created.
Get the md5 and sha256 hash of the file and check VT and Google
Use Velociraptor to search for similar files in org with a query
@githubfoam
githubfoam / Threat Hunting - investigate whether an incident occurred in O365 logs - threat hunting
Last active July 7, 2023 05:58
Threat Hunting - investigate whether an incident occurred in O365 logs
#===================================================================================================================================
#ChatGPT https://twitter.com/chrissanders88/status/1633121837336121345
What do you look for to investigate whether an incident occurred in O365 logs as a security engineer where the user is on vacation for a week and unreachable.
As a security engineer investigating whether an incident occurred in O365 logs where the user is on vacation for a week and unreachable, here are some key things to look for:
Login activity: Check the login activity of the user in question during the period of their absence. Look for any suspicious login attempts or successful logins from unfamiliar locations or devices.
Email activity: Look for any unusual email activity such as mass email forwarding, sending emails to unfamiliar contacts, or accessing sensitive emails.