R3dy / capsulecorp-pentest

Vagrant VirtualBox environment for conducting an internal network penetration test
https://www.manning.com/books/the-art-of-network-penetration-testing?a_aid=royce
834 stars 158 forks source link

[ERROR] pentest: metasploit #66

Closed neto1920 closed 2 years ago

neto1920 commented 2 years ago

Dear after you have updated the pentet virtual machine, I noticed that the:

box.vm.provision "ansible" do |ansible|
       ansible.playbook = "pentest.yml"
     end

inside the vagrant file

so I insert and correct some errors that were occurring with the new pentet vm. Among all the errors that you correct such as:

because it is returning the following error:


TASK [metasploit : set_fact] ***************************************************
ok: [pentest]

TASK [metasploit : Install necessary gem bundler] ******************************
fatal: [pentest]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '[127.0.0.1]:2212' (ECDSA) to the list of known hosts.\r\npentest@127.0.0.1: Permission denied (publickey,password).", "unreachable": true}

PLAY RECAP *********************************************************************
pentest                    : ok=19   changed=4    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I've been dedicating a lot of time trying to solve the problems that are occurring with the vms, because it's the only environment that I can practice in your book, I believe others who have acquired your book too. It's been a few months since I got your book, but as I'm dealing with problems and I'm still at the beginning, the good thing is that I'm learning a lot about ruby haha'.

can i upload my updates here in git

Thank you very much for your attention!!

R3dy commented 2 years ago

You can always submit a pull request and I will review the changes.

that said the latest update replaces the pentest VM with Kali Linux which should have all the tools from my book installed by default which means there is no need to run the Ansible playbook

neto1920 commented 2 years ago

Vms don't get ping, don't listen. Even being on the same only-host network. How can I resolve this?

R3dy commented 2 years ago

Sounds like you’ve made a lot of changes.

I recommend running vagrant destroy on everything.

then one at a time run vagrant up goku, gohan etc…

If vagrant up fails with any VM try running vagrant provision immediately after on that same VM

the last update I pushed was working perfectly using Windows, virtualbox and WSL

if this doesn’t work for you then I’ll try to help but I can’t really do anything unless I know every detail about your setup.

have you changed the vagrant file? What host OS What version of vagrant and Ansible. Etc…

neto1920 commented 2 years ago

Okay thanks a lot, I'll start from scratch again.

Ubuntu 20.04.4 LTS

ansible --version
ansible [core 2.12.6]
vagrant -v
Vagrant 2.2.19
R3dy commented 2 years ago

Did you fix it?

neto1920 commented 2 years ago

I did:

but it doesn't receive ICMP ping on the pentet vm:

in pentest, see

for ip in {1..254}; do ping -c 1 192.168.56.$ip -W 1 >> pingsweep.txt & done cat pingsweep.txt |grep "bytes from" | cut -d " " -f4 |cut -d ":" -f1 > targets.txt

cat targets.txt
192.168.56.100
192.168.56.140
192.168.56.200

192.168.56.200 <- pentest ip

neto1920 commented 2 years ago

I added rule in VM where I didn't get ICMP ping:

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow

https://www.howtogeek.com/howto/windows-vista/allow-pings-icmp-echo-request-through-your-windows-vista-firewall/

Now, i receive and fixed this error!! =)

TASK [Activate windows] ********************************************************
changed: [vegeta]

PLAY RECAP *********************************************************************
vegeta                     : ok=12   changed=5    unreachable=0    failed=0    skipped=10   rescued=0    ignored=0  

But I still have problem with Goku VM when I restart. inssue #64

UralovAO commented 2 years ago

How did you fix it?