Description

There’s an interesting script in the user’s home directory Additional details will be available after launching your challenge instance.


Steps

╰─❯ ssh -p 52940 picoplayer@saturn.picoctf.net                              
The authenticity of host '[saturn.picoctf.net]:52940 ([13.59.203.175]:52940)' can't be established.
ED25519 key fingerprint is SHA256:DiJcS90U9QussLS8HLR6l6BGJb5eCA0vRmA18IvDvw8.
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]:52940' (ED25519) to the list of known hosts.
picoplayer@saturn.picoctf.net's password:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.5.0-1023-aws x86_64)
 
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
 
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
 
picoplayer@challenge:~$ ls
useless
picoplayer@challenge:~$ cd useless
-bash: cd: useless: Not a directory

img

well thats not a dir so lets cat :

picoplayer@challenge:~$ cat useless
#!/bin/bash
# Basic mathematical operations via command-line arguments
 
if [ $# != 3 ]
then
  echo "Read the code first"
else
	if [[ "$1" == "add" ]]
	then
	  sum=$(( $2 + $3 ))
	  echo "The Sum is: $sum"
 
	elif [[ "$1" == "sub" ]]
	then
	  sub=$(( $2 - $3 ))
	  echo "The Substract is: $sub"
 
	elif [[ "$1" == "div" ]]
	then
	  div=$(( $2 / $3 ))
	  echo "The quotient is: $div"
 
	elif [[ "$1" == "mul" ]]
	then
	  mul=$(( $2 * $3 ))
	  echo "The product is: $mul"
 
	else
	  echo "Read the manual"
 
	fi
fi

img

MATHS, so i tried all kind of operations :

picoplayer@challenge:~$ ./useless
Read the code first
picoplayer@challenge:~$ ./useless $1
Read the code first
picoplayer@challenge:~$ ./useless "$1"
Read the code first
picoplayer@challenge:~$ ./useless add 5 3
The Sum is: 8
picoplayer@challenge:~$ ./useless $1  5 3
Read the code first
picoplayer@challenge:~$ ./useless $1 5 3
Read the code first
picoplayer@challenge:~$ ./useless sub 5 3
The Substract is: 2
picoplayer@challenge:~$ ./useless div 5 2
The quotient is: 2
picoplayer@challenge:~$ ./useless mul 5 2
The product is: 10

after all that, again i went back to the code and saw echo "Read the manual" so yeah :

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,subtrac‐
     tion, 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_3xp******}

GGS

img