Nmap automation script useful for beginner in recon process of HTB Boxes
by 4ung - Saturday February 3, 2024 at 10:09 AM
#1
I had successfully created the nmap automation script by python language to recon the box which will be useful in pentesting practice.

You may can check.
nmap_automation.py

Work Flow:
1) Nmap port scan on the target host
2) Filter opened ports
3) service, os, scripts scan on the open ports
4) Print the results in the terminal and saved in the files.

Preview Video of Usage
Reply
#2
that's really cool, does it scan UDP ports as well?
Reply
#3
(02-03-2024, 10:18 AM)alph4byt33 Wrote: that's really cool, does it scan UDP ports as well?

Thanks for asking.
For sure, we can edit to scan including udp ports by adding -u flag.

I'll edit it for better.
Reply
#4
alright that's awesome, thanks a lot
Reply
#5
Thisis so cool, I will try to make one but that automated the whole recon

Thanks for posting, I downloading now
Ban reason: Leeching. (Permanent)
Reply
#6
thanks for sharing
Reply
#7
Okay, that's great, many thanks.
poly track
Reply
#8
great bro! thanks, keep improving, your thread is very useful
nice script
Ban reason: Scraping | Contact us via https://raidforums.im/contact if you feel this is incorrect. (Permanent)
Reply
#9
hello,

i suggest you to add the "-n" option to avoid DNS resolution

Here is the bash function that i use.
The first arg is the @IP of the target (target.htb by default is the common name i use) and the second arg is the name of the log file (it will be "nmap-all" by default)

Nmap () { TARGET="${1:-target.htb}"; LOG="${2:-all}"; TMPFILE=$(mktemp /dev/shm/XXXXXX); \sudo nmap -p- -n --min-rate=1000 -T4 "${TARGET}" -v | \tee -a "${TMPFILE}"; ports=$(\cat "${TMPFILE}" | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//); \sudo nmap -n -sC -sV -v -p "${ports}" "${TARGET}" -oN "./nmap-${LOG}"; }
Reply
#10
thanks alot for the autonmap script , can it be allowed for OSCP??
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot htb-bot 96 28,851 09-06-2026, 06:45 PM
Last Post: horz
  HTB LAB MACHINE[Overflow][HARD] User & Root flags t1g35h4rk 0 491 09-05-2026, 07:08 PM
Last Post: t1g35h4rk
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 369 117,299 09-05-2026, 10:59 AM
Last Post: dsscdsee
  HTB Academy - Active Directory Penetration Tester Path 2024 loganpaul09 19 11,755 09-01-2026, 06:25 AM
Last Post: adolfoL
  HTB Eloquia User and Root Flags - Insane Box 69646B 14 19,784 08-21-2026, 07:27 PM
Last Post: tangol



 Users browsing this thread: 1 Guest(s)