NReco.PdfGenerator “Exit with code 1 due to network error: ContentAccessDenied”

Took me ages to work this one out. HtmlToPdfConverter.GeneratePdf causes the error mentioned in the title.

Looking at the iis trace in process monitor produced no mention of it attempting to access anything at all.

A few years ago someone posted the same issue on stackoverflow
As with the issue I was troubleshooting, I could get the code to run ok on an old server and also when running it via IIS Express in Visual Studio but the moment you deployed it to the main IIS it would error when generating a PDF.

It took hours of messing around but eventually I figured out the Exit Code was a message produced by another component, “wkhtmltopdf.exe” (which I’ve used in the past with my own process running wrapper). Seems NReco just runs a 3rd party application “wkhtmltopdf.exe” but with command lines to write to a system temporary folder.

"D:\website\mainroot\App_Data\wkhtmltopdf\wkhtmltopdf.exe"  -q  -s A4  "C:\WINDOWS\TEMP\pdfgen-cex1sm4a.zbf.html"  "C:\WINDOWS\TEMP\pdfgen-ioeaohqn.wvq.html" 

You don’t see this as a user of NReco PDFGenerator, you just see the error. It gives you no indication of which folder it is failing to access.

My instance was solved by adding Authenticated Users to have full permissions over the c:\windows\temp folder:

Hours of time could have been saved if the error output from the component was more coincide or if it was clearer that the .net component just runs a .exe to perform the conversion, this would make it clearer that temporary files must be being used somewhere.
It appears there is no way to set the temporary file NReco PDF Generator uses either. This restriction will be an unfixable issue for deployments on shared servers where you won’t be able to change the permissions on the windows system temp folder!

Posted in Uncategorized | Leave a comment

Required OpenVPN modifications for Grandstream phones.

Just for my future reference as normal..

Using a standard setup from this script:

Comment out the tls-crypt line

add a log line:

log /var/log/openvpn/log.log

Turn off LZO on phone. Configure, then reboot phone.

Posted in Uncategorized | Leave a comment

Asterisk PBX: Using TimeZones in GotoIfTime

Asterisk VoIP PBX allows you to setup your dialplan to route calls to different places depending on the time of day.

I setup a system in the UK which has British summer time / daylight savings time. (BST). The documentation on is always missing examples.
The examples on the incredibly helpful didn’t contain any information about timezones. Googling also didn’t reveal much.

Eventually I managed to find the right Google words to dig up a blog.

The correct use of timezones for the UK is:

 same = n,GotoIfTime(8:30-17:00,mon-thu,*,*,/usr/share/zoneinfo/Europe/London?helpdeskopen,1)
 same = n,GotoIfTime(8:30-16:00,fri,*,*,/usr/share/zoneinfo/Europe/London?helpdeskopen,1)
 same = n,Verbose(1, "Helpdesk is in night mode")
 same = n,Playback(duty-manager-details)

exten = helpdeskopen,1,Verbose(1, "Helpdesk is in day mode")
 same = n,Playback(pls-wait-connect-call)

Obviously modify to fit your needs.

Until I found the helpful blog I had assumed that the timezone would be something like “BST” or “GMT” or “UK”.. I wouldn’t have even though of trying a timezone (zoneinfo) file!

Examples in documentation go a long way to reducing the difficulty of learning new things. I get frustrated that voip-info has been left to do a lot of the heavy lifting in terms of Asterisk examples and documentation.

Posted in Uncategorized | Leave a comment

Asterisk PBX: Enable beep on call transfer.

I always find this difficult to google for.. so just to save me time in the future:

extensions.conf: same = n,Set(__ATTENDED_TRANSFER_COMPLETE_SOUND=beep)

The __ at the beginning means the variable inherits multiple levels on calls or processes spawned by the dialplan.

For more information on ATTENTED_TRANSFER_COMPLETE_SOUND see:
Otherwise there is very other little documentation about the variable.

Posted in Uncategorized | Leave a comment

Electronics goods scam, 2022 version

It has been a while, I’ve previously written about similar scams in 2021 and earlier.
I stopped being able to find active sites towards the end of 2021 and, sadly, lost interest in checking after a while.
A recent comment on that page has highlighted that they’ve finally returned.

Here are sites which I believe are scams where they will take your money (often by Stripe card payments) and never deliver anything. If you paid via this method you should be able to do a chargeback via your card company for goods not delivered.
A few of the sites don’t even offer card payment and ask for direct bank transfers. If you made a direct bank payment it becomes a lot more complicated to claim the funds back.

In any case, if you’ve been a victim it is important you raise a case with ActionFraud. This won’t do anything specific but the more people who complain about a type of fraud or a specific website the more likely it is that the police will be able to do something about it. If you don’t report it then you leave it wide open for others to become victims; help others and yourself by reporting loss and fraud to ActionFraud!

Likely fraud and scam sites: – Registered 16th November 2021. – Registered 16th November 2021. – Registered 23rd November 2021. – Registered 5th December 2021. – Registered 2nd January 2022. (Related keyword “daniel”) – Registered 8th January 2022. (Related keyword “odessy”) – Registered 11th February 2022. – Registered 20th February 2022. – Registered 1st March 2022. (different scam group? Related keyword “vibesvilla”) – Registered 4th April 2022. (different scam group? Related keyword “vibesvilla”) – Registered 3rd March 2022. (different scam group? Related keyword “vibesvilla”) – Registered 30th April 2022. (different scam group? Related keyword “riaj35277”) – Registered 27th May 2022. – Registered 28th May 2022. (different scam group? Related keyword “vibesvilla”)

If you’ve come across these or any others please let me know how you found them. What were you searching for and on what website did you see the link to the scam site.

Posted in Uncategorized | 6 Comments

How to make Speedify use multiple gateways on linux

This has been tested on a virtual guest with multiple virtual adaptors provided by the host (no vlans). It may work with linux virtual adapters (e.g. ens10:1) too but untested.

Default adaptor and gateway are as normal. No changes required.

The other two adaptors:

Add a route in on /etc/iproute2/rt_tables by adding the following to the bottom of the file:
1 rt2
2 rt3

ip route add default via dev ens19 table rt2
ip rule add from table rt2
ip rule add to table rt2

ip route add default via dev ens20 table rt3
ip rule add from table rt3
ip rule add to table rt3

You may wish to run tcpdumps on each interface:
tcpdump -nn -i ens20
tcpdump -nn -i ens19
tcpdump -nn -i eth0

Then connect on speedify and run a speed test to check that all windows scroll data and it is using all the connections.

Posted in Uncategorized | Leave a comment

Webmin not updating Debian firewall.

This is again mainly for my own reference. If you are stuck in “I don’t like CLI” land – like I am sometimes – this is how you get Webmin configured iptables rules to apply if the GUI isn’t applying them.

ip6tables-restore /etc/iptables/rules.v6
iptables-restore /etc/iptables/rules.v4

(Rebooting also seems to apply any unapplied changes but rebooting is also very inconvenient!)

Posted in Uncategorized | Leave a comment

Gaining full root access to the Hyperoptic ZTE ZXHN H298A

Here I will go through the rough and very technical steps to gain root access to this router.

Beware – it is very technical, needs a working GenieACS server and a DHCP server which allows you to set an Option 43 response.

Attack Vector:
The takeover of this router hinges around the default configuration of the router picking up an ACS / TR-069 server from DHCP on the WAN.
ACS / TR-069 is a remote management protocol for routers, SIP phones and other network items. This means we can plug the H298A WAN port into a network we control and respond with our own ACS Server.
Once the router is communicating with our ACS server we can then reset the root password and log into the web admin interface with this root password.

Features Gained:
You gain the ability to edit the WAN settings of the router. Possibly use a 3g dongle as backup and you can configure it to use your own VoIP service.

Install and make sure you have a working GenieACS server. I’m afraid this is a bit of a mission. I installed VMWare Player; debian as a guest with bridged networking to my LAN.

Once debian was up and working I then followed the instructions on the GenieACS documentation to install Node, MongoDB and GenieACS. I also referenced a good summary on Mikrotik’s forum.

Make sure you can bring up your GenieACS UI in a browser using port 3000.. e.g. (replacing the IP with the IP you are running GenieACS on, on your LAN).
I had to reboot my debian guest after doing all the install before this web page would work.
I’d also check the port that the router will communicate with.. e.g. (This page will give you method not allowed error, but that is expected).

Go into the Admin tab on GenieACS.
Go to Provisions on the left.
Click Show on the default line.
Add the following at the bottom of the existing script:

const password = "wenowknowthis";

const informInterval = 30;
const daily =;

declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});

declare("Device.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
declare("Device.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});

declare("InternetGatewayDevice.DeviceInfo.X_ZTE-COM_AdminAccount.*", {path: hourly, value: hourly});

And then save it. What this does is, along with the other default stuff GenieACS does when a router first communicates, will set the password on the routers ACS “connection request url” to be something we know. This allows easy access to change settings via Genie ACS. If we didn’t do this step then GenieACS would fail to push settings to the router with an authentication error.

We now need to set DHCP Option 43 on your LAN DHCP Server.

On OPNSense you add an option 43, select String from the drop down box and then the value in this format:


Which is
01 (start)
18 (length, in hex, of the url string to follow, windows calculator in programmer mode is your friend here)
68:74:74:70:3a:2f:2f:31:30:2e:31:30:30:2e:31:2e:38:31:3a:37:35:34:37:2f ( in hex; cyberchef is your friend here to convert to and from Hex).

Save and apply your DHCP config.

Plug in your Hyperoptic router WAN port into your LAN.

Wait for it to boot up – then refresh your GenieACS interface and you _should_ see the Hyperoptic router in there!

Go to the device by clicking on the serial number.
In the grey box below “All parameters” type in AdminAccount.

Click the little pencil icon to the right of “blank” on the password line.
Type in a secure password. If you try and set something like “rob” it will error with task faulted and invalid parameter value. If this happens you need to click on the fault at the top and delete it from the queue.

So after setting a secure password like Underground123! click Queue then Commit.

You should see green status lines saying the change has been sent ok. You can now log into the Hyperoptic router interface using the username root and the password you just set in the last step.

Good luck and I hope this information helps someone :)
Posted in Uncategorized | Leave a comment


I suck at systemd.. this is just a post so I can find the information I need in the future:

systemctl list-unit-files --type=service --state=enabled --all
systemctl enable asterisk.service
service --status-all
Posted in Uncategorized | Leave a comment

My daily drivers / tools

I wrote about this back in 2013 and things have changed since then.

My current daily drivers and important tools are..

Wireshark – still use this constantly and almost daily

CyberChef – An easy to access tool for data conversion, encryption and decryption.

PowerToys FancyZones – Incredible desktop snapping and organisation tool.

Alt-Tab Terminator – I now have so many screens open at once; this tool allows me to search the alt+tab list.

(The last two functions are built into the Pop!_OS linux distribution which I intend to try one day as Windows slowly gets more bloat and less customisable.)

nmap – Network scanning and service discovery.

PuTTY – SSH client.

TightVNC – Simple and versatile method to remote to computers.

Posted in Uncategorized | Leave a comment