https://github.com/bitsadmin/nmappy
NmapPy - Python implementation of Nmap
https://github.com/bitsadmin/nmappy
commandline nmap portscan
Last synced: 2 months ago
JSON representation
NmapPy - Python implementation of Nmap
- Host: GitHub
- URL: https://github.com/bitsadmin/nmappy
- Owner: bitsadmin
- License: bsd-3-clause
- Created: 2016-12-07T13:54:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-27T19:40:40.000Z (over 6 years ago)
- Last Synced: 2025-04-26T07:16:57.486Z (2 months ago)
- Topics: commandline, nmap, portscan
- Language: Python
- Size: 149 KB
- Stars: 35
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NMapPy
## Files
* nmappy.py - Python implementation of Nmap
* include-services.py - Utility to integrate list top services from the nmap-services file into the nmappy.py file
* topports.py - Utility to obtain the top X ports from the nmap-services file
* nmap-services - Copy from https://github.com/nmap/nmap## Tools
### NmapPy
_Python implementation of Nmap_**Commandline**
```
usage: nmappy.py [-iL [INPUT_FILENAME]] [-Pn] [-sn] [-s {T,U}] [-p PORTS]
[--top-ports TOP_PORTS] [-F] [-r] [-T {1,2,3,4,5}] [-v]
[-o {N,X}] [-h]
[targets] [output_file]NmapPy 0.51 ( https://github.com/bitsadmin/nmappy/ )
TARGET SPECIFICATION:
targets Can pass hostnames, IP addresses, networks, etc.
-iL [INPUT_FILENAME] Input from list of hosts/networksHOST DISCOVERY:
-Pn Treat all hosts as online -- skip host discovery
-sn Ping Scan - disable port scanSCAN TECHNIQUES:
-s {T,U} TCP Connect()/UDP scan (not implemented)PORT SPECIFICATION AND SCAN ORDER:
-p PORTS Only scan specified ports
--top-ports TOP_PORTS
Scan most common ports
-F Fast mode - Scan fewer ports than the default scan
-r Scan ports consecutively - don't randomizeTIMING AND PERFORMANCE:
-T {1,2,3,4,5} Set timing template (higher is faster)OUTPUT:
-v Increase verbosity level (use -vv or more for greater
effect)
-o {N,X} Output scan in normal/XML (not implemented)
output_file File name/locationMISC:
-h, --help Print this help summary page.
```### Include-Services
_Utility to integrate list top services from the nmap-services file into the nmappy.py file._**Commandline**
```
usage: nmappy_services.py [-h] [-i NUMBER] [nmappy_file] [nmap_services_file]NmapPy services includer 0.10 ( https://github.com/bitsadmin/nmappy/ )
positional arguments:
nmappy_file File to patch
nmap_services_file nmap-services source fileoptional arguments:
-h, --help show this help message and exit
-i NUMBER, --include NUMBER
Number of TCP and UDP services to include (default:
50). Use -1 for all.
```### TopPorts
_Utility to obtain the top X ports from the nmap-services file._This is for example useful when you want to use Cobalt Strike to run a portscan on the top 10 TCP ports.
**Commandline**
```
usage: topports.py [top # of ports] [optional: tcp|udp]
example: topports.py 10 tcpTopPorts v1.0 ( https://github.com/bitsadmin/nmappy/ )
```## PyInstaller
In order to use the tools stand-alone, binaries can be generated using PyInstaller.1. **Install PyInstaller**: `pip install PyInstaller`
2. **Generate the Windows/Linux binary:** `pyinstaller --onefile nmappy.py`
3. Output file can be found in `./dist`