Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some improvements #3

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft

Conversation

serialfuzzer
Copy link

** What did I do? **

  1. Added multi-threading support
  2. Added standard input as a possible way to supply targets to the tool
  3. Made some optimizations

@IamLizu
Copy link
Owner

IamLizu commented Jun 12, 2023

Hey @serialfuzzer, great work man. But if you could maintain the project installation steps and other instructions, I can merge the PR and publish the new version in PyPi.

@IamLizu IamLizu reopened this Jun 12, 2023
@serialfuzzer
Copy link
Author

Hi @IamLizu, Thank you! :) I will make some more changes to optimise it and then I'll let you know here.

@serialfuzzer
Copy link
Author

Hi @IamLizu,

Does these changes look good or you want to add something to it? I'm going to do a speedrun to implement features listed below

To implement

  1. Use 1000 requests per thread
  2. Each request should be sent in an asynchronous way
  3. Implement two methods: i. Fast (Some false positives but blazingly fast) ii. Slow (Highly accurate but slow)

Fast mode (default)
Will send 1 request and analyse it for wordpress patterns

Slow mode
Will send multiple requests and analyse it for wordpress patterns

User interface design
-slow option should trigger the scans in slow mode -t option should specify the number of threads

Input options
Three methods to supply input:

File
Standard input
Command line argument
If all of the input methods contains values then combine the targets from all the sources instead of priotizing one and ignoring other

Some additional optimisations
Remove duplicates from the targets container to avoid sending multiple requests to the same URL

Create test scripts

@IamLizu
Copy link
Owner

IamLizu commented Jun 15, 2023

@serialfuzzer noice

I will check as soon as I can and I will let you know.

@serialfuzzer
Copy link
Author

Sure, I will start implementing code asap

@serialfuzzer
Copy link
Author

Just realised that multithreading in Python does no good due to the GIL. Regardless, we can keep the code changes in hopes that one day, python maintainers would launch a thread-safe environment. I need to update the slow method now. Slow method will use the old legacy function

@serialfuzzer
Copy link
Author

Note: It's not ready to push yet

@IamLizu
Copy link
Owner

IamLizu commented Jun 20, 2023

@serialfuzzer hey, just checking. Should I start reviewing?

@IamLizu
Copy link
Owner

IamLizu commented Jun 20, 2023

I looked into the changes a bit from here and I think we do not need to include the local installing instruction. Let's keep the pip one only.

And for an example URL to test the sites, let's not use iamlizu.com because that no longer have WordPress.

@serialfuzzer
Copy link
Author

Hi, @IamLizu
Sure, you can start reviewing the code.

Let's use https://www.malcare.com/ then. I'll update the readme

@serialfuzzer
Copy link
Author

Using multiple-threads is making it slower by couple of seconds. I think it's because of the GIL. I think requests has to be sent all at once in a multi-threading asynchronous way and then use multiprocessing to to parse those results for wordpress patterns.

@serialfuzzer
Copy link
Author

Due to behavior in above mentioned comment, I have set the default number of threads to 1.

@IamLizu
Copy link
Owner

IamLizu commented Jun 21, 2023

@serialfuzzer cool.

@IamLizu
Copy link
Owner

IamLizu commented Jun 21, 2023

I have started reviewing.

@IamLizu
Copy link
Owner

IamLizu commented Jun 21, 2023

I am thinking of removing the README.rst and use the README.md. Seems duplicate, I don't know why I did it back then. Probably because I couldn't figure out something. But we can just remove it now.

Also, I am think of migrating to hatchling build system instead of setuptools. But I will do this myself after merging your PR.

Copy link
Owner

@IamLizu IamLizu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serialfuzzer Good work <3

However, I request you to not change the way the application is used or consumed. Let's keep the user experience same and improve the internal performance and methods.

I appreciate your contribution so much, kudos again. I hope you will come up with suggested changes soon.

@serialfuzzer
Copy link
Author

Hi @IamLizu,

Thank you for reviewing.

I will start making the changes now. Also, it's a good idea to make it backwards compatible.

@serialfuzzer
Copy link
Author

Hi @IamLizu

Could you check now?

@serialfuzzer
Copy link
Author

We are using click to parse CLI arguments and options. The entire code base has been rewritten

@serialfuzzer
Copy link
Author

serialfuzzer commented Jun 22, 2023

The difference between old engine and current engine:

Old engine:

  1. Send multiple requests to observe if a site is wordpress or not

New engine:

  1. Send one request to observe if a site is wordpress or not

However, the legacy feature will be implemented as slow method of scanning. It has not been incorporated into the codebase yet which is the reason why mode is not documented in Readme.md. However, the script works perfectly with increased speed under default configuration in new method.

I have also implemented the --silent flag. When, --silent flag is sent, the tool will not output banners or additional information besides the URLs using wordpress.

Why I did this?

If an user wants to fetch all the subdomains using wordpress and then bruteforce for information disclosing files than they could just do

$ cat subdomains | wpdetect --silent | bruteforceSensitiveFiles

@serialfuzzer
Copy link
Author

I think we should also add -v option that displays current version. What is your opinion on this?

@hasan-zaag
Copy link

I noticed the use of click. I have also used it in another library.

The silent and v flags are good. I am still at work. I will review these tonight.

@serialfuzzer
Copy link
Author

Sure

@serialfuzzer
Copy link
Author

serialfuzzer commented Jun 22, 2023

I am also thinking that --ports flag should be added at some point. Maybe let the user specify which ports to scan too?

Second thought: This won't be a good idea. Let's keep the tools segmented. A user could just add another port in their input file. For example:

https://google.com:1337/
https://youtube.com:8080

@IamLizu
Copy link
Owner

IamLizu commented Jun 23, 2023

@serialfuzzer I feel that we need a place to discuss our plans and visions in a bit more organized way. I would love if you please join this following discord channel.

https://discord.gg/g4hReRSsgN

@IamLizu IamLizu marked this pull request as draft June 23, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants