Blog Image

MaxSpirit - bevlogen ICT!

Melle Visser

https://www.maxspirit.nl

Log POST request data

Linux Posted on Thu, March 03, 2022 14:00:57

Welke data stuurt een client mee in zijn web request?

Meestal eenvoudig te achterhalen door het netwerk verkeer te snifferen met tcpdump en wireshark. Maar web verkeer wordt steeds vaker versleuteld, dus dan zie je nog niet het bericht. Een oplossing kan zijn door gebruik te maken van de Apache Module mod_dumpio.

  • Zorg ervoor dat de module mod_dumpio is geladen in Apache
  • Plaats onderstaande parameters in de virtual host
  • Herstart Apache Webserver

DumpIOInput On
DumpIOOutput On
LogLevel dumpio:trace7

Als de client nu een POST request stuurt

curl -v -k -d @postdata.xml https://www.somewebsite.nl/somewebservice

Dan zal deze gelogd worden in de error log (zie ErrorLog)

[Wed Mar 02 14:30:37.630279 2022] [dumpio:trace7] [pid 7989:tid 139849176680192] mod_dumpio.c(103): [remote 1.1.1.1:443] mod_dumpio: dumpio_out (data-POOL): POST /somewebservice HTTP/1.1\r\n



Rdesktop and Win2012 change password

Linux Posted on Wed, December 28, 2016 15:11:44

Rdesktop is a great way to connect to Windows Desktops.

But there is a pesky drawback. How to change your windows password?

Pressing Ctrl+Alt+Delete usally results in your operating system doing some stuff, instead of forwarding the key combo to the Windows RDP server.
The alternative Ctrl+Alt+End combo never worked for me.

Then I came across a great way to send the required key combination:
namely use Sticky Keys !

“I
find that when I type Shift 5 times in a row, a window pops up from the
Windows guest asking if I want to use Sticky Keys, I type Enter to
accept.
Then I can type Ctrl by itself, then Alt by itself, then
Delete by itself, and the remote-desktop guest sees a usual
Ctrl-Alt-Delete and opens the login screen.
The host OS does not see or respond to the Sticky-Keys Ctrl-Alt-Del.”

In short: hit Shift
5 times, Enter in the Sticky-Keys popup, Ctrl down & release, Alt
down & release, Delete down & release = Ctrl-Alt-Del

And you get the option to change your password !



Rdesktop

Linux Posted on Mon, June 20, 2016 12:33:12

Rdesktop is a great package to connect to windows servers.
And Linux Mint is a great distribution.

but… the latest version of rdesktop (the one without the pesky mouse bug) is not in the repository

So let’s build it ourselves:

1. download rdesktop ( https://github.com/rdesktop/rdesktop/releases )
2. become the root user
3. remove the old rdesktop
apt-get remove rdesktop
4. install the needed development packages
apt-get install gcc-multilib libx11-dev libssl-dev
5. tar xvfz rdesktop-1.8.3.tar.gz
6. cd rdesktop-1.8.3/
7. ./configure –disable-credssp –disable-smartcard
8. make
9. make install

enjoy !



VI ontkleuren

Linux Posted on Thu, November 05, 2015 09:19:59

Je opent de vi editor en wordt verwelkomd door allerlei kleuren.
Wil je dit uitzetten dan doe je het volgende:

$ echo “syntax off” >> $HOME/.vimrc

voila



AWK is je vriend

Linux Posted on Mon, August 10, 2015 13:33:56

AWK kan zoveel, en dat is meteen een van de nadelen.

Dus hier een aantal handige voorbeelden:

1. welke URL geeft een http 500?

cat access_log|awk ‘{ if ($9==”500″) print $0}’

2. hoeveel requests zijn er per minuut geweest, waarvan de http code 200 is en de time taken is groter dan 70 seconden

cat access_log|awk ‘{ if ($11>=70000000 && $9==”200″) print $4}’|cut -c2-18 | sort |uniq -c

NB. LogFormat “%h %l %u %t \”%r\” %>s %b %D” common



TCPdump

Linux Posted on Tue, March 10, 2015 00:04:02

Het kan echt zo handig zijn om even een tcpdump te maken en uit te lezen met wireshark (is Follow TCP Stream niet geweldig ?!)

sudo /usr/sbin/tcpdump -n -s 0 -w effe.pcap -i en1 tcp port 80

-n Don’t convert addresses (i.e., host addresses, port numbers, etc.) to names
-s Setting snaplen to 0 means use the required length to catch whole packets.
-w Write the raw packets to file rather than parsing and printing them out
-i Listen on interface

gebruik port, host, net om de stroom te filteren, bijvoorbeeld:

sudo /usr/sbin/tcpdump -n -s 0 -w effe.pcap -i en1 dst 10.111.1.10 and tcp port 22

referentie: man-page tcpducmp



VNC server

Linux Posted on Tue, March 12, 2013 10:01:16

Zelf ben ik een fan van X-forwarding, maar het kan heel handig zijn om een vnc server op te zetten en daaraan te connecten.
Wat dan heel handig is, is om de vncserver meteen alle inkomende connecties te laten accepteren in plaats van eerst te connecten lokaal aan de vncserver en dan een xhost+ te geven.
Dit kan door de vncserver te starten met de optie: -ac

vncserver -ac

Controleren of de vncserver draait?

netstat -an|grep LISTEN|grep 590<display nummer>

Stoppen van de vncserver?

vncserver -kill :<display nummer>



Unlock user

Linux Posted on Mon, August 27, 2012 21:37:00

Het operating system gebruikt de pam utility om af te dwingen dat een user account locked naar 3 keer verkeerd inloggen.

Verifieer dat de user gelocked is m.b.v.
$ faillog
of
$ tail /var/log/secure
of
$ pam_tally2 -u <username>

Om deze user weer te unlocken voor onderstaand commando uit
$ pam_tally –user <username> –reset=0
of
$ pam_tally2 -u <username> –reset
of
$ faillog -u <username> -r



Next »