Mar 7, 2023 03:15 AM
(This post was last modified: Mar 10, 2023 12:08 AM by Mr. Robot.)
BIG UPDATE~!
You can now install this using
or for help documents
https://pypi.org/project/menuscript/
I created this, was going to make it much more complicated but I decided to go with the route of creating something easily accessible and editable for when you need a quick menu.
This should be really easy to break down for even non-coders due to the way I made it work. While you might not at first be able to break down what the starting script does, you will definitely be able to break down the menu script you create using it.
https://github.com/AIMadeScripts/createmenus
It can now read arguments! If you put in
This would make a file called name_of_your_script_goes_here.py
It would then ask you to name your 5 options.
It will also ask you for any commands you normally execute via command line, and assign those to the menu options. Even something like executing other python scripts. (python3 myotherscript.py)
You can also just run it like
This will let you choose the name and options in here rather than via arguments.
En-fucking-joy. This was actually a load of fun to make.
![[Image: 4fns9Zw.png]](https://i.imgur.com/4fns9Zw.png)
Example code of how your new script might look after creating it.
This is the script it made called scanner_script.py from the commands you see in the image above.
You can now install this using
Code
pip install menuscriptCode
menuscriptCode
menuscript -hhttps://pypi.org/project/menuscript/
I created this, was going to make it much more complicated but I decided to go with the route of creating something easily accessible and editable for when you need a quick menu.
This should be really easy to break down for even non-coders due to the way I made it work. While you might not at first be able to break down what the starting script does, you will definitely be able to break down the menu script you create using it.
https://github.com/AIMadeScripts/createmenus
It can now read arguments! If you put in
Code
python3 create.py -n "name of your script goes here" -o "5"It would then ask you to name your 5 options.
It will also ask you for any commands you normally execute via command line, and assign those to the menu options. Even something like executing other python scripts. (python3 myotherscript.py)
You can also just run it like
Code
python3 create.pyEn-fucking-joy. This was actually a load of fun to make.
![[Image: 4fns9Zw.png]](https://i.imgur.com/4fns9Zw.png)
Example code of how your new script might look after creating it.
This is the script it made called scanner_script.py from the commands you see in the image above.
Code
#!/usr/bin/env python
###===Import Modules Go Here===###
import os
###===Setting your variables to blank values===###
target = ""
target2 = ""
###===Separator Function For Pretty Menu===###
def print_separator():
print("=" * 50)
###===Your Viewable Menu===###
def menu():
clear_screen()
print('Scanner Script!')
variable_counts = {}
print('Your script has some variables $target, $target2')
print_separator()
print('1. Nmap')
print('2. Ping')
variable_counts = {}
print(f'set_target | current variable target = {target}')
print(f'set_target2 | current variable target2 = {target2}')
print('(exit) Exit')
###===Making Clear Screen Work On Windows And Linux===###
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
###===When You Choose An Option It Runs One Of These===###
def nmap():
print('You selected nmap')
nmap = f"nmap -sV -sC {target}"
try:
os.system(nmap)
except KeyboardInterrupt:
print('nmap interrupted by user')
input('Press enter to return to menu...')
def ping():
print('You selected ping')
ping = f"ping {target2}"
try:
os.system(ping)
except KeyboardInterrupt:
print('ping interrupted by user')
input('Press enter to return to menu...')
def set_target():
global target
target = input('Enter a new target:')
input('Press enter to return to menu...')
def set_target2():
global target2
target2 = input('Enter a new target:')
input('Press enter to return to menu...')
def exit_menu():
print('Goodbye!')
exit()
###===Enter Your Choice And Then It Will Activate That Option===###
if __name__ == '__main__':
while True:
menu()
choice = input('Enter your choice: ')
if choice == '1':
nmap()
if choice == '2':
ping()
if choice == 'set_target':
set_target()
if choice == 'set_target2':
set_target2()
elif choice.lower() == 'exit':
exit_menu()
else:
print('Invalid choice. Try again.')



![[Image: O444cFs.jpg]](https://i.ibb.co/c2rr5jw/O444cFs.jpg)

![[Image: IMK3P8b6_o.png]](https://images2.imgbox.com/85/09/IMK3P8b6_o.png)