Author Archives: pankajsheoran

Python script to ping ip in a subnet

from commands import getoutput from multiprocessing import Process from sys import exit class PING_SWEEP(object): def pinger(self, host_num): “””thread pinger function””” hostadrr = host.split(‘.’)[:-1]#removes . from user input hostadrr = ‘.’.join(hostadrr) + ‘.’ + repr(host_num) # adds . and last octet … Continue reading

Posted in Python | Leave a comment

Remove trailing space from all line of a file using powershell

We can use following script to remove space at the end of each line in a file with the help of powershell script. $InputFile = ‘C:\Users\user\Desktop\1.txt’ write-host “removing trailing space.. of file $InputFile” $content = Get-Content $InputFile $content | Foreach {$_.TrimEnd()} … Continue reading

Posted in Other | Leave a comment

Python script to print all hyper links on a URL

We can use this script to find all hyper links on a web page. This script can be used in reconnaissance. import urllib2 import re import sys #connect to a URL url= str(sys.argv[1]) website = urllib2.urlopen(url) #read html code html … Continue reading

Posted in Python | Leave a comment

Reconnaissance

There are lot of tool to perform reconnaissance: nmap arping arping: This command send arp request packet to a host and if a reply comes then we can say that that host is alive. This command can be useful to … Continue reading

Posted in OSCP | Leave a comment

How to resolve in Linux

While running commands with the help of sudo if you are getting following error the you have to add that user to sudo group : is not in the sudoers file. This incident will be reported adduser <username> sudo  

Posted in Linux | Leave a comment

Understanding commands

Cut command: cut -d : -f1,2 /etc/passwd delimiter is specified by -d option and in this command the delimiter is : -f option specifies to print 1,2 match cd command: cd command is used to change the directory. “.” represents … Continue reading

Posted in Linux | Leave a comment

Protected: Attacks

There is no excerpt because this is a protected post.

Posted in Other