Script to find webmaster contact details - ruby

As part of a summer project I am currently undertaking, I am interested in writing a script to automate the retrieval of the contact email address for a particular site's webmaster. Is there any information anyone can direct my way to start me off? Stuff like research papers, source code for similar applications etc. I am currently reading "Introduction to Information Retrieval" by Manning, Raghavan and Schutz, as this work is part of a larger information extraction project, in which I eventually hope to develop a people search system. Oh yes, and I intend to write these systems in Ruby, if that is any further help. Thanks.

Check out Simone Carletti's pure ruby whois client & parser GitHub project. Here's a usage example:
r = Whois.whois("google.com")
# => #<Whois::Record>
t = r.technical_contact
# => #<Whois::Record::Contact>
t.email
# => "dns-admin#google.com"

Related

Why is there no access to all document resources?

I would like to understand why I can not continue my work with Carrot2. A message appears saying "Our apologies, the following processing error has occurred:
org.carrot2.source.etools.IpBannedException: org.apache.http.client.HttpResponseException: Forbidden"
There is a problem with eTools, Wiki, PUT document sources (31/07/19) into Online version. I try to work with the downloaded version of the programme, but no document source does not work. Could you solve this problem and how long it will take?
Thank you!
Please see here:
http://project.carrot2.org/faq.html#ipbanned
We provide the search interface as a demo of the technology and we use a partnership with a company called Comcepta (eTools) for providing a limited number of free search requests. Unfortunately, some people have been abusing this free service and we had to introduce per-IP limitations.
If you wish to extend your query limits please install Carrot2 locally and contact Comcepta for custom query limit arrangements.
Apologies for the inconvenience.

How to get started writing Metasploit modules/exploits? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to contribute code to the Metasploit Framework but I haven't got to know their formatting guidelines and code requirements. What are the contribution guidelines to get started to write your own Metasploit modules?
If you follow this link:
How to get started with writing an auxiliary module
You'll find not only a helpful reference for setting up a metasploit module, but also an entire wiki with (at time of writing) 106 pages on metasploit development and use.
Now, I say reference and not tutorial because making metasploit modules 10% boilerplate code that you need to look up and 90% good-old-ruby that has nothing to do with metasploit.
Take, for example, this simple template module:
require 'msf/core'
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Scanner
def initialize(info = {})
super(update_info(info,
'Name' => 'Module name',
'Description' => %q{
Say something that the user might want to know.
},
'Author' => [ 'Name' ],
'License' => MSF_LICENSE
))
end
def run
# use `print_status` to print to the metasploit console, instead of `puts`
end
end
Walking through it line by line:
require 'msf/core'
First we require the metasploit files so we can use them.
class MetasploitModule < Msf::Auxiliary
Then we define a new class which inherits from the metasploit auxiliary class.
include Msf::Auxiliary::Scanner
Here we include the metasploit scanner so we can use it in our code. You can include any of metasploit's modules here to use them within your own module; however, you likely won't find tutorials for the modules. You're expected to read the documentation to learn how to use them.
def initialize(info = {})
super(update_info(info,
'Name' => 'Module name',
'Description' => %q{
Say something that the user might want to know.
},
'Author' => [ 'Name' ],
'License' => MSF_LICENSE
))
end
This initialize method is basically boilerplate code that tells metasploit information about your module so it can display said information to users inside the metasploit console.
def run
# use `print_status` to print to the metasploit console, instead of `puts`
end
This is where your code goes! This is also where metasploit ends and good-old-ruby begins. If you're making an HTTP server to echo a malicious payload, use an http server gem and write your logic. You can use metasploit modules here, but you use them (and learn how to use them) the same way you would any other ruby gem or library: look up the documentation and the API reference.
end
And that's it! Ultimately, you're discovering what makes IT security such a difficult field. There aren't any tutorials that can teach you how to hack or frameworks that can help you create exploits. Metasploit is more of a tool for curating collections of exploits, and writing your own module is just "plugging" your exploit into metasploit so other people can easily use it. The exploit itself is simply some ruby code, made to do something clever using basic network libraries.
Creating a completely new and useful hacking tool would be a big deal that some paid security professionals only dream of achieving. I suggest you pick a hacking tool which already exists (password cracker, network scanner, web crawler, etc), research that tool's purpose and functions, get well-acquainted with using it, and work on creating your own version of one. Then, once you've got it doing what you want, take your code and wrap it in a metasploit template so it can be accessed from metasploit.
If you get stuck along the way, you can come back to StackOverflow with more specific questions (eg "How can I scan for open ports on an IP?" or "How do I access options inside a metasploit module?") and we'll be happy to help you with those!
Cheers and good luck!

Reading a Google Spreadsheet into Ruby Objects (or settle for a file download)

I think it's probably simplest to start with my use case:
I'm trying to read the contents of a Google Spreadsheet into ruby, and then use that data for other purposes. This needs to happen server-to-server.
Here's what I've tried:
First I tried to use this google drive gem. Since my interaction needs to be server to server (i.e. a service account), I couldn't get this to work (someone please let me know if they've managed this!)
Next, I tried using the latest google-api-ruby gem, and, following its documentation, was successfully able to authenticate my service account, and have been able to get lists of files, etc. So basically the API is authenticated and working.
The latest issue is that Google Spreadsheets can't be downloaded using the normal download_dest parameter on the get_file method (sorry - would post links to relevant documentation here, but don't have enough rep to do so). So I'm not really sure how to proceed with downloading the relevant file (I understand how to get an export_link), but have no clue how to then prepare the next request).
Any help would be greatly appreciated :)
Here's some basic code for reference -
require 'googleauth'
require 'google/apis/drive_v2'
scopes = ['https://www.googleapis.com/auth/drive']
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = 'path/to/my/creds.json'
auth = Google::Auth.get_application_default(scopes)
drive = Google::Apis::DriveV2::DriveService.new
drive.authorization = auth
ss = drive.get_file('my_spreadsheet_id')
export_url = ss.export_links
# what now?

Which email software is used? optiext/optiextension.dll in url

Does anybody know what email software is used by the following mailing?
It has optiext/optiextension.dll in the url. I've seen many companies are using it.
http://nieuwsbrief.ah.nl/optiext/optiextension.dll?ID=QijQmaS446wp8V4_5bBYmbqi_rNLdLq6oO5B982jqvctRCUAcRtWu_s_ROO0vnQ5YHddppLfeNw9WmBi4C3y9xEmOIddPRRsi0iGTkQy
I think you'll find it is part of the software stack from Selligent (www.selligent.com)
M

Check if Zip Code or postal code is real

After some searching, I haven't been able to find a definite answer.
If I am given a zip code like 11111, it is technically a valid zip code but it doesn't exist. Is there a way to check this? The same goes for a postal code like a1a a1a (valid but not real).
For United States zipcodes:
You can purchase / download databases of zip codes, which you can use in your local app.
Google for
us zip code database
Here is one that you can use for free for non-commercial purposes (for commercial purposes you can purchase a cheap license):
http://www.unitedstateszipcodes.org/zip-code-database/
There are some providers which allow you to perform remote HTTP calls, search around
For any who stumble onto this and are using Python, this exists: https://github.com/Brobin/usps-api
It doesn't cover all the API functionality, but it makes the standard stuff much easier than constructing XML by hand.

Resources