Sunday, August 30, 2020

Linux Command Line Hackery Series: Part 1




In this concise article we will learn some basics of how to use Linux Command line, so lets get started.

Requirements:

1. An open Terminal in your Linux Box. I'm using Kali Linux 2.0
or you can check out this amazing website Webminal

Command:  ls
Syntax:         ls [flag(s)]
Function:      ls is short for list. ls command is used to list the contents of a directory these contents include files, folders, and links. ls has many optional flags as well, some of them are described below
Flags:    -a this flag is used to view hidden files that is those files whose names are preceded                      by a '.'(dot)
               -l  this flag is used to view file permissions, owner of the file, group of the owner, the                        file size, the modification date, and the filename. We'll talk more about it in later                            articles.

Command:  mkdir
Syntax:         mkdir dirname
Function:      mkdir is used to create a directory (or a folder) with the name which is followed by the command

now lets create a directory in our current directory named as myfiles, how would you do that?

mkdir myfiles

which command should we use in order to verify that the directory has been created in our current folder?

ls

this will list all the files and directories in our current folder. Do you see myfiles directory listed?

Command:  cd
Syntax:         cd path/to/directory
Function:      cd is short for change directory. It is used to navigate directories, or to make it clear it does the same thing as what double clicking on a folder do except it doesn't show you contents of the directory :(. In order to navigate or visit another directory we need to provide it's ABSOLUTE-PATH or RELATIVE-PATH you heard that, didn't ya?

Paths are of two types relative path or absolute path (also called full-path). Relative as the name suggests is relative to the current directory, so if you have to navigate to a folder within the current directory you'll just simply type cd directory_name. But what if you have to navigate to a directory which is the parent of current directory? Well it's easy just type cd .. (yes double dots, you noticed that .. and . thing when you typed ls -a, didn't you?). The double dots mean the directory above current directory (i,e the parent directory) and a single dot means the current directory (i,e the directory that I'm currently in). Now if you have to navigate two directories above current directory using relative path navigation you'll type

cd ../.. 

here .. means previous directory and another .. after slash (/) means the previous directory of the previous directory sounds confusing..!

The Absolute Path means full path to the file or folder which starts from root directory. Say I want to navigate to my home folder using absolute path, then I'll type:

cd /home/user

where user is the username
Now think of navigating to the myfiles folder from your home directory using the absolute path, it will be something like this:

cd /home/user/myfiles

Exercise: Create a directory project1 inside your home directory and inside the project1 directory create a file and a directory named index.html and css respectively. Then navigate to the css directory and create a style.css file inside it. At last navigate out of the css directory to home both using the relative and absolute path mechanisms.

[Trick: To get quickly out of any directory to your home directory type cd ~ [press Enter] or simply cd [press Enter]]

Command:  touch
Syntax:         touch filename
Function:      touch is a nifty little function used to create an empty file (actually it's used to change access time of a file but everyone has got bad habits :P ). You can create any type of empty file with the touch command. If you are a bit curious about touch read the manual page of the touch command using the man touch command.

Now lets create a few files inside of our myfiles directory

touch file1 file2 file3

The above command creates three empty files in our current directory named file1, file2, and file3.
How will you verify that it has indeed created these three files in your current directory? I won't answer this time.

Command:  echo
Syntax:         echo Hacker manufacturing under process
Function:      echo is used to display a line of text. By default echo displays a line of text on the terminal which is the standard output device (stdout for short). However we can redirect the output of an echo command to a file using > (the greater than symbol).
Now if we have to echo a line of text to a file, say file1 in our myfiles directory, we will type:

echo This is file1 > file1

The above command will echo the text "This is file1" to file1.

Command:  cat
Syntax:         cat filename [anotherfilename...]
Function:      cat stands for concatenate (not that puny little creature in your house). The main function of cat is to concatenate files and display them on your terminal (or in geeky terms stdout). But its also used to display the contents of a file on your terminal.

Let's display the contents of file1 in the myfiles directory that we echoed to it using the echo command, for that we'll type:

cat file1

Awesome I can see on black screen contents of my file (what if your terminals background is white?), looks like I'm becoming a hacker. In case you don't see it then I suggest you should give up the thought of becoming a hacker. Just kidding you might have missed a step or two from the above steps that we performed.

Now lets say that we want to add another line of text to our file using the echo command should we use the same greater than (>) symbol? No, if we want to add another line (which in geeky terms is to append a line) to our file using the echo command we have to use >> (two greater than symbols) like this:

echo Another line of text >> file1

now to check the contents of file1 we'll type:

cat file1

OK we wrote two lines inside of the file1.
Does it mean we have to add three greater than symbols to write third line? Oh! I didn't thought you'd be such a genius.

A single greater than symbol (>) means redirect the output of the preceding command to a file specified after the > symbol. If the file exists then overwrite everything that's in it with the new contents and if the file does not exist then create one and write to it the output of the preceding command. So if you had typed

echo Another line of text > file1

it would have overwritten the contents of the file1 with "Another line of text" and the line "This is file1" would no longer be present in the file.

Two greater than symbols (>>) mean that append (remember the geeky term?) the output of the previous command to the end of file specified after >>. Now if you want to add another line of text to file1, you won't use >>> rather you'll use >> like this:

echo Third line in file1 >> file1

This is it for today. But don't worry we'll learn more things soon.

Related links


TOP 10 HACKING MOVIES YOU SHOULD WATCH

Technology and hacking gave a new horizon to the science fiction movies. As hacking is getting common and every online thing is at risk whether it's 10% or 90%, not a system is 100% secure over the internet. Every day new security holes are getting discovered. So, now most of the sci-fi movies have the tech and hack stuff to grow awareness in everybody's mind about the online privacy and risk to their information. Here I am sharing top 10 hacking movies that worth a watch.

TOP 10 HACKING MOVIES

Here I have listed top 10 hacking movies that you should watch.

1. HACKERS (1995)

In Hackers, Angelina Jolie and Jonny Lee Miller portray two youthful and hip hackers. Miller portrays a hacker who got caught as a very young child at an age of 11 years after crashing thousands of computers and has been sentenced to zero computer access until his 18th birthday.

2. LIVE FREE OR DIE HARD (2007)

Live Free or Die Hard (also known as Die Hard 4 and released as Die Hard 4.0 outside North America) is a 2007 American action film, and the fourth in the Die Hard film series depicts a scenario where a hacker played by Timothy Olyphant (of Justified fame) takes down nearly the entire U.S. infrastructure in an attempt to transfer trillions of dollars from the Federal Reserve to his account. This movie gives a complete idea of how actually these blackhat hackers operate.

3. EAGLE EYE (2008)

In this movie, two people get a call from an unknown number by a woman. They get a task on the phone that if they don't follow the phone call they would die. This movie displays supercomputer hack on all networks and military networks. This is just an amazing movie on how artificial intelligence computer hacks our real life for bad motives.

4. ALGORITHM (2014)

The film 'Algorithm' tracks the travails of Will, who is the freelance computer hacker who hacks into a top-secret government contractor agency and downloads all their recently developed programs." You can see the full movie below

5. WARGAMES (1983)

The film features David Lightman (Broderick), a young high school student hacker who accidentally hacks into a military supercomputer and starts the countdown to World War III.

6. THE MATRIX (1999)

This is one of the greatest science fiction movies. In this movie, reality, as perceived by most humans, is actually a simulated reality called "the Matrix", created by machines to subdue the human population, while their bodies' heat and electrical activity are used as an energy source.
A character named "Neo", who is a computer Hacker, learns this truth and is drawn into a rebellion against the machines, which involves other people who have been freed from the "dream world". The Matrix franchise is a trilogy movie series.

7. TAKEDOWN (2000)

This movie is based on famous computer U.S. hacker Kevin David Mitnick. Based upon the book and written by his nemesis, Tsutomu Shimomura, the story tends to glorify Shimomura. Mitnick operated in the 1980s and '90s and eventually went to prison for a couple of years. Now, he is a highly paid IT security consultant, speaker, and writer.

8. BLACKHAT (2015)

Blackhat is newly released movie by Chris Hemsworth. In this movie, hackers hack the Chinese nuclear power plant to start a nuclear reaction. Simultaneously, they also hack the stock exchange and steal millions of dollars from the bank. This movie shows how a black hat hackers threaten governments.

9. THE ITALIAN JOB (2003)

Although the MINI Coopers are really the stars of The Italian Job (a remake of the 1969 film of the same name), Seth Green plays Lyle, a hacker among a group of elite thieves, who is able to manipulate traffic signals, among other devices, that make this grand theft possible.

10. UNTRACEABLE (2008)

This film involves a serial killer who rigs contraptions that kill his victims based on the number of hits received by a website KillWithMe.com that features a live streaming video of the victim. Millions of people log on, hastening the victims' deaths.

There may be more exciting hacking movies but I found these top 10 hacking movies that you should watch for once.
You can also find out the top 5 most dangerous hackers in the real world living.

Related articles


  1. Hacking Tools Name
  2. Hacking Tools Usb
  3. Hacker Tools 2020
  4. Install Pentest Tools Ubuntu
  5. Hak5 Tools
  6. Hack Apps
  7. Hack Tools Pc
  8. Bluetooth Hacking Tools Kali
  9. Hacker Tools For Windows
  10. Hack Tools 2019
  11. Pentest Tools Github
  12. Pentest Tools Kali Linux
  13. Pentest Tools Framework
  14. Pentest Tools
  15. Game Hacking
  16. Top Pentest Tools
  17. Pentest Tools Bluekeep
  18. Hacker Tools 2020
  19. Hacking Apps
  20. Hacking Tools Online
  21. Tools For Hacker
  22. Hacking Tools For Windows Free Download
  23. Pentest Tools Linux
  24. Hacking Tools Free Download
  25. Pentest Tools Review
  26. Pentest Tools Linux
  27. Pentest Tools Kali Linux
  28. Hack Tools Github
  29. Pentest Tools Url Fuzzer
  30. Tools Used For Hacking
  31. Hacking Tools For Windows Free Download
  32. Pentest Tools Url Fuzzer
  33. Pentest Tools Url Fuzzer
  34. Hack Website Online Tool
  35. Hacking Tools For Windows 7
  36. Pentest Reporting Tools
  37. Hacker Tools Free Download
  38. Hacker Tools For Windows
  39. Hack Tools Pc
  40. Hacking Tools Usb
  41. Pentest Tools Website
  42. Hacking Tools Software
  43. Github Hacking Tools
  44. Pentest Tools Download
  45. Hack Tools Github
  46. Pentest Tools Website
  47. Hacker Tools For Mac
  48. Hacker Tools
  49. Hack Tools Mac
  50. Hacking Tools Windows 10
  51. Hak5 Tools
  52. Pentest Tools Nmap
  53. Pentest Tools Framework
  54. Computer Hacker
  55. Pentest Tools Framework
  56. Termux Hacking Tools 2019
  57. Install Pentest Tools Ubuntu
  58. Blackhat Hacker Tools
  59. Pentest Tools Online
  60. Tools For Hacker
  61. Pentest Tools Find Subdomains
  62. Hacker Tools Github
  63. Best Hacking Tools 2020
  64. Hack Tools Pc
  65. Growth Hacker Tools
  66. Kik Hack Tools
  67. Pentest Tools Tcp Port Scanner
  68. Nsa Hack Tools Download
  69. Growth Hacker Tools
  70. Hacking Tools For Beginners
  71. New Hacker Tools
  72. Hackrf Tools
  73. Pentest Tools Find Subdomains
  74. Easy Hack Tools
  75. Pentest Tools Free
  76. How To Make Hacking Tools
  77. Easy Hack Tools
  78. Hacking Tools Pc
  79. World No 1 Hacker Software
  80. Hacking Tools For Pc
  81. Hacker Tools For Pc
  82. Pentest Tools Find Subdomains
  83. Pentest Tools Apk
  84. Install Pentest Tools Ubuntu
  85. Hacker Tools 2019
  86. Pentest Tools For Ubuntu
  87. Hack Tool Apk No Root
  88. Hackers Toolbox
  89. Hacking Tools For Pc
  90. Hacking Tools For Mac
  91. Hack Tool Apk
  92. Pentest Tools Android
  93. Hacker Tools
  94. How To Install Pentest Tools In Ubuntu
  95. Ethical Hacker Tools
  96. Pentest Recon Tools
  97. Hack Rom Tools
  98. Hacking Tools Online
  99. Hacker Tools 2020
  100. Hacking Tools Online
  101. How To Make Hacking Tools
  102. Pentest Tools List
  103. Android Hack Tools Github
  104. Black Hat Hacker Tools
  105. Hacking Tools For Kali Linux
  106. Hacking Tools Download
  107. Hacker Tools Windows
  108. Pentest Tools Url Fuzzer
  109. Hacker Techniques Tools And Incident Handling
  110. Hacking Tools For Mac
  111. Pentest Tools Apk
  112. Pentest Tools Subdomain
  113. Hacker Tools Github
  114. Hacker Tools Online
  115. Hacking Tools
  116. Hacking Tools Github
  117. Hacker Tools Apk Download
  118. Pentest Automation Tools
  119. Hacking Tools For Pc
  120. Nsa Hack Tools Download
  121. Ethical Hacker Tools
  122. Pentest Tools Tcp Port Scanner
  123. Hacking Tools Name
  124. Underground Hacker Sites
  125. Pentest Tools Subdomain
  126. Install Pentest Tools Ubuntu
  127. Best Hacking Tools 2019
  128. Beginner Hacker Tools
  129. Pentest Tools Nmap
  130. Tools 4 Hack
  131. Top Pentest Tools
  132. Hacking Tools Name
  133. Best Hacking Tools 2020
  134. Hack Tools For Ubuntu
  135. Hacking Tools For Pc
  136. Hacker Tools 2019
  137. Hacking Tools Hardware
  138. Hacking Tools Windows 10
  139. Hacker Tools For Pc
  140. Hack App
  141. Tools 4 Hack
  142. Hacking Tools For Mac
  143. Black Hat Hacker Tools
  144. Hacking Tools 2019
  145. Pentest Tools Nmap
  146. Hacker Security Tools
  147. Blackhat Hacker Tools
  148. Hacking Tools For Windows
  149. Hacking App
  150. Usb Pentest Tools
  151. Free Pentest Tools For Windows
  152. Hacker Tools Windows
  153. Tools Used For Hacking
  154. Hacking Tools 2019
  155. Kik Hack Tools
  156. Pentest Tools Open Source
  157. Nsa Hack Tools Download
  158. Black Hat Hacker Tools