Skip to content

Commit

Permalink
Minor eye-candy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stasinopoulos authored Mar 16, 2017
1 parent 0582d42 commit 0e72463
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions ptf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Website: https://www.trustedsec.com
####################################################################################

from src.core import *
import sys
import subprocess
import os
Expand All @@ -22,8 +23,8 @@ def create_launcher():
# check for an Internet connection
def check_internet():
try:
print("[*] You can always type ./ptf --no-network-connection to skip the Internet check..")
print("[*] Checking for an Internet connection...")
print_status("You can always type ./ptf --no-network-connection to skip the Internet check..")
print_status("Checking for an Internet connection...")
rhost = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
rhost.connect(('google.com', 0))
rhost.settimeout(2)
Expand All @@ -47,15 +48,13 @@ try:
if not "--no-network-connection" in sys.argv[1:]:
# check internet connection
if check_internet() == 0:
print ("[!] Unable to detect Internet connection. Needed for PTF.")
print (
"[!] We will now exit PTF. Launch again when you got a connection.")
print (
"[!] You can also run ptf with the --no-network-connection argument to bypass the network check.")
print_warning("Unable to detect Internet connection. Needed for PTF.")
print_warning("We will now exit PTF. Launch again when you got a connection.")
print_warning("You can also run ptf with the --no-network-connection argument to bypass the network check.")
sys.exit()

# try to update ourself first
print("[*] Trying to update myself first.. Then starting framework.")
print_status("Trying to update myself first.. Then starting framework.")
subprocess.Popen("git pull", shell=True).wait()

# create automatic launcher
Expand All @@ -78,12 +77,11 @@ try:

except KeyboardInterrupt:
print("\n")
print("[*] Exiting PTF - the easy pentest platform creation framework.")
print_status("Exiting PTF - the easy pentest platform creation framework.")
exit()
sys.exit()

except Exception as e:
print ("[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.")
print ("[!] It's not possible its due to my coding skillz, it must be you? :-)")
print(("[!] Printing that error. Get that error. You get it: " + str(e)))

print_error("[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.")
print_error("[!] It's not possible its due to my coding skillz, it must be you? :-)")
print_error(("[!] Printing that error. Get that error. You get it: " + str(e)))

0 comments on commit 0e72463

Please sign in to comment.