Jump to content

Bash Bunny Nmap Script Help


KaliShodan

Recommended Posts

#Whenever I run the script I get a green light and then nothing could someone please explain my error I am making?

#!/bin/bash
#
# Title: Nmap Scan
# Author: Jaret Bottoms
# Required Time: 2 Minutes 18 Seconds
# Details: Scans for open ports and services
# Version: 1.0
REQUIRETOOL Nmap
NMAP_OPTIONS="-A 192.168.1.1"
LOOTDIR=/root/udisk/loot/nmap
LED SETUP
ATTACKMODE ECM_ETHERNET
GET TARGET_IP
GET TARGET_HOSTNAME
mkdir -p $LOOTDIR
HOST=${TARGET_HOSTNAME}
[[ -z "$HOST" ]] && HOST="noname"
COUNT=$(ls -lad $LOOTDIR/$HOST*.log | wc -l)
COUNT=$((COUNT+1))
if [ -z "${TARGET_IP}" ]; then
    LED FAIL
    exit 1
fi
LED ATTACK
Nmap $NMAP_OPTIONS $TARGET_IP >> $LOOTDIR/$HOST-$COUNT.log
LED CLEANUP
sync
LED FINISH

 

Link to comment
Share on other sites

  • 1 year later...

As Rkiver suggested, there's a Bunny section of the forums that should be used, so I guess this thread should be moved.

Anyway, there are some bits and pieces that could render possible problems in the original code (i.e. the first post, which seems based on the "official" nmapper payload and then adjusted). For starters how nmap is spelled, with a capital "N" that will throw a "Nmap: command not found".

Regarding the latest submitted code suggestion; what is <yOur IP> supposed to be replaced with? The victim is in most situations a "black box" when it comes to knowledge about device details, such as the IP address. I would rather stick to the original idea of using GET TARGET_IP instead of having to know the "victim" IP before I write the payload. I also need to elevate my knowledge about SYNC. It seems to be a part of the Ducky language that I haven't seen before. I get if "sync" is used so that the information is saved to disk in a proper way, but SYNC and sync isn't the same thing and SYNC must therefore refer to something else that I don't know about but happily would get more info on.

  • Upvote 1
Link to comment
Share on other sites

3 hours ago, Jerry33 said:

Try This

 

# NMAP SCAN
LED G
ATTACKMODE RNDIS_ETHERNET
LED R G 100
export HOST_IP=<yOur IP>
nmap -F $HOST_IP >> /root/udisk/nmap.txt
SYNC
SYNC
LED G

 

It's year old mate... I don't know if he's coming back.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...