• Stars
    star
    144
  • Rank 254,017 (Top 6 %)
  • Language
    Python
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Opens 1K+ IPs or Shodan search results and attempts to login

device-pharmer

Concurrently open either Shodan search results, a specified IP, IP range, domain, or list of IPs from a text file and print the status and title of the page if applicable. Add the -u and -p options to attempt to login to the page first looking for a form login and failing that, attempt HTTP Basic Auth.

Use -f SEARCHSTRING to look for a certain string in the html response in order to test if authentication succeeded. Logs all devices that respond using either the Shodan search term or the target IPs/domain + _results.txt. One caveat with searching the response page's HTML is that some form login pages return a JSON object response after an authentication request rather than the post-login page's HTML source. Often you can determine whether or not you were successful by just using -f "success" in scenarios like this.

Default timeout on the requests is 15 seconds. Sends batches of 1000 requests concurrently which can be adjust using the -c option. One should note that Shodan only allows the first page of results (100 hosts) if you are using their free API key. If you have their professional API key you can specify the number of search result pages to test with the -n NUMBER_OF_PAGES argument. By default it will only check page 1.

Requirements:

Python 2.7

  • mechanize
  • gevents
  • BeautifulSoup
  • shodan (if giving the -s option)

Modern linux

  • Tested on Kali 1.0.6

Shodan API Key (only if you are giving the -s SEARCHTERM argument)

  • Give the script the -a YOUR_API_KEY argument OR
  • Edit line 82 to do it permanently and feel free to offer a pull request after you perform this so you have it in your records; safe hands and all ;). Don't have an API key? Get one free easily from shodan... alternatively, explore your Google dorking skills before downloading some Shodan ones.

Usage

Simplest usage:

python device-pharmer.py -s 'dir-300' -a Wutc4c3T78gRIKeuLZesI8Mx2ddOiP4

Search Shodan for "dir-300" using the API key Wutc4c3T78gRIKeuLZesI8Mx2ddOiP4. Print the IP and title of the response page should it exist.

python device-pharmer.py -s 'dd-wrt' -a Wutc4c3T78gRIKeuLZesI8Mx2ddOiP4 -u admin -p password -n 5 -f ">Advanced Routing<" --proxy 123.12.12.123:8080 --timeout 30

Search Shodan for "dd-wrt" using the given api key and attempt to login to the results with the username "admin" and the password "password". Gather only the first 5 pages (500 hosts) of Shodan results and check if the landing page's HTML contains the string ">Advanced Routing<". Print "* MATCH *" along with the IP and title of the page in the output and log if the string is found. Finally, use an HTTP proxy at 123.12.12.123:8080 for all requests and set the timeout to 30s.

python device-pharmer.py -t 192.168.0-2.1-100 -c 100

Targeting 192.168.0-2.1-100 is telling the script to concurrently open 192.168.0.1-101, 192.168.1.1-101, and 192.168.2.1-101 and to gather the status and title of the response pages. -c 100 will limit concurrency to 100 pages at a time so this script will pass through 3 groups of 100 IPs each. Since the default timeout within the script is 15 seconds this will take about ~45 seconds to complete.

python device-pharmer.py -t www.reddit.com/login -ssl -u sirsmit418 -p whoopwhoop -f 'tattoos'

Try logging into www.reddit.com/login using HTTPS specifically with the username sirsmit418 and password whoopwhoop. Look for the text "tattoos" correlating to a subscribed subreddit in the response html to check for authentication success.

python device-pharmer.py --ipfile list_of_ips.txt

Test each IP from a textfile of newline-separated IPs

All options:

-a APIKEY: use this API key when searching Shodan (only necessary in conjunction with -s)

-c CONCURRENT: send a specified number of requests concurrently; default=1000

-f FINDTERMS: search for the argument string in the html of each response; upon a match print it and log it

--ipfile IPTEXTFILE: test each IP in a list of newline-separated IPs from the specified text file

-n NUMPAGES: go through specified amount of Shodan search result pages collecting IPs; 100 results per page

-p PASSWORD: attempt to login using this password

--proxy PROXY: use this proxy for making requests; to login to the proxy with HTTP Basic do something like, user:[email protected]:8080

-s SEARCHTERMS: search Shodan for term(s) and print each IP address, whether the page returned a response, and if so print the title of the returned page (follows redirects)

-ssl: specifically send HTTPS requests to all targets

-t IPADDRESS/DOMAIN/IPRANGE: try hitting this domain, IP, or IP range instead of using Shodan to populate the targets list and return response information

--timeout TIMEOUT: set the timeout for each URI in seconds; default is 15

-u USERNAME: attempt to login using this username

License

Copyright (c) 2014, Dan McInerney All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Dan McInerney nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


More Repositories

1

wifijammer

Continuously jam all wifi clients/routers
Python
3,925
star
2

LANs.py

Inject code and spy on wifi users
Python
2,573
star
3

net-creds

Sniffs sensitive data from interface or pcap
Python
1,654
star
4

xsscrapy

XSS spider - 66/66 wavsep XSS detected
Python
1,628
star
5

icebreaker

Gets plaintext Active Directory credentials if you're on the internal network but outside the AD environment
PowerShell
1,178
star
6

pymetasploit3

Automation library for Metasploit
PowerShell
362
star
7

pentest-machine

Automates some pentest jobs via nmap xml file
Ruby
317
star
8

dnsspoof

DNS spoofer. Drops DNS responses from the router and replaces it with the spoofed DNS response
Python
270
star
9

fakeAP

Create fake AP in Kali with 1 command
Python
263
star
10

elite-proxy-finder

Finds public elite anonymity proxies and concurrently tests them
Python
247
star
11

msf-autoshell

Feed the tool a .nessus file and it will automatically get you MSF shell
Python
233
star
12

creds.py

Harvest FTP/POP/IMAP/HTTP/IRC creds
Python
167
star
13

fast-recon

Does some google dorks against a domain
Python
157
star
14

wifi-monitor

Prints the IPs on your local network that're sending the most packets
Python
141
star
15

msf-autopwn

Autoexploitation of some of the most common vulnerabilities in wild
Python
120
star
16

search-google

Scrape google search results
Python
91
star
17

autorelay

Automatically performs the SMB relay attack
Python
71
star
18

msfbot

WORK IN PROGRESS. Waits for MSF session then automatically gets domain admin
PowerShell
64
star
19

get_proxy

Py class that returns fastest http proxy
Python
56
star
20

Invoke-Cats

Obfuscated Invoke-Mimikatz
PowerShell
52
star
21

SMB-reverse-brute

Async'ly gather unique usernames thru null SMB sessions and bruteforce them with 2 passwords
Python
51
star
22

best-channel

Find wifi channel with least interference
Python
51
star
23

shellshock-hunter

Concurrently test bing results for shellshock vulnerability
Python
43
star
24

smb-autopwn

Discovers and exploits hosts vulnerable to MS08-067/MS17-010
Python
42
star
25

Autobloodhound

Automatically parses and attacks BloodHound-generated graphs
Python
40
star
26

autoresp

Runs Responder, uploads hashes for cracking, alerts when cracked
Python
37
star
27

FuzzStrings

Simple, hand-picked list of fuzz strings
Python
32
star
28

shellshock-hunter-google

Search google for shellshock vulnerable sites
Python
28
star
29

cookiejack

ARP spoof then session jack within your browser
Python
27
star
30

crawler.py

async web crawler
Python
26
star
31

nmap-parser

Parses Nmap XML files
Python
25
star
32

MsfWrapper

Asynchronous MSF RPC API wrapper
Python
21
star
33

net-sniffer

Sniffs an interface/pcap file and concatenates fragmented packet loads
Python
21
star
34

shodan-search

Python
18
star
35

WPSmash

Python
17
star
36

mailspy

Catch IMAP/POP passwords and see incoming and outgoing messages
Python
17
star
37

arp-ping-detector

ARP ping detector on local network
Python
15
star
38

Obf-Cats

Obfuscated Invoke-Mimikatz script
PowerShell
14
star
39

injecthtml

injecthtml
Python
13
star
40

async-meterpreter-controller

Template for asynchronously controlling meterpreter sessions
Python
12
star
41

search-bing

Search bing with python
Python
11
star
42

flashforge-finder-api

FlashForge Finder 3D Printer API with temperature control
Python
10
star
43

postanalyzer

Analyze and log POSTs your machine makes
Python
10
star
44

joomla-addon-hunter

Find potential SQLi in Joomla URLs
Python
8
star
45

vimrc

My .vimrc
Vim Script
8
star
46

UfcstatsScraper

Scrapes ufcstats.com for data
Python
7
star
47

BestfightoddsScraper

Asynchronously scrape bestfightodds.com for odds data
Python
6
star
48

Invoke-Pwds

Obfuscated Invoke-PowerDump for SAM hash retrieval
PowerShell
6
star
49

basic-xss-spider

sort of functional - abandoned
Python
6
star
50

arpdet

Detects and deauths arp spoofers automatically. Broken.
Python
5
star
51

SherdogScraper

Scrapes sherdog.com for fights
Python
4
star
52

async-requests

Python
3
star
53

quickscan

beta
Python
2
star
54

bashrc

My bashrc
Shell
2
star
55

Dating-service

Written by kid I was teaching python to.
Python
2
star
56

mma

Python
1
star
57

dotfiles

Dotfiles
Vim Script
1
star
58

UFCScraper

Python
1
star