Phython - Firewall/Desktop Action

Geschlossen Veröffentlicht vor 1 Jahr Bezahlt bei Lieferung
Geschlossen Bezahlt bei Lieferung

Hi,

I am struggeling with that code. I need to block any outgoing traffic except traffic to 80.64.129.139. When program (python) is running then the desktop wallpaper should be changed:

Program runs thru but nothing happens. I still can connect to internet, the desktop is not changed.

import os

import subprocess

import hashlib

import ctypes

# Liest das verschlüsselte Administrator-Passwort aus der Datei

password_file = 'C:\\Program Files (x86)\\Gafa Exam\\Files\\[login to view URL]'

with open(password_file, 'rb') as f:

encrypted_password = [login to view URL]()

# Entschlüsselt das Passwort mit MD5

md5_object = [login to view URL]()

[login to view URL](encrypted_password)

decrypted_password = [login to view URL]()

# Netzwerkverbindungen zu Public IP Adressen blockieren

block_cmd = 'netsh advfirewall firewall add rule name=\'Block - All\' dir=out action=block protocol=TCP localip=any remoteip=any'

[login to view URL](['runas', '/user:offic', 'cmd', '/c', 'echo', decrypted_password, '|', 'powershell', '-Command', block_cmd], stdin=[login to view URL], stdout=[login to view URL])

# Netzwerkverbindung zur IP-Adresse [login to view URL] erlauben

allow_cmd = "netsh advfirewall firewall add rule name='Allow - Gafa' dir=out action=allow protocol=TCP localip=any remoteip=[login to view URL]"

[login to view URL](['runas', '/user:offic', 'cmd', '/c', 'echo', decrypted_password, '|', 'powershell', '-Command', allow_cmd], stdin=[login to view URL], stdout=[login to view URL])

# Desktop-Hintergrundbild ändern

image_path = 'C:\\Program Files (x86)\\Gafa Exam\\Images\\[login to view URL]'

[login to view URL](['runas', '/user:offic', 'cmd', '/c', 'echo', decrypted_password, '|', 'powershell', '-Command', 'REG', 'ADD', 'HKCU\\Control Panel\\Desktop', '/v', 'Wallpaper', '/t', 'REG_SZ', '/d', image_path, '/f'], stdin=[login to view URL], stdout=[login to view URL])

[login to view URL](['runas', '/user:offic', 'cmd', '/c', 'echo', decrypted_password, '|', 'powershell', '-Command', '[login to view URL]', '[login to view URL],UpdatePerUserSystemParameters'], stdin=[login to view URL], stdout=[login to view URL])

# Meldung anzeigen, wenn alle Befehle erfolgreich ausgeführt wurden

[login to view URL](None, "Der PC ist nun im Prüfungsmodus.", "Erfolgreich", 0x40 | 0x1)

Python C++ Programmierung C Programmierung Shell Script Linux

Projekt-ID: #36487233

Über das Projekt

8 Vorschläge Remote Projekt Aktiv vor 11 Monaten

8 Freelancer bieten im Durchschnitt €141 für diesen Job

imtyzooel71n

Hi, I am Senior Python script developer with 10 years of experience. I can bug fix by python with your instructions very short time. Can we discuss please? Thanks

€140 EUR in 1 Tag
(77 Bewertungen)
7.2
jinc772

Hi, I can help you as python expert. I am looking forward for honest client and will do my best for you. Thanks

€140 EUR in 7 Tagen
(20 Bewertungen)
6.8
writerLanguage

Hi Greeting of the Day!!! If you are looking for an Expert Python developer who can write auto-updater for websites then I am here to help you and can start right now. So can you please send me the complete detail so Mehr

€200 EUR in 7 Tagen
(4 Bewertungen)
3.2
lenzfabian

Hi, da du hier Deutsche Kommentare verwendest probiere ich mein Glück und schreibe dir auf Deutsch. Ich bin Fabian bin im First LvL Bereich der Bundeswehr unterwegs. Ich würde dir Vorab ein paar gratis Tipps zu deinem Mehr

€90 EUR in 3 Tagen
(0 Bewertungen)
0.0