Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, 23 October 2012

Hack LInux Password


To crack Linux password all it takes is adjusting the boot parameters slightly and typing a command or two. Just follow the below given commands, and the work would be done.

1)Reboot your computer, and then as soon as you see the GRUB Loading screen, make sure to hit the ESC key so that you can get to the menu.

2)Now you have two options:
  a)Root Shell Method
     i)If you have the option, you can choose the “recovery mode” item on the menu, usually found right below your default kernel option.
     ii)Then choose “Drop to root shell prompt” from this menu (This is called the Single User Mode).
     iii)This should give you a root shell prompt.
  b)Alternate Root Shell Method
If you don’t have the recovery mode option, this is the alternate way to manually edit the grub options to allow for a root shell.
      i)First you’ll have to make sure to choose the regular boot kernel that you use (typically just the default one), and then use the “e” key to choose to edit that boot option.
      ii)Now just hit the down arrow key over to the “kernel” option, and then use the “e” key to switch to edit mode for the kernel option.

3)Now in the next screen that you see, you have to remove the “ro quiet splash” part with the backspace key, and then add this onto the end:
rw init=/bin/bash
(On some versions of Linux, you might have other shells as the default shell. So you have to type the above line accordingly. But most Linux versions have the “bash” shell as the default shell.)
4)Once you hit enter after adjusting the kernel line, you’ll need to use the B key to choose to boot with that option.
5)At this point the system should boot up very quickly to a command prompt.
You are now at the Root Shell Prompt (also called the Single User Mode)

Now Reset the Password

1)Once you are the Root Shell Prompt, by following any of the above given method, you can use following command to reset the password of any user account:
passwd username
2)After the command is successful, type the following command to make sure the changes are written to the hard disk, before you reboot the computer:
sync
3)Now reboot the computer using the command:
reboot -f
Once the computer restarts, you shall be able to login from the account, for which you had changed the password.

Cracking Linux Password in Lock Grub


If the Grub is password protected,then we can use the Linux Live CD to crack the Linux Password. Follow the below given steps to change the Linux Password, using the Linux Live CD.

1)Boot your computer from your Linux Live CD, choosing “Try Linux without any change to your computer” from the boot menu.
2)Once the system boots open up a new Terminal window and then type in the following command:
sudo fdisk –l
3)This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system.
4)Now you’ll need to create a directory to mount the hard drive on. Since we’re actually booting off the live cd, the directory doesn’t really get created anywhere.
sudo mkdir /media/sda1
5)The next command will mount the hard drive in the /media/sda1 folder.
sudo mount /dev/sda1 /media/sda1
6)Now it’s time for the command that actually does the magic:
chroot.
This command is used to open up a shell with a different root directory than the current shell is using, and we’ll pass in the folder where we mounted the hard drive.
sudo chroot /media/sda1

7)Now you should be able to use the passwd command to change your user account’s password, and it will be applied to the hard drive since we are using chroot.
passwd <username>
8)Now you should be able to reboot your system and log yourself in with your new password.

GREP COMMAND


Grep command is used to search files for a specific text. This is incredibly powerful command with lots of options.
Syntax: grep [options] pattern [files]

How to find all lines matching a specific keyword on a file?

In this example, grep looks for the text suku inside /etc/passwd file and displays all the matching lines.
# grep suku /etc/passwd

sunny:x:1041:1041:suku sameer:/home/sunny:/bin/bash
supriya:x:1083:1083:John suman:/home/supriya:/bin/bash

Option -v, will display all the lines except the match. In the example below, it displays all the records from /etc/password that doesn’t match John.
Note: There are several lines in the /etc/password that doesn’t contain the word John. Only the first line of the output is shown below.
# grep -v suku /etc/passwd jbourne:x:1084:1084:Jason Bourne:/home/jbourne:/bin/bash

How to find how many lines matched the text pattern in a particular file?

In the example below, it displays the total number of lines that contains the text suku in /etc/passwd file.
# grep -c suku /etc/passwd
2

You can also get the total number of lines that did not match the specific pattern by passing option -cv.
# grep -cv suku /etc/passwd
39

How to search a text by ignoring the case?

Pass the option -i (ignore case), which will ignore the case while searching.
# grep -i suku /etc/passwd

sunny:x:1041:1041:suku sameer:/home/sunny:/bin/bash
supriya:x:1083:1083:John suman:/home/supriya:/bin/bash

How to search all subdirectories for a text matching a specific pattern?

Use option -r (recursive) for this purpose. In the example below, it will search for the text "suku" by ignoring the case inside all the subdirectories under /home/users.

This will display the output in the format of “filename: line that matching the pattern”. You can also pass the option -l, which will display only the name of the file that matches the pattern.
# grep -ri suku /home/users

/home/users/subdir1/letter.txt:suku, Thanks for your contribution.
/home/users/name_list.txt:suku sameer
/home/users/name_list.txt:suku suman

# grep -ril suku /root

/home/users/subdir1/letter.txt
/home/users/name_list.txt

Linux Based Operating System's Vulnerabilities


What Are Vulnerabilities?

The main vulnerability of Linux OS is that anyone can access the code of the operating system. And, if you are not savvy enough with the programming code like hackers are. You only need to search for the correct free Linux hacking tool and you will be able to get inside in no time.
The other problem is that many of the drivers made for determined hardware. Let’s say, a printer is not created by people who have security in mind. This is especially important for a company who do not wish to find its intellectual property is stolen each time they send something to the printing room.
So, after all of these possible loopholes inside Linux OS, you should consider using a version that has been designed with security in mind. Check www.engardelinux.com and find more about this variation of Linux OS.

What Is Kernel Hacking?

The kernel is the software inside a computer that is in charge of maintaining an adequate communication between the hardware and the rest of the software. One of the strong points among the Linux community is that the kernel of a Linux OS can be altered. And for what reason? The two main motives are fixing any problem that may arise and increase the efficiency of a driver responsible for managing a determined piece of hardware

Hacking Runescape

Runescape is a massively multiplayer online role-playing game that was launched in 2001 . The marvelous thing about this online game is that it is independent of the operating system that you are using since it works over the web using JAVA (JAVA is a platform that can work in any kind of computer since it creates a virtual machine for its own use).
But as in any online game, you will find people who are hacking Runescape. Although it is free to use and only requires some basic information for its subscription, some hackers are willing to spend their time trying to find a backdoor or any other scheme that will permit them obtain an advantage over other players. One could say that it is inevitable due to the competitive nature of our species.
So, Runescape hacking, hacking programs for Runescape, free password hacking programs for Runescape, files for hacking Runescape and hacking Runescape accounts has become quite common among players. Although some could say that there is no grace in doing this since it is basically cheating, hackers don’t think the same. For them, using any method for being the best in the game isn’t only good; it’s what is expected from any human being.
Thanks to free network hacking tools, hackers from around the world with a basic knowledge of English and some practice with computers, can start lurking networks everywhere, waiting for their chance to success and increase their reputation inside the hacking community. Although right now Windows is the preferred platform, Linux hacking will become a favorite amongst hackers.

A-Z Index of the Bash command line for Linux (PART 3)


Q

quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas

R

ram ram disk device
rcp Copy files between two machines
read Read a line from standard input
readarray Read from stdin into an array variable
readonly Mark variables/functions as readonly
reboot   Reboot the system
rename Rename files
renice   Alter priority of running processes
remsync  Synchronize remote files via email
return Exit a shell function
rev Reverse lines of a file
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)

S

screen Multiplex terminal, run remote shells via ssh
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp     Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
slocate Find files
sort Sort text files
source Run commands from a file `.’
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace   Trace system calls and signals
su Substitute user identity
sudo Execute a command as another user
sum Print a checksum for a file
suspend Suspend execution of this shell
symlink Make a new name for a file
sync Synchronize data on disk with memory

T

tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap     Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

U

ulimit Limit user resources
umask Users file creation mask
umount   Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

V

v        Verbosely list directory contents (`ls -l -b’)
vdir     Verbosely list directory contents (`ls -l -b’)
vi Text Editor
vmstat Report virtual memory statistics

W

watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Search the user’s $path, man pages and source files for a program
which Search the user’s $path for a program file
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un’)
wget     Retrieve web pages or files via HTTP, HTTPS or FTP
write Send a message to another user

X

xargs Execute utility, passing constructed argument list(s)
xdg-open Open a file or URL in the user’s preferred application.

Y

yes Print a string until interrupted

. Run a command script in the current shell

### Comment / Remark

A-Z Index of the Bash command line for Linux (PART 2)

I

id Print user and group id’s
if Conditionally perform a command
ifconfig Configure a network interface
ifdown Stop a network interface
ifup Start a network interface up
import Capture an X server screen and save the image to file
install Copy files and set attributes

J

jobs List active jobs
join Join lines on a common field

K

kill Stop a process from running
killall Kill processes by name

L

less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint   Print a file
lprintd  Abort a print job
lprintq  List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files

M

make     Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs  Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mtr Network diagnostics (traceroute/ping)
mv Move or rename files or directories
mmv Mass Move and rename (files)

N

netstat  Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
Notify-send Send desktop notifications
nslookup Query Internet name servers interactively

O

open Open a file in its default application
op Operator access

P

passwd Modify a user password
paste Merge lines of files
pathchk  Check file name portability
ping Test a network connection
pkill Stop processes from running
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory

A-Z Index of the Bash command line for Linux (PART 1)


A

adduser  Add a user to the system
addgroup Add a group to the system
alias Create an alias
apropos  Search Help manual pages (man -k)
apt-get Search for and install software packages (Debian/Ubuntu)
aptitude Search for and install software packages (Debian/Ubuntu)
aspell Spell Checker
awk Find and Replace text, database sort/validate/index

B

basename Strip directory and suffix from filenames
bash     GNU Bourne-Again SHell
bc Arbitrary precision calculator language
bg Send to background
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)

C
cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
chkconfig System services (runlevel)
cksum Print CRC checksum and byte counts
clear    Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command – ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts

D

date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers, boot records
ddrescue Data recovery tool
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls’
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
dmesg Print kernel & driver messages
du Estimate file space usage

E

echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands •
env Environment variables
ethtool  Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expect Automate arbitrary applications accessed over a terminal
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions

F

false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fg Send job to foreground
fgrep Search file(s) for lines that match a fixed string
file     Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format   Format disks or tapes
free     Display memory usage
fsck File system consistency check and repair
ftp      File Transfer Protocol
function Define Function Macros
fuser Identify/kill the process that is accessing a file

G

gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)

H

hash Remember the full pathname of a name argument
head Output the first part of file(s)
help     Display help for a built-in command
history Command History
hostname Print or set system name

Monday, 22 October 2012

How to scan a NETWORK? (PART 1)

To scan a network the most common application is Nmap Security Scanner.

Zenmap is the official graphical user interface (GUI) for the Nmap Security Scanner. It is a multi-platform, free and open-source application designed to make Nmap easy for beginners to use while providing advanced features for experienced Nmap users. Frequently used scans can be saved as profiles to make them easy to run repeatedly. A command creator allows interactive creation of Nmap command lines. Scan results can be saved and viewed later. Saved scans can be compared with one another to see how they differ. The results of recent scans are stored in a searchable database.

Tech N Science 2012