Neither replied to a request for comment sent to email addresses referred to in their chat logs.

Both had roots in the Iranian defacement community, which would attack and take over websites and Twitter accounts, replacing them with pro-Iranian slogans and images.

Over time, the two become more sophisticated, developing malware as they moved between Iranian hacking groups. Recently, the men have been tied to a group known as “Charming Kitten” by security companies. The group is believed to be responsible for a range of attacks, including targeting aviation companies in the United States.

The chat logs showed two men frustrated with the pace of their work.

“We need someone for Mac in Tehran,” Mr. Keshvari wrote on June 15, 2014, bringing up a topic the two men had discussed nearly a month earlier. The best hackers, he complained, were making “good money” elsewhere, and were not tempted by the idea of moving to Tehran to work in a cramped office for roughly $780 a month. There should be some other benefit, Mr. Keshvari joked, at one point suggesting they offer to send prospective hires on vacation to Turkey and Thailand.

Mr. Keshvari appeared focused on bringing in prospective new hires, but he was often stymied by Mr. Borhani. On May 30, 2014, he complained that Mr. Borhani had scared off prospective new hires.

“Listen, if during the interview you ask them about working with SCADA, I will kill you,” Mr. Keshvari wrote, referring to the operating system used to control industrial facilities, such as power plants or oil and gas refineries.

Mr. Keshvari responded that he “does not do the interview in this way.” And after several profanities were exchanged, the two agreed to meet with a new recruit.

“We need them … send them here,” Mr. Borhani wrote. He repeatedly pressed for programmers with expertise in Mac operating systems.