Find Jobs
Hire Freelancers

Python - Code for Firewall Action

€30-250 EUR

In Progress
Posted 12 months ago

€30-250 EUR

Paid on delivery
In Dos-Box (CMD) a firewall rule can be set like this (with Administrator Privileges) netsh advfirewall firewall add rule name="RULENAME" dir=out action=block protocol=TCP localip=any remoteip=any netsh advfirewall firewall add rule name="RULENAME" dir=out action=allow protocol=TCP localip=any remoteip=[login to view URL] password = "xxxxxxx" def block_internet(): print("Call block internet") # Block all outgoing traffic block_cmd = '\"netsh advfirewall firewall add rule name=\"RULENAME\" dir=out action=block protocol=TCP localip=any remoteip=any\"' [login to view URL](['runas', '/user:surface-sl-05\Administrator', 'cmd', '/c', 'echo', password, '|', 'powershell', '-Command', block_cmd], stdin=[login to view URL], stdout=[login to view URL]) print("Blocking all outgoing traffic...") I try the same with Python but I am failing as this code is not running. For testing purposes I have saving the password in clear into the programm. I just need the syntax for the subprocess The code so far: import os import subprocess import hashlib import ctypes # Funktion zum Verschlüsseln des Passworts mit MD5 def encrypt_password(password): md5_object = [login to view URL]() [login to view URL]([login to view URL]()) return [login to view URL]() # Passwort im Klartext speichern password = "Flbs28100923!" def block_internet(): print("Call block internet") # Block all outgoing traffic block_cmd = '\"netsh advfirewall firewall add rule name=\"RULENAME\" dir=out action=block protocol=TCP localip=any remoteip=any\"' [login to view URL](['runas', '/user:surface-sl-05\Administrator', 'cmd', '/c', 'echo', password, '|', 'powershell', '-Command', block_cmd], stdin=[login to view URL], stdout=[login to view URL]) print("Blocking all outgoing traffic...") # Allow outgoing traffic to [login to view URL] allow_cmd = 'netsh advfirewall firewall add rule name=\"Allow\" dir=out action=allow protocol=any remoteip=[login to view URL] localport=any' [login to view URL](['runas', '/user:surface-sl-05\Administrator', 'cmd', '/c', 'echo', password, '|', 'powershell', '-Command', allow_cmd], stdin=[login to view URL], stdout=[login to view URL]) print("Allowing outgoing traffic to exam.edu.gafa.ac.at...") # Change desktop background image image_path = 'C:\\Program Files (x86)\\Gafa Exam\\Images\\[login to view URL]' [login to view URL](['runas', '/user:surface-sl-05\Administrator', 'cmd', '/c', 'echo', 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:surface-sl-05\Administrator', 'cmd', '/c', 'echo', password, '|', 'powershell', '-Command', '[login to view URL]', '[login to view URL],UpdatePerUserSystemParameters'], stdin=[login to view URL], stdout=[login to view URL]) print("Changing desktop background image...") # Ping test response = [login to view URL]("ping [login to view URL]") if response == 0: # Ping successful, display error message [login to view URL](None, "Fehler: Ping erfolgreich, Internetverbindung nicht blockiert.", "Fehler", 0x40 | 0x1) else: # Ping unsuccessful, display success message [login to view URL](None, "Internetverbindung blockiert, nur Verbindung zu [login to view URL] ist erlaubt. Hintergrundbild wurde geändert", "Erfolg", 0x40 | 0x1) block_internet()
Project ID: 36488801

About the project

6 proposals
Remote project
Active 1 yr ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average €128 EUR for this job
User Avatar
Hello Stefan, I hope this message finds you well. I will be able to help you with your project. I read through the description and it sounds like I am just the right person for it. I have the right skill set with sophisticated experience in Python and Software Architecture. As a next step I would like to discuss some further questions with you. Either over the chat or a call, whatever you prefer. For my references and qualifications: I graduated in Computer Science with highest grades from one of the most reputable universities in Germany. Currently, I am enrolled in the Master's program. During my studies, I already published a paper on the subject of Artificial Intelligence. Further, I managed to get a lot of hands-on experience by working in several companies that operate in the field of Computer Science. As a native German speaker who was living in Canada for a year, my level in English is proficient/fluent. Further, I am in the preferred Freelancer program, making me part of the top 3% on the platform. Many successful past projects can be seen on my profile page. I am looking forward to working with you and if you have any further questions I would be happy to answer them. Best regards, Simon
€200 EUR in 3 days
5.0 (18 reviews)
5.9
5.9
User Avatar
✔️I am a senior python programmer who Gold Award Winner at University Challenges, Codeforces and ACM✔️ I am really interested in your project . I have just read your detail carefully and I have understood what you want exactly. I have 5+ years experience doing similar jobs related to these skills Python, C++ programming, AI and ML. I can complete this project perfectly on time and a low cost. Looking for your reply. Best regards.
€100 EUR in 3 days
5.0 (5 reviews)
3.2
3.2
User Avatar
I understand that you are looking for a team to create a Python code for Firewall Action on Dos-Box and I believe I am the best fit for this project. With my experience in software engineering and C programming, I am confident that I can deliver the required code quickly and accurately. Additionally, I have a degree in computer science which allows me to understand the technical complexities of the project. I understand that you would like the syntax for subprocess to be provided so that you can test the code before proceeding with the project. Additionally, I will provide guidance on how to change desktop background image and ping test so that you can verify functionality before proceeding with the project.
€140 EUR in 7 days
5.0 (1 review)
1.8
1.8
User Avatar
Hello, I have keenly checked your project requirements and I promise to deliver quality work in 2 days time, Please hire me and you will get maximum satisfaction from my work. Thank you
€140 EUR in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello, I have checked your long- description carefully and I can be sure I can solve the firewall action code issue. Let's chat here if you want to solve this issue asap. I am ready to discuss now. Regarding the time line and budget, it can be decided exactly after enough discussion. Hope to hear from you soon. Best regards, Marcos
€140 EUR in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRIA
Wien, Austria
5.0
82
Payment method verified
Member since May 15, 2017

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.