Skip to content

Commit

Permalink
Merge pull request #33 from morpheuslord/mod6
Browse files Browse the repository at this point in the history
functionality update
  • Loading branch information
morpheuslord authored Jul 26, 2023
2 parents f8f3518 + 14d46f1 commit 9c7161a
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GEOIP_API_KEY = ''
OPENAI_API_KEY = ''
OPENAI_API_KEY = ''
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ python gpt_vuln.py --target <HOSTNAME> --attack sub

# Specify target for Subdomain Enumeration no profile used custom list file
python gpt_vuln.py --target <HOSTNAME> --attack sub --list <PATH to FILE>

# Specify target for geolocation lookup
python gpt_vuln.py --target <IP> --attack geo

# Interactive step by step cli interface
python gpt_vuln.py --menu True
```

Supported in both windows and linux
Expand Down
Binary file modified commands/__pycache__/dns_recon.cpython-311.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions commands/dns_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def dnsr(target: str, key: Optional[str]) -> Any:
except dns.resolver.NXDOMAIN:
print('NXDOMAIN record NOT Found')
pass
except dns.resolver.LifetimeTimeout:
print("Timmed out check your internet")
pass
except KeyboardInterrupt:
print("Bye")
quit()
Expand Down
237 changes: 234 additions & 3 deletions gpt_vuln.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import argparse
import json
import os
import platform
from typing import Any

import cowsay
from dotenv import load_dotenv
from rich.console import Console
from rich.table import Table

from rich import print
from rich.panel import Panel
from commands.dns_recon import dnsr
from commands.geo import geoip
from commands.port_scanner import p_scanner
Expand Down Expand Up @@ -42,13 +44,35 @@
help='Shows a more clean help manu using rich only argument-input is help',
default=help,
required=False)
parser.add_argument('--menu', metavar='menu', type=bool,
help='Terminal Interactive Menu',
required=False,
default=True)
args = parser.parse_args()

target = args.target
profile = args.profile
attack = args.attack
choice = args.r
list = args.list
list_loc = args.list
menu = args.menu
keyset = ""
t = ""
profile_num = ""


def clearscr() -> None:
try:
osp = platform.system()
match osp:
case 'Darwin':
os.system("clear")
case 'Linux':
os.system("clear")
case 'Windows':
os.system("cls")
except Exception:
pass


def help_menu() -> None:
Expand Down Expand Up @@ -113,6 +137,211 @@ def flatten_json(data: Any, separator: Any = '.') -> Any:
return flattened_data


def nmap_menu() -> None:
global keyset
global t
global profile_num
table = Table()
table.add_column("Options", style="cyan")
table.add_column("Utility", style="green")
table.add_row("1", "ADD API Key")
table.add_row("2", "Set Target")
table.add_row("3", "Set Profile")
table.add_row("4", "Show options")
table.add_row("5", "Run Attack")
table.add_row("r", "Return")
console.print(table)
option = input("Enter your choice: ")
match option:
case "1":
clearscr()
keyset = input("Enter OpenAI API: ")
print(Panel(f"[RED]API-Key Set: {keyset}"))
nmap_menu()
case "2":
clearscr()
t = input("Enter Target: ")
print(Panel(f"[RED]Target Set: {t}"))
nmap_menu()
case "3":
clearscr()
profile_num = input("Enter your choice: ")
print(Panel(f"Key Set {profile_num}"))
nmap_menu()
case "4":
clearscr()
table1 = Table()
table1.add_column("Options", style="cyan")
table1.add_column("Value", style="green")
table1.add_row("API Key", str(keyset))
table1.add_row("Target", str(t))
table1.add_row("Profile", str(profile_num))
console.print(table1)
nmap_menu()
case "5":
clearscr()
pout: str = p_scanner(t, int(profile_num), keyset)
print_output("Nmap", pout)
case "r":
menu_term()


def dns_menu() -> None:
global keyset
global t
global profile_num
table = Table()
table.add_column("Options", style="cyan")
table.add_column("Utility", style="green")
table.add_row("1", "ADD API Key")
table.add_row("2", "Set Target")
table.add_row("3", "Show options")
table.add_row("4", "Run Attack")
table.add_row("r", "Return")
console.print(table)
option = input("Enter your choice: ")
match option:
case "1":
clearscr()
keyset = input("Enter OpenAI API: ")
print(Panel(f"[RED]API-Key Set: {keyset}"))
dns_menu()
case "2":
clearscr()
t = input("Enter Target: ")
print(Panel(f"[RED]Target Set:{t}"))
dns_menu()
case "3":
clearscr()
table1 = Table()
table1.add_column("Options", style="cyan")
table1.add_column("Value", style="green")
table1.add_row("API Key", str(keyset))
table1.add_row("Target", str(t))
console.print(table1)
dns_menu()
case "4":
clearscr()
dns_output: str = dnsr(t, keyset)
print_output("DNS", dns_output)
case "r":
menu_term()
pass


def geo_menu() -> None:
global keyset
global t
global profile_num
table = Table()
table.add_column("Options", style="cyan")
table.add_column("Utility", style="green")
table.add_row("1", "ADD API Key")
table.add_row("2", "Set Target")
table.add_row("3", "Show options")
table.add_row("4", "Run Attack")
table.add_row("r", "Return")
console.print(table)
option = input("Enter your choice: ")
match option:
case "1":
clearscr()
keyset = input("Enter GEO-IP API: ")
print(Panel(f"[RED]API-Key Set: {keyset}"))
geo_menu()
case "2":
clearscr()
t = input("Enter Target: ")
print(Panel(f"[RED]Target Set: {t}"))
geo_menu()
case "3":
clearscr()
table1 = Table()
table1.add_column("Options", style="cyan")
table1.add_column("Value", style="green")
table1.add_row("API Key", str(keyset))
table1.add_row("Target", str(t))
console.print(table1)
geo_menu()
case "4":
clearscr()
geo_output: str = geoip(keyset, t)
GEOIP_to_table(str(geo_output))
case "r":
menu_term()


def sub_menu() -> None:
global list_loc
global t
global profile_num
table = Table()
table.add_column("Options", style="cyan")
table.add_column("Utility", style="green")
table.add_row("1", "ADD Subdomain list")
table.add_row("2", "Set Target")
table.add_row("3", "Show options")
table.add_row("4", "Run Attack")
table.add_row("r", "Return")
console.print(table)
option = input("Enter your choice: ")
match option:
case "1":
clearscr()
list_loc = input("Enter List Location: ")
print(Panel(f"[RED]Location Set: {list_loc}"))
sub_menu()
case "2":
clearscr()
t = input("Enter Target: ")
print(Panel(f"[RED]Target Set: {t}"))
sub_menu()
case "3":
clearscr()
table1 = Table()
table1.add_column("Options", style="cyan")
table1.add_column("Value", style="green")
table1.add_row("Location", str(list_loc))
table1.add_row("Target", str(t))
console.print(table1)
sub_menu()
case "4":
clearscr()
sub_output: str = sub(t, list_loc)
console.print(sub_output, style="bold underline")
case "r":
menu_term()


def menu_term():
table = Table()
table.add_column("Options", style="cyan")
table.add_column("Utility", style="green")
table.add_row("1", "Nmap Enum")
table.add_row("2", "DNS Enum")
table.add_row("3", "Subdomain Enum")
table.add_row("4", "GEO-IP Enum")
table.add_row("q", "Quit")
console.print(table)
option = input("Enter your choice: ")
match option:
case "1":
clearscr()
nmap_menu()
case "2":
clearscr()
dns_menu()
case "3":
clearscr()
sub_menu()
case "4":
clearscr()
geo_menu()
case "q":
quit()
pass


def main(target: Any) -> None:
cowsay.cow('GVA Usage in progress...')
if target is not None:
Expand All @@ -122,6 +351,8 @@ def main(target: Any) -> None:
try:
if choice == "help":
help_menu()
elif menu is True:
menu_term()
else:
match attack:
case 'geo':
Expand All @@ -148,7 +379,7 @@ def main(target: Any) -> None:
dns_output: str = dnsr(target, akey)
print_output("DNS", dns_output)
case 'sub':
sub_output: str = sub(target, list)
sub_output: str = sub(target, list_loc)
console.print(sub_output, style="bold underline")
except KeyboardInterrupt:
console.print_exception("Bye")
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ rich==13.4.2
cowsay==5.0
tk==0.1.0
customtkinter==5.2.0
python-dotenv==1.0.0

0 comments on commit 9c7161a

Please sign in to comment.