weed-out-from a-list another-list

This week I wrote from scratch and then lost at least four times a script to clean up a list of elements from elements contained in another list --I had to make sure I do not accidentally block white-listed networks on Firewall and Gateway machines.

It is a relative simple task that can be accomplished with a tiny bit of dash, bash, perl, or your other favorite language, in a few if not just one line. However, having to figure it out 4 or more times a week adds up --especially now-days that I have better things to do than showing off my command line slutness to junior sysadmins. Here is the weed-out-from bash script I put together and officially added to my toolbox. It is certainly not the most efficient way of doing it but hey!

weed-out-from
#!/bin/bash
#weed-out-from - g0 2012 , aLog.IPduh.com

function help {
        echo "weed-out-from usage: weed-out-from infected-list list-of-weeds"
        exit 3
}

if [ -z $1 -o -z $2 ]
then
        help
fi
if [ ! -f $1 ]
then
        echo "weed-out-from: I cannot read the file $1"
        help
fi
if [ ! -f $2 ]
then
        echo "weed-out-from: I cannot read the file $2"
        help
fi

DIRTY=$1
DIRT=$2

for i in `cat $DIRTY`
do
        grep -i $i $DIRT &> /dev/null
        if [ $? -ne 0 ]
        then
                echo $i
        fi
done


weed-out-from usage:
$ cat spring-garden-before 
Windflower
groundsel
Azaleas
Allium
pigweed
Belladonna-Lily
Strelitzia
Bloodroot
Calla-Lily
Cornflower
Cosmos
kikuyugrass
Crocus
Crabgrass
Dahlia
spurge
Bermudagrass

$ cat list-of-weeds 
groundsel
pigweed
kikuyugrass
Crabgrass
spurge
Bermudagrass

$ weed-out-from spring-garden-before list-of-weeds 
Windflower
Azaleas
Allium
Belladonna-Lily
Strelitzia
Bloodroot
Calla-Lily
Cornflower
Cosmos
Crocus
Dahlia


Note: List elements may be separated by new lines or space.

Install weed-out-from for all users:
# wget http://kod.ipduh.com/lib/weed-out-from
# chmod 755 weed-out-from 
# mv weed-out-from /usr/bin


weed out a list from another list

Disable autorun on windows XP Pro

Disable autorun because it is annoying and to defend against USB viruses.


Disable autorun on Windows XP Pro with the Group Policy Editor Gpedit.msc :
  • Click Start, click Run, type Gpedit.msc in the Open box, and then click OK.
  • Under Computer Configuration, expand Administrative Templates, and then click System. In the Settings pane, right-click Turn off Autoplay, and then click Properties.
  • Click Enabled, and then select All drives in the Turn off Autoplay box to disable Autorun on all drives.
  • Click OK to close the Turn off Autoplay Properties dialog box.
  • Restart the computer.


If you do not have Gpedit.msc on your system use the Registry Editor regedit to disable autorun :.
  • Click Start, click Run, type regedit in the Open box, and then click OK.
  • Locate and then click the following entry in the registry: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDriveTypeAutorun
  • Right-click NoDriveTypeAutoRun, and then click Modify.
  • In the Value data box, type 0xFF to disable all types of drives.
  • Click OK, and then exit Registry Editor.
  • Restart the computer.


Ref: Disable autorun on windows

Disable Autorun on Windows XP pro

1,000,001 Apple iPhone and Apple iPad UUIDs available to everyone. All the Apple UUIDs are held by the FBI.


All the Apple iPhone and iPod devices have a hardcoded Universally Unique Identifier String of characters, UUID. According to Anonymous a list of all apple UUIDs along with full owner names, device types ,cell numbers , addresses , zipcodes , etc is held by the FBI.

The Anonymous claim that somehow they got a hold of this ~12 million devices long list and decided to release a part of it so everyone can look at it. So they released a list containing 1,000,001 UUID, Apple DevTokens, User Defined Device Names, and Device types. The anonymous trimmed out personal data such as full names, cell numbers, addresses, zipcodes, etc.

This way a ridiculously large amount of people can certify the Anonymous' claim and blackhats cannot do too much with the list. This is also a good way for any organization interested in buying this list to verify its validity.

I do not own any Apple iOS devices , I know I am weird , so I do not have a way to verify that this list is legit. Then again, only 1,000,001/~12,000,000 UUIDs were released. I will guess that it is a legitimate list and that the Anonymous who released it are not lying.

So, if you or someone in your family own a good looking shiny jail --iOS device- please try to find the UUID in the list.

You can download the list from any of this

If you want to download the list I would recommend to: download the list , grep for your UUIDs , delete the list and all associated files , let everyone know if you did find you UUID corresponding to your User Defined Device Name.

Here is a little script that decrypts the list:
#!/usr/bin/bash
md5sum $1
echo "Does the above MD5sum match e7d0984f7bb632ee19d8dda1337e9fba ?If yes the file downloaded is the original file"
echo "When asked use the password: antis3cs5clockTea#579d8c28d34af73fea4354f5386a06a6"
openssl aes-256-cbc -d -a -in $1 -out decryptedfile.tar.gz
tar -xvzf decryptedfile.tar.gz
echo "the list is at iphonelist.txt"


To find out if your UUID and User Defined Device Name is listed try:
$grep myUUIDhere iphonelist.txt
or
$grep myUDDNhere iphonelist.txt


To permanently delete the list and the related files use shred, secure-delete tools, or some other tested digital shredder
Using shred:
$shred -u -z -n 30 decryptedfile.tar.gz
$shred -u -z -n 30 iphonelist.txt
$shred -u -z -n 30 download.txt
Now restart to wipe off RAM:
$sudo shutdown -r now


Using secure-delete:
$sudo apt-get install secure-delete
$srm decryptedfile.tar.gz
$srm iphonelist.txt
$srm download.txt
Memory Wipe:
$smem
Reboot:
$sudo shutdown -r now


This Post is based on this Pastebin Paste.





1,000,001 Apple iPhone and Apple iPad UUIDs available to everyone. All the Apple UUIDs are held by the FBI.