読者です 読者をやめる 読者になる 読者になる

qshinoの日記

Powershell関係と徒然なこと

ポートスキャンサービス

ポートスキャンサービス

外部からポートスキャンをしてくれるサービス。

Sields Up

https://www.grc.com/x/ne.dll?bh0bkyd2

参考

http://www.atmarkit.co.jp/fsecurity/rensai/securitytips/006portscan.html

delegate by Powershell

サンプル

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }

参考

http://www.nivot.org/blog/post/2009/07/18/PowerShell20RCWorkingWithNETCallbacksPart1Synchronous

AppDomain再び

AppDomain再び

PowerShellによるAppDomain制御。

ちょっと古い記事。10年前のもの。

by oising 2007/12/07 As knowledge of PowerShell increases for those new to .NET, there comes a point when people start to notice some shortcomings of the Assembly loading/unloading mechanisms of the 2.0 CLR. Namely, once you load an assembly into PowerShell to use it, you can’t unload it again. The only way to remove it from memory is to restart PowerShell. Eventually, you might read something about how Assemblies can be loaded into AppDomains, and AppDomains themselves can be unloaded. This is true, but for the most part it is not much use in PowerShell unless the Types in question where specifically designed with this in mind. For those of you who understand enough of what I’m talking about to get this far without going “huh?”, the following script will demonstrate some of the issues at hand:

Before you run this script, please disable PowerTab or any other SnapIns that may load the WinForms assembly into the current AppDomain. In short, this script creates a Form object in a child AppDomain, examines the current AppDomain for the WinForms assembly. It then attempts to manipulate the Form and again examines the current AppDomain for the WinForms assembly.

# full qualified display name to WinForms assembly   
$assembly = "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  
  
function IsWinFormsLoaded() {   
    $loaded = [appdomain]::currentdomain.getassemblies()   
    $winforms = $loaded | ? { $_.fullname -like "system.windows*" }   
    return ($winforms -ne $null)       
}   
  
if (-not (IsWinFormsLoaded)) {   
    "Creating child AppDomain..."  
    $child = [appdomain]::Createdomain("child",$null,$null)   
  
    # create a remote instance of a WinForms Form in a child AppDomain   
    "Creating remote WinForms Form in child AppDomain... "  
    $handle = $child.CreateInstance($assembly, "System.Windows.Forms.Form")   
  
    # examine returned ObjectHandle   
    "Returned object is a {0}" -f $handle.GetType()   
    $handle | gm # dump methods   
  
    # Did WinForms get pulled into our AppDomain?   
    "Is Windows Forms loaded in this AppDomain? {0}" -f (IsWinFormsLoaded)   
  
    # attempt to manipulate remote object, so unwrap   
    "Unwrapping, examining methods..."  
    $form = $handle.Unwrap()   
    $form | gm | select -first 10   
  
    # is Windows Forms loaded now?   
    "Is Windows Forms loaded in this AppDomain? {0}" -f (IsWinFormsLoaded)   
  
} else {   
    write-warning "System.Windows.Forms is already loaded. Please disable PowerTab or other SnapIns that may load System.Windows.Forms and restart PowerShell."  
} 

Hopefully this will clear up any outstanding questions. I’ll post more information about this later, or possibly add to this post.

参考

http://www.nivot.org/post/2007/12/07/WhyAppDomainsAreNotAMagicBullet

https://msdn.microsoft.com/en-us/library/ms173140(v=vs.80).aspx

https://msdn.microsoft.com/en-us/library/ms173139(v=vs.80).aspx

Windows7 整列

Windows7ウインドウ整列

Windows7でウインドウを整列する方法。

  1. タスクバーで右クリック。
  2. ウインドウを上下に並べて表示 または、左右に並べて表示
  3. 戻す時 タスクバーで、元に戻す。

結構便利。

参考

https://www.microsoft.com/ja-jp/atlife/tips/archive/windows/tips/276.aspx

Excell プルダウンリスト

Excel プルダウンリスト

データタブ => データの入力規則 => データの入力規則 => 設定タブ => 全ての値 => リスト => コンマ区切りで入力 — (A)

バリエーション

(A) の部分

  1. シート範囲指定
  2. 名前で指定。
  3. Indirect()

名前の設定方法

数式 => 名前の定義 => 名前の定義

参考

http://excel-hack.com/beginner/pulldown-menu/

Screen Capture

Ezvid

https://www.ezvid.com/download

参考

http://www.hongkiat.com/blog/win-screen-recording-softwares/

https://www.ezvid.com/download

PPPoE

PPPoE

PPPoEは二つのセッションに別れる。

  1. Discovery
  2. PPP

Discovery

ここでは、PPPoE Active Discovery パケットがやり取りされる。本パケットには、下記のものがある。

  1. PADI. : Initialize
  2. PDO. : Offer
  3. PADR : Request
  4. PADS : Session-Confirmation

PPP

PPPセッションは、4段階からなる。

  1. LCP調整 : Link Control Protocol
  2. 認証 : Pap or Chap
  3. IPCP : IPアドレス付与
  4. PPP通信 : 通信

最後のPPP通信段階が通常の通信状態である。

参考

http://www.infraexpert.com/study/wan9.html