Internet access & own network IP address on Kali linux [on hold]

I have a Kali linux and a windows XP installed as VM’s on VirtualBoxs.
I want Kali to be able to ping and communicate with windows xp while still having internet access.
I added a NAT adaptor and a internal adaptor on kali while windows xp has internal and NAT adaptors.
The problem is i can only use one or the other adaptors. How do i use both synchronously ? so that kali have internet access and be in its own network to communicate with windows xp at the same time?

Attach agent to running process

I am trying to attach an agent from a client process to the server process
Basically i try this with using com.sun.tools.attach.VirtualMachine
This is my code

String command = "pgrep service";
        File file;
        Process proc = null;
        String agentPath = "Agent.jar";
        try {
            proc = Runtime.getRuntime().exec(command);
            BufferedReader reader =
                    new BufferedReader(new InputStreamReader(proc.getInputStream()));

            String line = "";
            while ((line = reader.readLine()) != null) {
                System.out.print(line + "\n");
                file = (new File("Agent.jar"));
                VirtualMachine vm = VirtualMachine.attach("8607");
                vm.loadAgent(agentPath, "");
                vm.detach();
            }
            proc.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
        }

This giving PID correctly
But i am getting following error

com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
    at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
    at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
    at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
    at 
common.netty.echo.EchoHttpServer.main(EchoHttpServer.java:89)

Any solution for this problem ?

Kafka docker container cannot run in virtual machine

I’m trying to run kafka docker image inside my VirtualBox. I firstly run zookeeper server by:

 docker run -d -p 2181:2181 --name zookeeper jplock/zookeeper

After that, I run kafka which is linked to that zookeeper server:

docker run -d --name kafka --link zookeeper:zookeeper ches/kafka

When I check “docker ps -a”, only zookeeper is running and kafka is not (the status of kafka is always “Exited”.

docker ps -a

However, when I do those things above outside VM, which is local machine, everything work just fine. What am I missing here?

Update: I just run the “docker logs kafka” and I got this:

docker logs kafka

VM Network settings for a Wireless Connection of a Laptop

I have an Apache Web Server installed on Ubuntu 16.04 in a VM, the problem I’m having is that my server doesn’t seem to have its own IP address. I tried using hostname -I but only a blank line appears, while ifconfig shows 127.0.0.1 and 10.0.0.2.

The problem I suspect is that it’s related to the network settings of my VM since when I imported it to the computer laboratory at school, the commands hostname -I and ifconfig showed an IP address like 192.xxx.x.xx, I tried searching around but I can’t find similar problems where the host machine is connected to a router via wireless connection. What can I do?

EDIT:

VM software being used is Oracle VM VirtualBox Manager

Network Settings: Screen shot of network settings

Vagrant setup is imcomplete and displaying “installation step failed: failed step is select and install software

I am trying to install vagrant setup with oracle vm virtualbox. When i started building template.json file from packer directory, all the components are downloaded and but i get stuck in “waiting for ssh to become available”. The virtual box stopped its installation and is displaying a popup “an installation step failed….: failed step is select and install software”.
Vagrant log

Vm virtual box installation failure popup

The same setup was successfully installed and a box file is created at the end for other collegues who had same windows configurations and ran same template.json file. I tried reinstalling vagrant and vm virtualbox but stuck in same point.

Any idea about this? or can i copy the box file which was successfully built in other system and proceed with further steps?

Request to help on this

Thanks in advance.

Nmap PortScanner() in Python is not working

Hi I’m using a virtual machine that has linux CentOS in it to connect python Jupyter notebook. For some reason even if I installed python-nmap using sudo pip install python-nmap, I keep getting an error:

AttributeError: 'module' object has no attribute 'PortScanner'

My current code is just:

import nmap
nm = nmap.PortScanner()

I saw one answer in Stack overflow that says to change the regex line to

regex = re.compile('Nmap version [0-9]*\.[0-9]*[^ ]* \( http://nmap\.org \)')

but since it is inside a VM, I cant find the folder where it is contained. How do you fix this problem?