Git Product home page Git Product logo

eyewitness's Introduction

EyeWitness

EyeWitness is designed to take screenshots of websites provide some server header info, and identify default credentials if known.

EyeWitness is designed to run on Kali Linux. It will auto detect the file you give it with the -f flag as either being a text file with URLs on each new line, nmap xml output, or nessus xml output. The --timeout flag is completely optional, and lets you provide the max time to wait when trying to render and screenshot a web page.

A complete usage guide which documents EyeWitness features and its typical use cases is available here - https://www.christophertruncer.com/eyewitness-2-0-release-and-user-guide/

Windows

Red Siege has created a Windows client (thanks to the massive help of Matt Grandy (@Matt_Grandy_) with the stability fixes). All you need to do is build it locally (or check the releases), and then provide a path to a file containing the URLs you want scanned! EyeWitness will generate the report within your "AppData\Roaming" directory. The latest version of the C# EyeWitness supports parsing and taking screenshots of Internet Explorer and Chrome bookmarks without having to supply a list of URLs. This version is also small enough to be delivered through Cobalt Strike's execute-assembly.

Setup:

  1. Navigate into the CS directory
  2. Load EyeWitness.sln into Visual Studio
  3. Go to Build at the top and then Build Solution if no modifications are wanted

Usage:

EyeWitness.exe --help
EyeWitness.exe --bookmarks
EyeWitness.exe -f C:\Path\to\urls.txt
EyeWitness.exe --file C:\Path\to\urls.txt --delay [timeout in seconds] --compress

Linux

Supported Linux Distros:
  • Kali Linux
  • Debian 7+ (at least stable, looking into testing) (Thanks to @themightyshiv)
  • CentOS 7
  • Rocky Linux 8

E-Mail: GetOffensive [@] redsiege [dot] com

Setup:

  1. Navigate into the Python/setup directory
  2. Run the setup.sh script

Usage:

./EyeWitness.py -f filename --timeout optionaltimeout

Examples:

./EyeWitness -f urls.txt --web

./EyeWitness -x urls.xml --timeout 8 

./EyeWitness.py -f urls.txt --web --proxy-ip 127.0.0.1 --proxy-port 8080 --proxy-type socks5 --timeout 120

Proxy Usage

The best guide for proxying EyeWitness through a socks proxy was made by @raikia and is available here - #458

To install EyeWitness from a system while needing to go through a proxy, the following commands (thanks to @digininja) can be used.

APT
-------
/etc/apt/apt.conf.d/70proxy

$ cat /etc/apt/apt.conf.d/70proxy
Acquire::http::proxy "http://localhost:3128";
Acquire::https::proxy "https://localhost:3128";

Git
-----------------
$ cat ~/.gitconfig
[http]
proxy = http://localhost:3128

Wget
---------------------
$ cat ~/.wgetrc or /etc/wgetrc

use_proxy=yes
http_proxy=127.0.0.1:3128
https_proxy=127.0.0.1:3128

General system proxy
--------------------------------

export HTTP_PROXY=http://localhost:3128
export HTTPS_PROXY=http://localhost:3128

Docker

Now you can execute EyeWitness in a docker container and prevent you from install unnecessary dependencies in your host machine.

Note: execute docker run with the folder path in the host which hold your results (/path/to/results)
Note2: in case you want to scan urls from a file, make sure you put it in the volume folder (if you put urls.txt in /path/to/results, then the argument should be -f /tmp/EyeWitness/urls.txt)

Usage
sudo docker build -t eyewitness
Example #1 -
sudo docker run --rm \
    -v /tmp:/Eyewitness/Python/ \
    eyewitness --web \
    -f /Eyewitness/Python/dns.txt \
    --no-prompt \
    -d /Eyewitness/Python/report-$(date +'%d-%m-%Y-%H-%M-%S' | sed 's/[-:]/-/g')

And then on your host :

cd /tmp && ls 
cd report*
firefox-esr report.html &
Call to Action:

I'd love for EyeWitness to identify more default credentials of various web applications.
As you find a device which utilizes default credentials, please e-mail me the source code of the index page and the default creds so I can add it in to EyeWitness!

eyewitness's People

Contributors

0x6d6f7468 avatar blark avatar christruncer avatar cnotin avatar coffeetocode avatar conscioushacker avatar crash avatar cuvidk avatar dannycork avatar datasiph0n avatar dawid-czarnecki avatar digininja avatar ganofins avatar jonasonline avatar leesoh avatar mattgrandy avatar n00py avatar netanelravid avatar nidem avatar peterdavehello avatar radaram avatar rasta-mouse avatar relkci avatar rpunnett avatar rvazarkar avatar sandrogauci avatar thanathan-k avatar viss avatar wh1tenoise avatar yaleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eyewitness's Issues

Gemfile

If you put the following in a Gemfile file in the app then users can do

bundle install

to install all the gems


source 'https://rubygems.org'

gem 'netaddr'
gem 'nokogiri'
gem 'selenium-webdriver'
gem 'timeout'
gem 'similar_text'

Ruby version check dependencies installed

If you don't have one of the required gems installed you get a standard ruby error, I've implemented the following in one of my apps which catches the exception and handles it nicely.

begin
require 'nonStandardGem'
rescue LoadError => e
# catch error and provide feedback on installing gem
if e.to_s =~ /cannot load such file -- (.*)/
missing_gem = $1
puts "\nError: #{missing_gem} gem not installed\n"
puts "\t use: "gem install #{missing_gem}" to install the required gem\n\n"
exit
else
puts "There was an error loading the gems:"
puts
puts e.to_s
exit
end
end

Use an HTML templating system

Use a templating system like Cheetah or something for the report templating, it would make things much more extensible and manageable.

Burst mode - multiple screenshots

I've forked the repo and would like to try to add this. Basically a parameter to say how many screenshots to take of each site. It can be used to pick up rotating banners or maybe differences caused by load balancers.

I was thinking of using a JavaScript library and where you show the single image have forward and back to step through each image.

This display model could also be used along with the multiple user agent option suggested in the previous ticket.

use multiline strings

You could use multiline strings in the source at several places. Example:

Instead of:

html = "<html>\n"
html += "<head>\n"
html += "<title>" + title + "</title>\n"

Write this:

html = """
<html>
<head>
<title>{t}</title>
""".format(t=title).strip()

You can also format a multiline string.

Xvfb not closing properly

I ran a single URL to test the install was working, came to run a file full and got the error below.

Checked and found that there is already an Xvfb running on display 99. This could be as a result of things not closing down properly due to the 2.6 issue but thought I'd mention it just in case there is a bug around closing Xvfb down.

EyeWitness

Fatal server error:
Server is already active for display 99
If this server is no longer running, remove /tmp/.X99-lock
and start again.

input from nmap and nessus

Here is a challenge for you, rather than taking a flat text file as input, how about parsing an nmap file (probably xml) and pulling out all the web servers found.

Obviously you could easily pull out common web ports such as 80, 443 and 8080 but it would be interesting to see if you can spot where nmap has found web servers on other ports.

Nessus also does various outputs, latest one does csv and database so that might be worth looking at as well.

Handle Python unicode strings properly

There's some peculiar handling of unicode strings right now that involves searching for u' and removing it, this can be handled better, ideally the whole app can just be unicode aware, natively.

EyeWitness causing ghost.ghost.Error?

Hello,

So i've got a rather lengthy file, and on each line there is the protocol (http:// or https://) followed by the IP address and port. So a snippet of the file would be similar to the following:

http://192.168.1.2:4040
https://192.168.2.4:8080
...etc...

EyeWitness chugs along fine for a few hundred, and then I receive the following error:

ghost.ghost.Error: You must specified a value to confirm "Please use the wizard navigation buttons at the bottom of the page.

Once this error is thrown a single time, it is thrown on every subsequent IP address that is tested.

I'm looking into it myself. Thanks!

Add Second Screenshot "library"

Look into adding a second screenshot library, potentially selenium. Personally, I like having options, and fallbacks in case things fail. I'd like to have the ability to use a different library/engine in case, for some reason, ghost has issues with a certain, or multiple, websites.

I haven't ran across any issues yet, but I like having contingencies.

Make the code PEP-8 compliant

I had to look at this because I've got vim set up to alert me when things aren't compliant.

http://legacy.python.org/dev/peps/pep-0008/

The new code I'm writing will be compliant and I've updated some of your existing code in my burst branch. don't know if you want to update the main branch as well or leave me to do wit along with my changes.

Add feature to cycle through various user agents

Just had a thought...many sites show different content based upon the user agent presented to the server. What if EyeWitness was modified to have a certain flag. When that flag was triggered (maybe you could only do this if sending a single site and not a whole subnet), EyeWitness would look at the site using multiple UserAgents (iphone, droid, FF, IE6-9, GoogleBot, Safari...).

Instead of just presenting the user with all the content coming back, EyeWitness could look at the byte size of the content of a "normal" request and then each of the other UserAgent requests. If the byte size was significantly different, it'd probably indicate that the server is serving different content. If the size is the same, ignore or just note it but don't show it (for space-savings).

Add Scanning Capability

I just had a request to add a scanning capability in to EyeWitness. The use case was if there is a compromised machine, they wanted to wrap EyeWitness into an executable, drop it on a box, have it do some basic checks for web servers (Maybe check the ip and subnet it currently is in, and then check those IPs with maybe a top 10 list of web server ports), and generate a file containing the "live" web servers. That list could then be fed back in to EyeWitness and used to get the server info.

Too many open files

Got this while it was creating the report after scanning 46 URLs from an nmap XML file.

[*] ERROR: Web page possibly blank or SSL error!
Traceback (most recent call last):
File "./EyeWitness.py", line 1549, in
IOError: [Errno 24] Too many open files: '/home/robin/reports/xx/screenshots_named/report.html'

Then I tried to run it again and got this at URL 37:

Attempting to capture: http://xxx.com:80 (37/46)

(process:7534): GLib-ERROR **: Creating pipes for GWakeup: Too many open files

Trace/breakpoint trap

Execute javascript

Hi,

maybe this issue is stupid and inappropriate (or already answered).
But is there a possibility to execute javascript with EyeWitness.

For instance if the page contain only

<script>
    window.location.replace("https://github.com");
</script>

I want EyeWitness to screenshot gitHub.

handle users with rvm installed

Your setup script tries to install ruby 2.1 through apt but I handle all my ruby versions through rvm so don't want anything installed through the distro.

You could try running rvm list and then grepping out the version you want, if it is found then don't install from the distro. You can also create some files, can't remember their names off hand, that tell rvm to switch to a certain version of ruby when you go into the directory. That would be good to make sure they are using the correct version when they enter the directory.

Default credentials for Polycom SoundPoint/Soundboard

Is this enough to identify it?

Page Title: 401 Unauthorized
WWW-Authenticate: Basic realm="SPIP Configuration", Digest realm="SPIP Configuration", nonce="140837670", algorithm="MD5"
Server: Polycom SoundPoint IP Telephone HTTPd

On page:
401 Unauthorized

Polycom SoundPoint IP Telephone HTTPd Server at 1.2.3.4 Port 80

username: Polycom
password: 456

don't assume the protocol

When I create the URL file I didn't put the http:// on the URLs and the app failed, I'd check and if there is no protocol assume http.

missing title tags if not on own line

Barracuda WAFs have their title tag on the same line as the opening html tag, i.e.

<title>Barracuda Web Application Firewall ....blah...

So you don't pick it up.

When you can detect it the default credentials are admin/admin

For an extra check, the http server is BarracudaHTTP 4.0

Portfolio default creds

Don't know if this is to vague or not but
"Page Title: Portfolio "
probably refers to Extensis Portfolio which has default creds of administrator/password

Don't know what your rules fire on but here is the full info just in case anything helps.

Page Title: Portfolio
Content-Length: 4096
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA/Tomcat-5.5
Expires: Thu, 01 Jan 1970 01:00:00 GMT
Server: Apache-Coyote/1.1
Last-Modified: Fri, 07 Jan 2011 12:07:20 GMT
ETag: W/"4096-1294402040312"
Pragma: No-cache
Cache-Control: no-cache
Date: Thu, 15 May 2014 11:12:00 GMT
Content-Type: text/html

It is a flash app so all you get in the page is a request to install flash

Output directory validation is too strict

https://github.com/ChrisTruncer/EyeWitness/blob/master/EyeWitness.py#L58

IMO defining your own regex for directory validation here is not necessary or desirable. For example, I want to provide an absolute path on OSX which is denied because it contains forward-slashes (/) - at minimum. A valid directory can also contain spaces, hyphens, unicode, etc. Some sort of OS specific check should be performed to see if a provided path is correct, or simply wrap the directory creation/file creation in a try/except and fail gracefully if it doesn't work out.

Here's some starting points for how to do that, no particularly great ways but I think just doing it in a try/except and handling error cases there is suitable.

spcify an output directory

add a parameter to allow the specifying of the output directory to override the current timestamp directory name

Group Same web pages together in EyeWitness Report

Do a search based on HTML title tag value and identify if multiple websites have the same title. If they do, group them together in the report, so it shows potentially all the same sites (mirrors?) grouped together.

proxy support for ruby

I need proxy support so just hacked this together to hardcode it in, thought you might like it.

It works in the same way as you set the user agent, by modifying the Firefox profile, for now I've just thrown mine into the selenium_driver method, I'll hand it over to you to integrate properly into the cli parameters.

profile['network.proxy.type'] = 1
profile['network.proxy.http'] = "localhost"
profile['network.proxy.http_port'] = 3128
profile['network.proxy.ssl'] = "localhost"
profile['network.proxy.ssl_port'] = 3128

Bug in reporting for python version

This is pretty similar to the off by one bug. Not sure how/when this was introduced, but when running the python eyewitness with multiple sites in a text file, the first page is blank, and then the report seems to start on the second page. Link structure is off.

I know it's going to have to do with the counters. I just need to look into this and fix it for good.

Add Selenium to Python, keep ruby, but python is likely primary

I think I am going to be adding Selenium into Python, rewrite it to make it much more efficient (and OO), and use that as the primary language for EyeWitness.

I plan on keeping Ruby around, but I might throw it into its own repo, or into a sub folder. I think the python version is a lot more stable

setup still fails

The only change to setup.sh from last night is the check for root user but you've also added all the extra files, shouldn't the setup be referencing those in some way?

This is what I get when I run it which is the same as I got originally. When you had the setup download the script from your server Ghost.py did install but didn't work for EyeWitness. Before this setup would work I had to uninstall it.

setup # ./setup.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
The following packages were automatically installed and are no longer required:
guile-1.8-libs libkadm5clnt-mit8 libkadm5srv-mit8 libtasn1-3-dev libx264-140 openssh-blacklist openssh-blacklist-extra
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied (use --upgrade to upgrade): Ghost.py in /usr/local/lib/python2.7/dist-packages/Ghost.py-0.1b3-py2.7.egg
Cleaning up...

setup # pip uninstall Ghost.py
Uninstalling Ghost.py:
/usr/local/lib/python2.7/dist-packages/Ghost.py-0.1b3-py2.7.egg
Proceed (y/n)? y
Successfully uninstalled Ghost.py

setup # ./setup.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
The following packages were automatically installed and are no longer required:
guile-1.8-libs libkadm5clnt-mit8 libkadm5srv-mit8 libtasn1-3-dev libx264-140 openssh-blacklist openssh-blacklist-extra
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Downloading/unpacking Ghost.py
Could not find a version that satisfies the requirement Ghost.py (from versions: 0.1a, 0.1a2, 0.1a3, 0.1b, 0.1b2, 0.1b3)
Cleaning up...
No distributions matching the version for Ghost.py
Storing complete log in /root/.pip/pip.log

setup script needs to check package install works

I just ran the setup script on a debian box, apt-get install failed but the setup script kept running then failed miserably. You can probably check the return code from apt-get to see if it is OK to continue.

Don't support Python 2.6

The ParseError attribute was added in Python 2.7 so you fail with the following error if ran in Python 2.6. Don't know if you want to support 2.6 or not but if not then maybe check for the version on start up and fail gracefully.

Traceback (most recent call last):
File "./EyeWitness.py", line 1302, in
url_list, number_urls = logistics(url_filename, create_targets)
File "./EyeWitness.py", line 465, in logistics
except XMLParser.ParseError:
AttributeError: 'module' object has no attribute 'ParseError'

create config file support

Just a thought, as there are a few configurable options, timeout, UA, proxy (?) is it time to create a config file so that we can store our preferred settings?

I'd like a default one but the ability to specify an alternative, that way I could have one that runs through my proxy but have the default one go direct.

Your setup doesn't support BackTrack

My /etc/issue file contains:

BackTrack 5 R2 - Code Name Revolution 32 bit \n \l

But this isn't in the osinfo case statement. I just manually ran through the Kali setup and it worked except you also need to add python-argparse to the list of packages to be installed.

Checked and the app ran fine after that.

bug with too many urls

Hi,

EyeWitness is perfect when I have a small amount of website to screenshot.
But when I have more than 10 000 web sites it becomes a bit more complicated.
Recently I got he following error after approximately 500 urls:

(python:7511): GLib-ERROR **: Creating pipes for GWakeup: Too many open files

I know that my bug report is a bit short.

./EyeWitness.rb -? gives error

./EyeWitness.rb:142:in parse': invalid option: -? (OptionParser::InvalidOption) from ./EyeWitness.rb:1102:in

'

The fix is to wrap the parse on line 141 in a begin rescue block catching OptionParser::InvalidOption

141 begin
142 opt_parser.parse!(args)
143 options
144 rescue OptionParser::InvalidOption
145 puts "Invalid option given"
146 exit
147
148 end

Unicode unhandled exception

Hello there, I came across your project and tried it out for a few minutes.
Here is the traceback of the issued command and the command used to "achieve" the exception.

Command
"python EyeWitness.py --skipcreds --single https://github.com/Daxda/EyeWitness.git

Traceback

Trying to screenshot https://github.com/Daxda/EyeWitness.git
Traceback (most recent call last):
  File "EyeWitness.py", line 1174, in <module>
    script_path, operating_system)
  File "EyeWitness.py", line 877, in table_maker
    ":</b> " + html_encode(value) + "\n"
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 501: ordinal not in range(128)

-d option fails on multiple report pages

line 1691 appends the script directory onto the provided directory name rather than doing whatever the first page does.

Traceback (most recent call last):
File "./EyeWitness.py", line 1691, in
".html", 'w') as page_out:
IOError: [Errno 2] No such file or directory: '/home/robin/tools/web/EyeWitness//home/robin/reports/xxx/xxxx/internal/screenshots_443/report_page2.html'

-d is broken

If you use -d with a directory name ending in a / which doesn't exist the script won't run and complains "[*] Error: Please provide a valid folder name/Path"

If you run it without the / on the end it runs OK. If you point it at a directory which exists then the mkdir fails trying to create the directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.