当前位置:网站首页>Record of the 25th week

Record of the 25th week

2022-06-25 04:34:00 3ackr0d

1、 Through a htb Infiltrating learning linux command

1.1 ssh command

ssh  There are two ways to connect , One is password , Second, public key login 

ssh [email protected]  [-p]   # ssh The default port is 22, If there are changes , use  -p Parameters   Appoint 

Public key login process

  • ssh-keygen Creating public and private keys
    -t Specify the encryption type -f Specify the generated file name
  • ssh-copy-id Upload the public key to the server /.ssh/authorized_keys
    -i Specify the public key file
  • ssh -i Private key file [email protected]
ssh-keygen -t rsa -f 3ackr0d

ssh-copy-id -i 3ackr0d [email protected]

ssh -i 3ackr0d [email protected]

Be careful : You can only log in with public key , You can change the configuration file

#/etc/ssh/sshd_confing

PasswordAuthentication  Change it to  no

1.2 ln command

Full name :make links between files, ln What is taken is link Two letters of

Utilization method :
ln On link Downloaded files ( Public key ) and /root/.ssh/authorized_keys, And then you can use it ssh With root Identity login

ln 
-s   Build soft links , Note that the source file name must be an absolute path 
-f   If the destination file exists , that -f Parameter will overwrite the target file 

1.3 echo command

Output content

-n Get rid of echo The following newline character
-e Backslash escape takes effect

Single quotation marks 、 Double quotes 、 The difference without quotation marks

  • The contents in single quotation marks are output intact
  • Inside the double quotation marks $\ `( The quotation marks ) It will work
  • Not using quotation marks will explain everything

1.4 base64

Carry on the content base64 Encoding and decoding

echo -n hello | base64

echo -n hello | base64 -d  #-d Parameter is decode 

2 python Write program debugging

When executing the program use python -i target.py Enter the interactive interface

dir() # Look at the built-in methods 
原网站

版权声明
本文为[3ackr0d]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250228533832.html