Hackers Rest
  • Hacker's Rest
  • Tools & Cheatsheets
    • Cybersecurity YouTube Channels
  • Hacking Methodology
  • Hands-on Practice
  • Fundamentals
    • Network Fundamentals
    • Computer Fundamentals
  • Unix
    • Unix Fundamentals
    • Hardening & Setup
      • TMUX/Screen Cheatsheet
    • Red Team Notes
      • Enumeration
      • Getting Access
      • Privilege Escalation
      • Pivoting/Lateral Movement
      • Data Exfiltration
      • Persistence
    • Vim
  • Windows
    • Windows Fundamentals
    • PowerShell
    • Hardening & Setup
    • Red Team Notes
      • Enumeration
      • Getting Access
      • Privilege Escalation
      • Pivoting/Lateral Movement
      • Persistence
      • Data Exfiltration
      • Active Directory
        • Enumeration
        • Getting Access
        • Privilege Escalation
        • Persistence
      • Kerberos
      • Impacket
  • MacOS
    • MacOS Basics
    • Hardening & Configuration
    • Red Team Notes
      • Enumeration
      • Getting Access
      • Privilege Escalation
      • Persistence
  • Web
    • Burp Suite
    • DNS
    • Web Notes
      • Enumeration
      • Web Filter Bypass
      • Command Injection
      • Subdomain/Virtual Host Enumeration
      • The Web Application Hacker's Handbook
  • Mobile
    • iOS
    • Android
  • OS Agnostic
    • Basic Enumeration
    • Cryptography & Encryption
    • Network Hardware
    • OS Agnostic
    • OSINT
    • Password Cracking
      • Gathering the Hashes
      • Wordlist Manipulation
      • Cracking the Hashes
    • Pivoting
      • Chisel
      • Plink.exe
      • SSH
      • Sshuttle
      • Socat
    • Reverse Engineering & Binary Exploitation
      • Buffer Overflow
    • Scripting
      • Script Language Syntax
    • SQL
    • SSH & SCP
    • Steganography
    • Wireless
  • Unsorted
Powered by GitBook
On this page
  • Linux
  • Remote Code Execution
  • Misc Linux
  • Cat file directly to clipboard
  • Check encoding of a text file

Was this helpful?

Edit on GitHub
  1. Unix

Red Team Notes

Sorted Linux notes, need to separate to different pages and reorganize

PreviousTMUX/Screen CheatsheetNextEnumeration

Last updated 4 years ago

Was this helpful?

Hack Responsibly.

Always ensure you have explicit permission to access any computer system before using any of the techniques contained in these documents. You accept full responsibility for your actions by applying any knowledge gained here.

Linux

Website for searching for shells through random programs such as vi "living off the land binaries":

Remote Code Execution

Run commands on remote system without a shell through SSH with a "Herefile". HERE can be anything, but it must begin and end with the same word.

ssh <user>@<server> << HERE
 <command1>
 <command2>
HERE

Misc Linux

Raw memory location so no files on disk: /dev/shm/

list all running commands:

ps -eo command`
#change delimiter to \n instead of <space> (loop by line): 
IFS=$'\n'
#Then loop through each line in output: 
for i in $(ps -eo command); do echo $i; done

Cat file directly to clipboard

#! /bin/bash
xclip -selection clipboard -i $@

'new' netstat: ss -lnp | grep 9001 #check if any connections on port 9001

copy files to local machine without file transfer:

base64 -w 0 /path/of/file/name.file 
#copy base64 then: 
echo -n <base64material> | base64 -d > filename.file

Check encoding of a text file

script to copy contents of file directly to clipboard; Save in PATH location then enjoy!

pretty print JSON text in console (). Pipe the JSON output to jq. Example from NASA ISS API: curl -s http://api.open-notify.org/iss-now.json | jq

vi -c 'let $enc = &fileencoding | execute "!echo Encoding: $enc" | q' <file_to_check> check encoding of a text file (needed especially when doing crypto with python, or cracking passwords with rockyou.txt - hint: needs latin encoding!) (how to make an alias for the above command)

If you like this content and would like to see more, please consider !

GTFObins
https://www.cyberciti.biz/faq/linux-unix-osx-bsd-ssh-run-command-on-remote-machine-server/
https://unix.stackexchange.com/questions/211817/copy-the-contents-of-a-file-into-the-clipboard-without-displaying-its-contents
https://www.howtogeek.com/529219/how-to-parse-json-files-on-the-linux-command-line-with-jq/
https://vim.fandom.com/wiki/Bash_file_encoding_alias
buying me a coffee