Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
/ [PYTHON] Cross-Platform Network Scanner v1.0
« Last post by HardcoreHacker on October 15, 2017, 01:21:03 AM »

Cross-Platform Network Scanner v1.0

Release date: 20171015
Type: Python 2.7 system ping / TCP network scanner script
Description: Network scanner, determines it's own currect network, makes a range of network addresses to scan, utilises system (linux/windows) ping and performs TCP portscans. No need for parameters on this one, or code modifications, just run it! Easy to modify to your own needs, such as the ports/protocols to scan for. Tested on Windows and Raspbian.


Introductie:

Beste lezer,

in deze les leert u hoe we met een Raspberry Pi een netwerk kunnen scannen. De les is bedoeld voor zowel beginners als gevorderden. We beginnen bij het begin, wat is een netwerk? Een netwerk is een systeem waarover o.a. computers communiceren. Het internet is daar een goed voorbeeld van. Niet veel mensen weten dat internet staat voor ‘interconnected computer networks’, de werking van internet is dan ook nagenoeg hetzelfde als van een lokaal netwerk. Wanneer we een netwerk betreden en we geen kennis hebben van waar welke apparaten/servers/services aanwezig zijn, kunnen we met een scanner om ons heen kijken in een netwerk. Er zijn vele scanners, maar wat doet een scanner nou eigenlijk?

Een scanner kijkt of er apparaten op het netwerk zijn, vroeger was een ping rond het netwerk eigenlijk voldoende, maar tegenwoordig zijn er veel apparaten standaard in stealth mode, wat alleen maar inhoud dat ze niet reageren op een ICMP (ping) aanvraag. Dat wil nog niet zeggen dat we het apparaat niet kunnen ontdekken, door een TCP verbinding te openen op veelvoorkomende communicatie poorten zoals 80 voor HTTP, 21 voor FTP en 23 voor Telnet kunnen we zien dat een apparaat antwoord, en daarom aanwezig is op het netwerk. In sommige gevallen kan men eenvoudig toegang krijgen vervolgens. Een bereik van het netwerk is in de meeste gevallen de eerste 3 octetten van het ipv4 host adres van 1-254 (bijvoorbeeld 192.168.10.1 - 192.168.10.254). Tenzij er sprake is van 1 of meerdere VLANs, dan krijgen we bijvoorbeeld ook 192.168.11.1-254 maar dat slaan we voor nu even over.

In Python kunnen we eigenlijk vrij eenvoudig een scanner maken. Omdat ping nog niet uitgesloten is en soms nog effectief keuren we die ontdekkingsmethode nog niet af, daarnaast scannen we de veelgebruikte poorten op TCP. Het zou makkelijk zijn als de scanner zelf de scanrange kan bepalen, met name scripted scanners hebben veelal allerlei input nodig van de gebruiker, het zou mooier zijn als onze scanner het zelf kan bepalen.


Source:

#Cross-Platform Network Scanner v1.0 by HcH
#Network scanner based on system ping and TCP scanning, tested on Windows/Raspbian

#returning the system/OS name can be done using platform

from platform import system as system_name
#for executing shell commands we import system
from os import system as system_call
#for gethostname function we need socket
import socket

#get the range of the scan based off the host ip address that's able to communicate to the internet
#it returns a join with rpartition, it splits the string at the last occurrence of the argument string so the last octet of the ipv4 address is removed
def get_scanrange():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect(("8.8.8.8", 80))
    return ''.join(s.getsockname()[0].rpartition('.')[:2])

#a scanrange will look like 10.0.0. , the for loop will fill in 1-254 for us at the last octet of the ipv4 address
network = str(get_scanrange())

#ping as system call function, for windows and linux!
def ping(host):
    #ping parameters depending on OS
    parameters = "-n 1 -w 3" if system_name().lower()=="windows" else "-c 1"
    #the ping command itself
    return system_call("ping " + parameters + " " + host + ">NUL") == 0

#scannerplugin example, tries to connect to webservers
def http(ipaddr):
    s = socket(AF_INET, SOCK_STREAM)
    s.settimeout(0.3)
    if not s.connect_ex((ipaddr,80)):
        s.close()                     
        return 1
    else:
        s.close()

#scannerplugin example, tries to connect to ftpservers
def ftp(ipaddr):
    s = socket(AF_INET, SOCK_STREAM)
    s.settimeout(0.3)
    if not s.connect_ex((ipaddr,21)):
        s.close()                     
        return 1
    else:
        s.close()

#scannerplugin example, tries to connect to telnetservers
def telnet(ipaddr):
    s = socket(AF_INET, SOCK_STREAM)
    s.settimeout(0.3)
    if not s.connect_ex((ipaddr,23)):
        s.close()                     
        return 1
    else:
        s.close()

#to obtain getfqdn function we now import from socket:
from socket import *

def run():
    print ''
    #ping addresses <network>.1 to <network>.254
    for ip in xrange(1,254):
        ipaddr = network + str(ip)
        #the function 'getfqdn' returns the remote hostname, add it easily to a 1 line output
        if ping(ipaddr):
            print '%s \t ::: \t PING  \t ::: \t %s' %(ipaddr, getfqdn(ipaddr))
        if ftp(ipaddr):
            print '%s \t ::: \t FTP   \t ::: \t %s' %(ipaddr, getfqdn(ipaddr))
        if telnet(ipaddr):
            print '%s \t ::: \t TNET  \t ::: \t %s' %(ipaddr, getfqdn(ipaddr))
        if http(ipaddr):
            print '%s \t ::: \t HTTP  \t ::: \t %s' %(ipaddr, getfqdn(ipaddr))

#here's the main:
if __name__ == '__main__':
    print '\n' + 'Cross-Platform Network Scanner v1.0' + '\n' + '\n' + 'Scanning ' + network + '1-254 ...'
    run()
    raw_input('\n' + 'Done')

Download: registered members can download attachments of this post.
2
/ [PYTHON] Cross-Platform System Ping Based Network Scanner v0.9
« Last post by HardcoreHacker on October 14, 2017, 02:15:20 AM »
Cross-Platform System Ping Based Network Scanner v0.9

Simple Python scanner script that determines it's own scanrange, starts scanning on start, and works cross-platform (linux/windows). For now it's only tested on Windows, but it should work on Linux as well, I'll test this soon and update the script to v1.0.

#returning the system/OS name can be done using platform
from platform import system as system_name
#for executing shell commands we import system
from os import system as system_call
#for gethostname function we need socket
import socket

#get the local_ip address, if it's not 127.0.0.1 ...
local_ip = [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1]
#remove the last octet from the retrieved local_ip address by defining a separator in order to set a scan range
for line in local_ip:
    separator = "."
    network = separator.join(line.split(separator, 3)[:-1])
    #add a dot
    network = network + '.'

#ping as system call function, for windows and linux!
def ping(host):
    #ping parameters depending on OS
    parameters = "-n 1 -w 8" if system_name().lower()=="windows" else "-c 1"
    #the ping command itself
    return system_call("ping " + parameters + " " + host + ">NUL") == 0

#to obtain getfqdn function we now import from socket:
from socket import *

def run():
    print ''
    #ping addresses <network>.1 to <network>.254
    for ip in xrange(1,254):
        ipaddr = network + str(ip)
        if ping(ipaddr):
            #the function 'getfqdn' returns the remote hostname, add it easily to a 1 line output
            print '%s \t ::: \t  %s' %(ipaddr, getfqdn(ipaddr))

#here's the main:
if __name__ == '__main__':
    print
    print 'Cross-Platform System Ping Based Network Scanner v1.0'
    print
    print 'Scanning ' + network + '1-254 ...'
    run()
    raw_input('Done')

Code: [Select]
#returning the system/OS name can be done using platform
from platform import system as system_name
#for executing shell commands we import system
from os import system as system_call
#for gethostname function we need socket
import socket

#get the local_ip address, if it's not 127.0.0.1 ...
local_ip = [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1]
#remove the last octet from the retrieved local_ip address by defining a separator in order to set a scan range
for line in local_ip:
    separator = "."
    network = separator.join(line.split(separator, 3)[:-1])
    #add a dot
    network = network + '.'

#ping as system call function, for windows and linux!
def ping(host):
    #ping parameters depending on OS
    parameters = "-n 1 -w 8" if system_name().lower()=="windows" else "-c 1"
    #the ping command itself
    return system_call("ping " + parameters + " " + host + ">NUL") == 0

#to obtain getfqdn function we now import from socket:
from socket import *

def run():
    print ''
    #ping addresses <network>.1 to <network>.254
    for ip in xrange(1,254):
        ipaddr = network + str(ip)
        if ping(ipaddr):
            #the function 'getfqdn' returns the remote hostname, add it easily to a 1 line output
            print '%s \t ::: \t  %s' %(ipaddr, getfqdn(ipaddr))

#here's the main:
if __name__ == '__main__':
    print
    print 'Cross-Platform System Ping Based Network Scanner v1.0'
    print
    print 'Scanning ' + network + '1-254 ...'
    run()
    raw_input('Done')
3
/ Re: NEW AD-FREE DOWNLOAD LOCATION
« Last post by HardcoreHacker on September 11, 2017, 10:22:40 AM »
Hi,
I am a newbie here and sincerely need you guys help! I bought some android netbooks (10") with model hl-pc1088 for resale, unfortunately 5 of the netbooks are having issues (freeze on booting), I have searched everywhere for its firmware, only saw the wm version and uberoid universal doesnt contain the model number also.
I will be very grateful if anybody can direct me to the suitable download link
Thanks in advance
Note: I have tried most of the wms firmwares i saw online but the thing will just went blank instead of loading the files on the sd card
re-uploading ... can I email you the new link?

HcH
4
/ Re: [WM8850] Universal Uberoid v3.1 JB 4.1.1 22NOV2013
« Last post by HardcoreHacker on September 11, 2017, 09:39:00 AM »
Hi,
I am a newbie here and sincerely need you guys help! I bought some android netbooks (10") with model hl-pc1088 for resale, unfortunately 5 of the netbooks are having issues (freeze on booting), I have searched everywhere for its firmware, only saw the wm version and uberoid universal doesnt contain the model number also.
I will be very grateful if anybody can direct me to the suitable download link
Thanks in advance
Note: I have tried most of the wms firmwares i saw online but the thing will just went blank instead of loading the files on the sd card
Hello lordzeus,

I can upload the ROMs for you, can I send you a email with the download links?

HcH
5
/ Re: [WM8850] Universal Uberoid v3.1 JB 4.1.1 22NOV2013
« Last post by lordzeus on September 08, 2017, 08:58:56 AM »
Hi,
I am a newbie here and sincerely need you guys help! I bought some android netbooks (10") with model hl-pc1088 for resale, unfortunately 5 of the netbooks are having issues (freeze on booting), I have searched everywhere for its firmware, only saw the wm version and uberoid universal doesnt contain the model number also.
I will be very grateful if anybody can direct me to the suitable download link
Thanks in advance
Note: I have tried most of the wms firmwares i saw online but the thing will just went blank instead of loading the files on the sd card
6
/ Re: NEW AD-FREE DOWNLOAD LOCATION
« Last post by lordzeus on September 08, 2017, 03:39:44 AM »
Hi,
I am a newbie here and sincerely need you guys help! I bought some android netbooks (10") with model hl-pc1088 for resale, unfortunately 5 of the netbooks are having issues (freeze on booting), I have searched everywhere for its firmware, only saw the wm version and uberoid universal doesnt contain the model number also.
I will be very grateful if anybody can direct me to the suitable download link
Thanks in advance
Note: I have tried most of the wms firmwares i saw online but the thing will just went blank instead of loading the files on the sd card
7
/ [BAT] Apply File Properties to Foldername
« Last post by HardcoreHacker on August 29, 2017, 11:26:25 PM »
Here's a nice nifty script that handles a action per directory per type of file.
This example came in handy when I was sorting some game collection, I wanted the date of each folder's .exe file to be appended to the directory name of each game. Basically you can easily modify this to do whatever you want :)

@echo off

setlocal enabledelayedexpansion

REM :::::::::::::::::::::
REM :: GET-FILEDETAILS ::
REM :::::::::::::::::::::

for /F "tokens=* delims=" %%i in ('dir /ad /b') do (

echo -----------------------------------------------------------------------------

echo Parsing dir "%%i" ...
for /F "tokens=* delims=" %%j in ('dir /b "%CD%\%%i\*.exe"') do (

echo Parsing file "%CD%\%%i\%%j" ...
for %%a in ("%CD%\%%i\%%j") do set FileDate=%%~ta
echo FD !FileDate!
set year=!FileDate:~6,4!
echo Year !year!
ren "%CD%\%%i" "%%i [!year!]")

echo -----------------------------------------------------------------------------

)

pause
8
/ DOSBox.Windows.95B.OSR2.DirectX6.1.Portable-HcH
« Last post by HardcoreHacker on August 16, 2017, 10:06:48 PM »
DOSBox.Windows.95B.OSR2.DirectX6.1.Portable-HcH


About:
Thanks to this script, playing a game in Windows 95 through DosBox was never this easy!

Due file only limitations of Dosbox's internal copy function there is no subdirectory copy support, and we want that! This synchronizes the content of "%CD%\Game" to a Windows 95 HDD mounted in Dosbox, making the data available inside Windows once it's booted, because once Windows is booted, we will loose connection to the local filesystem. This meant someone usually uses a virtual driver or IMG editor of some sort to add new files/games/programs to a Windows 95 DosBox. This trick uses DosBox to synchronize the files inside the \Game directory with C:\Game inside Windows 95, using a expanded copy script to support subdirectories. The script will be generated by your local system in \Game in DosBox's acceptable commands, then it will boot to Windows.

Code: (Windows95-FILECOPY.bat) [Select]
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
PUSDH "%~dp0"

REM :: Due file only limitations of Dosbox's internal copy function there is no subdirectory copy support, and we want it! ::
REM :: This synchronizes the content of "%CD%\Game" to a Windows 95 HDD mounted in Dosbox ::
REM :: Thanks to the script, playing a game in Windows 95 was never this easy:
REM :: Step 1. Extract game to "%CD%\Game"
REM :: Step 2. Start "Windows95-FILECOPY.bat". The script generates a list of directories to create and files to copy from \Game.
REM :: Step 3. Automatically the script will start Dosbox and launch the generated script, it's now copying from the \Game dir to the Win95 HDD
REM ::         This is important, if we start Windows 95, we'll loose the D: drive because it's mounted through Dosbox, now it will copy the content to that HDD so we can use it in Windows 95!

SET OUTPUT=Game\filecopy.bat
if exist %OUTPUT% del /f %OUTPUT%

REM :: Get local directory name in 8.3 format to strip later on from the full filepaths of the files to copy ::
FOR /F "tokens=*" %%A IN ('echo %CD%\Game') DO set FIND=%%~sA

REM :: Get a sub directory list to create the directories before copying ::
FOR /F "tokens=*" %%A IN ('dir /ad /s /b .\Game\*.*') DO (echo Found: .%%~sA
set replace=
set line=%%~sA
set newline=!line:%find%=%replace%!
echo mkdir c:\Game!newline!>>!OUTPUT!)

REM :: Get filenames of the files to copy in 8.3 format ::
FOR /F "tokens=*" %%A IN ('dir /a-d /s /b .\Game\*.*') DO call :THETRICK %%~sA

REM :: Now here's the trick, this removes the directories before the main path so the simple 16bit copy command will also copy the subdirectories ::
:THETRICK
set replace=
if [%1]==[] start "DOSBox" DOSBox.exe -noconsole -conf Windows95-FILECOPY.conf
for %%F in (%1) do (set "line=%%F"
set newline=!line:%find%=%replace%!
echo Found: .!newline!
echo copy /y d:!newline! c:\Game!newline!>>!OUTPUT!)

Code: (Windows95-FILECOPY.conf Autoexec lines) [Select]
imgmount c: hdd-1gb-c.img -size 512,63,64,520 -fs fat
mount d .\Game
call d:\filecopy.bat
boot -l c

Usage:
Step 1. Extract game to "%CD%\Game"
Step 2. Start "Windows95-FILECOPY.bat". The script generates a list of directories to create and files to copy from \Game.
Step 3. Automatically the script will start Dosbox and launch the generated script, it's now copying from the \Game dir to the Win95 HDD. This is important, if we start Windows 95, we'll loose the D: drive because it's mounted through Dosbox, now it will copy the content to that HDD so we can use it in Windows 95!

Details:
* Sound Blaster (with updated Win95 driver)
* S3 VGA (with updated Win95 driver)
* DirectX 6.1
* 64MB RAM

Games tested:
* Monster Truck Madness
* Doom95
* Beavis & Butthead: Virtual Stupidity
* Fury 3

Download:
DOSBox.Windows.95B.OSR2.DirectX6.1.Portable-HcH.rar (134.5 MB)
Full package, including prepared 1GB FAT HDD IMG, Windows 95B OSR2, DirectX6.1, copy scripts and DOSBox v0.74
9
/ [BAT] Use WMI to list, (un)install software on remote systems
« Last post by HardcoreHacker on July 31, 2017, 09:44:38 AM »
Hey sysadmins, it has come to my attention that many sysadmins don't use the power of WMI, when I learnt it, it made my life easier, so let's share here what made it so easy:

If you are a little bit of a scripter you can easily make a script to run on all the computers on your network:

Basics:

index software packages:
wmic /node:%CNAME% product get name,version,vendor

index software based on vendor:
wmic /node:%CNAME% product where "vendor like 'Micro%'" get name,vendor

index software based on version:
wmic /node:127.0.0.1 product where "version like '7%'"

uninstall a certain software package:
wmic /node:%CNAME% product where "name='Adobe AIR'" call uninstall /nointeractive

uninstall all Acrobat on a LIST of computers (divided by newlines):
wmic /failfast:on /node:@"c:\computers.txt" product where name="Acrobat.com" call uninstall /nointeractive

uninstall all HP bloatware of a system (mutiple reboots required)
wmic /node:%CNAME% product where "vendor like 'Hewlett%'" call uninstall /nointeractive

install a msi:
wmic /node:%CNAME% product call install true,"" , "C:\%msiname%"
(please be warned as you first need to upload your MSI file to the remote station before you can deploy it there, I am sure you can make some easy script that does all this.
I have my simple networkscanner script setup to run together with wmic so each found system will receive the commands I define. With minor tweaking I can also patch according to OS version or presence of certain software for example. This made life a whole lot easier)


Usage:

You can easily combine this with something like: "SET /P CNAME=Enter target computername: " , if you put that in front of the command, and the command seeks %CNAME% for node, you can quickly remote command a system. Or combine it with a scanner: the code is a little iffy, but here's some shit-simple-ping-based-network-scanner-script that looks neat: http://www.techknow.one/forum/index.php?topic=9380.0 and since it's just batch code you can modify it easily.

Checks: ALWAYS check AND log if software is installed succesfully, use %ERRORLEVEL% to determine if a installation failed or was a succes.


Simple example of a script listing all MSI files in it's directory, mapping them to a number for easy selection, and deploying to a remote system:
Code: [Select]
@echo off > TMP1
:BOF
set #=0
setLocal EnableDelayedExpansion
cls
echo.
echo Remote App MSI Installer
echo.
for /f "tokens=*" %%D in ('dir /b *.msi') do (
set /a #+=1
echo [!#!] %%D >> TMP1 )
echo. >>TMP1
type TMP1|more
set /p dirNUM=Enter MSI number:
find "[!dirNUM!]" < TMP1 > TMP2
for /f "tokens=2" %%D in (TMP2) do set msiname=%%D
del /q TMP1 && del /q TMP2
set /p cname=Input computer name:
xcopy "%msiname%" "\\%cname%\c$" /y
if not exist "\\%cname%\c$\%msiname%" color 0c && rem cls && echo ERROR: FILE NOT FOUND! && pause && goto EOF
wmic /node:%CNAME% product call install true,"" , "C:\%msiname%"
echo.
echo Removing installation files from remote. . .
echo.
del /f "\\%cname%\c$\%MSINAME%"
echo Done && echo. && pause
goto :BOF
:EOF

Advanced example, including remote registry to deploy application settings:
Code: [Select]
@echo off > TMP1
:BOF
set #=0
setLocal EnableDelayedExpansion
cls
echo.
echo Remote App MSI Installer
echo.
for /f "tokens=*" %%D in ('dir /b *.msi') do (
set /a #+=1
echo [!#!] %%D >> TMP1 )
echo. >>TMP1
type TMP1|more
set /p dirNUM=Enter MSI number:
find "[!dirNUM!]" < TMP1 > TMP2
for /f "tokens=2" %%D in (TMP2) do set msiname=%%D
del /q TMP1 && del /q TMP2
set /p cname=Input computer name:
xcopy "%msiname%" "\\%cname%\c$" /y
if not exist "\\%cname%\c$\%msiname%" color 0c && rem cls && echo ERROR: FILE NOT FOUND! && pause && goto EOF
wmic /node:%CNAME% product call install true,"" , "C:\%msiname%"
sc \\%CNAME% start "remoteregistry"
echo Delaying for service to startup properly ...
ping %CNAME% -n 3
REG ADD \\%CNAME%\HKLM\Software\Wow6432Node\TightVNC\Server /v Password /t REG_BINARY /d "31bb662aace625aa" /f
REG ADD \\%CNAME%\HKLM\Software\Wow6432Node\TightVNC\Server /v ControlPassword /t REG_BINARY /d "31bb662aace625aa" /f
REG ADD \\%CNAME%\HKLM\Software\Wow6432Node\TightVNC\Server /t REG_DWORD /v SaveLogToAllUsersPath /d "0" /f
ping %CNAME% -n 5
echo.
echo Removing installation files from remote. . .
echo.
del /f "\\%cname%\c$\%MSINAME%"
echo Done && echo. && pause
goto :BOF
:EOF

Enjoy being more creative in your solutions.

Enjoy not installing third party software on servers and domain controllers (feeding it domain admin credentials and hope that it doesn't call home)

Enjoy not needing to pay for simple solutions.

Have a nice day
10
/ Re: [WM8850] Universal Uberoid v3.1 JB 4.1.1 22NOV2013
« Last post by HardcoreHacker on June 26, 2017, 01:43:32 PM »


HcH - been trying to get ahold of you. I wanted to send you the mods I  made to Uberoid (Android 4.1) for
CIFS network mounts and also for full USB host support (OTG)

I have a build of Android 5.0 that came on a generic WM8880 7" Netbook.  It's interesting because there are
a few goodies in the FIrmwareInstall directory, ie: a root script, alternate set of autorun.wmt scripts that boot
from SD card, and a launcher that was written for a WM8880 based car radio.

I have gotten this firmware to successfully update an iCraig CLP288 from Android 4.2 to Android 5.0.  I would
like to share it with the forum by putting the files in your downloads section.

Send me a private message with your email address, please ?
You've got mail :)
Pages: [1] 2 3 4 5 6 ... 10
Powered by EzPortal