LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-01-2015, 05:54 AM   #1
enter username
LQ Newbie
 
Registered: May 2015
Posts: 1

Rep: Reputation: Disabled
Help figureing out hacker commands


Im a linux newbie im trying to understand how the hacker gained privileges from hacking an unprivileged account. Here are the commands used.Trying to understand "mv getlogs.sh" and why the "echo /bin/sh > getlogs.sh" was issued? Im a newbie to Linux so this is probably something easy thanks for your support.

cd scripts
ls -lah
sudo -l
cat getlogs.sh
mv getlogs.sh getlogs.bkup
echo "/bin/sh" > getlogs.sh
cat getlogs.sh
chmod x getlogs.sh
ls -l
./getlogs.sh
id
exit
sudo getlogs.sh
sudo /home/ccoffee/scripts/getlogs.sh
id
 
Old 05-01-2015, 07:25 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
They had execute and write privileges for the directory.
They had write privileges for getlogs.sh, but not execute privileges.
So they moved, thus wrote, getlogs.sh to another file, because they had rwx for the directory.
Then they created a new getlogs.sh which contained the /bin/sh command.
They made that executable, and then ran it.
Somehow that allowed them into a group they weren't supposed to be within and thus they were able to do the sudo command. Or maybe not, maybe they persisted in trying, but never succeeded. Seems like they were still checking their user and group ids.
 
Old 05-01-2015, 07:38 AM   #3
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
I think the point was to replace the original script with one that opens a shell, then run the new script with sudo to get the shell with elevated permissions. Hence the first use of sudo -l to see if any of the scripts could be run with sudo.

The way I read it, the cracker was going slowly and testing every step.
 
Old 05-01-2015, 07:41 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Yes I don't think they succeeded, but they were able to do those things based on the privileges they had for the directory and at least were able to delete and then create a new script where originally they were not able to run or modify that script.

This points out that the directory permissions are equally important.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic LXer Syndicated Linux News 0 04-29-2015 08:40 PM
USB Low Level commands (embedded Linux, terminal commands) JonCombat Linux - Newbie 2 01-05-2013 02:34 PM
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 08:54 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration