This is my first time posting on the forum so I wasn't entirely sure if this was in the right section of the forums.
I'm doing work for an assignment and have been using Kali Linux on VirtualBox. The part I'm unsure of is using Python coding in this and how to call the file to run the Python code.
We've been given instructions to create a Bin folder which I've done and these are the other instructions for the first part:
Create the file "listip.py" in the "bin" folder and enter the text from above into that file.
Set the execute permission on that file with the command: chmod o+x ~/bin/listip.py
Test to see if it works using the command: ~bin/listip.py x.x.x.x/n
(where x.x.x.x/n is the IP address of your target virtual machine)
This is the code they've given for the first one:
Code: Select all
#!/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()
There is more parts to this but wanted to try and work out how to do this part first.
Can anyone help or suggest what I should try out?