Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

This script in other languages...


  • Please log in to reply
1 reply to this topic

#1 enlivenit

enlivenit

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:08:05 AM

Posted 26 March 2012 - 11:18 PM

I have a DNSBL server hosted at www.mailer.mobi and a script on my web server written in PHP that checks the DNSBL to see if a visitor's IP is blacklisted and returns 0 or 1 accordingly. So you can put the following line of PHP code at the very start of your web site to return a 404 Error "Page Not Found" if it's visited by a computer on a blacklisted IP.

<?php if (@file_get_contents("https://mailer.mobi/?guard=".$_SERVER['REMOTE_ADDR']) == "1") { header("HTTP/1.0 404 Not Found"); die(); } ?>

What I'm after is the same functionality as the above line, but just in other dynamic languages, ie. ASP, JSP, Perl (CGI), Python, Coldfusion etc, so I can put them on the www.mailer.mobi site for people who have sites in those languages.

If you know how to do the above in another language, can you help me?

BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:04:05 PM

Posted 27 March 2012 - 09:43 AM

1. That's not really great PHP code; most commercial web servers have "fopen url" disabled, which will break that code. I would suggest using the curl extension instead.
2. It's unlikely you'll just get someone to write code for you. What have you tried in these other languages? If you don't know these languages, then putting someone else's code on your website would be disingenuous -- you would be stealing the work of the original author of the code. At the very least you'd need to give us a set of license terms to use, such as BSD or GPL. Moreover, if you pass off the code as your own, then people are going to expect you to support it, which is going to be problematic if you do not know the language in question.
3. You'd be better off just documenting your web service itself and then any reasonably competent programmer is going to have no problem with it in whatever language (s)he happens to know.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users