Nov-13-2019, 12:50 AM
Hi, I'm new to this forum so apologies if this is in the wrong part of the forum.
I'm using Kali Linux and am running it on VirtualBox. I've created a python file and saved it in a folder called bin and think it is in the home directory.
This is the code I've used for the python file:
#!/bin/python import sys, os
if len(sys.argv) == 2 :
os.system("nmap -n -sn -oG - " + sys.argv[1] + "|head -n -1|tail -n +2|cut -d' ' -f2")
exit()
I'm trying to get the file to run via the terminal window but am unsure which code to use for this in the terminal window.
This is the current line I'm trying out in the terminal window to run the .py file:
chmod o+x ~/home/bin/listip.py
Has anyone got any suggestions why this won't work? Alternatively if a similar question has been posted can someone direct me to that?
Thanks
I'm using Kali Linux and am running it on VirtualBox. I've created a python file and saved it in a folder called bin and think it is in the home directory.
This is the code I've used for the python file:
#!/bin/python import sys, os
if len(sys.argv) == 2 :
os.system("nmap -n -sn -oG - " + sys.argv[1] + "|head -n -1|tail -n +2|cut -d' ' -f2")
exit()
I'm trying to get the file to run via the terminal window but am unsure which code to use for this in the terminal window.
This is the current line I'm trying out in the terminal window to run the .py file:
chmod o+x ~/home/bin/listip.py
Has anyone got any suggestions why this won't work? Alternatively if a similar question has been posted can someone direct me to that?
Thanks