예제 #1
0
 function dnint_requests()
 {
     parent::SQL_Class("aifs");
     $s = $this->execute("SELECT id, fk_osint_url_id, content FROM osint_version ORDER BY id desc LIMIT 1");
     list($id, $url, $data) = $s->fetch_array();
     $this->id = $id;
     $this->page = $data;
     $this->url = $url;
 }
예제 #2
0
<?php

/**
 * AIFS OSINT Google Page Rank File
 * @digitaloversight
 * Shouts
 * Isusx's Programming Corner
 * http://isusx.com/programming
 */
include '../common/sql/Sql.php';
include '../common/sql/SqlStatement.php';
$dbh = new SQL_Class("aifs");
$sql = $dbh->execute("select url, u.id \r\n\t\t\t\t\t\tfrom osint_url u\r\n\t\t\t\t\t\twhere u.id not in (select fk_url_id from dnint_pagerank\r\n\t\t\t\t\t\twhere fetch_date > date_add(now(), INTERVAL -1 month))\r\n\t\t\t\t\t\torder by rand()\r\n\t\t\t\t\t\tlimit 1");
while ($row = $sql->fetch_assoc()) {
    $rank = get_pr($row['url']);
    if ($rank) {
        $dbh->execute("insert into dnint_pagerank set fk_url_id = " . $row['id'] . ", rank = " . $rank . "");
    } else {
        $dbh->execute("insert into dnint_pagerank set fk_url_id = " . $row['id']);
    }
}
//convert a string to a 32-bit integer
function str_to_num($str, $check, $magic)
{
    $int32_unit = 4294967296;
    // 2^32
    $length = strlen($str);
    for ($i = 0; $i < $length; $i++) {
        $check *= $magic;
        // If the float is beyond the boundaries of integer
        // (usually +/- 2.15e+9 = 2^31),
예제 #3
0
<?php

/**
 * AIFS OSINT Title Parser
 * Copyright (c) digitaloversight
 */
error_reporting(1);
ini_set('error_reporting', 1);
include_once '../common/sql/Sql.php';
include_once '../common/sql/SqlStatement.php';
$dbh = new SQL_Class("aifs");
$sql = $dbh->execute("  SELECT osint_version.id, osint_version.fk_osint_url_id, osint_version.content \n                            FROM osint_version\n                            LEFT JOIN osint_titles ON (osint_titles.fk_osint_version_id = osint_version.id)\n                        WHERE osint_titles.title IS NULL ORDER BY osint_version.id DESC LIMIT 1");
list($id, $uid, $content) = $sql->fetch_array();
if (!is_numeric($id)) {
    die;
}
$content = ereg_replace('<title>', '<cutme>', $content);
$content = ereg_replace('</title>', '<cutme>', $content);
$arr = explode('<cutme>', $content);
$title = ereg_replace("/\n\r|\r\n|\n|\r/", "", $arr[1]);
$sql = $dbh->execute("SELECT COUNT(*) FROM osint_titles WHERE osint_titles.fk_osint_url_id =" . $id);
if ($sql->sql_result() == 0) {
    if (strlen($arr[1]) < 500) {
        $dbh->execute("INSERT INTO osint_titles SET fk_osint_version_id='" . $id . "',\n                                fk_osint_url_id='" . $uid . "',\n                                title='" . addslashes($title) . "'");
    }
}
예제 #4
0
<?php

/**
 * AIFS OSINT Get new remote version
 * @digitaloversight
 */
include_once '../common/tool/DomainSelector.php';
require_once '../config/tool/DomainSelector.php';
include_once '../common/sql/Sql.php';
include_once '../common/sql/SqlStatement.php';
include_once '../common/tool/FetchFopen.php';
$conf = new Config('osint');
$helper = new Common('osint', $conf->global_path);
$fetch = new FetchFopen();
$dbh = new SQL_Class("aifs");
$sql = $dbh->execute("SELECT id, url FROM osint_url WHERE dead_link = 0 ORDER BY rand() LIMIT 1");
list($uid, $url) = $sql->fetch_array();
// fetch lastest version
$sql = $dbh->execute("SELECT size, date\r\n                        FROM osint_version\r\n                        WHERE fk_osint_url_id=" . $uid . " ORDER BY date desc LIMIT 1");
list($size, $date) = $sql->fetch_array();
if (strpos($date, date("Y") . '-' . date("m") . '-' . date("d")) !== false) {
    die;
}
// fetch online copy
$content = $fetch->getContent($url);
// compare and save
if ($size != strlen(addslashes($content))) {
    $dbh->execute("INSERT INTO osint_version SET  fk_osint_url_id = '" . $uid . "',\r\n                                                                        content ='" . addslashes($content) . "',\r\n                                                                        size ='" . strlen(addslashes($content)) . "',\r\n                                                                        date = NOW()");
    $sql = $dbh->execute("SELECT tag FROM osint_tags WHERE fk_osint_url_id='" . $uid . "' LIMIT 1");
    list($tag) = $sql->fetch_array();
    if (strlen($tag) > 1) {
예제 #5
0
<?php

// Подключение файла с путями и конфигурационного файла
//include_once htmlspecialchars($_SERVER['DOCUMENT_ROOT']).'/config/paths.php';
include_once htmlspecialchars($_SERVER['DOCUMENT_ROOT']) . '/NewConcept_detimediart/config/paths.php';
include_once $site_full . CONFIG . 'config.php';
// Подключение класса для работы с БД и создание экземпляра обработчика запросов к БД с подключением к БД
include_once $site_full . CLS . DB . 'DB_Class.php';
include_once $site_full . CLS . DB . 'SQL_Class.php';
$sql_voyager = new SQL_Class();
// Массив всех врачей
$temp_doctors = $sql_voyager->GetDoctorsArray();
$temp_number = count($temp_doctors);
// Убрать в массиве повторяющихся врачей
$all_doctors = array();
$doc_number = 0;
while ($temp_number != 0) {
    $flag = TRUE;
    for ($j = 0; $j < $doc_number; $j++) {
        if ($all_doctors[$j]["id"] == $temp_doctors[0]["id"]) {
            $flag = FALSE;
            break;
        }
    }
    if ($flag) {
        $all_doctors[] = $temp_doctors[0];
        $doc_number = count($all_doctors);
    }
    $gabage = array_shift($temp_doctors);
    $temp_number = count($temp_doctors);
}
예제 #6
0
<?php

/**
 * AIFS OSINT NS Check
 * @digitaloversight
 */
require_once '../config/tool/DomainSelector.php';
$conf = new Config('dnint');
require_once '../common/sql/Sql.php';
require_once '../common/sql/SqlStatement.php';
$dbh = new SQL_Class("aifs");
$sql = $dbh->execute("SELECT id, url FROM osint_url WHERE dead_link = 0 ORDER BY rand()");
list($id, $url) = $sql->fetch_array();
$url = str_replace('http://', '', $url);
$url = str_replace('https://', '', $url);
$arr = explode('/', $url);
$out = shell_exec("nslookup {$arr['0']}");
if (strpos($out, '** server') !== false) {
    $dbh->execute("UPDATE osint_url SET dead_link = 1 WHERE id=" . $id);
    if (strpos($conf->ns_fail_notify, '@') !== false) {
        mail($conf->ns_fail_notify, "AIFS NS expired", "The following url had it's domain name expired recently : \r\t\r\t" . $url . "\r\t\r\tDelivered you by AIFS node " . $conf->node_name);
    }
}
예제 #7
0
 function request()
 {
     parent::SQL_Class("aifs");
 }
/*
 * Execute the rotate OSINT version table
 * @digitaloversight
 */
error_reporting(1);
ini_set('error_reporting', 1);
require_once '../config/tool/DomainSelector.php';
require_once '../common/tool/DomainSelector.php';
require_once '../common/sql/Sql.php';
require_once '../common/sql/SqlStatement.php';
require_once '../common/sql/osint_requests.php';
$conf = new Config('osint');
$helper = new Common('osint', $conf->global_path);
$max_row_number = 8000;
$dbh = new SQL_Class();
// Step 1, select the last archived id
$sql = $dbh->execute("SELECT id as table_id, last_row as lst_row FROM osint_version_table_history\r\n\t\t              ORDER BY osint_version_table_history.id DESC LIMIT 1");
$results = $sql->fetch_assoc();
if ($results['lst_row'] == NULL) {
    $results['lst_row'] = 0;
}
$first_id_new_table = $results['lst_row'] + $max_row_number;
// Select the last avtive id
$sql = $dbh->execute("SELECT id as last_row_id, date as last_date FROM osint_version\r\n\t\t              ORDER BY osint_version.id DESC LIMIT 1");
$last_id = $sql->fetch_assoc();
// Is the last id higher than treshold?
if ($last_id['last_row_id'] >= $first_id_new_table) {
    $sql = $dbh->execute("SELECT id as first_row_id, date as first_date FROM osint_version\r\n  \t\t                ORDER BY osint_version.id ASC LIMIT 1");
    $first_id = $sql->fetch_assoc();
    $sql = $dbh->execute("SELECT COUNT(*) as numberofrow FROM osint_version_table_history");
예제 #9
0
<?php

/**
 * AIFS OSINT Change Parser
 * Copyright (c) digitaloversight
 */
error_reporting(1);
ini_set('error_reporting', 1);
include_once '../config/tool/DomainSelector.php';
include_once '../common/tool/DomainSelector.php';
include_once '../common/sql/Sql.php';
include_once '../common/sql/SqlStatement.php';
$conf = new Config('osint');
$helper = new Common('osint', $conf->global_path);
$dbh = new SQL_Class("aifs");
// Check for the newest version
$sql = $dbh->execute("SELECT id, fk_osint_url_id, content FROM osint_version ORDER BY id DESC LIMIT 1");
list($new_id, $new_url_id, $new_version) = $sql->fetch_array();
// Check if 2 versions are in store
$sql = $dbh->execute("SELECT count(*) FROM osint_version WHERE fk_osint_url_id=" . $new_url_id);
if ($sql->sql_result() < 2) {
    die;
}
$sql = $dbh->execute("SELECT count(*) FROM osint_changes WHERE fk_new_version_id=" . $new_id);
if ($sql->sql_result() == 1) {
    die;
}
$fp = fopen($conf->tmp_path . '/tmp_file_osint_changes', "w");
fwrite($fp, stripslashes($new_version));
fclose($fp);
$counter = 0;
예제 #10
0
 function FopenFetch($domain = 'osint')
 {
     parent::SQL_Class("aifs");
     $this->domain = $domain;
 }
예제 #11
0
<?php

/**
 * AIFS Routine DNINT url pipeline
 * Copyright (c) digitaloversight
 * @version 2016-01-07 1.02 RC2
 */
include_once '../config/tool/DomainSelector.php';
include_once '../common/tool/DomainSelector.php';
include_once '../common/sql/Sql.php';
include_once '../common/sql/SqlStatement.php';
include_once '../common/tool/FetchFopen.php';
$conf = new Config('dnint');
$helper = new Common('osint', $conf->global_path);
$dbh = new SQL_Class('aifs');
$fetch = new FetchFopen('dnint');
error_reporting($conf->debug);
ini_set('error_reporting', $conf->debug);
$sql = $dbh->execute("SELECT url FROM url_tld_com \n                        WHERE osint_submit=0 AND subchance = 0 ORDER by id DESC LIMIT 1");
list($myurl) = $sql->fetch_array();
$sql = $dbh->execute('SELECT * FROM dnint_url ORDER BY id DESC LIMIT 1');
list($id, $url, $time) = $sql->fetch_array();
if ($myurl != $url) {
    $sql = $dbh->execute("INSERT INTO dnint_url SET url='" . $myurl . "'");
}
$sql = $dbh->execute('SELECT * FROM dnint_url ORDER BY id DESC LIMIT 1');
list($id, $url, $time) = $sql->fetch_array();
$sql = $dbh->execute("SELECT COUNT(*) FROM dnint_url_contents WHERE fk_dnint_url_id=" . $id);
if ($sql->sql_result() != 0) {
    die;
}
예제 #12
0
<?php

/**
 * AIFS OSINT Async Tag Count
 * Copyright (c) digitaloversight
 */
error_reporting(1);
ini_set('error_reporting', 1);
include_once '../common/sql/Sql.php';
include_once '../common/sql/SqlStatement.php';
$dbh = new SQL_Class('aifs');
$sql = $dbh->execute("SELECT DISTINCT   tag as mytag, \n                                        (select count(*) from osint_tags WHERE tag = mytag) as mycount\n                     FROM osint_tags ORDER BY rand() LIMIT 1");
$results = $sql->fetch_assoc();
$sql = $dbh->execute("SELECT count(*) FROM osint_tags_count WHERE tags_name = '" . addslashes($results['mytag']) . "'");
$count = $sql->sql_result();
if ($count == 0) {
    $dbh->execute("INSERT INTO osint_tags_count SET tags_name = '" . addslashes($results['mytag']) . "',\n                                                        tags_count = '" . $results['mycount'] . "'");
} else {
    $dbh->execute("UPDATE osint_tags_count SET tags_count = '" . $results['mycount'] . "' WHERE\n                                                    tags_name ='" . addslashes($results['mytag']) . "'");
}