< All Advanced Penetration Testing Notes

ali2141997 | Advanced Penetration Testing | Module 2 - Programming

By: ali2141997 | Related Course: Advanced Penetration Testing | Published: July 23, 2017 | Modified: July 23, 2017
Join Cybrary

Notepadpart 2

ping www.google.com

ping w.google.com

*nano ping.sh{


if [”$1”== ””]


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

echo ”Examle: ./ping.sh 192.168.1”



echo $PATH

chmod +x(or 700) ping.sh 




Notepadpart 3

(network ping )

*nano ping.sh{


if [”$1”== ””]


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

echo ”Examle: ./ping.sh 192.168.1”


for x in ’seq 1 254’ ; do 

ping -c 1  $1.$x ( | grep ”64 byte” )( | cut -d ” ” -f 4) ( | sed  ’s/.$//’ )




./ping.sh 192.168.1


Notepadpart 4

nano python.py 

which python 

*nano python.py{


import socket

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

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

sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)

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

print ”port ”, port, ”is closed”


peint ”port ”, port ,”is open”}

chmod +x python.py 


Notepadpart 5

language C 

*nano program.c{

#include <stdio.h>

int main (int aegc, char *argv[]){

if (argc <2 ){

printf(”\s\n”, ”pass your name as an argument ”);

return -1;}

esle {printf(”Hello \s\n ”,argv[1]);

return 0;}


gcc program.c -o program

chmod +x program.c 



< 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?