Adding windowshell.py - brcon2025-hackathons - Bitreichcon 2025 Hackathons
(HTM) git clone git://bitreich.org/brcon2025-hackathons git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/brcon2025-hackathons
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
---
(DIR) commit 21bcb97ccf369f776500e8215bf6372a86945530
(DIR) parent f10e342fba766304ea9cf5727682a096ffea4a30
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 31 Jul 2025 21:43:02 +0200
Adding windowshell.py
Diffstat:
A seeedfarming/windowshell.py | 57 +++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/seeedfarming/windowshell.py b/seeedfarming/windowshell.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env micropython
+# coding=utf-8
+#
+# Microsoft Windows is Hell.
+#
+
+import network
+import socket
+import time
+
+wlan = network.WLAN()
+wlan.active(True)
+wlan.scan()
+wlan.connect('seeeder', 'seeedrooots')
+
+while not wlan.isconnected():
+ print('.', end='')
+print(' connected')
+
+myip = wlan.ipconfig('addr4')[0]
+print(myip)
+
+myport = 70
+
+s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+s.bind((myip, myport))
+s.listen(9)
+
+def gopher_info(line):
+ line = line.replace("\t", " ")
+ print("i%s\t\t\t\t\r\n" % (line))
+
+def gopher_print(text):
+ for line in text.split("\n"):
+ gopher_info(line)
+
+def gopher_link(baseselector, newdir):
+ newdir = newdir.replace("\t", " ")
+ printf("1%s\t%s/%s\t%s\t%s\r\n" % (newdir, baseselector, newdir,
+ myserver, myport))
+
+endserial="66666666666666666"
+
+while True:
+ conn, addr = s.accept()
+ print('Connected with %s:%s' % (addr[0], addr[1]))
+ selector = conn.read()
+ selectorpath = selector.split("/")
+ serialnumber = "".join(selectorpath)
+ if serialnumber == endserial:
+ gopher_print("You found the right serial number!\nHave a nice day!\n")
+ print("%s:%s found the exit from windows hell!" % (addr[0], addr[1]))
+ else:
+ gopher_print("Welcome to Windows Hell!\nTry to find the Serial Number to exit one by one!\n Har Har Har Har ....\n")
+ for number in range(0, 9):
+ gopher_link(selector, number)
+