nmap cheat sheet

Nmap cheat sheet $ nmap <scan types> <options> <target> -snDisables port scanning. -oA tnetStores the results in all formats starting with the name ’tnet'. -iLPerforms defined scans against targets in provided ‘hosts.lst’ list. -PE Performs the ping scan by using ‘ICMP Echo requests’ against the target. –packet-trace Shows all packets sent and received --reasonDisplays the reason for specific result. --top-ports=10Scans the specified top ports that have been defined as most frequent. -p 21 Scans only the specified port. –packet-trace Shows all packets sent and received. -n Disables DNS resolution. –disable-arp-ping Disables ARP ping. -PnDisables ICMP Echo requests. ...

January 8, 2023 · 2 min · 240 words · FAMASoon

rpc enumeration

RPC Client RPC client $ rpcclient -U "" 10.129.14.128Enter WORKGROUP\'s password: rpcclient$> rpcclient$> srvinfo DEVSMB Wk Sv PrQ Unx NT SNT DEVSM platform_id : 500 os version : 6.1 server type : 0x809a03 rpcclient$> enumdomainsname:[DEVSMB] idx:[0x0] name:[Builtin] idx:[0x1] rpcclient$> querydominfoDomain: DEVOPS Server: DEVSMB Comment: DEVSM Total Users: 2 Total Groups: 0 Total Aliases: 0 Sequence No: 1632361158 Force Logoff: -1 Domain Server State: 0x1 Server Role: ROLE_DOMAIN_PDC Unknown 3: 0x1 rpcclient$> netshareenumallnetname: print$ remark: Printer Drivers path: C:\var\lib\samba\printers password: netname: home remark: INFREIGHT Samba path: C:\home\ password: netname: dev remark: DEVenv path: C:\home\sambauser\dev\ password: netname: notes remark: CheckIT path: C:\mnt\notes\ password: netname: IPC$ remark: IPC Service (DEVSM) path: C:\tmp password: rpcclient$> netsharegetinfo notesnetname: notes remark: CheckIT path: C:\mnt\notes\ password: type: 0x0 perms: 0 max_uses: -1 num_uses: 1 revision: 1 type: 0x8004: SEC_DESC_DACL_PRESENT SEC_DESC_SELF_RELATIVE DACL ACL Num ACEs: 1 revision: 2 --- ACE type: ACCESS ALLOWED (0) flags: 0x00 Specific bits: 0x1ff Permissions: 0x101f01ff: Generic all access SYNCHRONIZE_ACCESS WRITE_OWNER_ACCESS WRITE_DAC_ACCESS READ_CONTROL_ACCESS DELETE_ACCESS SID: S-1-1-0 rpcclient$> enumdomusersuser:[mrb3n] rid:[0x3e8] user:[cry0l1t3] rid:[0x3e9] rpcclient$> queryuser 0x3e9 User Name : cry0l1t3 Full Name : cry0l1t3 Home Drive : \\devsmb\cry0l1t3 Dir Drive : Profile Path: \\devsmb\cry0l1t3\profile Logon Script: Description : Workstations: Comment : Remote Dial : Logon Time : Do, 01 Jan 1970 01:00:00 CET Logoff Time : Mi, 06 Feb 2036 16:06:39 CET Kickoff Time : Mi, 06 Feb 2036 16:06:39 CET Password last set Time : Mi, 22 Sep 2021 17:50:56 CEST Password can change Time : Mi, 22 Sep 2021 17:50:56 CEST Password must change Time: Do, 14 Sep 30828 04:48:05 CEST unknown_2[0..31]... user_rid : 0x3e9 group_rid: 0x201 acb_info : 0x00000014 fields_present: 0x00ffffff logon_divs: 168 bad_password_count: 0x00000000 logon_count: 0x00000000 padding1[0..7]... logon_hrs[0..21]... rpcclient$> queryuser 0x3e8 User Name : mrb3n Full Name : Home Drive : \\devsmb\mrb3n Dir Drive : Profile Path: \\devsmb\mrb3n\profile Logon Script: Description : Workstations: Comment : Remote Dial : Logon Time : Do, 01 Jan 1970 01:00:00 CET Logoff Time : Mi, 06 Feb 2036 16:06:39 CET Kickoff Time : Mi, 06 Feb 2036 16:06:39 CET Password last set Time : Mi, 22 Sep 2021 17:47:59 CEST Password can change Time : Mi, 22 Sep 2021 17:47:59 CEST Password must change Time: Do, 14 Sep 30828 04:48:05 CEST unknown_2[0..31]... user_rid : 0x3e8 group_rid: 0x201 acb_info : 0x00000010 fields_present: 0x00ffffff logon_divs: 168 bad_password_count: 0x00000000 logon_count: 0x00000000 padding1[0..7]... logon_hrs[0..21]... rpcclient$> querygroup 0x201 Group Name: None Description: Ordinary Users Group Attribute:7 Num Members:2 brute force ...

January 8, 2023 · 3 min · 630 words · FAMASoon

Samba enumeration

Samba samba $ cat /etc/samba/smb.conf | grep -v "#\|\;"[global] workgroup = DEV.INFREIGHT.HTB server string = DEVSMB log file = /var/log/samba/log.%m max log size = 1000 logging = file panic action = /usr/share/samba/panic-action %d server role = standalone server obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes [printers] comment = All Printers browseable = no path = /var/spool/samba printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no 設定 説明 [sharename] ネットワーク共有の名前。 workgroup = WORKGROUP/DOMAIN クライアントがクエリを実行したときに表示されるワークグループ。 path = /path/here/ ユーザーにアクセス権を付与するディレクトリ。 server string = STRING 接続が開始されたときに表示される文字列。 unix password sync = yes UNIX パスワードを SMB パスワードと同期しますか? usershare allow guests = yes 認証されていないユーザーが、定義された共有にアクセスすることを許可しますか? map to guest = bad user ユーザーのログイン要求が有効な UNIX ユーザーと一致しない場合はどうすればよいですか? browseable = yes この共有を利用可能な共有のリストに表示する必要がありますか? guest ok = yes パスワードを使用せずにサービスに接続できるようにしますか? read only = yes ユーザーにファイルの読み取りのみを許可しますか? create mask = 0700 新しく作成されたファイルにはどのような権限を設定する必要がありますか? browseable = yes 現在の共有で利用可能な共有をリストすることを許可しますか? read only = no ファイルの作成と変更を禁止しますか? writable = yes ユーザーにファイルの作成と変更を許可しますか? guest ok = yes パスワードを使用せずにサービスに接続できるようにしますか? enable privileges = yes 特定の SID に割り当てられた特権を尊重しますか? create mask = 0777 新しく作成されたファイルにはどのようなアクセス許可を割り当てる必要がありますか? directory mask = 0777 新しく作成されたディレクトリに割り当てる必要のあるアクセス許可は何ですか? logon script = script.sh ユーザーのログイン時にどのスクリプトを実行する必要がありますか? magic script = script.sh スクリプトが閉じられたときにどのスクリプトを実行する必要がありますか? magic output = script.out マジック スクリプトの出力をどこに保存する必要がありますか? Sambaに接続する ...

January 8, 2023 · 3 min · 448 words · FAMASoon

SMTP enumeration

SMTP SMTP 送信と通信は、SMTP サーバーにユーザーの要求を実行させる特別なコマンドによっても行われます。 指示 説明 AUTH PLAIN AUTH は、クライアントの認証に使用されるサービス拡張です。 HELO クライアントはそのコンピューター名でログインし、セッションを開始します。 MAIL FROM クライアントは電子メールの送信者に名前を付けます。 RCPT TO クライアントは、電子メールの受信者に名前を付けます。 DATA クライアントが電子メールの送信を開始します。 RSET クライアントは開始された送信を中止しますが、クライアントとサーバー間の接続は維持します。 VRFY クライアントは、メールボックスがメッセージ転送に使用できるかどうかを確認します。 EXPN クライアントは、このコマンドでメールボックスがメッセージングに使用できるかどうかも確認します。 NOOP クライアントは、タイムアウトによる切断を防ぐために、サーバーに応答を要求します。 QUIT クライアントはセッションを終了します。 $ telnet 10.129.14.128 25 Trying 10.129.14.128... Connected to 10.129.14.128. Escape character is '^]'. 220 ESMTP Server HELO mail1.inlanefreight.htb 250 mail1.inlanefreight.htb EHLO mail1 250-mail1.inlanefreight.htb 250-PIPELINING 250-SIZE 10240000 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING $ telnet 10.129.14.128 25 Trying 10.129.14.128... Connected to 10.129.14.128. Escape character is '^]'. 220 ESMTP Server EHLO inlanefreight.htb 250-mail1.inlanefreight.htb 250-PIPELINING 250-SIZE 10240000 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING MAIL FROM: <cry0l1t3@inlanefreight.htb> 250 2.1.0 Ok RCPT TO: <mrb3n@inlanefreight.htb> NOTIFY=success,failure 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> From: <cry0l1t3@inlanefreight.htb> To: <mrb3n@inlanefreight.htb> Subject: DB Date: Tue, 28 Sept 2021 16:32:51 +0200 Hey man, I am trying to access our XY-DB but the creds don't work. Did you make any changes there? . 250 2.0.0 Ok: queued as 6E1CF1681AB QUIT 221 2.0.0 Bye Connection closed by foreign host. nmap ...

January 8, 2023 · 3 min · 433 words · FAMASoon

[Note] How to build v8 for AFL

I built v8 to run fuzzing in AFL. First, install depot_tools using the link below. And then download the v8 source code. https://v8.dev/docs/source-code Next, create an afl directory in the v8/third_party directory and download the contents of the following link. https://chromium.googlesource.com/chromium/src/+/refs/heads/master/third_party/afl/ Next, go to the v8 directory and execute the following command. gn gen out/libfuzzer '--args=use_afl=true is_asan=true optimize_for_fuzzing = true ' --check ninja -C out/libfuzzer d8 afl-fuzz -D -i third_party/afl/src/testcases/others/js/ -o fuzzout -M fuzz1 ./out/libfuzzer/d8 This was a afl-g++ based fuzzing method. You can probably use clang for faster fuzzing. You can also use fuzzilli or Dharma for fuzzing. ...

August 23, 2022 · 1 min · 100 words · FAMASoon

twintについて使ってみる

Twint について使ってみる(初級編) 何をするにも現代人はすぐにTwintterに情報を投稿する。 それはそれで良いのだが、ごくまれにどのような情報を投稿しているか・フォロー/フォロワーは・たくさんRTしている人は誰かなんとなく調べたくなってしまう時がある。 Twitterに連絡してのAPI利用許可を貰えばいいだろうと思うが、昔と違い今はAPI申請も難しくなっている(ぶっちゃけ面倒) そんなわけでどうにかしてAPIを使わずにTwitterの情報を集めるツールがないか探したところTwintに出会った。 特定のユーザーからツイートを収集したり、特定のトピック、ハッシュタグやトレンドに関連するツイートを収集することができる(ツイート取得3,200件の壁はあるものの) しかもプロキシ使い放題とは流石だ(未検証) そんなわけで今回はTwintを利用するところまでを紹介する。 インストール GitHubに書かれている内容そのままで簡単にインストールできる。 pipでインストール pip3 install twint 使ってみる 対象ユーザの最近のツイートとフォロワーをcsvファイルにしてみる。 今回は私のスクリーンネームFAMASoonで検索してみる。 import twint def get_followers(username): c = twint.Config() c.Username = username c.Profile_full = True c.Store_csv = True c.Output = "recent_followers.csv" twint.run.Followers(c) def get_recent_tweets(username): c = twint.Config() c.Username = username c.Store_csv = True c.Output = "recent_tweets.csv" twint.run.Search(c) def main(): # ここに任意のスクリーンネームを入力 user_name = "FAMASoon" get_recent_tweets(user_name) get_followers(user_name) if __name__ == "__main__": main() recent_followers.csvやrecent_tweets.csvという名前でフォロワーやツイートがリストアップされているだろう。 所感 結構簡単に使えた。 特定ユーザの動向をヲチするときとかに使えそう。

May 17, 2020 · 1 min · 71 words · FAMASoon

How to use crashwalk

How to use crashwalk crashwalk can check to quickly determine which crashes may lead to exploitable or not. Install Install gdb and golang by apt Download exploitable.py Install crashwalk $ sudo apt install gdb golang $ mkdir ~/src $ cd ~/src $ git clone https://github.com/jfoote/exploitable $ go get -u github.com/bnagy/crashwalk/cmd/... Usage crashwalk can be used immediately if there is a path of AFL crash outputs. For example, I will show using crashwalk on ./target. ...

April 2, 2020 · 1 min · 139 words · FAMASoon

Jupyter Notebook の導入

Jupyter Notebook の導入 はじめに Mac を買ったので新しく環境構築しました。 その際に行った作業のメモです。 Jupyter Notebook とは Python の対話的な実行環境のこと。 コードの共有や結果の可視化が楽にできます。 Markdownでメモを添えることもできます、便利ですね。 実はPython 以外も扱えます。 詳細は公式を見てください。 インストール Jupyter Notebook pip3 install jupyter で簡単にインストールできます。 Jupyter extension これだけでも便利ですが、さらに便利にできる拡張機能群があるのでインストールします。 ソースコードはここ pip3 install jupyter_contrib_nbextensions jupyter contrib nbextension install --user これで拡張機能が使えるようになりました。 http://localhost:8888/nbextensions で拡張機能を選択できるようになっています。 ちなみに自分はVimのキーバインドを使うために"Select CodeMirror Keymap"を、コードの展開とかを良い感じにやってくれる"Codefolding"と"Codefolding in Editor"を使っています。 jupyter-themes 少し暗めの色が好きなのでテーマカラーを変更できる jupyter-themes をインストールしてみます。 pip3 install jupyterthemes jt -t oceans16 -T -N これでテーマを変更することができました。 今回はoceans16を選択したが他にもテーマはあります。 下記コマンドで使用可能なテーマがリストとして出力されます。 jt -l お好みのテーマを選んでみてください。 おわりに Jupyter Notebook の環境構築をやってみました。 本当に便利なので使う人増えて欲しいですね。 何か良い拡張機能を知っている方は良ければ教えてください。

March 26, 2020 · 1 min · 68 words · FAMASoon

Malware Analysis links

I published a collection of links related to malware analysis. Please use it. Best Regards :) Links Tracker Haruko MalwareBazaar CyberCrime Tracker VXvault AZORult Tracker CCAM CyberCrime Tracker ATM CyberCrime Tracker Feodo Tracker URLhaus viriback RAT Tracker C2 Panel Tracker INQUEST LABS Source MALWARE-TRAFFIC-ANALYSIS.NET Twitter IoC Sandbox/Analyzer manalyzer VirusTotal Any.Run RE techniques THISISSECURITY XyliBox Fumik0_’s box MalwareTech Malware don’t need coffee nao_sec ZEROPHAGE SentinelLABS blog 0ffset MalwareLab.pl Research Notes Malware Reversing Encyclopedia malpedia ATT&CK Report APT_REPORT CyberThreatIntel Community OTX VirusBay kernelmode.info URL/Domain PhishTank urlscan.io tags: Malware Links

March 26, 2020 · 1 min · 87 words · FAMASoon

OpenFaas で function を自作する

OpenFaas で function を自作する OpenFaas で function を実装してデプロイしてみる。 OpenFaas のセットアップについてはこちら function をビルドする 下記コマンドで function の実装ができる $ faas-cli new --lang <実装したい言語> <functionの名前> 今回は入力されたドメインの whois 情報を出力する function を Golang で実装してみる。 faas-cli で function を作成すると諸々の設定ファイルや function を実装するためのファイルが生成される。 $ faas-cli new --lang go whois $ ls template whois whois.yml ファイルの中身を確認する whois.yml ファイルには実装する function に関する設定が書かれている。 provider: name: faas gateway: http://127.0.0.1:8080 functions: whois: lang: go handler: ./whois image: whois:latest whois/handler.go ファイルには function の処理が書かれている。 ...

March 26, 2020 · 1 min · 210 words · FAMASoon