본문 바로가기

Hojung's Command List

Total Commands : 232

 (e)grep (6)
 * find large files (2)
 * System info (12)
 * Term Key (8)
 * use previous argu (1)
 *CD/DVD cmd (5)
 *DNS test (4)
 ab (2)
 apg (1)
 arping (4)
 at (1)
 awk (1)
 cal (2)
 cd and pushd (3)
 crontab (7)
 curl (4)
 dd (1)
 dhclient (1)
 dig (2)
 du (1)
 echo (1)
 editcap (1)
 ethtool (2)
 find (20)
 head (1)
 history (1)
 host (1)
 hping3 (6)
 ifconfig (3)
 lftp (1)
 logger (1)
 ls (2)
 lsof (2)
 mail (2)
 man (1)
 mergecap (1)
 mount (8)
 nc (netcat) (1)
 ncftpput (1)
 netcat(nc) (1)
 netstat (1)
 nice (2)
 nl (1)
 nmap (5)
 ntpdate (1)
 openssl (15)
 ping (1)
 pkill (1)
 ps (2)
 rar (1)
 recode (6)
 rename (3)
 rm (1)
 route (2)
 rpm (4)
 sed (4)
 smb (3)
 snmpwalk (2)
 sort (4)
 ssh (1)
 tar (6)
 tcpdump (10)
 top (1)
 touch (2)
 uniq (1)
 vi (11)
 wall (2)
 wget (3)
 yum (5)
 zip/unzip (6)

Simple File Encryption

openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
openssl aes-256-cbc -d -a -in secrets.txt.enc -out secrets.txt.new

-aes-256-cbc: the encryption cipher to be used. (256bit AES is what the United States government uses to encrypt information at the Top Secret level.)
-a: the encrypted output will be base64 encoded, this allows you to view it in a text editor or paste it in an email. This is optional.
-salt: add strength to the encryption and should always be used.
You will be prompted for a password.
-d: decrypt data.

$ echo U2FsdGVkX18YcWkbmhsN7M/MP1E+GLf4IqmNsa53T+A= | openssl aes-256-cbc -d -a
enter aes-256-cbc decryption password: <pass>
hello world!
Written by Hojung at 2013-04-24 09:53:59

윈도우 텍스트파일의 ^M^@ 제거하기

:1,$s/^M//g <---------- ^M은 [ctrl]+v+m
:1,$s/^@//g <---------- ^@은 [ctrl]+[shift]+2

Written by Hojung at 2013-04-17 12:14:20

여러 속도로 패킷 보내기

hping3 -c 5 --syn -p 80 172.28.14.206 <----- 1초당 패킷1개 (5개 패킷 5초걸림)
hping3 -c 50 --fast --syn -p 80 172.28.14.206 <----- 1초당 패킷10개 (50개 패킷 5초걸림)
hping3 -c 50 --faster --syn -p 80 172.28.14.206 <----- fast 보다 빠르게 (테스트시 50개 패킷 0.098초 걸림)
hping3 --flood --syn -p 80 172.28.14.206 <----- 카운트없이 Flood 함

hping3 -c 5 -i 1 --syn -p 80 172.28.14.206 <----- 1초 간격으로 5개 패킷보냄
hping3 -c 5 -i u100000 --syn -p 80 172.28.14.206 <----- 0.1초 간격으로 5개 패킷보냄

-c : count
-i : interval X sec or uX micro sec (1 seconds = u1000000 micro seconds)
--rand-source : rand source
Written by Hojung at 2013-01-28 15:22:47

File or direcotry upload by single command

ncftpput -u user -p passwd -m server_address /remote/dir /local/file <------ file upload
ncftpput -R -u user -p passwd -m server_address /remote/dir /local/dir <------ directory upload

nohup find . -name *filename -exec ncftpput -u user -p passwd -m 172.28.11.152 /remote/dir {} \; 2> error.log &
Written by Hojung at 2013-01-17 16:52:33

Website 인증서 내용보기

openssl s_client -showcerts -connect some.server.com:port

Written by Hojung at 2012-12-24 17:56:25

DHCP packets sent by the client (DISCOVER, REQUEST, INFORM)

tcpdump -i eth0 -vvv -s 1500 '((port 67 or port 68) and (udp[8:1] = 0x1))'

Written by Hojung at 2012-12-13 16:58:37

DHCP packets including a specific Client MAC Address

tcpdump -i eth0 -vvv -s 1500 '((port 67 or port 68) and (udp[38:4] = 0x3e0ccf08))'

Written by Hojung at 2012-12-13 16:57:48

untar all .gz files in current dir

ls -1 *.gz | xargs -n 1 tar xzvf
(or $ls *gz | xargs -n 1 tar zxvf)

Written by Hojung at 2012-12-12 10:29:05

사이트에서 다운받기

curl ftp://ftp_site/filename.iso -o filename.iso
curl -O http://site/filename

Written by Hojung at 2012-12-12 10:27:55

ICMP Flooding with ping

ping -fi 0.5 1.1.1.1

ICMP echo request를 0.5초마다 한번씩 보냄
Written by Hojung at 2012-11-28 15:30:30