picoCTF2023

chrono 

 |  | 100 points 

Tags: General Skillslinux 

AUTHOR: MUBARAK MIKAIL 

Description 

How to automate tasks to run at intervals on linux servers? 

Additional details will be available after launching your challenge instance. 

 

 

picoCTF{Sch3DUL7NG_T45K3_L1NUX_abe2c490} 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ ssh picoplayer@saturn.picoctf.net -p 64468 

 

picoplayer@challenge:~$ crontab -e 

no crontab for picoplayer - using an empty one 

update-alternatives: error: no alternatives for editor 

/usr/bin/sensible-editor: 25: editor: not found 

/usr/bin/sensible-editor: 28: nano: not found 

/usr/bin/sensible-editor: 31: nano-tiny: not found 

/usr/bin/sensible-editor: 34: vi: not found 

Couldn't find an editor! 

Set the $EDITOR environment variable to your desired editor. 

crontab: "/usr/bin/sensible-editor" exited with status 1 

picoplayer@challenge:~$ sudo crontab -e 

[sudo] password for picoplayer:  

picoplayer is not in the sudoers file.  This incident will be reported. 

picoplayer@challenge:~$ cd /etc 

picoplayer@challenge:/etc$ cat crontab 

# picoCTF{Sch3DUL7NG_T45K3_L1NUX_abe2c490} 

 


findme 

 |  | 100 points 

Tags: Web Exploitation 

AUTHOR: GEOFFREY NJOGU 

Description 

Help us test the form by submiting the username as test and password as test! 

Additional details will be available after launching your challenge instance. 

 

 

picoCTF{proxies_all_the_way_599a80c2} 

 

Go to the site, follow the instructions.  

Poked around the site, but could not find anything. 

 

Use Developer Tool, capture traffic from the first page to login success, you see there are two entried with no response: 

http://saturn.picoctf.net:56021/next-page/id=cGljb0NURntwcm94aWVzX2Fs 

http://saturn.picoctf.net:56021/next-page/id=bF90aGVfd2F5XzU5OWE4MGMyfQ==  

 

The values of id look like base64 encoded. Decode these two id values and you get the flag. 


hideme 

 |  | 100 points 

Tags: Forensicssteganography 

AUTHOR: GEOFFREY NJOGU 

Description 

Every file gets a flag.The SOC analyst saw one image been sent back and forth between two people. They decided to investigate and found out that there was more than what meets the eye here

 
 

 

picoCTF{Hidding_An_imag3_within_@n_ima9e_c31884c7} 

 

 

Try online tool first. 

https://aperisolve.fr/  

 

Looks binwalk found some hidden file. 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ binwalk flag.png   

  

DECIMAL   HEXADECIMAL DESCRIPTION 

-------------------------------------------------------------------------------- 

0         0x0         PNG image, 512 x 504, 8-bit/color RGBA, non-interlaced 

41        0x29            Zlib compressed data, compressed 

39739     0x9B3B      Zip archive data, at least v1.0 to extract, name: secret/ 

39804     0x9B7C      Zip archive data, at least v2.0 to extract, compressed size: 2832, uncompressed size: 2984, name: secret/flag.png 

42871     0xA777      End of Zip archive, footer length: 22 

  

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ binwalk -e flag.png 

  

DECIMAL   HEXADECIMAL DESCRIPTION 

-------------------------------------------------------------------------------- 

0         0x0         PNG image, 512 x 504, 8-bit/color RGBA, non-interlaced 

41        0x29            Zlib compressed data, compressed 

39739     0x9B3B      Zip archive data, at least v1.0 to extract, name: secret/ 

39804     0x9B7C      Zip archive data, at least v2.0 to extract, compressed size: 2832, uncompressed size: 2984, name: secret/flag.png 

42871     0xA777      End of Zip archive, footer length: 22 

  

                                                                                                                      

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ ls 

aaa.txt  atbash.jpg  encrypted.txt  flag.png  _flag.png.extracted 

                                                                                                                      

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ cd _flag.png.extracted  

                                                                                                                      

┌──(kali㉿kali)-[~/Desktop/picoCTF/_flag.png.extracted] 

└─$ ls 

29  29.zlib  9B3B.zip  secret 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF/_flag.png.extracted] 

└─$ cd secret              

        

 

┌──(kali㉿kali)-[~/Desktop/picoCTF/_flag.png.extracted/secret] 

└─$ ls 

flag.png 

        

 

 


HideToSee 

 |  | 100 points 

Tags: Cryptography 

AUTHOR: SUNDAY JACOB NWANYIM 

Description 

How about some hide and seek heh?Look at this image here

 
 

picoCTF{atbash_crack_6c4bcb08} 

 

 

Tried online tool: 

https://aperisolve.fr/  

Online steg site with all the tools together 

 

It has strings, exiftool and some others. The simple ones didn't work. 

 

Try steghide. 

 

Try password atbash with steghide and it does not work. 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ steghide info atbash.jpg       

"atbash.jpg": 

  format: jpeg 

  capacity: 2.4 KB 

Try to get information about embedded data ? (y/n) y 

Enter passphrase:  

steghide: could not extract any data with that passphrase! 

                                                                                                      

Try without password and it worked.                 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ steghide info atbash.jpg 

"atbash.jpg": 

  format: jpeg 

  capacity: 2.4 KB 

Try to get information about embedded data ? (y/n) y 

Enter passphrase:  

  embedded file "encrypted.txt": 

size: 31.0 Byte 

encrypted: rijndael-128, cbc 

compressed: yes 

                                                                                                                      

                                                                   

Extract file without password.                                                   

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ steghide extract -sf  atbash.jpg 

Enter passphrase:  

wrote extracted data to "encrypted.txt". 

                                                                                                                      

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ cat encrypted.txt                           

krxlXGU{zgyzhs_xizxp_6x4yxy08} 

 

Notice the image says atbash. So decode this string with atbash decoder: 

picoCTF{atbash_crack_6c4bcb08} 

 


MatchTheRegex 

 |  | 100 points 

Tags: Web Exploitation 

AUTHOR: SUNDAY JACOB NWANYIM 

Description 

How about trying to match a regular expressionThe website is running here

 

 

picoCTF{succ3ssfully_matchtheregex_18b306a0} 

 

 

First try search with ***, get an error. 

Then try search with picoCTF*** and it worked


money-ware 

|  

| 100 points 

Tags:  

Author: Juni19 

Description 

Flag format: picoCTF{Malwarename} The first letter of the malware name should be capitalized and the rest lowercase. Your friend just got hacked and has been asked to pay some bitcoins to 1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX. He doesn’t seem to understand what is going on and asks you for advice. Can you identify what malware he’s being a victim of? 

 

Just google 

"1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX malware" 

You will find news that points to a malware named Petya. 

 

picoCTF{Petya} 


PcapPoisoning 

 |  | 100 points 

Tags: Forensicspcap 

AUTHOR: MUBARAK MIKAIL 

Description 

How about some hide and seek heh?Download this file and find the flag. 

 

 

Open the file in wireshark. 

Search key word pico. And you will find it. 

 

 

 

picoCTF{P64P_4N4L7S1S_SU55355FUL_ba1a6097} 

 

 


Permissions 

 |  | 100 points 

Tags: General Skillsvim 

AUTHOR: GEOFFREY NJOGU 

Description 

Can you read files in the root file?The system admin has provisioned an account for you on the main server:ssh -p 58850 picoplayer@saturn.picoctf.netPassword: cbjrrAIyO4Can you login and read the root file? 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ ssh -p 58850 picoplayer@saturn.picoctf.net 

The authenticity of host '[saturn.picoctf.net]:58850 ([3.12.65.157]:58850)' can't be established. 

ED25519 key fingerprint is SHA256:oCgGxVpfRH0kgCbgMYs6D+4eE2zVsDCCjmEzmEiK2iQ. 

This key is not known by any other names 

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 

Warning: Permanently added '[saturn.picoctf.net]:58850' (ED25519) to the list of known hosts. 

picoplayer@saturn.picoctf.net's password:  

picoplayer@challenge:~$ cd /root 

-bash: cd: /root: Permission denied 

picoplayer@challenge:~$ whoami 

picoplayer 

picoplayer@challenge:~$ sudo -i 

[sudo] password for picoplayer:  

Sorry, user picoplayer is not allowed to execute '/bin/bash' as root on challenge. 

picoplayer@challenge:~$ sudo -l 

[sudo] password for picoplayer:  

Matching Defaults entries for picoplayer on challenge: 

    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin 

  

User picoplayer may run the following commands on challenge: 

(ALL) /usr/bin/vi 

 

First see if you can use vi to open the flag.txt file under /root. 

 

picoplayer@challenge:~$ vi /root/flag.txt 

picoplayer@challenge:~$ sudo vi /root/flag.txt 

Nothing showed up. 

 

So you can run vi with sudo permission, check what command can be used to get a root shell from vi: 

https://gtfobins.github.io/gtfobins/vi/#sudo  

  

 

 

picoplayer@challenge:~$ sudo vi -c ':!/bin/sh' /dev/null 

 

# cd /root 

# ls 

flag.txt 

# cat flag.txt 

# ls -al 

total 16 

drwx------ 1 root root   38 Mar 15 08:17 . 

drwxr-xr-x 1 root root   63 Mar 15 08:14 .. 

-rw-r--r-- 1 root root 3106 Dec  5  2019 .bashrc 

-rw-r--r-- 1 root root   35 Mar 15 02:46 .flag.txt 

-rw-r--r-- 1 root root  161 Dec  5  2019 .profile 

-rw------- 1 root root  707 Mar 15 08:17 .viminfo 

-rw-r--r-- 1 root root 0 Mar 15 08:17 flag.txt 

# cat .flag.txt 

picoCTF{uS1ng_v1m_3dit0r_27f6a05a} 

#  

 


ReadMyCert 

 |  | 100 points 

Tags: Cryptography 

AUTHOR: SUNDAY JACOB NWANYIM 

Description 

How about we take you on an adventure on exploring certificate signing requestsTake a look at this CSR file here

 

 

Download the CSR file, try base64 decoder. So just decode the file and you will get the flag. If you want to read all the contents, try a CSR decoder https://www.sslshopper.com/csr-decoder.html . The flag is the common name of the cert. 

 

picoCTF{read_mycert_12eba7f1} 



Ready Gladiator 0

Ready Gladiator 0 

 |  | 100 points 

Tags: Reverse EngineeringCoreWars 

AUTHOR: LT 'SYREAL' JONES 

Due to Instance Launching maintenance, you may access the challenge download file to work offline: 

Your opponent is the Imp. The source is available here. If you wanted to pit the Imp against himself, you could download the Imp and start your own corewars server 

Description 

Can you make a CoreWars warrior that always loses, no ties?Your opponent is the Imp. The source is available here. If you wanted to pit the Imp against himself, you could download the Imp and connect to the CoreWars server like this:nc saturn.picoctf.net 59924 < imp.red 

 

 

picoCTF{h3r0_t0_z3r0_4m1r1gh7_7c030e56} 

 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ nc saturn.picoctf.net 59924 < imp.red 

Submit your warrior: (enter 'end' when done) 

  

;redcode 

;name Imp Ex 

;assert 1 

mov 0, 1 

end 

Warrior1: 

;redcode 

;name Imp Ex 

;assert 1 

mov 0, 1 

end 

  

Rounds: 100 

Warrior 1 wins: 0 

Warrior 2 wins: 0 

Ties: 100 

Try again. Your warrior (warrior 1) must lose all rounds, no ties. 

 

Follow the instruction and try it first. It looks like a game with input file. 

 

I asked ChatGPT. 😀 

 

Can you make a CoreWars warrior that always loses, no ties? 

Yes, I can create a CoreWars warrior that always loses without any ties. One simple strategy for doing so is to create a warrior that simply performs a single "DAT" instruction, which writes a "0" to the current address and terminates execution. This warrior will always lose because it never performs any useful action, and it immediately destroys itself by writing a "0" to its own memory location. 

Here is an example CoreWars warrior code that always loses: 

MOV 0, 0 ; move 0 to address 0 

DAT #0   ; write 0 to address 1 and terminate 

and terminate
 

This warrior loads the value "0" into memory location 0 using the "MOV" instruction, and then writes a "0" to memory location 1 using the "DAT" instruction. The "DAT" instruction also terminates the execution of the warrior, ensuring that it cannot perform any further actions. 

When this warrior is executed in a CoreWars simulation, it will immediately write a "0" to memory location 1 and terminate, guaranteeing that it loses the battle. 

 

 

 

So give it a try! 

                                                                                                                                                 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ nc saturn.picoctf.net 59924 < imp1.red 

MOV 0, 0; 

DAT #0 

Submit your warrior: (enter 'end' when done) 

  

end 

'end' 

^C 

                            

Looks the input file need a "end". 

                                                                                                                      

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ nc saturn.picoctf.net 59924 < imp1.red 

MOV 0, 0; 

DAT #0 

end 

Submit your warrior: (enter 'end' when done) 

  

Warrior1: 

MOV 0, 0; 

DAT #0 

end 

  

Warning: 

     Missing ';assert'. Warrior may not work with the current setting 

Number of warnings: 1 

  

Rounds: 100 

Warrior 1 wins: 0 

Warrior 2 wins: 100 

Ties: 0 

You did it! 

picoCTF{h3r0_t0_z3r0_4m1r1gh7_7c030e56} 

                                     


two-sum

two-sum 

 |  | 100 points 

Tags: Binary Exploitation C make 

AUTHOR: MUBARAK MIKAIL 

Due to Instance Launching maintenance, you may access the challenge download file to work offline: 

What two positive numbers can make this possible: n1 > n1 + n2 OR n2 > n1 + n2 

Source 

Description 

Can you solve this? 

Additional details will be available after launching your challenge instance. 

 

picoCTF{Tw0_Sum_Integer_Bu773R_0v3rfl0w_bc0adfd1} 

 

Download the source code C program. Read the program, so it asks for integer overflow. 

 

 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ nc saturn.picoctf.net 50022 

n1 > n1 + n2 OR n2 > n1 + n2  

What two positive numbers can make this possible:  

2147483647 1          

You entered 2147483647 and 1 

You have an integer overflow 

YOUR FLAG IS: picoCTF{Tw0_Sum_Integer_Bu773R_0v3rfl0w_bc0adfd1} 

 

 

 

I tried to ask ChatGPT: 

 

 

 

what integer number a and b can make this happen in C language? 

I'm sorry, but I'm not sure what you are referring to. Could you please provide more context and information about what you are trying to achieve in your C program? 

 

static int addIntOvf(int result, int a, int b) { result = a + b; if(a > 0 && b > 0 && result < 0) return -1; if(a < 0 && b < 0 && result > 0) return -1; return 0; } 

The addIntOvf function appears to be checking for integer addition overflow by verifying that the signs of a, b, and result are consistent with the expected outcome of the addition. 

If a and b have the same sign (both positive or both negative) and the sum of a and b has the opposite sign, then overflow has occurred. In this case, the function returns -1 to indicate that overflow has occurred. 

If a and b have different signs (one positive and one negative), then overflow cannot occur. In this case, the function returns 0 to indicate that no overflow has occurred. 

It's worth noting that this implementation assumes two's complement representation of signed integers, which is the most common representation used in modern computers. 

To answer your question, there are many integer values of a and b that can make this function return -1, depending on the range of integers that are being used in the C implementation. If you provide more information about the integer range being used, I may be able to provide a specific example? 

 

can you give examples of a and b for 16-bit and 32-bit systems? 

Sure, here are some examples of values for a and b that can cause the addIntOvf function to return -1 for 16-bit and 32-bit systems: 

For a 16-bit system, the range of integers is -32,768 to 32,767. Here are some examples: 

For a 32-bit system, the range of integers is -2,147,483,648 to 2,147,483,647. Here are some examples: 

It's worth noting that these are just examples, and there are many other combinations of values for a and b that can cause the function to return -1. 

 

what about 64-bit system? 

For a 64-bit system, the range of integers is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Here are some examples of values for a and b that can cause the addIntOvf function to return -1: 

It's worth noting that these are just examples, and there are many other combinations of values for a and b that can cause the function to return -1 on a 64-bit system. 

 


useless 

useless 

 |  | 100 points 

Tags: General Skillsman 

AUTHOR: LOIC SHEMA 

Description 

There's an interesting script in the user's home directoryThe work computer is running SSH. We've been given a script which performs some basic calculations, explore the script and find a flag.Hostname: saturn.picoctf.net
Port: 50619
Username: picoplayer
Password: password 

 

 

picoCTF{us3l3ss_ch4ll3ng3_3xpl0it3d_3555} 

 

 

This is not a good challenge. 

 

Login to the machine. Read the code, so this is a basic arithmetic function. Nothing fancy. Asked ChatGPT, no buffer overflow, no privilege escalation. 

 

Then notice the keyword for this challenge – man and the code says checking manual. 

 

picoplayer@challenge:~$ man useless 

  

useless 

  useless, — This is a simple calculator script 

  

SYNOPSIS 

  useless, [add sub mul div] number1 number2 

  

DESCRIPTION 

  Use the useless, macro to make simple calulations like addition,subtraction, multiplication and division. 

  

Examples 

  ./useless add 1 2 

    This will add 1 and 2 and return 3 

  

  ./useless mul 2 3 

    This will return 6 as a product of 2 and 3 

  

  ./useless div 6 3 

    This will return 2 as a quotient of 6 and 3 

  

  ./useless sub 6 5 

    This will return 1 as a remainder of substraction of 5 from 6 

  

Authors 

  This script was designed and developed by Cylab Africa 

  

     picoCTF{us3l3ss_ch4ll3ng3_3xpl0it3d_3555} 

  

picoplayer@challenge:~$  

 


Ready Gladiator 1 

Ready Gladiator 1 

 |  | 200 points 

Tags: Reverse EngineeringCoreWars 

AUTHOR: LT 'SYREAL' JONES 

Due to Instance Launching maintenance, you may access the challenge download file to work offline: 

Your opponent is the Imp. The source is available here. If you wanted to pit the Imp against himself, you could download the Imp and run your own core wars server 

Description 

Can you make a CoreWars warrior that wins?Your opponent is the Imp. The source is available here. If you wanted to pit the Imp against himself, you could download the Imp and connect to the CoreWars server like this:nc saturn.picoctf.net 53899 < imp.redTo get the flag, you must beat the Imp at least once out of the many rounds. 

 

 

picoCTF{1mp_1n_7h3_cr055h41r5_b182a3f1} 

 

 

It looks similar to Ready Gladiator 0, so I asked ChatGPT again. But this time, it cannot solve the problem. It ended up with some syntax errors. So, I tried to google online. 

 

https://vyznev.net/corewar/guide.html  

 

Here is a good instruction with sample code. It mentions a Dwarf. I copy the code over and it worked! 

 

 

┌──(kali㉿kali)-[~/Desktop/picoCTF] 

└─$ nc saturn.picoctf.net 53899 < impnew3.red 

ADD #4, 3    ; execution begins here 

MOV 2, @2 

JMP -2 

DAT #0, #0 

end 

Submit your warrior: (enter 'end' when done) 

  

Warrior1: 

ADD #4, 3    ; execution begins here 

MOV 2, @2 

JMP -2 

DAT #0, #0 

end 

  

Warning: 

     Missing ';assert'. Warrior may not work with the current setting 

Number of warnings: 1 

  

Rounds: 100 

Warrior 1 wins: 25 

Warrior 2 wins: 0 

Ties: 75 

You did it! 

picoCTF{1mp_1n_7h3_cr055h41r5_b182a3f1} 

 

 

https://www.angio.net/res/garden.pdf 

 

 

Specialer

Specialer 

 |  | 400 points 

Tags: General Skillsbashssh 

AUTHOR: LT 'SYREAL' JONES, ET AL. 

Description 

Reception of Special has been cool to say the least. That's why we made an exclusive version of Special, called Secure Comprehensive Interface for Affecting Linux Empirically Rad, or just 'Specialer'. With Specialer, we really tried to remove the distractions from using a shell. Yes, we took out spell checker because of everybody's complaining. But we think you will be excited about our new, reduced feature set for keeping you focused on what needs it the most. Please start an instance to test your very own copy of Specialer.ssh -p 65319 ctf-player@saturn.picoctf.net. The password is 3f39b042 

 

 

picoCTF{y0u_d0n7_4ppr3c1473_wh47_w3r3_d01ng_h3r3_811ae7e9} 

 

Login to the machine, this time it looks the wrapper program is gone. You can run commands. But most of common commands are no longer available. It looks only bash shell native commands are still available. 

 

 

 

Specialer$ history 

1  cd /etc 

2  cd /usr 

3  command 

4  command -help 

5  command ls 

6  eval env 

7  history 

Specialer$ compgen -b 

alias 

bg 

bind 

break 

builtin 

caller 

cd 

command 

compgen 

complete 

compopt 

continue 

declare 

dirs 

disown 

echo 

enable 

eval 

exec 

exit 

export 

false 

fc 

fg 

getopts 

 

The list is long but not many useful commands are there. 

 

Use cd command you will notice there is no /usr either. 

 

So the question is what is the alternative commands we can use to run as 'ls' and 'cat'? 

 

I asked ChatGPT and it actually pretty helpful. Sometimes you just need to ask mutliple times. 

 

 

 

Specialer$ echo * 

abra ala sim 

Specialer$ cd abra 

Specialer$ echo * 

cadabra.txt cadaniel.txt 

Specialer$ cd .. 

Specialer$ cd ala 

Specialer$ echo * 

kazam.txt mode.txt 

Specialer$ cd .. 

Specialer$ cd sim 

Specialer$ echo * 

city.txt salabim.txt 

Specialer$ echo city.txt 

city.txt 

 

Specialer$ more 

-bash: more: command not found 

Specialer$ less 

-bash: less: command not found 

Specialer$ od -c city.txt 

-bash: od: command not found 

Specialer$ vi 

-bash: vi: command not found 

Specialer$ nano 

-bash: nano: command not found 

Specialer$ vim 

-bash: vim: command not found 

 

  

Specialer$ echo $(<city.txt) 

05ed181c-4aa0-4d4a-8505-2fe6ca9097d3 

Specialer$ echo $(<salabim.txt) 

#He was so kind, such a gentleman tied to the oceanside# 

Specialer$ cd .. 

Specialer$ echo * 

abra ala sim 

Specialer$ cd ala 

Specialer$ echo * 

kazam.txt mode.txt 

Specialer$ echo $(<kazam.txt) 

return 0 picoCTF{y0u_d0n7_4ppr3c1473_wh47_w3r3_d01ng_h3r3_811ae7e9} 

Specialer$                                           

 

 

 

 

*************************************************** 

ChatGPT chat script: 

 

if ls command is not available, what command can I use to list the programs available to me? 

If the ls command is not available, you can try using the echo command to display the contents of the current directory. 

For example, you can use the following command to list the files and directories in the current directory: 

echo *

 

 

if cat command is not available, what command can I use to show the content of a file on Linux? 

If the cat command is not available, you can use the more command or the less command to view the contents of a file on Linux. 

To use the more command, simply type the following command followed by the name of the file you want to view: 

Copy code 

more filename
 

This will display the contents of the file one page at a time. To move to the next page, press the space bar. To exit the more command, press q

To use the less command, type the following command followed by the name of the file you want to view: 

Copy code 

less filename
 

This will display the contents of the file, allowing you to scroll up and down through the text using the arrow keys. To exit the less command, press q

Both the more and less commands are commonly available on Linux systems, so they should be a reliable backup if the cat command is not available. 

 

 

but both more and less commands are not available either 

If both the cat, more, and less commands are not available on your Linux system, you can try using the od command to display the contents of a file in a hexadecimal format. 

To use the od command, type the following command followed by the name of the file you want to view: 

od -c filename 

This will display the contents of the file in a hexadecimal format, with each byte of data shown as a two-digit hexadecimal number. This can be difficult to read, but it will show you the contents of the file. 

Alternatively, you can use a text editor like vi or nano to view the contents of the file. These editors are typically available on most Linux systems. To use vi, type the following command followed by the name of the file you want to view: 

Copy code 

vi filename
 

This will open the file in the vi editor, which allows you to view and edit the contents of the file. To exit the vi editor, press Esc and then type :q and press Enter

To use nano, type the following command followed by the name of the file you want to view: 

Copy code 

nano filename
 

This will open the file in the nano editor, which also allows you to view and edit the contents of the file. To exit the nano editor, press Ctrl+X and then confirm that you want to exit by pressing Y and then Enter

 

 

od, nano are vi are not available either 

If cat, more, less, od, nano, and vi commands are not available, you can try using the echo command to display the contents of the file. However, this may not work well for larger files as it will print the contents of the file on the terminal. 

To use the echo command to display the contents of a file, type the following command followed by the name of the file: 

 

echo $(<filename) 

 

echo $(<filename)
 

This will display the contents of the file on the terminal. 

If this doesn't work, you can try using a different text editor that is available on your system, such as emacs or pico

To use emacs, type the following command followed by the name of the file: 

emacs filename 

emacs filename
 

This will open the file in the emacs editor, which allows you to view and edit the contents of the file. To exit the emacs editor, press Ctrl+X and then confirm that you want to exit by pressing Y and then Enter

To use pico, type the following command followed by the name of the file: 

pico filename pico filename
 

This will open the file in the pico editor, which also allows you to view and edit the contents of the file. To exit the pico editor, press Ctrl+X and then confirm that you want to exit by pressing Y and then Enter