Imagine leaving a shop door unlocked on purpose. Inside is a fake cash register and a hidden camera. Anyone who walks in thinks they have found easy money, and you simply watch what they try.
That is a honeypot [1], and it is the idea behind our capstone project, SNAPTRAP. It is a platform that pretends to be a vulnerable server, records everything attackers do, and shows it all on a live dashboard.
The idea is not new: Clifford Stoll followed a real intruder through a decoy file store in the 1980s [2]. What has changed is the scale, because today most attack traffic comes from automated bots.

Why we built it
Small organisations get attacked just as often as big ones. Port scans, password guessing and database attacks happen all day, but most small teams cannot afford enterprise tools to see them.
Open source honeypots are excellent collectors. A survey of honeypot software found that collection tooling is mature, while analysis and sharing of the captured data remain largely ad hoc [3]. Cowrie [4], Dionaea [5] and T-Pot [6] capture deeper interaction than SNAPTRAP does, but each installation is its own island: there is no separation between organisations and no model that learns attack patterns across them.

It was also a chance to apply three ideas from our High Performance Computing course to a realistic problem: asynchronous I/O, threads and multiple processes.

Who is it for?
- A college lab or start-up with a handful of servers and no security team: download one agent script, run it, and see who is probing you and how.
- A red team of authorised testers: simulate a labelled attack wave and check which attacks the classifier detected and which it missed.
- A platform operator watching several organisations at once: spot the same IP address attacking more than one of them.

What SNAPTRAP does
SNAPTRAP runs four fake services: SSH (remote login), HTTP (web), FTP (file transfer) and MySQL (database). Each looks real and accepts login attempts and requests, but exposes nothing valuable.

Here is the journey of a single attack:
1. Connect. The attacker reaches a fake service. Known bad IP addresses are turned away.
2. Stall. A “tarpit” makes the decoy answer slowly, like a shopkeeper in no hurry. The attacker wastes time while we collect more data.
3. Score. We record the login details or request and give it a threat score from 10 to 100.
4. Queue. The event joins a waiting line, so network handling never waits on the database.
5. Classify and store. A worker labels the attack with the model and saves it.
6. Block. Five suspicious events from one IP within ten minutes block it for a while.
7. Display. The dashboard shows it live.

One attack takes eight steps, and five side paths handle the exceptions

Under the hood there are four layers. The sensor is the only part that faces attackers. In the middle sit a Flask API and a PostgreSQL database. On top is a React dashboard. Underneath it all, Docker, GitHub Actions and Render deliver and run everything.

Doing many things at once
Hundreds of attackers can connect at once, and each mostly waits. So we matched three tools to three jobs: asyncio [7] runs all four decoys on one loop, like one waiter serving many tables; threads and a queue keep network work away from database work, like order slips on a counter; and multiple processes re-score stored attacks in batches, because Python’s GIL 8 prevents threads from speeding up CPU-heavy work.

Teaching a model to name attacks
The classifier is a Random Forest [10], which is many small decision trees voting on the answer, built with scikit-learn [11]. Each event becomes 19 numbers, such as payload length, how random the text looks, SQL or shell keywords, which service was hit and whether the IP has visited before.

We did not want a confident wrong answer. Below 60 percent confidence the label becomes “unknown”, and between 60 and 75 percent it is flagged “uncertain”.

The model retrains from an admin button and automatically every night.

The dashboard
The dashboard is a React app with a live “battlefield”: each attack type is a different shape moving toward a honeypot node, next to a feed of new events, charts of attack types and top attackers, and a blocklist.
Red team users can run a labelled self-test, and a built-in assistant called Snappy answers common questions from a knowledge base that runs in the browser.

Keeping organisations separate
Every organisation sees only its own data. Its identity always comes from a verified login token, never from something a user can edit in a web address. One tenant cannot peek at another by changing a number.
Passwords use Argon2id [12], a deliberately slow, memory-hungry scrambling method that OWASP recommends for password storage [13]. Browser sessions use signed JSON Web Tokens [14]. Failed logins are throttled, email verification links work only once, and every database query is parameterised, the first defence against injection attacks [15]. Organisations can also opt out of having their data used to train the model.

Testing and shipping
Everything runs in Docker. On every push, GitHub Actions runs 62 automated tests against a real PostgreSQL database, builds the dashboard and checks the container images. A nightly job retrains the model, and a metrics endpoint feeds an eight-panel Grafana dashboard. The hosted version runs on Render with a Supabase database.

One gap we still want to close: no test yet proves that one organisation cannot read another’s rows. Isolation comes from taking the organisation from the signed token, never from a request, but a test should assert it.

The bug that hid in plain sight
Our most instructive bug taught us that a safety net can hide a hole.
SNAPTRAP has a backup plan. If the machine learning model is unavailable, a simple keyword classifier takes over. SQL words mean SQL injection, for example. The platform keeps working, which sounds like a good idea. It was, until it went quietly wrong.
The honeypot tried to import two functions from the classifier module: one to load the model and one to check whether retraining was due. Neither had been written. The import failed every time. Our code caught the error, switched machine learning off and said nothing.
From then on, every live attack was labelled by the keyword rules, not the model. The dashboard still showed believable labels like “brute” and “sqli”, so nothing looked broken. We only found out when we traced one attack from connection to stored label and saw the model was never called.
Then came a second surprise. Fixing the import would have crashed the live path. The classifier function expected a small pair of values, but the live path handed it a full attack record and expected a structured answer back. The first bug had been hiding the second.

How we fixed it:
• We wrote the missing functions.
• We created a new classify_single function that takes a full attack record and returns the class, confidence, novelty flags and a warning. The old pair-based function became an internal worker for batch jobs.
• If no model exists, the function now raises a clear error, so the fallback is a deliberate choice.
• The sensor prints whether the model or the rules are active.
• A test checks that the live path gets every key it needs.
Two lessons: a fallback that fails silently is a liability, and parts that pass their own tests can still be disconnected from each other. Test the seams.

What we measured
Our measurements fell short of the targets we set before testing. The blueprint aimed for a 12x speedup at 16 workers.

Classifying events across 8 processes on a laptop reached only 2.4x, and about 1.2x with 2 workers on two-core machines. Amdahl’s law [9] explains the ceiling: the part of a job that cannot run in parallel limits the speed-up, and our laptop results imply that serial part is about a third of the work. We suspect hyper-threading and shared virtual CPUs, but we did not test that.
On the hosted deployment, adding threads to the ingest pipeline made it slower. The Python lock and one shared database connection are the likely causes, though we did not separate them.

The 16-thread run failed because our database pooler allows only 15 clients. These are small samples from one deployment, so we report them as findings about our setup, not as general results.

Other challenges
Real attacks. Render only exposes web traffic, so the SSH, FTP and MySQL decoys cannot be reached from the internet there. The hosted demo uses simulated traffic. Catching real attackers needs a server with a public IP.
Honest accuracy. Our simulator labels its own attacks, so accuracy shows how well the model separates simulated types, not how it would perform on real internet traffic.
Secrets and passwords. Seeded admin passwords reset on every restart until we changed the seeding rule to update existing rows, and early shortcuts left credentials in code. Both now come from environment variables and repository secrets.

Limits and what is next
Our decoys are low interaction. They fake the login but not a full operating system, so we cannot see what an attacker does after getting in.
Next, we plan to deploy the sensor on a server with a public IP, train on real traffic only, add a test proving one organisation cannot read another’s data, wire the process pool into live classification, repeat the benchmark with a larger connection pool, and compare the Random Forest against other models.

What we learned A fallback is only useful if it announces itself. Fixing one bug can expose another hiding behind it. And an honest limit written in the open is worth more than a flattering number.
The biggest surprise was that our most valuable findings were negative ones: a silent fallback, speed-up targets we missed, and accuracy numbers that only describe a simulator. Writing them down made the project more credible, not less.

Over to you
Have you ever been bitten by a silent fallback, or run a honeypot of your own? Tell us in the comments. And if you try SNAPTRAP, we would love to know which service attackers hit first.

Links and team
Live demo: https://snaptrap-hsxn.onrender.com/
GitHub: https://github.com/Zobiya-12/Snaptrap

Team Names
Zobiya Fatima
Hajira Nausheen
A. Sushmitha
P. Gouri Prasad Varma
K. Bhavya Sri

References

  1. L. Spitzner, Honeypots: Tracking Hackers. Boston, MA, USA: Addison-Wesley, 2002.
  2. C. Stoll, The Cuckoo’s Egg: Tracking a Spy Through the Maze of Computer Espionage. New York, NY, USA: Doubleday, 1989.
  3. M. Nawrocki, M. Waehlisch, T. C. Schmidt, C. Keil and J. Schoenfelder, “A survey on honeypot software and data analysis,” arXiv:1608.06249, 2016.
  4. M. Oosterhof, “Cowrie: SSH and Telnet honeypot,” GitHub repository, https://github.com/cowrie/cowrie.
  5. The Honeynet Project, “Dionaea: catches bugs,” project documentation, https://dionaea.readthedocs.io.
  6. Deutsche Telekom Security, “T-Pot: the all-in-one honeypot platform,” GitHub repository, https://github.com/telekom-security/tpotce.
  7. Python Software Foundation, “asyncio: Asynchronous I/O,” Python documentation, https://docs.python.org/3/library/asyncio.html.
  8. D. Beazley, “Understanding the Python GIL,” presented at PyCon 2010, Atlanta, GA, USA, 2010.
  9. G. M. Amdahl, “Validity of the single processor approach to achieving large scale computing capabilities,” in Proc. AFIPS Spring Joint Computer Conf., 1967, pp. 483-485.
  10. L. Breiman, “Random forests,” Machine Learning, vol. 45, no. 1, pp. 5-32, 2001.
  11. F. Pedregosa et al., “Scikit-learn: Machine learning in Python,” Journal of Machine Learning Research, vol. 12, pp. 2825-2830, 2011.
  12. A. Biryukov, D. Dinu and D. Khovratovich, “Argon2: New generation of memory-hard functions for password hashing and other applications,” in Proc. IEEE European Symposium on Security and Privacy (EuroS&P), 2016, pp. 292-302.
  13. OWASP Foundation, “Password Storage Cheat Sheet,” OWASP Cheat Sheet Series, https://cheatsheetseries.owasp.org.
  14. M. Jones, J. Bradley and N. Sakimura, “JSON Web Token (JWT),” IETF RFC 7519, May 2015.
  15. OWASP Foundation, “OWASP Top 10: 2021,” https://owasp.org/Top10.