The Language of Legal and Illegal Activity on the Darknet

Leshem Choshen, Dan Eldad, Daniel Hershcovich, Elior Sulem, Omri Abend

Abstract

The non-indexed parts of the Internet (the Darknet) have become a haven for both legal and illegal anonymous activity. Given the magnitude of these networks, scalably monitoring their activity necessarily relies on automated tools, and notably on NLP tools. However, little is known about what characteristics texts communicated through the Darknet have, and how well off-the-shelf NLP tools do on this domain. This paper tackles this gap and performs an in-depth investigation of the characteristics of legal and illegal text in the Darknet, comparing it to a clear net website with similar content as a control condition. Taking drug-related websites as a test case, we find that texts for selling legal and illegal drugs have several linguistic characteristics that distinguish them from one another, as well as from the control condition, among them the distribution of POS tags, and the coverage of their named entities in Wikipedia.

Introduction

The "Darknet"—specifically Onion services accessible via the Tor network—is often viewed as a monolith of illicit activity. However, it hosts a diverse range of content, from privacy-focused forums to pharmaceutical marketplaces and illegal drug bazaars. As the volume of this data grows, automated Natural Language Processing (NLP) becomes essential for monitoring and research. A critical challenge arises: most NLP models are trained on "Clear Net" data (e.g., Wikipedia, news), which may not generalize to the idiosyncratic language of the Darknet. This study investigates whether illegal activity constitutes a distinct linguistic domain and evaluates how standard NLP tools perform in this environment.

Quantifying Domain Divergence

To determine if illegal Darknet text is linguistically unique, researchers compared drug-related Onion sites (legal and illegal) against eBay descriptions as a control. Using Jensen-Shannon (JS) divergence to measure word distribution differences, the study found that the gap between legal and illegal Onion text is significant.

Jensen-Shannon divergence values showing the linguistic distance between different web domains.

As shown in the divergence table, the internal consistency (self-distance) of these datasets ranges from 0.23 to 0.26. In contrast, the distance between legal and illegal Onion domains (approx. 0.61) is comparable to the distance between the Darknet and the Clear Net (eBay). This suggests that "illegality" itself acts as a domain boundary, necessitating specialized treatment in NLP tasks.

The Wikification Gap

A key component of understanding specialized text is linking entities to known concepts, a process called "Wikification." The study used the spaCy library to extract named entities and attempted to link them to Wikipedia. The results revealed a stark contrast: while over 50% of entities on legal Onion sites were "Wikifiable," only 32.5% of entities on illegal sites could be linked. Standard tools often misidentified drug slang (e.g., "kush" or "GBL") as unknown entities, highlighting the need for domain-specific knowledge bases.

Classification and Feature Sensitivity

The researchers tested several classifiers—ranging from Naive Bayes (NB) and Support Vector Machines (SVM) to Attention-based neural networks—to distinguish between legal and illegal content. Surprisingly, simple models like Naive Bayes often outperformed complex neural networks, likely because pre-trained embeddings (like GloVe) are not tuned for the idiosyncratic vocabulary of the Darknet.

Classification accuracy heatmaps for various models across different datasets and feature isolation conditions.

A major finding was the role of syntax. Classifiers achieved high accuracy (~71%) using only Part-of-Speech (POS) tags. This indicates that illegal activity is not just defined by specific keywords or slang, but by unique grammatical structures and sentence patterns. Furthermore, models trained on drug-selling sites generalized well to forums (achieving ~85% accuracy with SVM), suggesting a consistent linguistic signature of illegality across different types of Darknet sites.

Conclusion

Illegal activity on the Darknet is not merely a subset of web text; it is a distinct linguistic domain. The failure of standard "Wikification" and the superior performance of simple models over pre-trained neural nets underscore the "domain shift" problem. Future efforts in Darknet monitoring must prioritize domain adaptation, including the development of specialized word embeddings and knowledge bases that account for the unique syntactic and lexical patterns of illicit online spaces.

Summary updated

BibTeX
@inproceedings{choshen2019language,
  author = {Leshem Choshen and Dan Eldad and Daniel Hershcovich and Elior Sulem and Omri Abend},
  title = {{The Language of Legal and Illegal Activity on the Darknet}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/p19-1419},
}
Figure