Basic Linux Commands
Find
Example:
find /usr -type d -name webshells
find / -type f -name Invoke-PowerShellTcp.ps1
find / -type f -name *password*
Other:
To specify user, use
-user <user>
To specify size, use
-size <bytes>
byte = c; e.g. 2 bytes = 2c
KiB = k; e.g. 2 KiB = 2k
MiB = M; e.g. 2MiB = 2M
You can also specify
>
,<
To specify permission, use
-perm xxx
/-perm u=r
At least the permission
-666
(e.g.-444
means readable by everyone)Match any permission set
/666
To specify time:
Create / Access / Modified =
c
/a
/m
ctime
atime
mtime
cmin
amin
mmin
Minute =
min
; Day =time
Created 7 days ago =
-ctime -7
Modified within the last 24 hours =
-mtime 0
Networking
Network Configuration
Wireless Configuration
Print ARP Cache
Command Line Kung Fu
SED - Stream Editor
-i
= in-place (save back to the original file)s
= the substitute commandoriginal
= a regular expression describing the word to replace (or just the word itself)new
= the text to replace it withg
= global (i.e. replace all)file.txt
= filename
SSH Tunnel
Local Host <--> SSH Server <--> Remote Host
Another one (socks proxy):
Proxychain
If you have a Meterpreter session, you can add an ad-hoc route:
Then check the proxychain port via /etc/proxychain.conf
After knowing the port, start a socks4a handler in Metasploit:
Then you can use proxychains
to reach the target:
DIG
Zone transfer
Reverse lookup
Add sudo user in one line
Change user password in one line
Find a phase in all files in a directory
Last updated