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

Change to Target URL Format #11

Merged
merged 28 commits into from Jun 3, 2022
Merged

Change to Target URL Format #11

merged 28 commits into from Jun 3, 2022

Conversation

Johnng007
Copy link

(Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)

What does this implement/fix? Explain your changes.

This fixes an issue with resolving IPs to hostnames using the conf.socket.gethostbyname(full_host) snippet.
Albeit i feel this task is not necessary as most hardened environments (like in OSCP & CTFs) purposely do not allow DNS resolving, users within a VPN environment would still experience this issue.

Owing to this i would like to make the following changes 
1. In the input for asset to scan users should enter only IP Address or Hostname without http://
2. Comment out full_ip = conf.socket.gethostbyname(full_host) in fullscan.py
3. Change nmap {full_ip} to  {full_host}
4. For nikto and dirsearch before {full_host} include http:// just to be http://{full_host}

Does this close any currently open issues?

Yes

Any relevant logs, error output, etc?

Traceback (most recent call last): File "/usr/local/bin/webmap", line 56, in <module> main() File "/usr/local/bin/webmap", line 48, in main conf.call_def(conf.full_scan) File "/home/kali/Desktop/TOOLS/WEB ATTACK/WebMap/conf/conf.py", line 80, in call_def func() File "/home/kali/Desktop/TOOLS/WEB ATTACK/WebMap/modules/fullscan.py", line 31, in full_scan full_ip = conf.socket.gethostbyname(full_host) socket.gaierror: [Errno -2] Name or service not known

Any other comments?

Where has this been tested?

Operating System: kali Linux

Platform:Kali Linux Python 3

Target Platform: Ubuntu

Python Version: Python 3

luizmlo and others added 28 commits January 5, 2021 20:37
Install.sh and reopen() function
I've added more information so it can install on other linux distribution other than Debian flavours.
Anything you can arrange. 
I've placed some comments on the file to be easy read
Update install.sh to install in other Systems
* remove chmod +x instruction from README as it's not needed (git keeps
  the permissions)
* don't use `sudo` to execute the install script as it contains `sudo`
  commands
* link to the MIT license in the README
* replace tabs with spaces
* remove trailing whitespaces
* add newline at end of files

In install.sh:

* use a variable to hold the dependencies instead of repeating them
* use the `--user` flag for pip install
* use /usr/local/bin instead of /usr/bin for symlink
* store dirsearch in ~/.opt instead of /opt: don't pollute the system
  with user software, don't use root to clone a git repository
* use `$()` instead of backquotes
* add quotes for variables
* use env to find bash
Various fixes
@commit-lint
Copy link

commit-lint bot commented Apr 6, 2022

Code Refactoring

  • Use the PEP8 naming convention (ff9e653)

Chore

Contributors

luizmlo, Anteste, tfprelvas, NicolasCARPi

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

Copy link
Author

@Johnng007 Johnng007 left a comment

Choose a reason for hiding this comment

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

Resolving inability to scan IP based URLs


conf.create_dir(full_output)

full_ip = conf.socket.gethostbyname(full_host)
Copy link
Author

Choose a reason for hiding this comment

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

#commenting out
#full_ip = conf.socket.gethostbyname(full_host)

conf.full_host = None
elif gnome_installed:
conf.os.system(
f"gnome-terminal -- bash -c 'nmap -A {full_ip} -o \"{full_output}/nmap.txt\" && bash'"
Copy link
Author

Choose a reason for hiding this comment

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

#Going with Full Host Instead
f"gnome-terminal -- bash -c 'nmap -A {full_host} -o "{full_output}/nmap.txt" && bash'"

conf.clear()

conf.os.system(
f"gnome-terminal -- bash -c 'python3 {conf.home}/.local/share/dirsearch/dirsearch.py -u {full_host} --simple-report=\"{full_output}/dirsearch.txt\" && bash'"
Copy link
Author

Choose a reason for hiding this comment

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

#Adding http in input
f"gnome-terminal -- bash -c 'python3 {conf.home}/.local/share/dirsearch/dirsearch.py -u http://{full_host} --simple-report="{full_output}/dirsearch.txt" && bash'"

conf.clear()

conf.os.system(
f"gnome-terminal -- bash -c 'nikto +h {full_host} -output \"{full_output}/nikto.txt\" && bash'"
Copy link
Author

Choose a reason for hiding this comment

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

#Adding http in input
f"gnome-terminal -- bash -c 'nikto +h http://{full_host} -output "{full_output}/nikto.txt" && bash'"

conf.clear()

else:
conf.os.system(f"nmap -A {full_ip} -o {full_output}/nmap.txt")
Copy link
Author

Choose a reason for hiding this comment

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

#Going with full_host instead
conf.os.system(f"nmap -A {full_host} -o {full_output}/nmap.txt")

f"python3 ~/.local/share/dirsearch/dirsearch.py -u {full_host} --simple-report='{full_output}/dirsearch.txt'"
)

conf.os.system(f"nikto +h {full_host} -output {full_output}/nikto.txt")
Copy link
Author

Choose a reason for hiding this comment

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

#Going with full_host instead
conf.os.system(f"nikto +h http://{full_host} -output {full_output}/nikto.txt")

print("===========================================================")

full_host = input(
conf.colored("\nEnter the target URL : ", "green", attrs=["bold"]))
Copy link
Author

Choose a reason for hiding this comment

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

#Change request parameter
conf.colored("\nEnter the target IP, Hostname or FQDN : ", "green", attrs=["bold"]))

@Anteste Anteste merged commit 43098bf into 1.0 Jun 3, 2022
@Anteste
Copy link
Owner

Anteste commented Jun 3, 2022

Hey John , thanks for the submiting this pull request.
Sorry if I didn't answer u earlier
You did a Good Job ;)

Anteste added a commit that referenced this pull request Jun 3, 2022
Merge pull request #11 from Anteste/1.x
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.

None yet

5 participants