< 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

#!/bin/bash

if[”$1” ==””]

then

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

else

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)

done

fi


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”

else:

        print ”port”, port, ”is open”


< All Advanced Penetration Testing Notes
Join Cybrary

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free 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.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel