The escalation of tensions between Iran and the United States over the past weeks has resulted in an influx of investors betting big on listed companies involved in the defense and cybersecurity sectors.

Despite the recent de-escalation in the conflict, shares of these types of companies continue to increase, signaling that investors likely forecast further escalations in the coming days. The companies that will likely see a lot of benefit from further geopolitical conflicts this year include industry giants such as military contractors Huntington Ingalls Industries, Northrop Grumman, and Lockheed Martin.

As noted by Goldman Sachs analysts, shares of these companies have slowly surged over the past few days. Lockheed Martin shares surged by 6 percent, while Northrop Grumman shares climbed 9 percent higher last week. Shipbuilding firm Huntington Ingalls saw its shares surge by 8 percent over the same period.

Cybersecurity-related stocks also climbed last week, with specialist companies such as Zscaler and CyberArk seeing their shares jump by 18 percent and 17 percent year-to-date, respectively. The S&P 500 Aerospace & Defense Industry Index also closed higher last week, continuing to grow in the days that followed after the US' attack.

Analysts at JPMorgan have stated that investors likely see these kinds of stocks as strong safe-haven bets in times of geopolitical and economic uncertainty. However, the same analysts have warned that the recent events, including the killing of Iran's top military commander, Qasem Soleimani, should not be seen as clear go signals to buy defense and cybersecurity stocks.

There are apparently still a lot of "unknowns" that could put things in reserve without warning. CIBC Private Wealth Management noted that investors shouldn't overreact to the current situation as Iran still remains to be very unpredictable in how it will choose to respond to the US' actions against it.

Following the US-led airstrike that killed Soleimani two weeks ago, Iran retaliated and attacked two Iraqi bases on Tuesday last week. According to the Iranian foreign ministry, more than a dozen ballistic missiles were launched as a "proportionate measure" against the US in "self-defense." 

US President Donald Trump somewhat downplayed the event during a press conference, revealing that there were no casualties and that Iran seemed to be backing down after its failed attack.  

The US' initial airstrike had resulted in sharp dips in global stocks, while also pushing gold and oil prices higher. Apart from cybersecurity and defense stocks, the energy sector also stands to benefit from the ongoing conflict between the United States and Iran. However, Goldman Sachs believes that energy-related shares have all but given back their gains in previous days.