Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- commandart = r'''
- 88888888888 d888 888
- 888 d8888 888
- 888 888 888
- 888 .d88b. 888d888 88888b.d88b. 888 88888b. 8888b. 888
- 888 d8P Y8b 888P" 888 "888 "88b 888 888 "88b "88b 888
- 888 88888888 888 888 888 888 888 888 888 .d888888 888
- 888 Y8b. 888 888 888 888 888 888 888 888 888 888
- 888 "Y8888 888 888 888 888 8888888 888 888 "Y888888 888
- V2.0 - Command Interpreter
- By Adm1n_0v3rride (C) 2021
- Type "Help command" for commands
- ==============================================================================================================
- The five stages are: Reconnaissance > Scanning > Gaining Access > Maintaining Access > Covering Tracks.
- ==============================================================================================================
- '''
- import os
- import sys
- import cmd
- import ssl
- import cmd
- import math
- import time
- import json
- import socket
- import base64
- import codecs
- import signal
- import struct
- import getpass
- import datetime
- import platform
- import ipaddress
- import threading
- import statistics
- import webbrowser
- import subprocess
- import http.client
- from queue import Queue
- from urllib import parse
- from pprint import pprint
- from urllib import request
- from threading import Thread
- from urllib import robotparser
- from urllib.parse import urlparse
- from urllib.parse import quote_plus
- print()
- print(commandart)
- print()
- host_name = socket.gethostname()
- host_ip = socket.gethostbyname(host_name)
- print("-----------------------------------------------\n")
- print("This Computer's Name is: {0}".format(host_name))
- print()
- print("This Computer's IP is: {0}".format(host_ip))
- print()
- print("-----------------------------------------------\n")
- def Main_Attempt():
- if sys.platform == "win32":
- class CommandProcessor(cmd.Cmd):
- os.system("cls")
- os.system("title Term1nal Command Interpreter")
- print()
- print(commandart)
- print()
- host_name = socket.gethostname()
- host_ip = socket.gethostbyname(host_name)
- print("-----------------------------------------------\n")
- print("This Computer's Name is: {0}".format(host_name))
- print()
- print("This Computer's IP is: {0}".format(host_ip))
- print()
- print("-----------------------------------------------\n")
- def do_command(self, command):
- """
- command [Command]
- Run Command
- To Restart the program
- command Gh0st.exe
- New Window:
- command start Gh0st.exe
- [ADMINISTRATOR] = you need to run this program in administrator mode to access more system features
- Wifi Troubleshooting Commands:
- 'netsh wlan show all' - Wireless System Information Summary
- 'netsh wlan show drivers' - check whether or not your computer supports a hosted network.
- 'netsh wlan show profiles' - Show all stored available network profiles.
- 'netsh wlan show networks' - Shows nearby networks using the current network adapters
- 'netsh wlan show interfaces' - shows all network devices / cards and adapters on the system.
- [ADMINISTRATOR] 'netsh wlan show wlanreport' - Generates a wireless network report that's saved as an HTML file.
- 'netsh interface ip show interfaces' - shows all active and in-active devices on the system.
- [ADMINISTRATOR] 'netsh wlan export profile folder=. key=clear' - Procure all wifi network passwords off of the current system.
- [If Installed]
- Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
- [Network Monitor]
- Example One: netstat -n 5 > scan.txt
- Example Two: netstat -a 5 > scan.txt
- Example Three: netstat -o 5 > scan.txt
- Example Four: netstat -ano 5 > scan.txt
- [All Wifi Passwords exported to XML files]
- netsh wlan export profile folder=. key=clear
- [How can I determine my public IP Address?]
- nslookup myip.opendns.com. resolver1.opendns.com
- [To see all usernames on the system]
- dir /b C:\Users or net users
- """
- if command:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system(str(command))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ping(self, ping):
- """
- ping [Ip address or www address]
- ping a target ex : 192.136.0.12 or www.google.com
- """
- if ping:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ping " + str(ping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_tracert(self, tracert):
- """
- tracert [Ip address or www address]
- tracert a target ex : 192.136.0.12 or www.google.com
- """
- if tracert:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("tracert " + str(tracert))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nslookup(self, nslookup):
- """
- nslookup [Ip address or www address]
- nslookup a target ex : 192.136.0.12 or www.google.com
- """
- if nslookup:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nslookup " + str(nslookup))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_pathping(self, pathping):
- """
- pathping [Ip address or www address]
- pathping a target ex : 192.136.0.12 or www.google.com
- """
- if pathping:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("pathping " + str(pathping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nbtstat_a(self, nbtstat_a):
- """
- nbtstat_a [Ip address or www address]
- nbtstat_a a target ex : 192.136.0.12 or www.google.com
- Info:
- Displays the NetBIOS name table of a remote computer.
- Original Command:
- nbtstat -a [RemoteName]
- """
- if nbtstat_a:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nbtstat -a " + str(nbtstat_a))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_shutdown(self, shutdown):
- """
- shutdown [switch]
- Example:
- shutdown -? or shutdown /? - Help Guide
- shutdown -i or shutdown /i - Remote Shutdown
- shutdown -s or shutdown /s - Shuts down system
- shutdown -r or shutdown /r - Restarts system
- shutdown -l or shutdown /l - log off your computer
- """
- if shutdown:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("shutdown " + str(shutdown))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_website_scanner(self, website_scanner):
- """
- website_scanner [url]
- website_scanner target ex : https://pymotw.com/
- """
- if website_scanner:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- print("==========================================================================")
- print()
- print("Website Report On {0}\n".format(website_scanner))
- print()
- print("==========================================================================")
- print()
- response = request.urlopen(website_scanner)
- print('RESPONSE:', response)
- print('URL :', response.geturl())
- headers = response.info()
- print('DATE :', headers['date'])
- print('HEADERS :')
- print('---------')
- print(headers)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_port_scanner(self, port_scanner):
- """
- port_scanner [Ip address]
- port_scanner a target ex : 192.136.0.12
- """
- if port_scanner:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- socket.setdefaulttimeout(0.25)
- print_lock = threading.Lock()
- t_IP = socket.gethostbyname(port_scanner)
- print()
- print ('Starting scan on host: ', t_IP)
- def portscan(port):
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- con = s.connect((t_IP, port))
- with print_lock:
- print(port, 'is open')
- con.close()
- except:
- pass
- def threader():
- while True:
- worker = q.get()
- portscan(worker)
- q.task_done()
- q = Queue()
- startTime = time.time()
- for x in range(100):
- t = threading.Thread(target = threader)
- t.daemon = True
- t.start()
- for worker in range(1, 500):
- q.put(worker)
- q.join()
- print('Time taken:', time.time() - startTime)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_Reverse_Lookup(self, Reverse_Lookup):
- """
- Reverse_Lookup [Ip address]
- Reverse_Lookup a target ex : 192.136.0.12
- """
- if Reverse_Lookup:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
- print('Hostname :', websiteonehostname)
- print()
- print('Aliases :', websiteonealiases)
- print()
- print('Addresses:', websiteoneaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_fdqn(self, get_fdqn):
- """
- get_fdqn [Ip address]
- get_fdqn a target ex : 192.136.0.12
- """
- if get_fdqn:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
- print()
- print('Website Alias :', websiteonemakeaselectionchoice)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_naming_info_server(self, get_naming_info_server):
- """
- get_naming_info_server [Ip address]
- get_naming_info_server a target ex : 192.136.0.12
- """
- if get_naming_info_server:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
- print('Hostname :', websitetwohostname)
- print()
- print('Aliases :', websitetwoaliases)
- print()
- print('Addresses:', websitetwoaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ncat(self, ncat):
- """
- ncat [Ip address]
- ncat a target ex : 192.136.0.12
- """
- if ncat:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ncat " + str(ncat))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_pyinstaller(self, pyinstaller):
- """
- pyinstaller [python file]
- pyinstaller target ex : pyinstaller hello.py
- """
- if pyinstaller:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("pyinstaller --onefile " + str(pyinstaller))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_vulners(self, vulners):
- """
- [Requires nmap vulners script]
- https://github.com/vulnersCom/nmap-vulners
- vulners [Ip address and web address]
- vulners target ex : vulners 192.168.0.15
- """
- if vulners:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nmap --script vulners " + str(vulners))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_admin_one(self, admin_one):
- """
- admin_one [username]
- Creates admin creditentals.
- Original Command:
- net user /add [username] [password]
- """
- if admin_one:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("net user /add " + str(admin_one) + " admin")
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_admin_two(self, admin_two):
- """
- admin_two [username]
- Hands over admin creditentals.
- Original Command
- net localgroup administrators [username] /add
- """
- if admin_two:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("net localgroup administrators " + str(admin_two) + " /add")
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_www_to_ip(self, www_to_ip):
- """
- www_to_ip [www address]
- www_to_ip a target ex : www.google.com
- """
- if www_to_ip:
- os.system("cls")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- addr = socket.gethostbyname(www_to_ip)
- print()
- print('The IP address of {} is {}'.format(www_to_ip, addr))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_EOF(self, line):
- return True
- def postloop(self):
- print()
- if __name__ == '__main__':
- CommandProcessor().cmdloop()
- elif sys.platform == "linux" or sys.platform == "linux2":
- class CommandProcessor(cmd.Cmd):
- os.system("clear")
- print()
- print(commandart)
- print()
- host_name = socket.gethostname()
- host_ip = socket.gethostbyname(host_name)
- print("-----------------------------------------------\n")
- print("This Computer's Name is: {0}".format(host_name))
- print()
- print("This Computer's IP is: {0}".format(host_ip))
- print()
- print("-----------------------------------------------\n")
- def do_command(self, command):
- """
- command [Command]
- Run Command
- Wifi Troubleshooting Commands:
- 'nmcli general' -
- 'nmcli device status' - Viewing only devices recognized by NetworkManager and their state
- 'nmcli general status' - Checking the overall status of NetworkManager
- 'nmcli general logging' - Viewing NetworkManager logging status
- 'nmcli connection show' - Viewing all connections
- 'nmcli connection show --active' - Viewing only currently active connections
- 'nmcli con show' - List all connections
- 'nmcli dev wifi' - lists available Wi-Fi access points known to NetworkManager.
- 'nmcli dev status' - Show the Network Manager status of all network interfaces
- '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.
- '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.
- 'nmcli con reload' - Tell networkManager to reread the configuration files (useful after they have been edited by hand)
- 'nmcli -p device list' - Viewing an output in pretty mode
- 'nmcli connection show' - nmcli is a command-line tool for controlling NetworkManager and reporting network status.
- 'nmcli general hostname' - To query the static host name
- [If Installed]
- Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
- """
- if command:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system(str(command))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ping(self, ping):
- """
- ping [Ip address or www address]
- ping a target ex : 192.136.0.12 or www.google.com
- """
- if ping:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ping " + str(ping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_mtr(self, mtr):
- """
- mtr [Ip address or www address]
- mtr target ex : 192.136.0.12 or www.google.com
- """
- if mtr:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("mtr -n " + str(mtr))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_dig(self, dig):
- """
- dig [Ip address or www address]
- dig target ex : 192.136.0.12 or www.google.com
- """
- if dig:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("dig " + str(dig))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_host(self, host):
- """
- host [Ip address or www address]
- host target ex : 192.136.0.12 or www.google.com
- """
- if host:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("host " + str(host))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_whois(self, whois):
- """
- whois [Ip address or www address]
- whois target ex : 192.136.0.12 or www.google.com
- """
- if whois:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("whois " + str(whois))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nslookup(self, nslookup):
- """
- nslookup [Ip address or www address]
- nslookup target ex : 192.136.0.12 or www.google.com
- """
- if nslookup:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nslookup " + str(nslookup))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_www_to_ip(self, www_to_ip):
- """
- www_to_ip [www address]
- www_to_ip a target ex : www.google.com
- """
- if ip_to_www:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- addr = socket.gethostbyname(www_to_ip)
- print()
- print('The IP address of {} is {}'.format(www_to_ip, addr))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_website_scanner(self, website_scanner):
- """
- website_scanner [url]
- website_scanner target ex : https://pymotw.com/
- """
- if website_scanner:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- print("==========================================================================")
- print()
- print("Website Report On {0}\n".format(website_scanner))
- print()
- print("==========================================================================")
- print()
- response = request.urlopen(website_scanner)
- print('RESPONSE:', response)
- print('URL :', response.geturl())
- headers = response.info()
- print('DATE :', headers['date'])
- print('HEADERS :')
- print('---------')
- print(headers)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_port_scanner(self, port_scanner):
- """
- port_scanner [Ip address]
- port_scanner a target ex : 192.136.0.12
- """
- if port_scanner:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- socket.setdefaulttimeout(0.25)
- print_lock = threading.Lock()
- t_IP = socket.gethostbyname(port_scanner)
- print()
- print ('Starting scan on host: ', t_IP)
- def portscan(port):
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- con = s.connect((t_IP, port))
- with print_lock:
- print(port, 'is open')
- con.close()
- except:
- pass
- def threader():
- while True:
- worker = q.get()
- portscan(worker)
- q.task_done()
- q = Queue()
- startTime = time.time()
- for x in range(100):
- t = threading.Thread(target = threader)
- t.daemon = True
- t.start()
- for worker in range(1, 500):
- q.put(worker)
- q.join()
- print('Time taken:', time.time() - startTime)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_Reverse_Lookup(self, Reverse_Lookup):
- """
- Reverse_Lookup [Ip address]
- Reverse_Lookup a target ex : 192.136.0.12
- """
- if Reverse_Lookup:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
- print('Hostname :', websiteonehostname)
- print()
- print('Aliases :', websiteonealiases)
- print()
- print('Addresses:', websiteoneaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_fdqn(self, get_fdqn):
- """
- get_fdqn [Ip address]
- get_fdqn a target ex : 192.136.0.12
- """
- if get_fdqn:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
- print()
- print('Website Alias :', websiteonemakeaselectionchoice)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_naming_info_server(self, get_naming_info_server):
- """
- get_naming_info_server [Ip address]
- get_naming_info_server a target ex : 192.136.0.12
- """
- if get_naming_info_server:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
- print('Hostname :', websitetwohostname)
- print()
- print('Aliases :', websitetwoaliases)
- print()
- print('Addresses:', websitetwoaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_httpping(self, HttpPing):
- """
- HttpPing [Ip address]
- HttpPing a target ex : 192.136.0.12
- """
- if httpping:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("httpping " + str(httpping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_tracepath(self, tracepath):
- """
- tracepath [Ip address]
- tracepath a target ex : 192.136.0.12
- """
- if tracepath:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("tracepath " + str(tracepath))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ncat(self, ncat):
- """
- ncat [Ip address]
- ncat a target ex : 192.136.0.12
- """
- if ncat:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ncat " + str(ncat))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nvulners(self, nvulners):
- """
- vulners [Ip address and web address]
- vulners target ex : vulners 192.168.0.15
- """
- if nvulners:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nmap --vulners " + str(nvulners))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_EOF(self, line):
- return True
- def postloop(self):
- print()
- if __name__ == '__main__':
- CommandProcessor().cmdloop()
- elif sys.platform == "darwin":
- class CommandProcessor(cmd.Cmd):
- os.system("clear")
- print()
- print(commandart)
- print()
- host_name = socket.gethostname()
- host_ip = socket.gethostbyname(host_name)
- print("-----------------------------------------------\n")
- print("This Computer's Name is: {0}".format(host_name))
- print()
- print("This Computer's IP is: {0}".format(host_ip))
- print()
- print("-----------------------------------------------\n")
- def do_command(self, command):
- """
- command [Command]
- Run Command
- [If Installed]
- Pyinstaller.exe --onefile --windowed --icon=app.ico app.py
- """
- if command:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system(str(command))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ping(self, ping):
- """
- ping [Ip address or www address]
- ping a target ex : 192.136.0.12 or www.google.com
- """
- if ping:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ping " + str(ping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_mtr(self, mtr):
- """
- mtr [Ip address or www address]
- mtr target ex : 192.136.0.12 or www.google.com
- """
- if mtr:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("mtr -n " + str(mtr))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_dig(self, dig):
- """
- dig [Ip address or www address]
- dig target ex : 192.136.0.12 or www.google.com
- """
- if dig:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("dig " + str(dig))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_host(self, host):
- """
- host [Ip address or www address]
- host target ex : 192.136.0.12 or www.google.com
- """
- if host:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("host " + str(host))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_whois(self, whois):
- """
- whois [Ip address or www address]
- whois target ex : 192.136.0.12 or www.google.com
- """
- if whois:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("whois " + str(whois))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nslookup(self, nslookup):
- """
- nslookup [Ip address or www address]
- nslookup target ex : 192.136.0.12 or www.google.com
- """
- if nslookup:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nslookup " + str(nslookup))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_www_to_ip(self, www_to_ip):
- """
- www_to_ip [www address]
- www_to_ip a target ex : www.google.com
- """
- if ip_to_www:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- addr = socket.gethostbyname(www_to_ip)
- print()
- print('The IP address of {} is {}'.format(www_to_ip, addr))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_website_scanner(self, website_scanner):
- """
- website_scanner [url]
- website_scanner target ex : https://pymotw.com/
- """
- if website_scanner:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- print("==========================================================================")
- print()
- print("Website Report On {0}\n".format(website_scanner))
- print()
- print("==========================================================================")
- print()
- response = request.urlopen(website_scanner)
- print('RESPONSE:', response)
- print('URL :', response.geturl())
- headers = response.info()
- print('DATE :', headers['date'])
- print('HEADERS :')
- print('---------')
- print(headers)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_port_scanner(self, port_scanner):
- """
- port_scanner [Ip address]
- port_scanner a target ex : 192.136.0.12
- """
- if port_scanner:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- socket.setdefaulttimeout(0.25)
- print_lock = threading.Lock()
- t_IP = socket.gethostbyname(port_scanner)
- print()
- print ('Starting scan on host: ', t_IP)
- def portscan(port):
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- con = s.connect((t_IP, port))
- with print_lock:
- print(port, 'is open')
- con.close()
- except:
- pass
- def threader():
- while True:
- worker = q.get()
- portscan(worker)
- q.task_done()
- q = Queue()
- startTime = time.time()
- for x in range(100):
- t = threading.Thread(target = threader)
- t.daemon = True
- t.start()
- for worker in range(1, 500):
- q.put(worker)
- q.join()
- print('Time taken:', time.time() - startTime)
- print()
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_Reverse_Lookup(self, Reverse_Lookup):
- """
- Reverse_Lookup [Ip address]
- Reverse_Lookup a target ex : 192.136.0.12
- """
- if Reverse_Lookup:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonehostname, websiteonealiases, websiteoneaddresses = socket.gethostbyaddr(Reverse_Lookup)
- print('Hostname :', websiteonehostname)
- print()
- print('Aliases :', websiteonealiases)
- print()
- print('Addresses:', websiteoneaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_fdqn(self, get_fdqn):
- """
- get_fdqn [Ip address]
- get_fdqn a target ex : 192.136.0.12
- """
- if get_fdqn:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websiteonemakeaselectionchoice = socket.getfqdn(get_fdqn)
- print()
- print('Website Alias :', websiteonemakeaselectionchoice)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_get_naming_info_server(self, get_naming_info_server):
- """
- get_naming_info_server [Ip address]
- get_naming_info_server a target ex : 192.136.0.12
- """
- if get_naming_info_server:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- print()
- websitetwohostname, websitetwoaliases, websitetwoaddresses = socket.gethostbyname_ex(kidandkiprainesbutinitatedsomethinglethalchoice)
- print('Hostname :', websitetwohostname)
- print()
- print('Aliases :', websitetwoaliases)
- print()
- print('Addresses:', websitetwoaddresses)
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_httpping(self, HttpPing):
- """
- HttpPing [Ip address]
- HttpPing a target ex : 192.136.0.12
- """
- if httpping:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("httpping " + str(httpping))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_tracepath(self, tracepath):
- """
- tracepath [Ip address]
- tracepath a target ex : 192.136.0.12
- """
- if tracepath:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("tracepath " + str(tracepath))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_ncat(self, ncat):
- """
- ncat [Ip address]
- ncat a target ex : 192.136.0.12
- """
- if ncat:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("ncat " + str(ncat))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_nvulners(self, nvulners):
- """
- vulners [Ip address and web address]
- vulners target ex : vulners 192.168.0.15
- """
- if nvulners:
- os.system("clear")
- print()
- print(commandart)
- print()
- print("Running Command:\n\n")
- os.system("nmap --vulners " + str(nvulners))
- print()
- else:
- print()
- print('Command Error')
- print()
- def do_EOF(self, line):
- return True
- def postloop(self):
- print()
- if __name__ == '__main__':
- CommandProcessor().cmdloop()
- Main_Attempt()
Add Comment
Please, Sign In to add comment