- Step -On my VM Debian Server I had to install the sudo utility first as root user I ran
apt install sudo
- Step is to add user you sudoers file. To do so you need to as root user run visudo and at the end of file add
username ALL=(ALL) NOPASSWD:ALL
- Step is to add user to the sudo group, again as root you run
usermod -aG sudo username
- Step you can now check if you can use sudo command as user you created before and if you followed those steps you should be able to run commands as trusted user
This is my very first blog with the posts about tutorials, walkthroughs and writeups for ethnical hacking and other cyber security themese
Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts
Tuesday, October 31, 2023
Debian Server 12 - adding user to sudoers
sudo is a command-line utility that allows trusted users to run commands as another user, by default root.
This tutorial shows two ways to grant sudo privileges to a user.
Thursday, December 8, 2022
TryHackMe - Year of the Rabbit - writeup
Year of the Rabbit is the beginer friendly CTF room on TryHackMe.com.
How ever i strongly suggest that this isnt your very first CTF room. Because this one is pretty long and not so straight forward as you would suspect from easy room.
Here is my "journey" through the VM we need to hack in and
AudiTTRSi
- step
- step
- step
- step
- step
- step
- step
As usually I started with nmap scan:
nmap -sS VM_IPOutput looks promissing with open ftp, ssh and http port.
I tried if ftp might allow us anonymous log in but without luck it doesnt allow. We will return to the ftp later.
In this step we will run our friend gobuster.
gobuster dir -u http://VM_IP -w /usr/share/wordlists/dirb/common.txt -x php,txt,htmlOutput directs us to the /assets folder where we find 2 files.
Well we got some text and a video. The text suggest that hint is in the video so i went for that but no luck. I tried looking around the web for hint and suggestion was to use burp suite. We use it to intercept the get request for page /sup3r_s3cr3t_fl4g.php in response we find the hidden folder.
Open the hidden folder we got in previous step we find picture of the girl. Hmm what could we do with it maybe some meta data.
strings hot_babe.pngVoila we get list of possible password and username for FTP access.
We use hydra tool:
hydra -l ftpuser - P possible_pass.txt ftp:/vm_ipHydra will run fast because of short list and you get log in to the ftp with username and password:
ftp VM_IPWe are prompted for credentials. After login we use ls and we see Eli's_Creds.txt. I have downloaded filed to attackbox:
get Eli's_Creds.txt
I have opened file on attackbox at first file looks like jibrish but I think I saw once this before.
I have looked around the web for brainfuck language. I have confirmed that this is brainfuck and I used this decoder
This one gave us ssh credentials.
ssh username@VM_IPWe enter password we got with decoded and the login we get hint were to look for flag? or soemthing else? we have found another credendetials.
su another_usernameAfter logged in new account I checked home folder of user where you find the user.txt flag.
Ok we got user flag, lets try to escalate priviliges. We check if we can run any command as root user.
sudo -lFrom output I saw you can run vi program. I headed over to the GTFObins and see what command will help us to get the root access.
sudo -u#-1 /usr/bin/vi /home/gwendoline/user.txtthen we ctrl + c and we type in !/bin/sh and voila we have root access.
cd /root
ls
cat root.txt
AudiTTRSi
Saturday, November 5, 2022
How to change default ssh login banner
To create a cool ASCII art banner for your server, first start off by going here:
ASCII art creator/
To change the message displayed before login, edit /etc/ssh/sshd_config :
ASCII art creator/
To change the message displayed before login, edit /etc/ssh/sshd_config :
sudo vim /etc/ssh/sshd_configand add (or uncomment) the line:
Banner /etc/banner/etc/banner can be whatever file you want. Then edit /etc/banner
sudo vim /etc/bannerYou’ll probably need to restart sshd before your changes take effect:
sudo /etc/init.d/ssh restartTo change the message displayed after login, edit /etc/motd :
sudo vim /etc/motdand enter the message you want to display.
Subscribe to:
Comments (Atom)
TryHackMe - Shadow Trace Writeup
Shadow Trace is premium room on TryHackMe.com part of the SOC Level 1 Path. We need to analyse a suspicious file, uncover hidden clues, an...
-
It has been a while since my last tinkering around VM machines on my laptop. Today I just had little bit of time to install new Debian 13 ...
-
This is my first writeup/walkthrough post for the TryHackMe website. TryHackMe is online platform for learning cyber security, using hand...