While the stock market was making its most perilous week-long dive in 60 years following the attacks on the Pentagon and World Trade Center, some companies went against the trend in a rather big way. Raytheon, for example, which makes the Tomahawk cruise missle, went up 37% during the week. The stock of General Dynamics, another defense contractor, moved up more than 10%. And L-3 Communications, an aerospace and communications specialty company, saw its stock go from the low 60s to the mid 80s.

The trend is clear. While the horror of September 11 has slammed industries like airlines and insurance, companies in industries like defense, computer hardware, security and telecommunications could find opportunities for business in the post-attack economy. The coming months and years will call for lots of reconstruction, and demand will flow towards companies equipped to meet it. “Clearly some people are going to benefit from this tragedy,” said David Farber, a University of Pennsylvania professor of telecommunications and former chief . “A massive amount of stuff will have to be replaced, including a whole range of things that have to do with defense and security.”

Spending on technology at the World Trade Center area alone may cost as much as $3.2 billion — $1.7 billion in hardware and $1.5 billion in software and services – according to a survey done by the TowerGroup, an information technology research firm near Boston. But when you consider what other companies, otherwise not affected, might do to upgrade their own computer systems, especially in terms of security, over the next several months, that number could be higher.

“What will be really interesting is to see whether big companies set up tiger teams, dropping other projects to go after computer security,” said Stephen Andriole, the former Chief Technical Officer at Safeguard Scientifics, who now runs TechVestCo, a new economy consulting company. “Normally, you do internal audits on a schedule. Do this in three months, say, and the other in nine months. But I think now every CTO, CIO and CEO is going to want to revisit everything with urgency. I think these audits will come with a drop-everything, get-it-done-yesterday fervor, and that will cause spending in many places.”

Andriole and Farber agree that while defense companies may get a boost, the real opportunities may come to companies that deal in computing or physical security.

“If you are a CEO, you have to revisit your investments in security, everything from entry into the buildings to information security to disaster recovery,” said Andriole. Stephen Mullin, the former Commerce Director for the City of Philadelphia, now a principal at Econsult, a business strategy consulting company, agrees. He sees just about everyone spending something to make their data, and everything else, secure.

“You see the federal government saying it will spend billions to aid the World Trade Center, but in its wake, you have got to believe it will do things elsewhere in concert with that,” said Mullin. “For instance, they are building a new Liberty Bell Pavillion. You’ve got to think there are people there now worrying more about how to keep that secure. The authorities will look at airport security systems in every city. It is not just the World Trade Center. It’s going to be everywhere.”

Farber said he isn’t sure there will be an immediate pop for any particular company, though.

“The analysis of all this is not a trivial exercise,” said Farber. He said that companies just got through a lot of analysis and upgrading in the wake of what was thought to be a potential Y2K crisis last year. They are not going to spend willy-nilly again. “But at least out of New York, the telecommunications people and mainframe people should get a quick boost.”

While companies like those that do iris-scanning for security or other types of esoteric security systems might get business, Andriole thinks that large companies are likely to get most of it. “IBM has an enormous computer security practice and PricewaterhouseCoopers is big in security areas as well,” said Andriole. “Whatever happens, there’s going to be a need for data storage, and you have to think companies like EMC will get a lot of that business, with facilities to get the hardware and software backup.” But then, he feels, there may just be a lot of switching around by businesses, especially as they look at their computer and security needs.

“If I were sitting in that CEO chair, I would want to know if I could use my corporate communications in a crisis,” said Andriole. “When the phones went down in New York, the Internet worked. But phone service is important. I would want to know about my cellular and telecommunications services. Who is my ISP? It may be taking business from one company and giving it to another, so it is hard to see exactly who would win there.”

There is a chance, too, that companies that provide video conferencing services will thrive in the post-attack economy. PiperJaffray, for instance, had two medical technology conferences set for its Minneapolis headquarters this week, but most New York analysts decided not to fly in. Instead, they will be doing the conferences by video. But Andriole, for one, thinks that is a short-term solution.

“In the end, you need personal contact for that kind of business,” he said. “Video conferencing companies want you to think it is just as good, but it’s with that personal contact that business makes progress.”

Farber agrees, suggesting that by Christmas, barring some other act of terror, travel will be back to normal. “It is too hard to figure out what would really replace business travel,” he said. “Even moving cargo. There may be a pop for railroads, but we are poorly situated that way. The airlines actually lost a lot of money when air mail and freight were embargoed. I received a ton of Fed Ex packages after they got to go back on line. Maybe this will help certain small things, like digital cameras, which can get your photo to your relatives without going through the mail.”

Farber said he saw a lot of upside in computing and the Internet on what he calls a citizen-to-citizen basis. A lot of Internet communication blossomed between ordinary people and he feels it has gotten more individuals hooked on e-mail and reading news on the Internet. “That may eventually spur the sales of PCs and software, but even regular citizens may look for more security in their transactions on the Internet, so security software may get a boost there, too,” he said.

Mullin said that the idea that companies will move out of New York to places like Philadelphia is probably wishful thinking, but there could still be some upside for commercial real estate near big cities.

“I’m sure there are people from, say, Chicago, coming in and telling companies, ‘Hey, we’re the second-largest financial center, why not come and work out here?’,” said Mullin. “But what may be more likely is the decentralization of some big companies. Maybe they will have more people in Chicago and Philadelphia than they used to, but they may still keep their headquarters in New York. I have to believe there are people who are worried about flying in or doing business in New York and Washington right now and businesses are going to have to accommodate that to some degree.”

But whoever believes they will win in this crisis is going to have to figure out how not to seem ghoulish in doing so. “Yes, that is a sticky wicket,” said Mullin. “But companies will be looking for security, real estate and other things. Someone will have to service these needs.”