Skip to content

Instantly share code, notes, and snippets.

@ninp0
Last active November 7, 2019 21:35
Show Gist options
  • Save ninp0/ba9698b7ca5a7696abf37a579097a2f2 to your computer and use it in GitHub Desktop.
Save ninp0/ba9698b7ca5a7696abf37a579097a2f2 to your computer and use it in GitHub Desktop.

IF ON OSX, THIS IS IMPORTANT FOR OBTAINING THE PROPER VERSION of rsync to support userland configs:

<Install vagrant>
<Install macports>
$ sudo port install rsync
$ sudo vi /etc/paths AND ADD /opt/local/bin AT THE TOP OF THE FILE

CLONE CSI:

$ cd / && sudo git clone https://github.com/0dayinc/csi /opt/csi

CONFIGURE AWS USERLAND CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/vagrant.yaml
<change settings in /opt/csi/etc/userland/aws/vagrant.yaml>

CONFIGURE METASPLOIT USERLAND CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/metasploit/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/metasploit/vagrant.yaml
<change password in /opt/csi/etc/userland/aws/metasploit/vagrant.yaml>

CONFIGURE APACHE2 USERLAND CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/apache2/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/apache2/vagrant.yaml
<update settings /opt/csi/etc/userland/aws/apache2/vagrant.yaml in order to have TLS enabled on local deployment of OpenVAS and Jenkins>

CONFIGURE JENKINS USERLAND CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/jenkins/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/jenkins/vagrant.yaml
<update settings /opt/csi/etc/userland/aws/jenkins/vagrant.yaml in order to change default passwords>
<add Jenkins XML files in /opt/csi/etc/userland/aws/jenkins/jobs_userland/ to automatically create Jenkins jobs @ deployment> 

CONFIGURE OPENVAS USERLAND CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/openvas/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/openvas/vagrant.yaml
<update settings /opt/csi/etc/openvas/vagrant.yaml in order to change default passwords>

CONFIGURE BURPSUITE PRO CONFIG:

$ sudo cp /opt/csi/etc/userland/aws/burpsuite/vagrant.yaml.EXAMPLE /opt/csi/etc/userland/aws/burpsuite/vagrant.yaml
<update settings /opt/csi/etc/userland/aws/burpsuite/vagrant.yaml in order to update SHA256 sum on Burp Pro Jar and Respective License>

For a more comprehensive list, again see /opt/csi/etc/userland/<CSI_PROVIDER>

DEPLOY CSI PER USERLAND CONSTRAINTS:

$ sudo chown -R $USER:staff /opt/csi
$ cd /opt/csi && ./install.sh aws
$ ssh -i <ssh_private_key_path> admin@<ec2_elastic_ip>

PLEASE NOTE: If you're using OSX Catalina, SSH is refusing to connect, and you've confirmed SSH is open on your Elastic IP:

$ sudo nmap -p 22 <your elastic public ip> -Pn
Host is up (0.048s latency).

PORT   STATE SERVICE
22/tcp open  ssh

It's possible OSX quarantined your private SSH key. To verify, run the following command:

$ ls -l <path to your private SSH key, ends in .pem> | awk '{print $1}'
-rw-------@

Notice the @ symbol...oh apple, control issues?

$ xattr -l <path to your private SSH key, ends in .pem> | grep quarantine
com.apple.quarantine: ...

Sooo, let's move it out of quarantine:

$ sudo xattr -c <path to your private SSH key, ends in .pem>

Now you should be able to re-ssh into your EC2 instance or re-run installation again:

$ cd /opt/csi && ./install.sh aws
$ ssh -i <ssh_private_key_path> admin@<ec2_elastic_ip>
admin@ip-X-X-X-X:~$ sudo passwd admin
<new password>
<new password>
admin@ip-X-X-X-X:~$ exit

$ rdesktop -b 16 -u admin <ec2_elastic_ip>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment