Category Archives: Technical

Twiddling-series.

This year has been quite.. eventful, just as last year.
I am hoping that things will calm down and my head will start working in a more true sense of the word soon.

When this happens (if it happens..), I will start up a small ‘twiddling’ series – targeting the more amusing and fun toys that exists for us interested in, well, fun stuffs.

The baseline will simply be a presentation of the “what”, the “how”, the “why”, and my own small experiences with it, twiddling.

Look at it this way, it’s a getting-started-and-start-getting-your-mods-and-ideas-rolling series.

Traffic Baseline. Apps/OS.

Rant.

Many “NGFW” creations looks into the application-stack “layer 8”. I am however pondering over, since many seems to also identify the underlying OS (for enabling better and easier rule-sets per device category for example) – why not also provide a baseline for that specific OS – what to expect and also identify the normally permitted traffic – and the underlying connectionpoints for those. With this reasoning, one could filter out lots of garbage traffic that otherwise needs to be looked at with all the possible UTM-profiles.

This would be something we all could benefit from, make easier exclusions on per OS-basis etc. If we learn what normal is, we do not have to look at it all the time – only in a fully forensic perspective would it be needed – to fully determine a timeline etc.

WiFi-Honeypot. #KeepCalmAndAnalyze

Step 0 – Create a new and updated infrastructure – migrate your connected devices.
Step 1 – do not update the infrastructure (the ‘broken’ one).
Step 2 – Isolate the infrastructure (meaning – place into a ‘pot’ mode with fake targets all over).
Step 3 – setup recording / detection of all things related to that part of the infrastructure.
Step 4 – monitor actions, step 1-3 and the possible broken part of WPA2 simply is a the entry-point.

Perhaps an exception of providing wireless access to resources would be a possible step 0 – but don’t just turn it off, make sure that the new way of connecting is communicated and understood.

In essence, WPA2-breakdown is like your locked cabinet of entry point for the network just gave away a way in to that specific portion.
It does not have to mean that all things are exposed. It has not broken the protocols that are in use (but they may already have their specific portion broken). You are not completely naked here.

What would be the general idea here? To always keep all things ‘up-to-date’ and isolated in the term of knowing how and where things communicate, separation of duties and communication still holds. Isolation in the world of connections means that you do not allow all things know or reach everything else of your infrastructure, ever.

The best part of this, is that sites/companies/entities can now detect (possibly) what kind of targets they are.
Is the attack general?
Just recon?
Already targeting specific (previously reachable) resources?
Someone trying to use you as a base of attack for another target?

Use this as an oppertunity, instead of doom.

My viewpoint here is – if you already have a wireless network attached to your infrastructure, you should already have isolated and made infrastructural decicions on access. There is no reason to go all in bananas because one of your entry points that already are a physical weakpoint might be now a even more broken entry point.

honeypot link collection. Wireless honeypot?

Just did a link collection to start myself off with honepots again – had this in draft for ages. Time to do something about it.

Perhaps it is time to start creating network-honeypots – as the counter is ticking down for the release of some possibly major WPA2-issues to be uncovered – creating dedicated wireless networks for monitoring of the possibility of being targeted is a nice idea.

https://github.com/threatstream/mhn/

http://conpot.org/

https://honeynet.org/

http://www.honeyd.org/

http://artemisa.sourceforge.net/

https://github.com/glastopf/conpot

https://www.cuckoosandbox.org/

HaveIBeenPwned API simple API usage

Trying to get my brain to work again. It’s a slow process..
I’ve been thinking of an automated, scheduled check – instead of signing up all mailadresses for notifications – get the information of possible breach in one go and place.

Here’s the lazy test setup I managed to get working after a few cups of coffee.

1 – Get all the addys into a manageable list (I’ll presume MS AD as target for extracting emails first).

https://community.spiceworks.com/scripts/show/76-list-all-ad-email-addresses-including-aliases
(I simply used the vbscript above from a AD-connected machine..)

2 – filter out things with … non-microsoft related stuff:

cat email_addresses.txt | tr ":" "\n" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | grep @yourdomain | sort | uniq | grep -v { | grep -v MsExch | grep -v MSExch

Simply clean out non-wanted default-standard-exchange-crap, check your list in short…

3 – ask the API:


!#/bin/bash
# AskTheAPI.sh
for fn in `cat emails.txt`; do
wget --user-agent="Internal Pwned checker" https://haveibeenpwned.com/api/v2/breachedaccount/$fn
sleep 3
done

The 404’s should be a happy sight – means no hits for that specific address. The ones that does have information, well, you need to do something about it.

Check the simple API doc for doing more or less;

https://haveibeenpwned.com/API/v2

Fortinet webfilter test


# cat getthefilter.sh

#!/bin/bash
#wget http://fortiguard.com/webfilter
#New url..
wget http://fortiguard.com/webfilter/categories
grep wftest categories > raw
IN=`cat raw`
links=$(echo $IN | tr '"' "\n")
for addr in $links
do
if [[ $addr == *"html"* ]];then
echo $addr >> targets
fi
done

targets=`cat targets`
for filtaddr in $targets
do
echo http://fortiguard.com"$filtaddr"
wget -o /dev/null --spider -t 1 http://fortiguard.com"$filtaddr"
done
#rm raw targets webfilter

How do you disclose / inform / or get in contact with online companies today?

So, Troy Hunt got the following out;
https://www.troyhunt.com/kids-pass-just-reminded-us-how-hard-responsible-disclosure-is/

If we back a bit, we have a communication history in general.
Based on email…

abuse
webmaster
postmaster

@yourdomain – those where the general in-channels.

Troy got into a tight spot, I have not encountered that – sadly, I got into something worse. Ignorance and fudge..
Reporting anything in a public space – really? How come?

Public space / “social media” is usually under the hand of PR / marketing. Getting ’em to move their butts and report higher … Not the easiest way when we are not talking about security-aware companies.

So how do we determine or detect security-aware companies? We don’t. Bash’em with information – make a correct statement (like Troy and friend did) – and hope that the receiver is not part of the stupidity-bunch.

Rant//off.

Cracking open the worthless Zyxel X1 Armor (WAP6806)

Prepare yourself, this will be so far one of my longest rants to this day.

Bought my bloody MacBook Pro, and figured it was time to get a cheapish AC Access Point since the MacBooks USB ports is non existant – a good trade off so TimeMachine could do it’s thing and I would be none the wiser but lots poorer.

However – getting the Mac and getting it to a good state was the easier part. Getting that fudged Zyxel AP however…

Waste of plastic.

We start the fun right here…

BusyBox v1.12.1 (2016-10-26 15:52:49 CST) multi-call binary

So.. After you enable TELNET (IN 2017!), and since you cannot change the “admin” password (default “1234”) to anything with “special chars” (I’ll append the f-ked message later on), you prolly log in with admin and 1234, over TELNET…

Ah – did I mention that you need to log out for the password change to stick? No? Okay.. Now I did..

This will leave you with the setup of;


# cat /proc/cpuinfo
system type : Ralink SoC
processor : 0
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0000, 0x0000, 0x0000]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available

processor : 1
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0000, 0x0000, 0x0000]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available

The CPU in this is laughable, or weird … So “much” umpf – for what? But, it’s not the main part – I knew I was in for a cheap-thrill to begin with with all the dinks and donks.


# cat /proc/meminfo
MemTotal: 58928 kB
MemFree: 23576 kB
Buffers: 0 kB
Cached: 21236 kB
SwapCached: 0 kB
Active: 580 kB
Inactive: 2872 kB
Active(anon): 564 kB
Inactive(anon): 2868 kB
Active(file): 16 kB
Inactive(file): 4 kB
Unevictable: 21196 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 3412 kB
Mapped: 2316 kB
Shmem: 20 kB
Slab: 7748 kB
SReclaimable: 2312 kB
SUnreclaim: 5436 kB
KernelStack: 400 kB
PageTables: 292 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 29464 kB
Committed_AS: 7968 kB
VmallocTotal: 1048372 kB
VmallocUsed: 2340 kB
VmallocChunk: 1044532 kB


# uname -a
Linux WAP6806 2.6.36 #173 SMP Tue Nov 1 11:37:47 CST 2016 mips unknown

The kernel is a bit more enjoyable – as I know it could at least do networking of some sort…

But, the REALLY sad part?

They have hardcoded a few bridge interfaces.. Why? NO F-ING IDEA!
The setup was supposed to be kinda straight forward – it is a disaster! With a old as hell kernel in (release 2016) 2017!

# ifconfig
br0 Link encap:Ethernet HWaddr 1C:xxxxxxx
inet addr:192.168.x.x Bcast:192.168.x.x Mask:255.255.255.x
inet6 addr: fe80::x::x Scope:Link
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:21870 errors:0 dropped:0 overruns:0 frame:0
TX packets:25841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1344357 (1.2 MiB) TX bytes:6758904 (6.4 MiB)

br0:1 Link encap:Ethernet HWaddr 1C:xxxxxxxxxxxx
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1

br0:9 Link encap:Ethernet HWaddr 1C:xxxxxxxxxxx
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1

eth2 Link encap:Ethernet HWaddr 1C:---------
inet6 addr: fe80::x::x Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:715 errors:0 dropped:0 overruns:0 frame:0
TX packets:1414 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:63796 (62.3 KiB) TX bytes:631847 (617.0 KiB)
Interrupt:3

eth3 Link encap:Ethernet HWaddr 00.......
inet6 addr: fe80::x::x Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21170 errors:0 dropped:0 overruns:0 frame:0
TX packets:25096 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1587641 (1.5 MiB) TX bytes:6223369 (5.9 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:115 errors:0 dropped:0 overruns:0 frame:0
TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9880 (9.6 KiB) TX bytes:9880 (9.6 KiB)

#


The static non-existant iwconfig;

# iwconfig
lo no wireless extensions.

eth2 no wireless extensions.

ra0 RTWIFI SoftAP Access Point: 1E:xx:xx:xx:

sit0 no wireless extensions.

ip6tnl0 no wireless extensions.

ra1 RTWIFI SoftAP ESSID:"ZyGuest[random]"
Mode:Managed 13 Access Point: 1E:--------
Bit Rate=300 Mb/s

ra2 RTWIFI SoftAP ESSID:"ZyGuest[random]"
Mode:Managed 13 Access Point: 1E:----------
Bit Rate=300 Mb/s

ra3 RTWIFI SoftAP ESSID:"ZyGuest[random]"
Mode:Managed 13 Access Point: 1E:---------
Bit Rate=300 Mb/s

apcli0 RTWIFI SoftAP ESSID:""
Mode:Managed 13 Access Point: Not-Associated
Bit Rate:300 Mb/s

eth3 no wireless extensions.

br0 no wireless extensions.

Well, I do have some idea – the interface 1.1.1.2 seems to be their tied in for static interface. Dozens of cgi-scripts calls it.

The other one, is their “alias” address, hardcoded into existance from factory at 192.168.1.2. Makes no sense. NO SENSE.

The awesome part was this -it has a “nice” Autodetect mode of what kind of mode it should be in – AP, Client or Repeater.
My unit got stuck in a rotating state – and kept changing mode ALL THE TIME.
And since the routing table get screwed up with the static parts – it’s really enjoyable.. I got a “new” release of the firmware (do NOT get me started on the versioning on their firmware…No, seriously, don’t). That “new” “release” “fixed” it.


# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
239.255.255.250 * 255.255.255.255 UH 0 0 0 br0
192.168.x.y * 255.255.255.x U 0 0 0 br0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
1.1.1.0 * 255.255.255.0 U 0 0 0 br0
default 192.168.x.y 0.0.0.0 UG 1 0 0 br0

The above example is missing out the static entry of br0:1 – as I killed it off so my network didn’t explode on itself since it’s supposed to be in another broadcast domain…

I could produce and sell a better setup software-wise myself. Why oh WHY don’t they (since they don’t seem to be interested in doing anything right or giving their R&D time to develop something resembeling a working state) simply make a pledge to dd-wrt or openwrt instead, meaning they can instead contribute and make sure their plastic is not wasted nor the components..

I am not sure where to end this.. So I’ll just update it as it comes and publish it. Meaning this line moves down.

We broke the internet, by inventing the internet.

Rant… This is a rant.

But in short, by the birth of the internet – interconnected computing, and the applications of that era – why whould not part of the first users take over in a hostile model what they started or, partially took over.

It’s a matter of cost. Looking back at my own involvement with the military – I get it. For low priority stuff you might even hook it up to the interwebs.

But – the problem is, they need to start just do what we do with our normal armies. Stuff ’em as security at the boarder and threatening power. Not enslaving the whole of us. Not stepping on rules, and regulations the majority of us keep. I am not talking about the amount of data. The amount of data is irrelevant. It is the intent of the normal average person connected to the internet. The persona that thinks they have nothing to loose. Nothing to hide, and the worst fear is loosing their smartphone.

Is it really about “defending ours”?

How about it’s time we simply stopped the intelligence community from walking into our livingrooms, and the corporations from owning us instead of us being the consumer of their products.

Time to step up the game, by laying down the rules.

So.. What are the rules?

In war – spare the civilians.

If you have to wage wars on the webs, stop involving us- and our data.