lazorfuzz / python-hacklib

hacklib - pentesting, port scanning, and logging in anywhere with Python
MIT License
91 stars 34 forks source link

Lan Scanner #8

Open lazorfuzz opened 8 years ago

lazorfuzz commented 8 years ago

Right now it just opens a bunch of threads that run ping. Does anyone want to do it with scapy instead? That way we might be able to get the device hostname and other useful info.

r0t0tiller commented 8 years ago

Do you just a ping sweep type of function, kinda like netdiscover? Or a port scanner?

lazorfuzz commented 8 years ago

Yeah like netdiscover. Should be able to return the hostnames, MAC addresses, and MAC vendors of the devices on the local network. This would help us do arp spoofing later down the line.

r0t0tiller commented 8 years ago

Sweet. I do plan on adding ARP Spoofing. Already have it made, just got to implement it into the library. Something like Netdiscover should be easy to implement with scapy. If you look at my probeRequests class you can see I am searching for requests and outputting the MAC for the devices. Scapy is a little tricky, but I think that is the best option for this task personally.

luca-conterio commented 7 years ago

Hi, I'm really interested in your project! I don't know if you already solved this issues but if you need a help I've almost finished a port scanner with scapy. It can perform syn, fin, ack, null, xmas and udp scans. In addition it can scan a network returning all devices connected with their mac and their vendor name. The program still works only on linux machines but it's not difficult to modify it for all platforms :)

lazorfuzz commented 7 years ago

Hi @luca-conterio

I'd be interested in adding your lan scan module into hacklib! We haven't updated it in quite a while (although a big feature is coming soon) and I'd be happy to incorporate your code before the feature comes out.

Please fork this project and modify the LanScanner class to your liking. Do try to keep the same style that we've been using (I'll be homogenizing Tyler's code to fit with the rest of the style soon as well). When you're ready, make a pull request and I'll put it up!

luca-conterio commented 7 years ago

I'm glad for your answer. I just need a bit of time to insert my code in the class cause it is built only with functions and also to make it support multithreading . Another question: in the hacklib.py there's written "# Import scapy if they have it. If they don't, they can still use hacklib"... the problem is that my code uses scapy to build packets

lazorfuzz commented 7 years ago

@luca-conterio we don't want to rely on scapy to run hacklib. For example, if somebody only needs to use AuthClient and doesn't have scapy, we don't need him to install it as it's a bit of a heavy install. Your LanScanner class should not assume that scapy is installed. Make use of the MissingPackageException class to inform the user that he/she needs to install scapy.

lazorfuzz commented 7 years ago

Check the _login_mechanize function in the AuthClient class for how to handle missing packages.