Showing posts with label Chinese. Show all posts
Showing posts with label Chinese. Show all posts

Tuesday, February 18, 2014

A preamble to a computer worm

I recently downloaded the source-code for 30 Chinese computer worms and Trojan horses. The code makes for interesting reading, but the comments are all in the GB2312 character set, so I have to convert to UTF-8 in order to read them.

When these things first appeared in the wild, they had a deliberate anonymity. Their original developers had given them names like Golden Pig and Chinese Vampire, and adorned their code with comments to describe and explain their effects. But before releasing them, the developers stripped them of all of their identifying and explanatory information, and sent them out into the world nameless and unexplained.

Those who discovered and analyzed them gave them new names. They disassembled their code, but they couldn't recreate the comments and non-semantic details that the original developers created.

It is interesting to look at the original source code for some of these things, for the subtle details you would not see in disassembled code. In this post, I will just give the preamble that appears at the top of one source file that is part of something the author called the Chinese Vampire, written in 2008. Reading this feels kind of like reading the mummy's curse.

Chinese Vampire Source Code
Author: God of the Black Net
After you buy the source code, please do not casually distribute it. Please treasure the product of the author's labor.
If you get lost in the code, the coding style and comments are not generally to blame. Those that I have already changed are very good, quite clear and easy to understand.

It does not use any C++, just simple C code, but edit it using VC++6.0. Once you edit it, you can use it. It has already passed hundreds of tests, so it is quite perfect, and there is no need to edit it very much.
If you can't get rid of it, contact the author and ask for a special killer.

This comment reveals a couple of interesting details about the Chinese Hacker world, at least as it was in 2008 (six years ago, now). First, the Chinese Vampire was for sale, a stock tool that could be purchased and customized. Second, there was an expectation that the author should be remunerated for his hard work.

Tuesday, February 11, 2014

A brief history of Chinese hacking: Part III

(The following draws extensively from an online text titled "The Record of X on the Rise of the Chinese Hacker", supplemented from other sources.)

In the last two posts, I have mentioned two galvanizing events for the Red Hacker movement: Violence against ethnic Chinese in Indonesia; and the NATO bombing of the Chinese embassy in Belgrade.

Two months after the bombing of the embassy in Belgrade, the government of Taiwan announced a 'Two States' policy, which undermined the long-held idea that China and Taiwan were a single country suffering a temporary disunion. Seasoned by the 1998 action against Indonesia and the May 1999 action against the United States, the Red Hacker apparatus was ready to turn and defend the honor of the motherland on the battlefield of Taiwan's networks.

They attacked the website of the Executive Yuan of Taiwan, as well as many other websites, deploying newly developed tools like Glacier (冰河, a trojan horse) for the first time, and NetSpy (a tool for uploading and downloading files from a server, apparently).

In 2000, the number of internet cafes mushroomed, and the hacker spectrum broadened. The old Black Hackers were still around, but the ready availability of technology led to a large number of careless, headstrong and unskilled teenagers pursuing the black hacker path. These "script kiddies" were nicknamed the Little Blacks (小黑黑) by an influential female hacker of the time named Wollf.

Alongside the Black and Red hackers, there also arose Blue Hackers (篮客, lán kè), who were relatively unconcerned with cheap tricks and politics, and intensely passionate about computer security.

In 2001, after the South China Sea collision incident, a small American hacker group called PoizonBOx defaced at least a hundred Chinese websites, and reportedly 80,000 Chinese hackers returned fire beginning on May 4. Most of these were unskilled script kiddies, so the damage done did not reflect their large numbers, and some considered the action to be a farce. As far as I can tell, 100-600 websites were vandalized, and the White House website suffered a DOS attack that blocked access from May 4 to May 8.

In the years between 2000 and 2002, Chinese hackers created and released the Code Red, Code Blue and nimda computer worms. But many also undertook a serious discussion of the ethical dimensions of hacking, and of hacking culture. They began to discover and publish their own findings on network and software vulnerabilities, which have been picked up by international security research organizations.

Sunday, February 9, 2014

A brief history of Chinese hacking: Part II

(The following draws extensively from an online text titled "The Record of X on the Rise of the Chinese Hacker", supplemented from other sources.)

I ended the last post with the emergence of the Chinese hacktivist alliance in response to violence against ethnic Chinese in Indonesia in 1998. This era also saw the emergence of the Green Corps and the Chinese Green League. (I'm not sure what the significance of the color "green" is in these names, but I wonder if it doesn't relate to the color of CRT screens).

Webpages discussing the technical details of hacking began to proliferate, and Chinese hackers eagerly undertook to study the relevant technologies. The most famous hacker of this period may have been Xiǎo Róng (小榕), creator of tools like Stream of Light (流光, a vulnerability scanner), Tracing Snow (溯雪, a password cracker) and Chaos Knife (乱刀).

1999 saw a dramatic increase in the number of internet users in China, and it also saw the NATO bombing of the Chinese embassy in Belgrade, which many Chinese saw as a deliberate act of retribution on the part of the United States for China's criticism of NATO action in Yugoslavia.

The second day after the bombing of the Chinese embassy in Belgrade, the first Red Hacker website was born, initially called the Chinese Hacker's Rallying Point for the Motherland (中国红客之祖国团结阵线), and later renamed the Chinese Hacker's United Front for the Motherland (中国红客之祖国统一战线).

This site drew intense interest from Chinese citizens around the world, and the Red Hackers carried out widespread attacks on American websites and email servers.

Hacking tools created in this period included NetSpy (inspired by Cult of the Dead Cow's Back Orifice), Glacier (冰河, a trojan horse), Black Hole (黑洞), Network Thief (网络神偷), Gray Dove (灰鸽子), XSan and YAI.

Glacier, Black Hole and Network Thief are still considered by many to be essential tools for the Chinese hacker. "Official" development of Glacier has ceased, but users have forked off many versions of their own.


A brief history of Chinese hacking: Part I

(The following draws extensively from an online text titled "The Record of X on the Rise of the Chinese Hacker", supplemented from other sources.)

China's earliest online community arose in the mid-1990s, with a small number of people using PCs and dial-ups to interact with each other on bulletin-board systems. Between 1994 and 1996, BBS servers proliferated in major Chinese cities, and interest in copying software and breaking license controls on software also grew, creating the first generation of Chinese hackers.

Internet access came to China in 1996, and the BBS culture moved from dial-ups and isolated servers to the internet. It is interesting to me that the BBS format is incredibly prevalent on Chinese websites today, while they have been basically replaced by social networks in America. It was during this period that a man named Gao Chunhui created the first personal website in China, and it is said that his personal site at that time was dedicated to the topic of breaking software registration controls.

This era also saw a brief period of phreaking (电话飞客), but advances in telecom technology rapidly put an end to that.

In 1998, a Taiwanese student named Chen Ing-Hau released the Chernobyl virus, which caused billions in economic damage in mainland China. Because the author was a Taiwanese student, some Chinese users perceived the damage done by the Chernobyl virus as a politically motivated attack.

Also in 1998, amid the deepening Asian Financial Crisis, there was widespread violence against ethnic Chinese in Indonesia. Chinese internet users formed teams that flooded Indonesian government email accounts, and they tried to bring down Indonesian websites with ping-based DOS attacks. In order to coordinate these attacks, a group was formed called the Chinese Hacker Emergency Meeting Center (中国黑客紧急会议中心). This might be considered the first Chinese hacktivist alliance.

So, from the very beginning, Chinese hacking has been closely tied to nationalist sentiments.


Friday, February 7, 2014

The Chinese Hacker's Code

In 1984, Steven Levy suggested that there was a commonly understood but unwritten [American/European] "hacker code of ethics", that encompassed the values of sharing, openness, decentralization, free access to computers, and world improvement.

On many Chinese hacker sites I have found a written code of conduct, which is attributed to an influential Taiwanese hacker named CoolFire, who has his roots in the computer culture of the late 1990s. I will present that code of conduct below, but first I want to write out something about the connotations of the word "hacker" in Chinese.

The most common word for "hacker" in Chinese is 黑客, hēikè, derived phonetically from the English word "hacker". These two characters literally mean "black guest", which I think is a great way to describe a hacker's presence on your system. Unlike the English word "hacker", however, the Chinese hēikè seems to have a less negative, perhaps more ambiguous connotation.

The less common word is 骇客, hàikè, also derived phonetically from English "hacker", but with a literal meaning of "terrifying guest". This seems to be a more negative term, maybe more like cyber-criminal.

There is a strong association between hacking (hēikè) and patriotism in China, dating back to the earliest organizations and activities of hackers in the 1990s. This has given rise to another term, 红客, hóngkè, meaning "red guest". This is sometimes translated as "honker", but I'll render it as Red Hacker for now. (Not only does "honker" also mean someone from Hong Kong, but it sounds pejorative to me.)

Without further ado, here is a composite of the Chinese Hacker Code, drawn from several similar versions.

1. Do not sabotage any system. It will only bring you trouble.

2. Do not modify any system files. If you must do so to access a system, please restore them to their original state after you are done.

3. Do not casually hack a website and then tell friends whom you do not trust.

4. Do not talk about what you have hacked in a BBS or forum.

5. Do not use your real name when you post an article.

6. Do not leave your computer while you are actively engaged in invasion.

7. Do not invade or attack telecom/government organization servers.

8. Do not talk about what you have hacked over the phone.

9. Keep your notes in a safe place.

10. Read everything related to system security or vulnerabilities (learn English quickly!)

11. Do not delete or alter accounts on the systems you invade.

12. Do not modify system files, unless it is necessary to conceal your intrusion. In any case, maintain the security of the system, do not invade and disable the original security.

13. Do not share the accounts you have cracked with your friends.

14. Do not invade or destroy government organization servers.

15. If you can't program you can't be a good hacker.

16. Hackers are not "pirates".


Thursday, February 6, 2014

Motherlode

Last month, I idled away some hours trying to get some idea of the Chinese hacker culture. I assumed that, like the hackers I knew when I was younger, that Chinese hackers would have some kind of specialized vocabulary, like a Chinese version of 1337. I figured if I could find a few terms in that specialized vocabulary, I might be able to do some narrow internet searches that would give me a general outline of the Chinese hacker world.

It didn't really work. I did get a really interesting look into how the Chinese government is handling cybersecurity, but I never found anything that really looked like a hacker site.

Today, by chance, I hit the motherlode. I found the type of site I was looking for, and the wealth of information available is a bit overwhelming. My experience with Chinese government sites has been that, after I access them a few times, they may drop off the net, especially if they are very interesting. I fear I won't have enough time to learn what I want to learn before this site goes away too.

If my luck holds, I will soon have much new and interesting information to blog about.

Monday, August 12, 2013

Obfuscation in Chinese

I recently saw the following status posted on a social networking site:

铋顼褀轵廯朙哒返怼働薍

If you run this through Google Translate, you get gibberish, and rightly so, because it is gibberish. The key is that each character stands for another that sounds the same (or similar).  The plaintext message is:

bìxū qízhì xiānmíngde fǎnduì dòngluàn
必须奇志鲜明地反对动乱
"We must aspire to clearly oppose disorder"

This kind of obfuscation seems trivial at first, because any speaker of Chinese can probably see right through it--especially since the poster used characters that both looked similar and sounded similar. But it has an advantage:  Humans can understand it, yet simple search algorithms cannot.

If you needed to send a text message to another human being across a communication network that is monitored by a (potentially) hostile authoritarian government, without the opportunity to exchange keys or encryption algorithms ahead of time, this approach would let you slip past monitoring software that searches for keywords.

But it has a huge disadvantage if it is over-used.  Once the authorities figure out what you are doing, all they have to do is flag messages that use obfuscated versions of sensitive words (like 返怼 for "oppose"), and they will be able to select out the subset of messages that both contain sensitive content and are trying to hide it.

Friday, July 19, 2013

渤海 Language

There was a kingdom called 渤海 in what is now North Korea and North-Eastern China.  For nationalistic reasons, certain modern nations are keen to assert that the people of that kingdom belonged to their own ethnic group and spoke their own language. The system of romanization you use has intense political ramifications. (Just read the talk pages on Wikipedia for this and related kingdoms.)

In order to sidestep this debate, I will use Chinese characters instead of contested historical names throughout this post.

No texts in the 渤海 language survive, so all we can do is speculate based on historical sources.  In fact, it appears that the 渤海 may have used the Chinese language as their literary language, based on a passage from the history of the Jurchen Jīn dynasty:
乙未,诏百官诰命,女直、契丹、汉人各用本字,渤海同汉人。
On the yiwei day, [the emperor] issued edicts to the hundreds of officials.  For the Jurchens, Khitans and Chinese, he used their own scripts; For the 渤海, [he used] the same as the Chinese.
Ethnically, the Jurchens seem to have believed that they were related to the 渤海, since the Taizu of the Jīn dynasty promulgated an edict saying:
女直、渤海本同一家。
The Jurchens and 渤海 are originally one family.
Indeed, the history of the Jurchen Jīn says:
粟末靺鞨始附高麗,姓大氏。李績破高麗,粟末靺鞨保東牟山。後爲渤海,稱王,傳十餘世。有文字、禮樂、官府、制度。有五京、十五府、六十二州。 
The 粟末靺鞨 allied themselves to 高麗, and took the surname Dashi.  After [the Tang official named] Li Ji destroyed 高麗, the 粟末靺鞨 guarded over Dongmo Hill.  Later, they became the 渤海, were called kings, and for ten generations had writing, laws, music, official courts, systems, customs, five capitals, fifteen prefectures, and sixty-two districts.
The 粟末靺鞨 here are one of the seven tribes of 靺鞨 from whom the Jurchens held themselves to be descended.  The characters 粟末 are reconstructed as *sok-mat in OCM (Minimal Old Chinese), and represent an ancient name for the Sunggari river (now called Songhua).  I expect the river name was something like *sugmar, which became *sumgar through metathesis, *sunggar through assimilation.

If we assume that the collective name of the seven tribes, 靺鞨, was pronounced the same as the phonetics 末曷, then that gives is an OCM reconstruction of *mat-gât.  The Early Middle Chinese reconstruction of 渤海, for comparison, is *bət-xəy'.  It seems like it is not entirely impossible to say that the name 渤海, which appeared in the Táng, is a later form of the older 靺鞨, having undergone some sound changes.  The sound change from m > b is not well represented, though we do find it in the Manchu words for "monkey", monio and bonio.

The language of 渤海, if it was anything other than pre-Jurchen, should have left some loan words in Manchu.  Indeed, the Manchu language has a large store of enigmatic words whose etymologies can't be found in Tungusic, Mongolic or Chinese.  Much of these will no doubt be Khitan, but some of them may be 渤海.  Khitan itself is likely to have some 渤海 loans, as well.

Someone really needs to do a careful archeology of Manchu in order to make sense of the enigmatic vocabulary.  Among the words whose origins are indeterminate are many words containing palatal velars (represented by -giy-, -kiy-, -hiy- in the Manchu script), including the name of the Manchu royal clan, gioro.  The following relatively common words are also enigmatic: boigon, "family"; boo, "house"; bonio, "monkey"; abka, "heaven"; aga, "rain"; wece-, "to shamanize"; ganio, "supernatural".

Someone also needs to do an analysis of the pre-Chinese place names of the Changbaishan, among which there are a fair number with palatal velars.  I wonder if a careful linguistic archeology might not reveal the presence of an otherwise unattested substratum language in the area of the Yalu river and Changbaishan.

Thursday, July 11, 2013

Prelude to "Deadly Weakness"

In China, there has not historically been a genre of "spy novels" like those produced in the West for the last century or so.  A number of American spy novels have been translated into Chinese, but it is only in the last ten years that Chinese authors have undertaken the task of writing original Chinese works in this genre.  One such author is Yang Hengjun, who published a trilogy serially on the internet in the years prior to the 2008 Beijing Olympics.

The following is my translation of the opening to his first novel, Deadly Weakness.

Prelude

A human body processing plant in the suburbs of the city of Qingdao, in Shandong province.

"Mr. Yang, thank you for coming," said the receptionist, with a professional smile.  "May I ask where you learned about our plant?"

"I saw your German founder at a display of human body specimens in Hong Kong three years ago.  Several hundred thousand people from Hong Kong attended it."

"Oh, yes, I remember.  Ticket sales from the Hong Kong event earned our founder more than a million HKD.  But that wasn't the most significant benefit from that event!"  The receptionist accompanied him now, eager to introduce him to the plant.  "Prior to the Hong Kong display, people told our boss that Chinese people are superstitious and consider dead bodies to be taboo--but he went ahead and did it, and hundreds of thousands of people came to see the display.  Their interest in the processing of human bodies far outstripped what we see even in Western countries, so our president decided to establish a body processing plant here in China.  Presently our body processing plan is the largest in scale of any plant he owns in the world, with 1,860 workers, able to handle the processing of six thousand cadavers per year...."

Yang interrupted her.  "Where do all the bodies come from?"

"The bodies all come from overseas."

"Oh, so...so do you have any that are my height?" Yang asked tentatively.

The receptionist glanced at Yang, hiding her surprise, then smiled.  "Do you think Germans are all tall and burly?  In fact, a lot of the cadavers are about your stature.  Since they are all immersed in special chemicals for shipping, processed by our technicians after they have arrived, then again put through a procedure that may take nine more months to produce a specimen, when they're all finished the height of the cadaver is usually about four centimeters shorter than the original body."

Yang nodded his head.  They were passing by a blue sign on the wall in English and Chinese that read "Work Center 1", and the receptionist explained: "This is where we receive international shipments of bodies, primarily from Germany.  We unpack the frozen bodies, remove their internal organs, then place them into a individual containers, immersed in a proprietary chemical formula.  This formula was created by our boss, and it's a lot like the formula for the Coca Cola you might drink every day, protected by patents all over the world.  The body remains here for six months, then moves on to Work Center 2, where it is primarily made mold-proof and desiccated.  When it is done there, the body is a lot like a Jianhua ham--no matter what temperature or condition, it won't deteriorate.  Even more like a Jinhua ham, if you were to put it in a supermarket, not even a maggot would want to eat it.  The next process takes place in Work Center 3, where the body undergoes the boss's own special process for at least six months.  Their duty is to take the processed body and to pose it very carefully according to the customer's wishes.  Some look like they are in mid-leap in a soccer game.  Some look like they would rush off to the battlefield if you were to just put a gun in their hands.  Some might be in the eighteen sexual positions, while if you were to place others in a public library, you might think they were real live people reading books, and you would tiptoe quietly by.  Lastly, we use a technique that fixes the bodies in their flamboyant postures.  Only our boss knows how to employ this technique.  Once the posture is fixed, even though you might think they look young and relaxed, there is no way you could move them.  Our human body specimens are unique.  Though their postures and expressions are worked out to the finest detail, and our products seem vivid and lifelike, nonetheless they could last fifty years without changing."

"Other factories are laying people off, but you guys are still hiring, so your business must be doing well," Yang said, covering his nose.

"We can't even supply enough product to meet the demand."  The receptionist could not conceal her pride on this point.  "At first it was only medical laboratories and universities that wanted them for their teachers to use, but now more and more institutions are placing orders, and even some individuals want a body to take back and use to decorate their offices and homes..."

"Are they all sold overseas?" asked Yang.

"Not all of them.  Currently some Chinese institutions have started to buy from us.  Originally, when our boss established his largest factory here, he was looking at the potential of the Chinese market.  At that time, this factory just took in materials (bodies) and sold the product overseas, and I hear that it won't be long before he opens a second and third factory here in China.  Then he will apply to market them locally.  Oh, right.  Mr. Yang, do you want to buy a body in some particular posture?"  The receptionist looked Yang over from head to toe as she asked.

"I...I want to buy one that looks like it is sitting and driving a car."

"Interesting, but among our clients there are people who are looking for any kind of posture.  I think Mr. Yang must be a car collector.  OK, I think it shouldn't be a problem.  You could have it for $50,000 HKD, but you'd have to wait a year for the goods."

"No, I need it this week.  I can throw in another $20,000 to expedite it."  Yang's eyes looked off into the distance.

The receptionist thought a moment, took out a handheld inventory tracker, and made a show of going through it.  At last she raised her head with a relieved sigh, "You're in luck, Mr. Yang. We have a body in the posture you are looking for, we just need to put in a little extra work to raise the arms up.  I'll see that the contract is drawn up.  After you pay, you can go back to Guangzhou, and the product will follow you a few days later."

"Thank you!"  Once they had finished talking, Yang no longer had any interest in seeing the factory.

Wednesday, June 26, 2013

The Roasted Cake Song

There is a Classical Chinese text called the Roasted Cake Song (燒餅歌), supposedly composed by the Ming official Liu Ji (劉基) who was posthumously named Liu Bowen (劉伯溫).  The song is cryptic, and is traditionally held to be prophetic, but is often considered a recent hoax.

I can't comment on whether it is prophetic or not, but I am pretty sure it is not a recent hoax.  Here is a page from the Old Manchu text Jiu Manzhou Dang, detailing a letter sent by the Manchu chieftain Nurhaci to the Khalkha of the Five Encampments in 1620.  I translate the highlighted section below.


The highlighted section says (in Old Manchu):
te geli liobe uwen-i gisunde latunahabi.  tere liobe uwen serengge dūleke julgei [n]iyalma kai. ganio joriha gese. liobe uwen-i gisun ehe sain ojibe emgeli jorime waciha kai.
Which I translate as:
Now again [events] adhere to the words of Liu Bowen.  That Liu Bowen was a person of the ancient past.  It is like he indicated supernatural things.  Regardless of whether his words were of good or evil, what he indicated came to pass.
So, at the very least, we can say that in 1620 there was some text attributed to Liu Bowen that was considered to be strange and prophetic.  It is possible that the Roasted Cake Song that survives to the present day is a hoax, but unless there is something in the content of the surviving text that is clearly anachronistic, we can probably assume that it dates at least to 1620.

Tuesday, June 4, 2013

It's a virus! It's a Trojan Horse! It's...the EPL IDE!

I tried to download the EPL 5.1.1 IDE, and it set off alarms with Chrome and Norton.  Nothing specific, just "Insight Network Threat.  There are many indications that this file is untrustworthy and therefore not safe".

A friend of mine was talking about "food fear" in China.  You can't trust the system to produce safe food, but then what choice do you have?  I think the same thing applies to software.  Who will trust software made in China?

Luckily, I don't need to play with EPL.

Sunday, June 2, 2013

易语言, a Chinese-lexified programming language

I just found out about Yìyǔyán (易语言, a.k.a. EPL), a Chinese-lexified programming language, which claims to be "The best development environment in China, and the best Chinese programming language".

I've often been curious what it would be like to work with a programming language that was not lexified from English.  I'm tempted to try it out, but first I'd like to take a look at "Teach yourself EPL in Ten Days".

Day 1 looks like an introduction to the IDE.  Here is a simple snippet of code pulled from Day 2:

变量1 = “我爱”
变量2 = “易语言”
变量3 = 变量1 + 变量2
编辑框1.内容 = 到文本 (变量3)

The syntax is generally familiar.  We have assignment (A = B), quoted strings, string concatenation with the plus sign (A + B), dot-notation for accessing object members (A.B) and parentheses to enclose function call parameters (A(B)). We can translate this snippet as follows:

variable1 = "I love" 
variable2 = "EPL" 
variable3 = variable1 + variable2 
textbox1.content = tostring(variable3)

There are several things that are incredibly interesting about this.  First, the act of translating the code from EPL to...whatever Englishy thing I translated it into...isn't a mechanical act.  There is real interpretation going on here, just as there is in translating natural language.

Translating 变量 as "variable" is no big deal, and translating the content of the strings ("I love" + "EPL") is also no big deal.  But rendering 编辑框 as "textbox" is a matter of interpretation.  Is the EPL 编辑框 the same thing as a textbox in the languages I am familiar with?  The "Textbox" I know and love in C# has a Text attribute, but the 编辑框 has a 内容 attribute.

There is something else here, too, that is really interesting.  In line 3, variable3 appears to be a concatenation of variable1 and variable2.  Normally you would expect that the result of the concatenation would be a string (文本), but then why would it need to be cast into a string (到文本) before being assigned to the content of the textbox?

One possible reason is that, when you concatenate strings in EPL, you create lists.  We'll have to keep an eye out.

This is cool!