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

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') ...

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

What is a firewall?How it works?

  Firewalls  are software or hardware that  work  as a filtration system for the data attempting to enter your computer or network.  Firewalls  scan packets for malicious code or attack vectors that have already been identified as established threats.      Firewalls filter network traffic so that you only receive data that you should be getting. No firewall works perfectly, and a lot of a firewall's effectiveness depends on how you configure it. The need of Firewalls for Personal Use For home use, firewalls work much more simply. The main goal of a personal  firewall is to protect  your personal computer and private network from malicious mischief. Malware, malicious software, is the primary threat to your home computer. Viruses are often the first type of malware that comes to mind. A virus can be transmitted to your computer through email or over the Internet and can quickly cause a lot of damage to your files. Other malware inclu...