Of the advertising

“Cho, someone wants to see you.”

Early in the morning, 361 antivirus company zhou was woken up.

Today the sun is very bright, old Zhou stretched himself, then walked to the studio.

“Who is early in the morning to make a noise, bad my sleepy”, heard, old week a little not too happy.

“Dong dong ~”, old Zhou looked up slightly, saw a sweet woman appeared in the studio door.

Old Zhou jumped up from his seat and walked to the woman with a gesture of welcome: “Beauty, please come in.”

After the two of them sat down, Old Zhou helped the frame of the glasses and straightened the plaid shirt. With a gentle manner, he asked in a low voice, “I wonder why the beautiful woman came here?”

Woman was a worried look on his face, “hello, I am light snow, Chrome company recently we visit red net, tao bei net web pages often appear many strange advertising, has long been complaints, listen to the teacher leaders say 361 antivirus companies weeks are experts in the field, want to ask you to help diagnose, exactly how these ads to”


Old week listen to some embarrassed, repeatedly waved, “is the original snow girl, where where, brave fight virus Trojan horse, eliminate rogue software this is my 361 company’s duty of matter, next also just do some modest force just”.

“Week teacher don’t be modest, you before pull out IE company Trojan intrusion of the story has spread throughout the entire Windows empire, everyone knows your fierce. This advertising problem, please “, xiao Xue looked at the old week, as if the eyes shining stars.


“Don’t mention it, this thing pack on my body.” Xiao Xue got up and left even saying a few words of thanks.

Who moved the HTTPS traffic

Baymax, who was in charge of filtering Internet data, was busy at the moment. Suddenly a hand was placed on his shoulder. Baymax turned around and saw Lao Zhou.

“Old Zhou, what brings you here, you are not in the security lab to analyze malicious code, why come to our network department?”

Zhou patted Baymax on the shoulder and said, “Baymax, I have something I need to ask you to do me a favor. Can you check if there are any ads inserted into your Chrome browser traffic?”

“On this matter, before paragraph of time discover router old to insert advertisement, I did characteristic screen, originally think they disappear stop, this just didn’t have a few days to come back again?” Baymax pulled up Chrome’s traffic and was ready to take a look.


Baymax looked more and more closely at his brow. “I don’t think so. I can access Qiandu and Taobai using HTTPS protocol, so it is not possible for routers to insert advertisements.”

“The HTTPS protocol? Why can’t I insert ads with this?” “Old Zhou asked.

“This all don’t know, you this 361 company safety laboratory leadership how to be up of”, big white a face speechless expression.


Old Zhou was a little embarrassed, “Oh, brother, don’t make fun of me. I have a specialty in this field. I am good at analyzing virus and Trojan code, but I really know little about network protocol.

Baymax seemed to feel that his words were a little harsh, so he took the opportunity to say, “Zhou, I was joking with you just now. Don’t take it to heart.”

“Nothing nothing, you quickly tell me about this HTTPS protocol, help me solve the case earlier.”

“Okay, wait a minute,” Baymax said as he began to draw on the whiteboard.

What is the HTTPS

“HTTPS = HTTP + SSL/TLS, this technology is both simple and complex. To put it simply, in order to ensure the security of network data, baymax protects HTTP traffic on traditional Internet by encrypting transmission, “baymax told Zhou while drawing the picture.


“Yes, so the question is, what encryption and decryption algorithm? How does the other side know what algorithm to use and what key to decrypt it with?” “Lao Zhou then grasped the key point.

“Well, that’s the point. Before the data is transmitted, there is a negotiation process to agree on the encryption algorithm to be selected and the key to be used.”

“Then again, if the contents of this negotiation were known, wouldn’t he be able to follow through and decrypt the contents of the transmission?” Old Zhou’s reaction was quick.

“Old Zhou is old Zhou indeed! It doesn’t matter if the encryption algorithm is known, after all, algorithms are public, the key is the key for subsequent encryption, this is the key that needs to be protected, this can’t let others know. “Baymax continued to draw.


“So? How do you protect this key? You say, “old Zhou was a little worried.

“Look out, high energy, both sides use a method called asymmetric encryption to transmit…”

“Wait a minute,” Zhou interrupted baymax. “Asymmetric encryption, what does that mean?”

Baymax sighed silently. “The common encryption method is called symmetric encryption algorithm. Symmetric is encryption and decryption using the same key. And as opposed to this, asymmetric encryption, which means that encryption and decryption use different keys, okay?”


Old Zhou thought a little and nodded, “I know, you continue to say, how to use this asymmetric encryption algorithm to transmit the key needed later?”

Baymax continued: “The client generates a random number, encrypts it with the public key, and sends it to the server. The server decrypts it with the private key to obtain the random number, and then calculates a key based on the random number and other information, which will be used as the key for subsequent encryption.”

“Wait, where did the client’s public key come from?”

“In the beginning, the client sends a request, and the server responds by telling the client the public key. Okay, I’m done. That’s it. “Baymax lowered his brush and a full HTTPS handshake emerged:


Old Zhou looked at it for a long time and finally said, “I can understand the process, but I always feel that it is unnecessary to use asymmetric encryption algorithm, so toss and turn.”

Baymax repeatedly waves, “You think it is simple, asymmetric encryption and decryption algorithm is much more difficult to execute, take many times more time, if the entire use of asymmetric encryption algorithm, it will seriously affect the online experience. Algorithm is a good algorithm, but with the cost is also very large, so under the balance, good steel used on the edge, only to transmit the key, behind the formal data transmission, or with conventional symmetric encryption algorithm, to the economy.”

Zhou nodded, sometimes thinking, sometimes looking up at the flow chart.

After a long time, Zhou pointed to the flowchart and asked again, “I said Baymax, if I insert a role between the client and the server, pretending to be the server for the client and pretending to be the client for the server, I can get in the way, modify packets and insert advertisements, right?”


After hearing, the white man who was drinking water choked and coughed again and again, “What you said is a middleman attack! You think HTTPS is a toy, so easy to hijacked, joke! Pay attention to the picture, there is an authentication process, not everyone can impersonate “Lao Zhou looked at the picture again,” how to authenticate the method, I would like to listen to.”


“In the response of the server, the public key I mentioned earlier is in something called a certificate, which identifies the server and is issued by an authority. When the client receives the certificate, it checks whether it is trusted. If it is not, it stops the following process.”

“So how do you tell if a certificate is trustworthy?” “The Empire has already installed the trusted certificate, just call the API to check.”


Old Zhou thought and thought, but he couldn’t put his finger on it.

There is only one truth

After several days, Lao Zhou still had no idea, so the matter was put on hold. It never rains but it pours. We’re still in the middle of this. There’s something wrong with Firefox. Originally, 361 antivirus company detected firefox secret started a Trojan features of the process, old week again led the team to explore, Firefox company fox is responsible for docking this matter.

Lao Zhou went to the Firefox disk storage directory and decided to check out what the Trojan horse file was.


“What kind of data is this?” “Old Zhou asked, pointing to a pile of papers.

“Miss Zhou, this is web cache data,” answered Fox.

“Open it up, see if you can find any signs of assault.”

Old Zhou looked around, pointed to another pile of papers and asked, “What is this pile of data?”

“Mr. Zhou, this is a bunch of certificates, used by authentication servers in HTTPS handshakes, that have nothing to do with this attack,” Fox continued.


“Authentication? Didn’t the Empire store trusted certificates? Why do you keep certificate information?” Old Zhou was puzzled.

“We don’t recognize empire’s trusted certificates. Who knows what kind of certificates are in there? They’re too unreliable,” fox said with a hint of pride.

After listening to Fox’s answer, Lao Zhou was stunned. After a few seconds, he came back to himself. He took out the Certificate from Chrome and asked Fox to have a look at it.

Fox took the certificate, examined it carefully, and after a moment said firmly, “There is something wrong with this certificate!” Old Zhou flashed a bright light and asked, “What’s the problem?”


“This certification authority is called ABSafe and is not on our trusted list! Besides, I have a certificate to cache Kiladu, which is not true at all. It must be fake. Look.”

Old Zhou took the two certificates and looked them over and over again, nodding from time to time.

“I see, there is only one truth! Someone must have installed this ABSafe authority on the Empire Trusted list to fool Chrome! HTTPS man-in-the-middle hijacking! YES!” “He shook his fist vigorously.

“Teacher Zhou, what are you saying, how can I not understand?” “Fox looked at Old Chow and said to himself.

Old Zhou told fellow old Qi to continue the investigation, hurried farewell fox left.


That night, two shadows appeared in the Imperial Trusted Root certificate repository.

“Someone deleted the root certificate we installed, so no wonder Chrome was alerted to qiandu.com,” one of the chubby shadows said.

The thin shadow covered the fat man’s mouth, “SHH, you give me some wind, I go to reinstall.”

The thin dark figure crept up and took something from his bosom.


“Don’t move! Security check!” , suddenly a beam of light shot over, the original old Zhou with the team lurking here for a long time.

“It’s you, master! Qiandu network and Tao Bei network of advertising is also you add is it?” “Old Zhou shouted.

The fat and thin figures looked at each other and confessed everything.

To be continued

eggs

“Qi, have you found anything about the Case of Firefox Company?” “Zhou, why don’t you come back again? It’s a bit complicated.”

To know how, please pay attention to the follow-up wonderful……

A review of past favorites

Python 1 click to Jar package, Java call Python new posture!

A Memoir of A Java object: Garbage collection

Kernel Address Space Adventure 3: Permission management

Who’s moving your HTTPS traffic?

Advertising secrets in routers

Kernel Address Space Adventure 2: Interrupts and exceptions

DDoS attacks: Infinite Warfare

An SQL injection leads to a spectacular case

Kernel address space Adventures: system calls

A magical journey through HTTP packets

A THRILLING tour of DNS packets

I am a rogue software thread

Scan code attention, more exciting