Adm1n_0v3rride

Terminal

Aug 8th, 2021 (edited)
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 52.47 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. commandart = r'''
  5.  
  6. 88888888888                              d888                     888
  7.    888                                 d8888                     888
  8.    888                                   888                     888
  9.    888   .d88b.  888d888 88888b.d88b.    888   88888b.   8888b.  888
  10.    888  d8P  Y8b 888P"   888 "888 "88b   888   888 "88b     "88b 888
  11.    888  88888888 888     888  888  888   888   888  888 .d888888 888
  12.    888  Y8b.     888     888  888  888   888   888  888 888  888 888
  13.    888   "Y8888  888     888  888  888 8888888 888  888 "Y888888 888
  14.  
  15. V2.0 - Command Interpreter
  16.  
  17. By Adm1n_0v3rride (C) 2021
  18.  
  19. Type "Help command" for commands
  20.  
  21. ==============================================================================================================
  22.  
  23. The five stages are: Reconnaissance > Scanning > Gaining Access > Maintaining Access > Covering Tracks.
  24.  
  25. ==============================================================================================================
  26.  
  27. '''
  28.  
  29. import os
  30. import sys
  31. import cmd
  32. import ssl
  33. import cmd
  34. import math
  35. import time
  36. import json
  37. import socket
  38. import base64
  39. import codecs
  40. import signal
  41. import struct
  42. import getpass
  43. import datetime
  44. import platform
  45. import ipaddress
  46. import threading
  47. import statistics
  48. import webbrowser
  49. import subprocess
  50. import http.client
  51. from queue import Queue
  52. from urllib import parse
  53. from pprint import pprint
  54. from urllib import request
  55. from threading import Thread
  56. from urllib import robotparser
  57. from urllib.parse import urlparse
  58. from urllib.parse import quote_plus
  59.  
  60.  
  61.  
  62. print()
  63. print(commandart)
  64. print()
  65. host_name = socket.gethostname()
  66. host_ip = socket.gethostbyname(host_name)
  67. print("-----------------------------------------------\n")
  68. print("This Computer's Name is: {0}".format(host_name))
  69. print()
  70. print("This Computer's IP is: {0}".format(host_ip))
  71. print()
  72. print("-----------------------------------------------\n")
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. def Main_Attempt():
  83.  
  84.     if sys.platform == "win32":
  85.  
  86.         class CommandProcessor(cmd.Cmd):
  87.             os.system("cls")
  88.             os.system("title Term1nal Command Interpreter")
  89.             print()
  90.             print(commandart)
  91.             print()
  92.             host_name = socket.gethostname()
  93.             host_ip = socket.gethostbyname(host_name)
  94.             print("-----------------------------------------------\n")
  95.             print("This Computer's Name is: {0}".format(host_name))
  96.             print()
  97.             print("This Computer's IP is: {0}".format(host_ip))
  98.             print()
  99.             print("-----------------------------------------------\n")
  100.             def do_command(self, command):
  101.                 """
  102.                command [Command]
  103.                Run Command
  104.                
  105.                To Restart the program
  106.                command Gh0st.exe
  107.                
  108.                New Window:
  109.                command start Gh0st.exe
  110.                
  111.                [ADMINISTRATOR] = you need to run this program in administrator mode to access more system features
  112.                
  113.                Wifi Troubleshooting Commands:
  114.                
  115.                'netsh wlan show all' - Wireless System Information Summary
  116.                
  117.                'netsh wlan show drivers' - check whether or not your computer supports a hosted network.
  118.                
  119.                'netsh wlan show profiles' - Show all stored available network profiles.
  120.                
  121.                'netsh wlan show networks' - Shows nearby networks using the current network adapters
  122.                
  123.                'netsh wlan show interfaces' - shows all network devices / cards and adapters on the system.
  124.                
  125.                [ADMINISTRATOR] 'netsh wlan show wlanreport' - Generates a wireless network report that's saved as an HTML file.
  126.                
  127.                'netsh interface ip show interfaces' - shows all active and in-active devices on the system.
  128.                
  129.                [ADMINISTRATOR] 'netsh wlan export profile folder=. key=clear' - Procure all wifi network passwords off of the current system.
  130.                
  131.                [If Installed]
  132.                
  133.                Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
  134.                
  135.                [Network Monitor]
  136.                
  137.                Example One: netstat -n 5 > scan.txt
  138.                
  139.                Example Two: netstat -a 5 > scan.txt
  140.                
  141.                Example Three: netstat -o 5 > scan.txt
  142.                
  143.                Example Four: netstat -ano 5 > scan.txt
  144.                
  145.                [All Wifi Passwords exported to XML files]
  146.                netsh wlan export profile folder=. key=clear
  147.                
  148.                [How can I determine my public IP Address?]
  149.                nslookup myip.opendns.com. resolver1.opendns.com
  150.                
  151.                [To see all usernames on the system]
  152.                dir /b C:\Users or net users
  153.                
  154.                """
  155.                 if command:
  156.                     os.system("cls")
  157.                     print()
  158.                     print(commandart)
  159.                     print()
  160.                     print("Running Command:\n\n")
  161.                     os.system(str(command))
  162.                     print()
  163.                 else:
  164.                     print()
  165.                     print('Command Error')
  166.                     print()
  167.  
  168.             def do_ping(self, ping):
  169.                 """
  170.                ping [Ip address or www address]
  171.                ping a target ex : 192.136.0.12 or www.google.com
  172.                """
  173.                 if ping:
  174.                     os.system("cls")
  175.                     print()
  176.                     print(commandart)
  177.                     print()
  178.                     print("Running Command:\n\n")
  179.                     os.system("ping " + str(ping))
  180.                     print()
  181.                 else:
  182.                     print()
  183.                     print('Command Error')
  184.                     print()
  185.  
  186.             def do_tracert(self, tracert):
  187.                 """
  188.                tracert [Ip address or www address]
  189.                tracert a target ex : 192.136.0.12 or www.google.com
  190.                """
  191.                 if tracert:
  192.                     os.system("cls")
  193.                     print()
  194.                     print(commandart)
  195.                     print()
  196.                     print("Running Command:\n\n")
  197.                     os.system("tracert " + str(tracert))
  198.                     print()
  199.                 else:
  200.                     print()
  201.                     print('Command Error')
  202.                     print()
  203.  
  204.             def do_nslookup(self, nslookup):
  205.                 """
  206.                nslookup [Ip address or www address]
  207.                nslookup a target ex : 192.136.0.12 or www.google.com
  208.                """
  209.                 if nslookup:
  210.                     os.system("cls")
  211.                     print()
  212.                     print(commandart)
  213.                     print()
  214.                     print("Running Command:\n\n")
  215.                     os.system("nslookup " + str(nslookup))
  216.                     print()
  217.                 else:
  218.                     print()
  219.                     print('Command Error')
  220.                     print()
  221.  
  222.             def do_pathping(self, pathping):
  223.                 """
  224.                pathping [Ip address or www address]
  225.                pathping a target ex : 192.136.0.12 or www.google.com
  226.                """
  227.                 if pathping:
  228.                     os.system("cls")
  229.                     print()
  230.                     print(commandart)
  231.                     print()
  232.                     print("Running Command:\n\n")
  233.                     os.system("pathping " + str(pathping))
  234.                     print()
  235.                 else:
  236.                     print()
  237.                     print('Command Error')
  238.                     print()
  239.  
  240.             def do_nbtstat_a(self, nbtstat_a):
  241.                 """
  242.                
  243.                nbtstat_a [Ip address or www address]
  244.                nbtstat_a a target ex : 192.136.0.12 or www.google.com
  245.                
  246.                Info:
  247.                Displays the NetBIOS name table of a remote computer.
  248.                
  249.                Original Command:
  250.                nbtstat -a [RemoteName]
  251.                
  252.                """
  253.                 if nbtstat_a:
  254.                     os.system("cls")
  255.                     print()
  256.                     print(commandart)
  257.                     print()
  258.                     print("Running Command:\n\n")
  259.                     os.system("nbtstat -a " + str(nbtstat_a))
  260.                     print()
  261.                 else:
  262.                     print()
  263.                     print('Command Error')
  264.                     print()
  265.  
  266.             def do_shutdown(self, shutdown):
  267.                 """
  268.                shutdown [switch]
  269.                
  270.                Example:
  271.                
  272.                shutdown -? or shutdown /? - Help Guide
  273.                
  274.                shutdown -i or shutdown /i - Remote Shutdown                
  275.                
  276.                shutdown -s or shutdown /s - Shuts down system
  277.                
  278.                shutdown -r or shutdown /r - Restarts system
  279.                
  280.                shutdown -l or shutdown /l - log off your computer
  281.                
  282.                """
  283.                 if shutdown:
  284.                     os.system("cls")
  285.                     print()
  286.                     print(commandart)
  287.                     print()
  288.                     print("Running Command:\n\n")
  289.                     os.system("shutdown " + str(shutdown))
  290.                     print()
  291.                 else:
  292.                     print()
  293.                     print('Command Error')
  294.                     print()
  295.  
  296.             def do_website_scanner(self, website_scanner):
  297.                 """
  298.                website_scanner [url]
  299.                website_scanner target ex : https://pymotw.com/
  300.                """
  301.                 if website_scanner:
  302.                     os.system("cls")
  303.                     print()
  304.                     print(commandart)
  305.                     print()
  306.                     print("Running Command:\n\n")
  307.                    
  308.                     print()
  309.                    
  310.                     print("==========================================================================")
  311.                    
  312.                     print()
  313.                    
  314.                     print("Website Report On {0}\n".format(website_scanner))
  315.                    
  316.                     print()
  317.                    
  318.                     print("==========================================================================")
  319.                    
  320.                     print()
  321.                    
  322.                     response = request.urlopen(website_scanner)
  323.                     print('RESPONSE:', response)
  324.                     print('URL     :', response.geturl())
  325.                    
  326.                     headers = response.info()
  327.                     print('DATE    :', headers['date'])
  328.                     print('HEADERS :')
  329.                     print('---------')
  330.                     print(headers)
  331.                    
  332.                     print()
  333.                    
  334.                     print()
  335.  
  336.                 else:
  337.                     print()
  338.                     print('Command Error')
  339.                     print()
  340.  
  341.             def do_port_scanner(self, port_scanner):
  342.                 """
  343.                port_scanner [Ip address]
  344.                port_scanner a target ex : 192.136.0.12
  345.                """
  346.                 if port_scanner:
  347.                     os.system("cls")
  348.                     print()
  349.                     print(commandart)
  350.                     print()
  351.                     print("Running Command:\n\n")
  352.                     print()
  353.                     socket.setdefaulttimeout(0.25)
  354.                     print_lock = threading.Lock()
  355.                    
  356.                     t_IP = socket.gethostbyname(port_scanner)
  357.                     print()
  358.                     print ('Starting scan on host: ', t_IP)
  359.                    
  360.                     def portscan(port):
  361.                         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  362.                         try:
  363.                             con = s.connect((t_IP, port))
  364.                             with print_lock:
  365.                                 print(port, 'is open')
  366.                             con.close()
  367.                         except:
  368.                             pass
  369.  
  370.                     def threader():
  371.                         while True:
  372.                             worker = q.get()
  373.                             portscan(worker)
  374.                             q.task_done()
  375.  
  376.                     q = Queue()
  377.                     startTime = time.time()
  378.  
  379.                     for x in range(100):
  380.                         t = threading.Thread(target = threader)
  381.                         t.daemon = True
  382.                         t.start()
  383.                        
  384.                     for worker in range(1, 500):
  385.                         q.put(worker)
  386.  
  387.                     q.join()
  388.                     print('Time taken:', time.time() - startTime)
  389.  
  390.                     print()
  391.                    
  392.                     print()
  393.  
  394.                 else:
  395.                     print()
  396.                     print('Command Error')
  397.                     print()
  398.  
  399.             def do_Reverse_Lookup(self, Reverse_Lookup):
  400.                 """
  401.                Reverse_Lookup [Ip address]
  402.                Reverse_Lookup a target ex : 192.136.0.12
  403.                """
  404.                 if Reverse_Lookup:
  405.                     os.system("cls")
  406.                     print()
  407.                     print(commandart)
  408.                     print()
  409.                     print("Running Command:\n\n")
  410.                     print()
  411.                     websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
  412.                     print('Hostname :', websiteonehostname)
  413.                     print()
  414.                     print('Aliases  :', websiteonealiases)
  415.                     print()
  416.                     print('Addresses:', websiteoneaddresses)
  417.                    
  418.                     print()
  419.  
  420.                 else:
  421.                     print()
  422.                     print('Command Error')
  423.                     print()
  424.  
  425.             def do_get_fdqn(self, get_fdqn):
  426.                 """
  427.                get_fdqn [Ip address]
  428.                get_fdqn a target ex : 192.136.0.12
  429.                """
  430.                 if get_fdqn:
  431.                     os.system("cls")
  432.                     print()
  433.                     print(commandart)
  434.                     print()
  435.                     print("Running Command:\n\n")
  436.                     print()
  437.                    
  438.                     websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
  439.                     print()
  440.                    
  441.                     print('Website Alias :', websiteonemakeaselectionchoice)
  442.                    
  443.                     print()
  444.  
  445.                 else:
  446.                     print()
  447.                     print('Command Error')
  448.                     print()
  449.  
  450.             def do_get_naming_info_server(self, get_naming_info_server):
  451.                 """
  452.                get_naming_info_server [Ip address]
  453.                get_naming_info_server a target ex : 192.136.0.12
  454.                """
  455.                 if get_naming_info_server:
  456.                     os.system("cls")
  457.                     print()
  458.                     print(commandart)
  459.                     print()
  460.                     print("Running Command:\n\n")
  461.                     print()
  462.                    
  463.                     websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
  464.                    
  465.                     print('Hostname :', websitetwohostname)
  466.                     print()
  467.                     print('Aliases  :', websitetwoaliases)
  468.                     print()
  469.                     print('Addresses:', websitetwoaddresses)
  470.                    
  471.                     print()
  472.  
  473.                 else:
  474.                     print()
  475.                     print('Command Error')
  476.                     print()
  477.  
  478.             def do_ncat(self, ncat):
  479.                 """
  480.                ncat [Ip address]
  481.                ncat a target ex : 192.136.0.12
  482.                """
  483.                 if ncat:
  484.                     os.system("cls")
  485.                     print()
  486.                     print(commandart)
  487.                     print()
  488.                     print("Running Command:\n\n")
  489.                     os.system("ncat " + str(ncat))
  490.                     print()
  491.                 else:
  492.                     print()
  493.                     print('Command Error')
  494.                     print()
  495.  
  496.             def do_pyinstaller(self, pyinstaller):
  497.                 """
  498.                pyinstaller [python file]
  499.                pyinstaller target ex : pyinstaller hello.py
  500.                """
  501.                 if pyinstaller:
  502.                     os.system("cls")
  503.                     print()
  504.                     print(commandart)
  505.                     print()
  506.                     print("Running Command:\n\n")
  507.                     os.system("pyinstaller --onefile " + str(pyinstaller))
  508.                     print()
  509.                 else:
  510.                     print()
  511.                     print('Command Error')
  512.                     print()
  513.  
  514.             def do_vulners(self, vulners):
  515.                 """
  516.                
  517.                [Requires nmap vulners script]
  518.                https://github.com/vulnersCom/nmap-vulners
  519.                
  520.                vulners [Ip address and web address]
  521.                vulners target ex : vulners 192.168.0.15
  522.                
  523.                """
  524.                 if vulners:
  525.                     os.system("cls")
  526.                     print()
  527.                     print(commandart)
  528.                     print()
  529.                     print("Running Command:\n\n")
  530.                     os.system("nmap --script vulners " + str(vulners))
  531.                     print()
  532.                 else:
  533.                     print()
  534.                     print('Command Error')
  535.                     print()
  536.  
  537.             def do_admin_one(self, admin_one):
  538.                 """
  539.                
  540.                admin_one [username]
  541.                Creates admin creditentals.
  542.                
  543.                Original Command:
  544.                net user /add [username] [password]
  545.                
  546.                """
  547.                 if admin_one:
  548.                     os.system("cls")
  549.                     print()
  550.                     print(commandart)
  551.                     print()
  552.                     print("Running Command:\n\n")
  553.                     os.system("net user /add " + str(admin_one) + " admin")
  554.                     print()
  555.                 else:
  556.                     print()
  557.                     print('Command Error')
  558.                     print()
  559.  
  560.             def do_admin_two(self, admin_two):
  561.                 """
  562.                admin_two [username]
  563.                Hands over admin creditentals.
  564.                
  565.                Original Command
  566.                net localgroup administrators [username] /add
  567.                
  568.                """
  569.                 if admin_two:
  570.                     os.system("cls")
  571.                     print()
  572.                     print(commandart)
  573.                     print()
  574.                     print("Running Command:\n\n")
  575.                     os.system("net localgroup administrators " + str(admin_two) + " /add")
  576.                     print()
  577.                 else:
  578.                     print()
  579.                     print('Command Error')
  580.                     print()
  581.  
  582.             def do_www_to_ip(self, www_to_ip):
  583.                 """
  584.                
  585.                www_to_ip [www address]
  586.                www_to_ip a target ex : www.google.com
  587.                
  588.                """
  589.                 if www_to_ip:
  590.                     os.system("cls")
  591.                     print()
  592.                     print(commandart)
  593.                     print()
  594.                     print("Running Command:\n\n")
  595.                     addr = socket.gethostbyname(www_to_ip)
  596.                     print()
  597.                     print('The IP address of {} is {}'.format(www_to_ip, addr))
  598.                     print()
  599.                 else:
  600.                     print()
  601.                     print('Command Error')
  602.                     print()
  603.  
  604.             def do_EOF(self, line):
  605.                 return True
  606.  
  607.             def postloop(self):
  608.                 print()
  609.  
  610.         if __name__ == '__main__':
  611.             CommandProcessor().cmdloop()
  612.    
  613.     elif sys.platform == "linux" or sys.platform == "linux2":
  614.  
  615.         class CommandProcessor(cmd.Cmd):
  616.             os.system("clear")
  617.             print()
  618.             print(commandart)
  619.             print()
  620.             host_name = socket.gethostname()
  621.             host_ip = socket.gethostbyname(host_name)
  622.             print("-----------------------------------------------\n")
  623.             print("This Computer's Name is: {0}".format(host_name))
  624.             print()
  625.             print("This Computer's IP is: {0}".format(host_ip))
  626.             print()
  627.             print("-----------------------------------------------\n")
  628.             def do_command(self, command):
  629.                 """
  630.                command [Command]
  631.                Run Command
  632.                
  633.                Wifi Troubleshooting Commands:
  634.                
  635.                'nmcli general' -
  636.                
  637.                'nmcli device status' - Viewing only devices recognized by NetworkManager and their state
  638.                
  639.                'nmcli general status' - Checking the overall status of NetworkManager
  640.                
  641.                'nmcli general logging' - Viewing NetworkManager logging status
  642.                
  643.                'nmcli connection show' - Viewing all connections
  644.                
  645.                'nmcli connection show --active' - Viewing only currently active connections
  646.                
  647.                'nmcli con show' - List all connections
  648.                
  649.                'nmcli dev wifi' - lists available Wi-Fi access points known to NetworkManager.
  650.                
  651.                'nmcli dev status' - Show the Network Manager status of all network interfaces
  652.                
  653.                'nmcli connection' - NetworkManager stores all network configuration as "connections", which are collections of data (Layer2 details, IP addressing, etc.) that describe how to create or connect to a network.
  654.                
  655.                'sudo iwlist scan' - Give the list of Access Points and Ad-Hoc cells in range, and optionally a whole bunch of information about them (ESSID, Quality, Frequency, Mode...). The type of information returned depends on what the card supports.
  656.                
  657.                'nmcli con reload' - Tell networkManager to reread the configuration files (useful after they have been edited by hand)
  658.                
  659.                'nmcli -p device list' - Viewing an output in pretty mode
  660.                
  661.                'nmcli connection show' - nmcli is a command-line tool for controlling NetworkManager and reporting network status.
  662.                
  663.                'nmcli general hostname' - To query the static host name
  664.                
  665.                [If Installed]
  666.                
  667.                Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
  668.                
  669.                
  670.                """
  671.                 if command:
  672.                     os.system("clear")
  673.                     print()
  674.                     print(commandart)
  675.                     print()
  676.                     print("Running Command:\n\n")
  677.                     os.system(str(command))
  678.                     print()
  679.                 else:
  680.                     print()
  681.                     print('Command Error')
  682.                     print()
  683.  
  684.             def do_ping(self, ping):
  685.                 """
  686.                ping [Ip address or www address]
  687.                ping a target ex : 192.136.0.12 or www.google.com
  688.                """
  689.                 if ping:
  690.                     os.system("clear")
  691.                     print()
  692.                     print(commandart)
  693.                     print()
  694.                     print("Running Command:\n\n")
  695.                     os.system("ping " + str(ping))
  696.                     print()
  697.                 else:
  698.                     print()
  699.                     print('Command Error')
  700.                     print()
  701.  
  702.             def do_mtr(self, mtr):
  703.                 """
  704.                mtr [Ip address or www address]
  705.                mtr target ex : 192.136.0.12 or www.google.com
  706.                """
  707.                 if mtr:
  708.                     os.system("clear")
  709.                     print()
  710.                     print(commandart)
  711.                     print()
  712.                     print("Running Command:\n\n")
  713.                     os.system("mtr -n " + str(mtr))
  714.                     print()
  715.                 else:
  716.                     print()
  717.                     print('Command Error')
  718.                     print()
  719.  
  720.             def do_dig(self, dig):
  721.                 """
  722.                dig [Ip address or www address]
  723.                dig target ex : 192.136.0.12 or www.google.com
  724.                """
  725.                 if dig:
  726.                     os.system("clear")
  727.                     print()
  728.                     print(commandart)
  729.                     print()
  730.                     print("Running Command:\n\n")
  731.                     os.system("dig " + str(dig))
  732.                     print()
  733.                 else:
  734.                     print()
  735.                     print('Command Error')
  736.                     print()
  737.  
  738.             def do_host(self, host):
  739.                 """
  740.                host [Ip address or www address]
  741.                host target ex : 192.136.0.12 or www.google.com
  742.                """
  743.                 if host:
  744.                     os.system("clear")
  745.                     print()
  746.                     print(commandart)
  747.                     print()
  748.                     print("Running Command:\n\n")
  749.                     os.system("host " + str(host))
  750.                     print()
  751.                 else:
  752.                     print()
  753.                     print('Command Error')
  754.                     print()
  755.  
  756.             def do_whois(self, whois):
  757.                 """
  758.                whois [Ip address or www address]
  759.                whois target ex : 192.136.0.12 or www.google.com
  760.                """
  761.                 if whois:
  762.                     os.system("clear")
  763.                     print()
  764.                     print(commandart)
  765.                     print()
  766.                     print("Running Command:\n\n")
  767.                     os.system("whois " + str(whois))
  768.                     print()
  769.                 else:
  770.                     print()
  771.                     print('Command Error')
  772.                     print()
  773.  
  774.             def do_nslookup(self, nslookup):
  775.                 """
  776.                nslookup [Ip address or www address]
  777.                nslookup target ex : 192.136.0.12 or www.google.com
  778.                """
  779.                 if nslookup:
  780.                     os.system("clear")
  781.                     print()
  782.                     print(commandart)
  783.                     print()
  784.                     print("Running Command:\n\n")
  785.                     os.system("nslookup " + str(nslookup))
  786.                     print()
  787.                 else:
  788.                     print()
  789.                     print('Command Error')
  790.                     print()
  791.  
  792.             def do_www_to_ip(self, www_to_ip):
  793.                 """
  794.                www_to_ip [www address]
  795.                www_to_ip a target ex : www.google.com
  796.                """
  797.                 if ip_to_www:
  798.                     os.system("clear")
  799.                     print()
  800.                     print(commandart)
  801.                     print()
  802.                     print("Running Command:\n\n")
  803.                     addr = socket.gethostbyname(www_to_ip)
  804.                     print()
  805.                     print('The IP address of {} is {}'.format(www_to_ip, addr))
  806.                     print()
  807.                 else:
  808.                     print()
  809.                     print('Command Error')
  810.                     print()
  811.  
  812.             def do_website_scanner(self, website_scanner):
  813.                 """
  814.                website_scanner [url]
  815.                website_scanner target ex : https://pymotw.com/
  816.                """
  817.                 if website_scanner:
  818.                     os.system("clear")
  819.                     print()
  820.                     print(commandart)
  821.                     print()
  822.                     print("Running Command:\n\n")
  823.                    
  824.                     print()
  825.                    
  826.                     print("==========================================================================")
  827.                    
  828.                     print()
  829.                    
  830.                     print("Website Report On {0}\n".format(website_scanner))
  831.                    
  832.                     print()
  833.                    
  834.                     print("==========================================================================")
  835.                    
  836.                     print()
  837.                    
  838.                     response = request.urlopen(website_scanner)
  839.                     print('RESPONSE:', response)
  840.                     print('URL     :', response.geturl())
  841.                    
  842.                     headers = response.info()
  843.                     print('DATE    :', headers['date'])
  844.                     print('HEADERS :')
  845.                     print('---------')
  846.                     print(headers)
  847.                    
  848.                     print()
  849.                    
  850.                     print()
  851.  
  852.                 else:
  853.                     print()
  854.                     print('Command Error')
  855.                     print()
  856.  
  857.             def do_port_scanner(self, port_scanner):
  858.                 """
  859.                port_scanner [Ip address]
  860.                port_scanner a target ex : 192.136.0.12
  861.                """
  862.                 if port_scanner:
  863.                     os.system("clear")
  864.                     print()
  865.                     print(commandart)
  866.                     print()
  867.                     print("Running Command:\n\n")
  868.                     print()
  869.                     socket.setdefaulttimeout(0.25)
  870.                     print_lock = threading.Lock()
  871.                    
  872.                     t_IP = socket.gethostbyname(port_scanner)
  873.                     print()
  874.                     print ('Starting scan on host: ', t_IP)
  875.                    
  876.                     def portscan(port):
  877.                         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  878.                         try:
  879.                             con = s.connect((t_IP, port))
  880.                             with print_lock:
  881.                                 print(port, 'is open')
  882.                             con.close()
  883.                         except:
  884.                             pass
  885.  
  886.                     def threader():
  887.                         while True:
  888.                             worker = q.get()
  889.                             portscan(worker)
  890.                             q.task_done()
  891.  
  892.                     q = Queue()
  893.                     startTime = time.time()
  894.  
  895.                     for x in range(100):
  896.                         t = threading.Thread(target = threader)
  897.                         t.daemon = True
  898.                         t.start()
  899.                        
  900.                     for worker in range(1, 500):
  901.                         q.put(worker)
  902.  
  903.                     q.join()
  904.                     print('Time taken:', time.time() - startTime)
  905.  
  906.                     print()
  907.                    
  908.                     print()
  909.  
  910.                 else:
  911.                     print()
  912.                     print('Command Error')
  913.                     print()
  914.  
  915.             def do_Reverse_Lookup(self, Reverse_Lookup):
  916.                 """
  917.                Reverse_Lookup [Ip address]
  918.                Reverse_Lookup a target ex : 192.136.0.12
  919.                """
  920.                 if Reverse_Lookup:
  921.                     os.system("clear")
  922.                     print()
  923.                     print(commandart)
  924.                     print()
  925.                     print("Running Command:\n\n")
  926.                     print()
  927.                     websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
  928.                     print('Hostname :', websiteonehostname)
  929.                     print()
  930.                     print('Aliases  :', websiteonealiases)
  931.                     print()
  932.                     print('Addresses:', websiteoneaddresses)
  933.                    
  934.                     print()
  935.  
  936.                 else:
  937.                     print()
  938.                     print('Command Error')
  939.                     print()
  940.  
  941.             def do_get_fdqn(self, get_fdqn):
  942.                 """
  943.                get_fdqn [Ip address]
  944.                get_fdqn a target ex : 192.136.0.12
  945.                """
  946.                 if get_fdqn:
  947.                     os.system("clear")
  948.                     print()
  949.                     print(commandart)
  950.                     print()
  951.                     print("Running Command:\n\n")
  952.                     print()
  953.                    
  954.                     websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
  955.                     print()
  956.                    
  957.                     print('Website Alias :', websiteonemakeaselectionchoice)
  958.                    
  959.                     print()
  960.  
  961.                 else:
  962.                     print()
  963.                     print('Command Error')
  964.                     print()
  965.  
  966.             def do_get_naming_info_server(self, get_naming_info_server):
  967.                 """
  968.                get_naming_info_server [Ip address]
  969.                get_naming_info_server a target ex : 192.136.0.12
  970.                """
  971.                 if get_naming_info_server:
  972.                     os.system("clear")
  973.                     print()
  974.                     print(commandart)
  975.                     print()
  976.                     print("Running Command:\n\n")
  977.                     print()
  978.                    
  979.                     websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
  980.                    
  981.                     print('Hostname :', websitetwohostname)
  982.                     print()
  983.                     print('Aliases  :', websitetwoaliases)
  984.                     print()
  985.                     print('Addresses:', websitetwoaddresses)
  986.                    
  987.                     print()
  988.  
  989.                 else:
  990.                     print()
  991.                     print('Command Error')
  992.                     print()
  993.  
  994.  
  995.  
  996.             def do_httpping(self, HttpPing):
  997.                 """
  998.                HttpPing [Ip address]
  999.                HttpPing a target ex : 192.136.0.12
  1000.                """
  1001.                 if httpping:
  1002.                     os.system("clear")
  1003.                     print()
  1004.                     print(commandart)
  1005.                     print()
  1006.                     print("Running Command:\n\n")
  1007.                     os.system("httpping " + str(httpping))
  1008.                     print()
  1009.                 else:
  1010.                     print()
  1011.                     print('Command Error')
  1012.                     print()
  1013.  
  1014.             def do_tracepath(self, tracepath):
  1015.                 """
  1016.                tracepath [Ip address]
  1017.                tracepath a target ex : 192.136.0.12
  1018.                """
  1019.                 if tracepath:
  1020.                     os.system("clear")
  1021.                     print()
  1022.                     print(commandart)
  1023.                     print()
  1024.                     print("Running Command:\n\n")
  1025.                     os.system("tracepath " + str(tracepath))
  1026.                     print()
  1027.                 else:
  1028.                     print()
  1029.                     print('Command Error')
  1030.                     print()
  1031.  
  1032.             def do_ncat(self, ncat):
  1033.                 """
  1034.                ncat [Ip address]
  1035.                ncat a target ex : 192.136.0.12
  1036.                """
  1037.                 if ncat:
  1038.                     os.system("clear")
  1039.                     print()
  1040.                     print(commandart)
  1041.                     print()
  1042.                     print("Running Command:\n\n")
  1043.                     os.system("ncat " + str(ncat))
  1044.                     print()
  1045.                 else:
  1046.                     print()
  1047.                     print('Command Error')
  1048.                     print()
  1049.  
  1050.             def do_nvulners(self, nvulners):
  1051.                 """
  1052.                vulners [Ip address and web address]
  1053.                vulners target ex : vulners 192.168.0.15
  1054.                """
  1055.                 if nvulners:
  1056.                     os.system("clear")
  1057.                     print()
  1058.                     print(commandart)
  1059.                     print()
  1060.                     print("Running Command:\n\n")
  1061.                     os.system("nmap --vulners " + str(nvulners))
  1062.                     print()
  1063.                 else:
  1064.                     print()
  1065.                     print('Command Error')
  1066.                     print()
  1067.  
  1068.             def do_EOF(self, line):
  1069.                 return True
  1070.  
  1071.             def postloop(self):
  1072.                 print()
  1073.  
  1074.         if __name__ == '__main__':
  1075.             CommandProcessor().cmdloop()
  1076.    
  1077.     elif sys.platform == "darwin":
  1078.  
  1079.         class CommandProcessor(cmd.Cmd):
  1080.             os.system("clear")
  1081.             print()
  1082.             print(commandart)
  1083.             print()
  1084.             host_name = socket.gethostname()
  1085.             host_ip = socket.gethostbyname(host_name)
  1086.             print("-----------------------------------------------\n")
  1087.             print("This Computer's Name is: {0}".format(host_name))
  1088.             print()
  1089.             print("This Computer's IP is: {0}".format(host_ip))
  1090.             print()
  1091.             print("-----------------------------------------------\n")
  1092.             def do_command(self, command):
  1093.                 """
  1094.                command [Command]
  1095.                Run Command
  1096.                
  1097.                [If Installed]
  1098.                
  1099.                Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
  1100.                
  1101.                """
  1102.                 if command:
  1103.                     os.system("clear")
  1104.                     print()
  1105.                     print(commandart)
  1106.                     print()
  1107.                     print("Running Command:\n\n")
  1108.                     os.system(str(command))
  1109.                     print()
  1110.                 else:
  1111.                     print()
  1112.                     print('Command Error')
  1113.                     print()
  1114.  
  1115.             def do_ping(self, ping):
  1116.                 """
  1117.                ping [Ip address or www address]
  1118.                ping a target ex : 192.136.0.12 or www.google.com
  1119.                """
  1120.                 if ping:
  1121.                     os.system("clear")
  1122.                     print()
  1123.                     print(commandart)
  1124.                     print()
  1125.                     print("Running Command:\n\n")
  1126.                     os.system("ping " + str(ping))
  1127.                     print()
  1128.                 else:
  1129.                     print()
  1130.                     print('Command Error')
  1131.                     print()
  1132.  
  1133.             def do_mtr(self, mtr):
  1134.                 """
  1135.                mtr [Ip address or www address]
  1136.                mtr target ex : 192.136.0.12 or www.google.com
  1137.                """
  1138.                 if mtr:
  1139.                     os.system("clear")
  1140.                     print()
  1141.                     print(commandart)
  1142.                     print()
  1143.                     print("Running Command:\n\n")
  1144.                     os.system("mtr -n " + str(mtr))
  1145.                     print()
  1146.                 else:
  1147.                     print()
  1148.                     print('Command Error')
  1149.                     print()
  1150.  
  1151.             def do_dig(self, dig):
  1152.                 """
  1153.                dig [Ip address or www address]
  1154.                dig target ex : 192.136.0.12 or www.google.com
  1155.                """
  1156.                 if dig:
  1157.                     os.system("clear")
  1158.                     print()
  1159.                     print(commandart)
  1160.                     print()
  1161.                     print("Running Command:\n\n")
  1162.                     os.system("dig " + str(dig))
  1163.                     print()
  1164.                 else:
  1165.                     print()
  1166.                     print('Command Error')
  1167.                     print()
  1168.  
  1169.             def do_host(self, host):
  1170.                 """
  1171.                host [Ip address or www address]
  1172.                host target ex : 192.136.0.12 or www.google.com
  1173.                """
  1174.                 if host:
  1175.                     os.system("clear")
  1176.                     print()
  1177.                     print(commandart)
  1178.                     print()
  1179.                     print("Running Command:\n\n")
  1180.                     os.system("host " + str(host))
  1181.                     print()
  1182.                 else:
  1183.                     print()
  1184.                     print('Command Error')
  1185.                     print()
  1186.  
  1187.             def do_whois(self, whois):
  1188.                 """
  1189.                whois [Ip address or www address]
  1190.                whois target ex : 192.136.0.12 or www.google.com
  1191.                """
  1192.                 if whois:
  1193.                     os.system("clear")
  1194.                     print()
  1195.                     print(commandart)
  1196.                     print()
  1197.                     print("Running Command:\n\n")
  1198.                     os.system("whois " + str(whois))
  1199.                     print()
  1200.                 else:
  1201.                     print()
  1202.                     print('Command Error')
  1203.                     print()
  1204.  
  1205.             def do_nslookup(self, nslookup):
  1206.                 """
  1207.                nslookup [Ip address or www address]
  1208.                nslookup target ex : 192.136.0.12 or www.google.com
  1209.                """
  1210.                 if nslookup:
  1211.                     os.system("clear")
  1212.                     print()
  1213.                     print(commandart)
  1214.                     print()
  1215.                     print("Running Command:\n\n")
  1216.                     os.system("nslookup " + str(nslookup))
  1217.                     print()
  1218.                 else:
  1219.                     print()
  1220.                     print('Command Error')
  1221.                     print()
  1222.  
  1223.             def do_www_to_ip(self, www_to_ip):
  1224.                 """
  1225.                www_to_ip [www address]
  1226.                www_to_ip a target ex : www.google.com
  1227.                """
  1228.                 if ip_to_www:
  1229.                     os.system("clear")
  1230.                     print()
  1231.                     print(commandart)
  1232.                     print()
  1233.                     print("Running Command:\n\n")
  1234.                     addr = socket.gethostbyname(www_to_ip)
  1235.                     print()
  1236.                     print('The IP address of {} is {}'.format(www_to_ip, addr))
  1237.                     print()
  1238.                 else:
  1239.                     print()
  1240.                     print('Command Error')
  1241.                     print()
  1242.  
  1243.             def do_website_scanner(self, website_scanner):
  1244.                 """
  1245.                website_scanner [url]
  1246.                website_scanner target ex : https://pymotw.com/
  1247.                """
  1248.                 if website_scanner:
  1249.                     os.system("clear")
  1250.                     print()
  1251.                     print(commandart)
  1252.                     print()
  1253.                     print("Running Command:\n\n")
  1254.                    
  1255.                     print()
  1256.                    
  1257.                     print("==========================================================================")
  1258.                    
  1259.                     print()
  1260.                    
  1261.                     print("Website Report On {0}\n".format(website_scanner))
  1262.                    
  1263.                     print()
  1264.                    
  1265.                     print("==========================================================================")
  1266.                    
  1267.                     print()
  1268.                    
  1269.                     response = request.urlopen(website_scanner)
  1270.                     print('RESPONSE:', response)
  1271.                     print('URL     :', response.geturl())
  1272.                    
  1273.                     headers = response.info()
  1274.                     print('DATE    :', headers['date'])
  1275.                     print('HEADERS :')
  1276.                     print('---------')
  1277.                     print(headers)
  1278.                    
  1279.                     print()
  1280.                    
  1281.                     print()
  1282.  
  1283.                 else:
  1284.                     print()
  1285.                     print('Command Error')
  1286.                     print()
  1287.  
  1288.             def do_port_scanner(self, port_scanner):
  1289.                 """
  1290.                port_scanner [Ip address]
  1291.                port_scanner a target ex : 192.136.0.12
  1292.                """
  1293.                 if port_scanner:
  1294.                     os.system("clear")
  1295.                     print()
  1296.                     print(commandart)
  1297.                     print()
  1298.                     print("Running Command:\n\n")
  1299.                     print()
  1300.                     socket.setdefaulttimeout(0.25)
  1301.                     print_lock = threading.Lock()
  1302.                    
  1303.                     t_IP = socket.gethostbyname(port_scanner)
  1304.                     print()
  1305.                     print ('Starting scan on host: ', t_IP)
  1306.                    
  1307.                     def portscan(port):
  1308.                         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  1309.                         try:
  1310.                             con = s.connect((t_IP, port))
  1311.                             with print_lock:
  1312.                                 print(port, 'is open')
  1313.                             con.close()
  1314.                         except:
  1315.                             pass
  1316.  
  1317.                     def threader():
  1318.                         while True:
  1319.                             worker = q.get()
  1320.                             portscan(worker)
  1321.                             q.task_done()
  1322.  
  1323.                     q = Queue()
  1324.                     startTime = time.time()
  1325.  
  1326.                     for x in range(100):
  1327.                         t = threading.Thread(target = threader)
  1328.                         t.daemon = True
  1329.                         t.start()
  1330.                        
  1331.                     for worker in range(1, 500):
  1332.                         q.put(worker)
  1333.  
  1334.                     q.join()
  1335.                     print('Time taken:', time.time() - startTime)
  1336.  
  1337.                     print()
  1338.                    
  1339.                     print()
  1340.  
  1341.                 else:
  1342.                     print()
  1343.                     print('Command Error')
  1344.                     print()
  1345.  
  1346.             def do_Reverse_Lookup(self, Reverse_Lookup):
  1347.                 """
  1348.                Reverse_Lookup [Ip address]
  1349.                Reverse_Lookup a target ex : 192.136.0.12
  1350.                """
  1351.                 if Reverse_Lookup:
  1352.                     os.system("clear")
  1353.                     print()
  1354.                     print(commandart)
  1355.                     print()
  1356.                     print("Running Command:\n\n")
  1357.                     print()
  1358.                     websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
  1359.                     print('Hostname :', websiteonehostname)
  1360.                     print()
  1361.                     print('Aliases  :', websiteonealiases)
  1362.                     print()
  1363.                     print('Addresses:', websiteoneaddresses)
  1364.                    
  1365.                     print()
  1366.  
  1367.                 else:
  1368.                     print()
  1369.                     print('Command Error')
  1370.                     print()
  1371.  
  1372.             def do_get_fdqn(self, get_fdqn):
  1373.                 """
  1374.                get_fdqn [Ip address]
  1375.                get_fdqn a target ex : 192.136.0.12
  1376.                """
  1377.                 if get_fdqn:
  1378.                     os.system("clear")
  1379.                     print()
  1380.                     print(commandart)
  1381.                     print()
  1382.                     print("Running Command:\n\n")
  1383.                     print()
  1384.                    
  1385.                     websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
  1386.                     print()
  1387.                    
  1388.                     print('Website Alias :', websiteonemakeaselectionchoice)
  1389.                    
  1390.                     print()
  1391.  
  1392.                 else:
  1393.                     print()
  1394.                     print('Command Error')
  1395.                     print()
  1396.  
  1397.             def do_get_naming_info_server(self, get_naming_info_server):
  1398.                 """
  1399.                get_naming_info_server [Ip address]
  1400.                get_naming_info_server a target ex : 192.136.0.12
  1401.                """
  1402.                 if get_naming_info_server:
  1403.                     os.system("clear")
  1404.                     print()
  1405.                     print(commandart)
  1406.                     print()
  1407.                     print("Running Command:\n\n")
  1408.                     print()
  1409.                    
  1410.                     websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
  1411.                    
  1412.                     print('Hostname :', websitetwohostname)
  1413.                     print()
  1414.                     print('Aliases  :', websitetwoaliases)
  1415.                     print()
  1416.                     print('Addresses:', websitetwoaddresses)
  1417.                    
  1418.                     print()
  1419.  
  1420.                 else:
  1421.                     print()
  1422.                     print('Command Error')
  1423.                     print()
  1424.            
  1425.             def do_httpping(self, HttpPing):
  1426.                 """
  1427.                HttpPing [Ip address]
  1428.                HttpPing a target ex : 192.136.0.12
  1429.                """
  1430.                 if httpping:
  1431.                     os.system("clear")
  1432.                     print()
  1433.                     print(commandart)
  1434.                     print()
  1435.                     print("Running Command:\n\n")
  1436.                     os.system("httpping " + str(httpping))
  1437.                     print()
  1438.                 else:
  1439.                     print()
  1440.                     print('Command Error')
  1441.                     print()
  1442.  
  1443.             def do_tracepath(self, tracepath):
  1444.                 """
  1445.                tracepath [Ip address]
  1446.                tracepath a target ex : 192.136.0.12
  1447.                """
  1448.                 if tracepath:
  1449.                     os.system("clear")
  1450.                     print()
  1451.                     print(commandart)
  1452.                     print()
  1453.                     print("Running Command:\n\n")
  1454.                     os.system("tracepath " + str(tracepath))
  1455.                     print()
  1456.                 else:
  1457.                     print()
  1458.                     print('Command Error')
  1459.                     print()
  1460.  
  1461.             def do_ncat(self, ncat):
  1462.                 """
  1463.                ncat [Ip address]
  1464.                ncat a target ex : 192.136.0.12
  1465.                """
  1466.                 if ncat:
  1467.                     os.system("clear")
  1468.                     print()
  1469.                     print(commandart)
  1470.                     print()
  1471.                     print("Running Command:\n\n")
  1472.                     os.system("ncat " + str(ncat))
  1473.                     print()
  1474.                 else:
  1475.                     print()
  1476.                     print('Command Error')
  1477.                     print()
  1478.  
  1479.             def do_nvulners(self, nvulners):
  1480.                 """
  1481.                vulners [Ip address and web address]
  1482.                vulners target ex : vulners 192.168.0.15
  1483.                """
  1484.                 if nvulners:
  1485.                     os.system("clear")
  1486.                     print()
  1487.                     print(commandart)
  1488.                     print()
  1489.                     print("Running Command:\n\n")
  1490.                     os.system("nmap --vulners " + str(nvulners))
  1491.                     print()
  1492.                 else:
  1493.                     print()
  1494.                     print('Command Error')
  1495.                     print()
  1496.  
  1497.             def do_EOF(self, line):
  1498.                 return True
  1499.  
  1500.             def postloop(self):
  1501.                 print()
  1502.  
  1503.         if __name__ == '__main__':
  1504.             CommandProcessor().cmdloop()
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530. Main_Attempt()
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
Add Comment
Please, Sign In to add comment