< All Advanced Penetration Testing Notes

shikhar77 | Advanced Penetration Testing | Module 2 - Programming

By: shikhar77 | Related Course: Advanced Penetration Testing | Published: August 19, 2017 | Modified: August 19, 2017
Join Cybrary

NotepadBash Scripting

nano ping.sh


if[”$1” ==””]


echo ”Usage: ./ping.sh [network]”

echo ”Example: ./ping.sh 192.168.1”

chmod 700 ping.sh

echo $PATH : places where linux will search for any file


NotepadNetwork Pings


for x in seq 1 254 : do

ping -c 1 $1.$x | grep ”64 bytes” cut -d ”” -f 4

(ipd addresses which are up will come up using this command)



NotepadPython for Port

nano python.py

#! /usr/bin/python

import socket

ip = raw_input(”Enter the IP address: ”)

port = input(”Enter the port number: ”)

sock = socket.socket(socket.AF_INET, cocket.sock_STREAM)

if sock.connect_ex((ip,port)):

        print ”port”, port, ”is closed”


        print ”port”, port, ”is open”

< All Advanced Penetration Testing Notes
Join Cybrary

Our Revolution

We believe Cyber Security training should accessible for everyone, everywhere. Everyone deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is the world's largest community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

We recommend always using caution when following any link

Are you sure you want to continue?