Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python in Kali Linux
#1
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
Reply


Messages In This Thread
Python in Kali Linux - by coolcassie - Nov-13-2019, 12:50 AM
RE: Python in Kali Linux - by snippsat - Nov-13-2019, 02:21 AM
RE: Python in Kali Linux - by coolcassie - Dec-02-2019, 12:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 796 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  How to use a variable in linux command in python code? ilknurg 2 1,625 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Python syntax in Linux St0rmcr0w 2 53,164 Jul-29-2021, 01:40 PM
Last Post: snippsat
  Login to NordVPN on Linux with python script AGreenPig 2 6,044 Feb-09-2021, 10:44 AM
Last Post: AGreenPig
  how to run linux command with multi pipes by python !! evilcode1 2 6,411 Jan-25-2021, 11:19 AM
Last Post: DeaD_EyE
  where to get portable Python for Linux (Fedora)? python001 5 6,365 Nov-01-2020, 05:23 PM
Last Post: Larz60+
  Python in Linux environment on RPI kendias 22 11,239 Sep-05-2020, 03:04 AM
Last Post: K_Research
  How do I pick the right python in Linux env? MDRI 9 3,728 Jun-27-2020, 05:40 PM
Last Post: snippsat
  control a linux program with python Fifoux082 9 4,140 May-08-2020, 04:24 PM
Last Post: Fifoux082
  Python version on Linux whois1230 5 3,567 Apr-10-2020, 07:12 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020