DeMOSS is an anti-thesis to MOSS. It is a tool designed to evade MOSS, a plagiarism detection system used extensively by many universities to prevent students cheat in programming assignments.
Online version of the tool is available at http://sohamapps.rf.gd/demoss.
Alternatively, you can run the tool locally by opening the index.html file in your browser.
Subtle Art of De-MOSS-ing by Vivek Kaushal, who is co-incidentally an alumnus of my college.
The tool is written in JavaScript and uses CodeMirror for syntax highlighting. Tree-sitter is used to parse the source code into an abstract syntax tree (AST). The AST is then traversed to make the necessary changes to the code.
The code relies on various 'tricks' to evade MOSS, such as:
- for -> while
is converted to
for (int i = 0; i < n; i++) { // do something }
int i = 0; while (i < n) { // do something i++; }
- a < b -> b > a
- i++ -> i+=1
- swapping if-else blocks
is converted to
if (a > b) { // do something } else { // do something else }
if (a <= b) { // do something else } else { // do something }
- Presently, the tool is not fool-proof. It can be easily detected by a human.
- The tool is not designed to work with all programming languages. It currently supports only C-like languages: C++, Java and JavaScript.
- more 'tricks' to evade MOSS
- a feature to check MOSS similarity with the original code
This tool is for educational purposes only.
Morgan Mastrangelo