命令绕过:Linux下读取文件

cmd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
[email protected]:~# echo "Hello,world!" > 1.txt
[email protected]:~# nl 1.txt
1 Hello,world!
[email protected]:~# od -c 1.txt
0000000 H e l l o , w o r l d ! \n
0000015
[email protected]:~# pv 1.txt -qL 10
pv 1.txt -qL 10
Hello,world!
[email protected]:~# cat 1.txt
Hello,world!
[email protected]:~# tac 1.txt
Hello,world!
[email protected]:~# rev 1.txt | rev
Hello,world!
[email protected]:~# sed -n p 1.txt
Hello,world!
[email protected]:~# awk '1' 1.txt
Hello,world!
[email protected]:~# gawk '1' 1.txt
Hello,world!
[email protected]:~# head 1.txt
Hello,world!
[email protected]:~# tail 1.txt
Hello,world!
[email protected]:~# less 1.txt
[email protected]:~# more 1.txt
Hello,world!
[email protected]:~# grep "." 1.txt
Hello,world!
[email protected]:~# curl file:///root/1.txt
Hello,world!
[email protected]:~# diff 1.txt 2.txt
1c1,2
< Hello,world!
---
> 0000000 6548 6c6c 2c6f 6f77 6c72 2164 000a
> 000000d
[email protected]:~# comm 1.txt 2.txt
0000000 6548 6c6c 2c6f 6f77 6c72 2164 000a
000000d
Hello,world!
[email protected]:~# strings 1.txt
Hello,world!
[email protected]:~# hexdump 1.txt
0000000 6548 6c6c 2c6f 6f77 6c72 2164 000a
000000d
[email protected]:~# base32 1.txt | base32 -d
Hello,world!
[email protected]:~# base64 1.txt | base64 -d
Hello,world!

and so on…

nocmd

1
[email protected]:~# $(<1.txt)

language

1
2
3
4
5
6
[email protected]:~# php -r "echo file_get_contents('1.txt');"
php -r "echo file_get_contents('1.txt');"
Hello,world!
[email protected]:~# python2 -c "print open('1.txt').read()"
python2 -c "print open('1.txt').read()"
Hello,world!

and so on…

editor

1
2
3
4
5
6
7
8
9
10
11
12
[email protected]:~# pico 1.txt
[email protected]:~# vi 1.txt
[email protected]:~# vim 1.txt
[email protected]:~# gvim 1.txt
[email protected]:~# gvimdiff 1.txt
[email protected]:~# emacs 1.txt
[email protected]:~# nano 1.txt
[email protected]:~# gedit 1.txt
[email protected]:~# leafpad 1.txt
[email protected]:~# sublime 1.txt
[email protected]:~# hexeditor 1.txt
[email protected]:~# mimeopen 1.txt

and so on…

alias

1
2
3
4
5
[email protected]:~# alias showme='cat'
alias showme='cat'
[email protected]:~# showme 1.txt
showme 1.txt
Hello,world!