Skip to main content

How To Share Files between Windows and Linux Over Network | Samba

 




No matter how good you are at CTF Challenges, you may not know how to edit a text file in Powershell. In reality, I don’t not a good score in Windows CTF challenges but these days I am learning more about windows. it is another matter that I can’t run Linux in this new Laptop. I mean, I can but with Virtualization.

PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and the associated scripting language. PowerShell supports aliases to refer to commands by alternate names. Aliasing allows users with experience in other shells to use common command names that they already know for similar operations in PowerShell. basically, it means that you can use cd command instead of Set-Locationcd will be read as Set-Location by the Powershell. Powershell scripting is mostly related to PHP and Linux shell scripting. all you have to learn new is cmdlets.

We are going to use two methods to edit a text file in Powershell. Both of the methods are going to be super simple. you won’t need to read or watch anything else but this article.

POWERSHELL

The first method we are going to look at is WSL. WLS stands for Windows subsystem for Linux. Windows Subsystem for Linux is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. but this method won’t help you during a CTF. because WSL doesn’t come pre-installed in Windows. You will need to install it through Microsoft Store.

Screenshot:


You can install Ubuntu Linux, Kali Linux and many more Linux systems into your Windows10. once you have it installed, run it easily with a command prompt or any other terminal.

Screenshot:

As you know me, I am a Kali lover. so, I installed Kali. Now you can run nano command while you are in Kali’s terminal. if you want to edit a file which is a file of windows, you can find the file in the /mnt directory. you will find all of your windows drive there.

Screenshot:

you can find your files there. but that might be frustrating, right? well, you can use the nano command without going into the Kali Linux shell. To do that you can use this command:

bash -c 'nano demo.txt'

Screenshot:

 

 

The next method we are going to use is Powershell cmdlets. we will use cmdlets in Powershell and edit a text file. so, open up your Powershell window. use this command to see all the files in the current folder:

Get-ChildItem

Screenshot:

 

 

 

Now, you choose the file to edit. there are basically two commands that you can use to edit a file. The first one is Set-Content or you can use its alias sc. it can be used when you want to overwrite a file with your given values. it will remove all the content of the file and then it will write your string value in that file.  But To add string, type this command:

Add-Content -Path .\demo.txt -value "`n Nice And Easy"

Screenshot:

 

-Path is to specify the path of the text file and -Value is the string value that you want to insert into the text file. And another important thing to notice here is that I have used `n to add a new line before adding the string to a file. you can use Set-Content too in your case.

 

 

Thanks For Visiting.

Comments

Popular posts from this blog

How To Make Personal Diary And Notes On WhatsApp, Learn These Special Tips

  In today’s era, the use of smartphones is constantly increasing, WhatsApp is the most special app on smartphones and it has become a special part of people’s lives as well. It is being used for personal and office work. Constantly new updates have been coming on WhatsApp, but in this report, we have been giving you some special tips with the help of which you can make a personal diary or notes on WhatsApp. Let’s know. We do most of our work from our smartphone only. In such a situation, when we have to note some important things or make a list, we share it on phone notes or WhatsApp. Many times, from office to personal work, we also share on WhatsApp. We write our important thing or any message and send it to any of our family members or friends on WhatsApp. Doing this can sometimes result in frontal confusion, so today we are telling you the trick of such a big work of WhatsApp which you can use to save your important work or any document. You can also use your WhatsApp like a p...

MY OVERTHEWIRE.ORG/BANDIT JOURNEY

Best Sellers in Sports, Fitness & Outdoors   This is my write-up for overthewire.org  bandit  wargames. About OverTheWire.Org Bandit Wargames This game was designed in a ctf (capture the flag) format to help you learn the basics of linux and do so while having fun. Completing this wargame will also prepare for advanced levels of wargames. There are a total of 34 levels in bandit as of date. More maybe added in the future. Start from level 0. To move to the next higher level, find the key/flag (information/file/password) you get from the solving the current level. Structure of the Walkthrough Each level is broken in to 3 sections. The Level Goal, How to Complete and Lesson Learnt. The  Level Goal  section sets the objective of the level. The  How to Complete  provides detailed walkthrough to achieve the goal. The  Lesson Learnt  section provides reference to commands used to solve the level and will enable further learning. Recommen...

SQL Injection Authentication Bypass Cheat Sheet

  This list can be used by penetration testers when testing for SQL injection authentication bypass.A penetration tester can use it manually or through burp in order to automate the process.The creator of this list is Dr. Emin İslam TatlıIf (OWASP Board Member).If you have any other suggestions please feel fr ee to leave a comment in order to improve and expand the list. or 1=1 or 1=1-- or 1=1# or 1=1/* admin' -- admin' # admin'/* admin' or '1'='1 admin' or '1'='1'-- admin' or '1'='1'# admin' or '1'='1'/* admin'or 1=1 or ''=' admin' or 1=1 admin' or 1=1-- admin' or 1=1# admin' or 1=1/* admin') or ('1'='1 admin') or ('1'='1'-- admin') or ('1'='1'# admin') or ('1'='1'/* admin') or '1'='1 admin') or '1'='1'-- admin') or '1'='1'# admin') ...